[PATCH] windowscodecs: Add support for DIB format.

Dmitry Timoshkov dmitry at baikal.ru
Mon Jan 21 12:11:55 CST 2013


Vincent Povirk <madewokherd at gmail.com> wrote:

> If there's really a demand for using native windowscodecs without
> breaking d3dx9 (which already happens because of the TGA decoder), I
> can supply a win32 build of our WIC extensions that winetricks could
> install with it. I can't do anything about ICNS.

TGA is the simplest format I've ever seen, CreateBitmapFromMemory is
the straight way to handle it. I haven't looked at ICNS support, but
probably it could be implemented using public APIs as well.

> >> Yes, there are other ways we could do this. Probably GDI is the next
> >> simplest way. However, this is a case where we can very easily reuse
> >> code that was already written to support the BMP and ICO decoders as
> >> well as the code in d3dx9 that uses WIC decoders, so to me it still
> >> seems like the best option.
> >
> > Personally I don't see why DIB handling needs a WIC codec in the first
> > place, GDI supports it just fine.
> 
> Sure, but we ALREADY HAVE CODE for packed dibs that was essentially
> free and that is currently maintained. To do this from GDI, we still
> have to write code in d3dx9 that parses the packed DIB enough that we
> can pass it so some GDI function, then write code that converts a GDI
> bitmap to a D3DX surface. It gets a little more complicated when you
> consider things like palettes and rle encoding.

DIB sections and things like SetDIBits should take care of all of this.

> >> (I was setting up for this when I was working on the ICO decoder, but
> >> that was only a matter of keeping separate the two changes I had to
> >> make in the logic for reading ICO frames, and writing
> >> DibDecoder_CreateInstance so anyone who went to implement a new one
> >> would see it.)
> >
> > The ICO decoder probably could be replaced by CreateBitmapFromHICON
> > on the client side, since the latter one is implemented now. For other
> > cases CreateBitmapFromHBITMAP or CreateBitmapFromMemory should work.
> 
> So now we need code in WIC that copies ICO streams into a file on disk
> so we can get an HICON for the bitmap frames (they could all be PNG)
> so we can pass that to CreateBitmapFromHICON? No thanks.

I don't see why you need to write anything to a file at all for a decoder
if you already have bitmap bits.

-- 
Dmitry.



More information about the wine-devel mailing list