[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
GrDrawImageToFit fail with PNG image with alpha layer
From: Daniel ####@####.#### Date: 3 Jun 2010 13:01:27 -0000 Message-Id: <AANLkTikaqKuCKqrPrVpTHC0_7GBl0Kg8h1z-PWkD3YGt@mail.gmail.com> This: > GrDrawImageToFit(GrNewPixmap(640, 480, NULL), > myGC, 0, 0, 640, 480, > GrLoadImageFromFile("/path/to/png_with_alpha_channel.png", 0)); fails with the following error: > nano-X: /path/to/microwin/src/drivers/fblin24.c: 35: linear24_drawpixel: Assertion `c < psd->ncolors' failed. The function is defined like this: > /* Set pixel at x, y, to pixelval c*/ > static void linear24_drawpixel(PSD psd, MWCOORD x, MWCOORD y, MWPIXELVAL c) and the assertion looks like: > assert (c < psd->ncolors); It seems like the PNG buffer is read as 32 bit values, but the function quickly thereafter turn the pixelval into r, g and b: > r = PIXEL888RED(c); > g = PIXEL888GREEN(c); > b = PIXEL888BLUE(c); And the pure 'c' is never used again. How about just remove that assertion? What would then fail? What would else be a way to get fblin24 handle png's with alpha chan? Best Regards Daniel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: GrDrawImageToFit fail with PNG image with alpha layer
From: "Aaron J. Grier" ####@####.#### Date: 3 Jun 2010 17:39:39 -0000 Message-Id: <20100603173922.GO1020@arwen.poofy.goof.com> On Thu, Jun 03, 2010 at 03:00:57PM +0200, Daniel Nyström wrote: > This: > > > GrDrawImageToFit(GrNewPixmap(640, 480, NULL), > > myGC, 0, 0, 640, 480, > > GrLoadImageFromFile("/path/to/png_with_alpha_channel.png", 0)); > > fails with the following error: > > > nano-X: /path/to/microwin/src/drivers/fblin24.c: 35: linear24_drawpixel: Assertion `c < psd->ncolors' failed. > > The function is defined like this: > > > /* Set pixel at x, y, to pixelval c*/ > > static void linear24_drawpixel(PSD psd, MWCOORD x, MWCOORD y, MWPIXELVAL c) > > and the assertion looks like: > > > assert (c < psd->ncolors); > > It seems like the PNG buffer is read as 32 bit values, but the > function quickly thereafter turn the pixelval into r, g and b: > > > r = PIXEL888RED(c); > > g = PIXEL888GREEN(c); > > b = PIXEL888BLUE(c); > > And the pure 'c' is never used again. How about just remove that > assertion? What would then fail? What would else be a way to get > fblin24 handle png's with alpha chan? the assertion is incorrect for non-palettized video modes. I would just remove the asserts, or change it to assert(psd->pixtype != MWPF_PALETTE || c < psd->ncolors) -- Aaron J. Grier | "Not your ordinary poofy goof." | ####@####.#### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] Re: GrDrawImageToFit fail with PNG image with alpha
layer
From: Daniel ####@####.#### Date: 3 Jun 2010 18:13:56 -0000 Message-Id: <AANLkTil7tS_I_8PflwK_M0Yttt3ZZZUN5CMVtS_g-9SJ@mail.gmail.com> 2010/6/3 Aaron J. Grier ####@####.#### > On Thu, Jun 03, 2010 at 03:00:57PM +0200, Daniel Nyström wrote: >> > assert (c < psd->ncolors); > > the assertion is incorrect for non-palettized video modes. I would just > remove the asserts, or change it to > > assert(psd->pixtype != MWPF_PALETTE || c < psd->ncolors) Since fblin24.c is specifically for 24bit RGB I guess pixtype will never be anything but MWPF_TRUECOLOR888, so just removing the assert would do? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] Re: GrDrawImageToFit fail with PNG image with alpha layer
From: "Aaron J. Grier" ####@####.#### Date: 3 Jun 2010 22:57:32 -0000 Message-Id: <20100603225721.GQ1020@arwen.poofy.goof.com> On Thu, Jun 03, 2010 at 08:13:32PM +0200, Daniel Nyström wrote: > 2010/6/3 Aaron J. Grier ####@####.#### > > On Thu, Jun 03, 2010 at 03:00:57PM +0200, Daniel Nyström wrote: > >> > assert (c < psd->ncolors); > > > > the assertion is incorrect for non-palettized video modes. I would just > > remove the asserts, or change it to > > > > assert(psd->pixtype != MWPF_PALETTE || c < psd->ncolors) > > Since fblin24.c is specifically for 24bit RGB I guess pixtype will > never be anything but MWPF_TRUECOLOR888, so just removing the assert > would do? that's what I figured and why I simply removed the assert. as to what should be commit back to the trunk, I defer to Greg's judgement. -- Aaron J. Grier | "Not your ordinary poofy goof." | ####@####.#### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] GrDrawImageToFit fail with PNG image with alpha layer
From: "Greg Haerr" ####@####.#### Date: 4 Jun 2010 20:59:00 -0000 Message-Id: <103201cb0428$9a5c8a30$0300a8c0@RDP> : > static void linear24_drawpixel(PSD psd, MWCOORD x, MWCOORD y, MWPIXELVAL c) : : and the assertion looks like: : : > assert (c < psd->ncolors); : : It seems like the PNG buffer is read as 32 bit values, but the What version are you running? The git repository should not have this issue. I am in the process of moving to alpha-compositing support, so the assert fails because the high byte of the RGB color value defaults to 255 alpha, which is outside the 24-bit color range. Regards, Greg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] Re: GrDrawImageToFit fail with PNG image with alpha layer
From: "Greg Haerr" ####@####.#### Date: 4 Jun 2010 21:00:27 -0000 Message-Id: <103601cb0428$d0444890$0300a8c0@RDP> : the assertion is incorrect for non-palettized video modes. I would just : remove the asserts, or change it to : : assert(psd->pixtype != MWPF_PALETTE || c < psd->ncolors) The above is incorrect, as the assert is in the fblin24 driver, which is only used for non-palette 24 bit framebuffers. I have recently completed some very extensive driver updates. I think all of this is fixed in the git repository, but am awaiting Daniel's statement as to which version he's running. Regards, Greg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] Re: GrDrawImageToFit fail with PNG image with alpha layer
From: "Greg Haerr" ####@####.#### Date: 4 Jun 2010 21:01:26 -0000 Message-Id: <104201cb0428$f2b03bf0$0300a8c0@RDP> > Since fblin24.c is specifically for 24bit RGB I guess pixtype will never be anything but MWPF_TRUECOLOR888, so just removing the assert would do? Yes - removing the assert is correct. Regards, Greg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] GrDrawImageToFit fail with PNG image with alpha layer
From: Daniel ####@####.#### Date: 7 Jun 2010 08:03:59 -0000 Message-Id: <AANLkTikVv_v2d6v-MFOSx1DDY_m2JA9gC1kEqshKziGO@mail.gmail.com> 2010/6/4 Greg Haerr ####@####.#### > : > static void linear24_drawpixel(PSD psd, MWCOORD x, MWCOORD y, MWPIXELVAL > c) > : > : and the assertion looks like: > : > : > assert (c < psd->ncolors); > : > : It seems like the PNG buffer is read as 32 bit values, but the > > What version are you running? I'm currently using a git clone of commit 265f32ae12c9e0310f4978b951060e5b77d91231. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] GrDrawImageToFit fail with PNG image with alpha layer
From: Daniel ####@####.#### Date: 8 Jun 2010 09:21:10 -0000 Message-Id: <AANLkTikehV2lrJGicijfO8O-lAtGYbGXjYnPYlj_m2oY@mail.gmail.com> 2010/6/7 Greg Haerr ####@####.#### >> I'm currently using a git clone of commit > > Thanks Daniel - I somehow forgot these asserts in > the fblin24 driver and have removed them. > > Are you running this same driver/hardware for your > earlier anti-aliasing font problem? Is it fixed? I'm using this same driver, and I actually haven't noticed any font rendering artifacts in a while. Maybe I should try out the test application once again, but I'm currently very overloaded at work. Trying out Freetype 2.3.9 along with the new PCF rendering is also on my todo-list. Regards Daniel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |