[Xastir] Diff for tiger_map.c that fixes colors on my system.

Jim Chandler jim at chandler.net
Tue Dec 9 22:23:25 EST 2003


Don't know why this is, but a while back tiger_map.c was changed to use
ModulateImage (not by me).  It dims the background, but the cities become
a very objectionable yellow and red, and the highway "signs" are a baby
blue.  Here is a patch that works on my system that corrects it to a way
that is more pleasing.  This is how I originally coded it.  Please see the
attached files.  Does anyone else see this?  I have attached the with
patch and without patch images for comparison.  For those using the
internet Tiger maps, what does your display most look like.  BTW, I'm
using 16 bit color here.


*** map_tiger.c 2003-12-09 21:04:31.000000000 -0600
--- map_tiger.c.fix     2003-12-09 20:58:43.000000000 -0600
***************
*** 492,500 ****
      width = image->columns;
      height = image->rows;

      //  Code to mute the image so it's not as bright.
!     if (raster_map_intensity < 1.0) {
          char tempstr[30];

          if (debug_level & 512)
              fprintf(stderr,"level=%s\n", tempstr);
--- 492,500 ----
      width = image->columns;
      height = image->rows;

      //  Code to mute the image so it's not as bright.
! /*    if (raster_map_intensity < 1.0) {
          char tempstr[30];

          if (debug_level & 512)
              fprintf(stderr,"level=%s\n", tempstr);
***************
*** 505,512 ****
--- 505,513 ----
              (int)(raster_map_intensity * 100.0));

          ModulateImage(image, tempstr);
      }
+ */


      // If were are drawing to a low bpp display (typically < 8bpp)
      // try to reduce the number of colors in an image.
***************
*** 568,578 ****
              //
              if (QuantumDepth == 16) {   // Defined in
/usr/include/magick/image.h
                  if (debug_level & 512)
                      fprintf(stderr,"Color quantum is [0..65535]\n");
!                 my_colors[l].red   = temp_pack.red;
!                 my_colors[l].green = temp_pack.green;
!                 my_colors[l].blue  = temp_pack.blue;
              }
              else {  // QuantumDepth = 8
                  if (debug_level & 512)
                      fprintf(stderr,"Color quantum is [0..255]\n");
--- 569,579 ----
              //
              if (QuantumDepth == 16) {   // Defined in
/usr/include/magick/image.h
                  if (debug_level & 512)
                      fprintf(stderr,"Color quantum is [0..65535]\n");
!                 my_colors[l].red   = temp_pack.red *
raster_map_intensity;
!                 my_colors[l].green = temp_pack.green *
raster_map_intensity;
!                 my_colors[l].blue  = temp_pack.blue *
raster_map_intensity;
              }
              else {  // QuantumDepth = 8
                  if (debug_level & 512)
                      fprintf(stderr,"Color quantum is [0..255]\n");


-- 
Jim
N0VH


More information about the Xastir mailing list