From beefb62a6fbd0f98abc7dcde1e5638463b179687 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 1 Jan 2019 20:15:25 -0600 Subject: [PATCH] wrbmp.c: Use IsExtRGB() macro where appropriate (to improve readability) --- wrbmp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 -- 2.50.1