[haiku-depot-web] Re: HVIF to PNG Conversion Issue

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-depot-web@xxxxxxxxxxxxx
  • Date: Sun, 12 Jul 2015 01:11:19 +0200

On 11.07.2015 13:07, Andrew Lindesay wrote:

This might a question for Stephan; I hope the high temperatures have
abated. We're getting quite the opposite treatment down here of course!

I have the HVIF successfully rendering and writing out as PNG on linux
now, but there is one small problem with the rendering. The resulting
bitmap [1] appears cropped on the bottom and right edges. I can imagine
that this might be a rounding issue or something like this.

Here is the mechanics of the rendering...

state.bitmap = new BBitmap(
BRect(0.0,0.0,state.params.size,state.params.size),
B_RGBA32); // actual storage is BGRA

status_t gvi_status = BIconUtils::GetVectorIcon(
state.hvif_buffer.buffer,
state.hvif_buffer.used,
state.bitmap);

I'm wondering if there is any obvious "known gotchas" with using these
static methods before I start hunting around.

The size of the bitmap you create is actually params.size + 1 pixels in both dimensions (*), which may not be what you intended.

CU, Ingo

(*) No, it doesn't make much sense, but BBitmap(BRect(0, 0, 9, 9),...) creates a 10x10 bitmap.

Other related posts: