]> granicus.if.org Git - libjpeg-turbo/commitdiff
wrbmp.c: Use IsExtRGB() macro where appropriate
authorDRC <information@libjpeg-turbo.org>
Wed, 2 Jan 2019 02:15:25 +0000 (20:15 -0600)
committerDRC <information@libjpeg-turbo.org>
Wed, 2 Jan 2019 02:48:14 +0000 (20:48 -0600)
(to improve readability)

wrbmp.c

diff --git a/wrbmp.c b/wrbmp.c
index 38a64e879f5e1dafee8ad528796bdc47bfaa7b1f..4bf81426b0ef685049d7228543eb9ce8aa326caa 100644 (file)
--- 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