[PATCH] windowscodecs: Add support for DIB format.

Dmitry Timoshkov dmitry at baikal.ru
Mon Jan 21 11:28:14 CST 2013


Vincent Povirk <madewokherd at gmail.com> wrote:

> > I'd suggest to use public APIs instead of inventing "extenstions".
> > CreateBitmapFromMemory should work for this purpose if you really need
> > to do it using windowscodecs, otherwise GDI APIs may work as well.
> 
> I've been of the opinion that we should have a separate dll for Wine
> extensions to WIC, which could also work on WIndows, but I was told to
> put them in the same dll. We have two extensions already: the ICNS
> encoder and the TGA decoder.

That's fine to have WIC support for really useful image formats if there
is no other way to handle them, I was thinking to add PCX support at some
point. But adding this support should not break other things. For instance
using native gdiplus or windowscodecs for testing already breaks in some
ways winemenubuilder, and adding a DIB decoder will break d3dx9 by adding
a dependency that could be easily avoided.

> 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.

> (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.

-- 
Dmitry.



More information about the wine-devel mailing list