nanogui: GdJPEG for PF_TRUECOLOR patch


Previous by date: 24 Feb 2000 06:22:20 -0000 Re: Shared memory + SDL, Greg Haerr
Next by date: 24 Feb 2000 06:22:20 -0000 menu, rogach
Previous in thread: 24 Feb 2000 06:22:20 -0000 GdJPEG for PF_TRUECOLOR patch, Kyle Harris
Next in thread: 24 Feb 2000 06:22:20 -0000 Re: GdJPEG for PF_TRUECOLOR patch, Martin Jolicoeur

Subject: Re: GdJPEG for PF_TRUECOLOR patch
From: "Greg Haerr" ####@####.####
Date: 24 Feb 2000 06:22:20 -0000
Message-Id: <012801bf7e8d$e6fa11e0$15320cd0@gregh>

: I made a few minor changes to the GdJPEG function to handle various
: pixel types. I believe the jpeg lib will always return a 24 bit pixel
: value unless requested to do otherwise. So, I think this patch is safe.
: I've only tested it with 16bpp.

Kyle,
    Thanks for your patch.  The original version didn't work with
anything other than 8bpp.

Actually, your patch fails with 32bpp, and only works 16bpp because you
happened to compile Microwindows with a PIXELVAL size
of 16bpp (unsigned short)...  If the source and destination pixel
values don't match, you can't use the RGB2PIXEL macros, but
instead must find GdFindColor.  I have attached a working version
that works on 8pp and 24bpp, and 32 bpp.  It think the 16bpp still works
(it segfaulted with your patch) but, alas, 16bpp is the one bpp I can't
test, since the fb palette isn't setup properly for cards which
return FB_VISUAL_DIRECTCOLOR, which require a palette
mapping first.  (If anyone has input for the palette map for 16bpp
DIRECTCOLOR ATI cards, let me know)


 I think there may have been a bug in the
: original version. It seems that within the "while (destx++ != maxx)"
: loop, k should be incremented outside of the if construct. Maybe I'm
: missing something (not unusual :).

No, if you move the k outside the loop, the image fails...

I've attached what I think is a patch to your patch, and have
entered it into the tree. ;-)

Regards,

Greg

[Content type application/octet-stream not shown. Download]

Previous by date: 24 Feb 2000 06:22:20 -0000 Re: Shared memory + SDL, Greg Haerr
Next by date: 24 Feb 2000 06:22:20 -0000 menu, rogach
Previous in thread: 24 Feb 2000 06:22:20 -0000 GdJPEG for PF_TRUECOLOR patch, Kyle Harris
Next in thread: 24 Feb 2000 06:22:20 -0000 Re: GdJPEG for PF_TRUECOLOR patch, Martin Jolicoeur


Powered by ezmlm-browse 0.20.