From: DRC Date: Wed, 2 Jan 2019 02:15:25 +0000 (-0600) Subject: wrbmp.c: Use IsExtRGB() macro where appropriate X-Git-Tag: 2.0.2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=beefb62a6fbd0f98abc7dcde1e5638463b179687;p=libjpeg-turbo wrbmp.c: Use IsExtRGB() macro where appropriate (to improve readability) --- diff --git a/wrbmp.c b/wrbmp.c index 38a64e8..4bf8142 100644 --- a/wrbmp.c +++ b/wrbmp.c @@ -5,7 +5,7 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2013, Linaro Limited. - * Copyright (C) 2014-2015, 2017, D. R. Commander. + * Copyright (C) 2014-2015, 2017, 2019, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -303,9 +303,7 @@ write_os2_header(j_decompress_ptr cinfo, bmp_dest_ptr dest) int bits_per_pixel, cmap_entries; /* Compute colormap size and total file size */ - if (cinfo->out_color_space == JCS_RGB || - (cinfo->out_color_space >= JCS_EXT_RGB && - cinfo->out_color_space <= JCS_EXT_ARGB)) { + if (IsExtRGB(cinfo->out_color_space)) { if (cinfo->quantize_colors) { /* Colormapped RGB */ bits_per_pixel = 8; @@ -499,9 +497,7 @@ jinit_write_bmp(j_decompress_ptr cinfo, boolean is_os2, if (cinfo->out_color_space == JCS_GRAYSCALE) { dest->pub.put_pixel_rows = put_gray_rows; - } else if (cinfo->out_color_space == JCS_RGB || - (cinfo->out_color_space >= JCS_EXT_RGB && - cinfo->out_color_space <= JCS_EXT_ARGB)) { + } else if (IsExtRGB(cinfo->out_color_space)) { if (cinfo->quantize_colors) dest->pub.put_pixel_rows = put_gray_rows; else