[Scummvm-devel] Moving and merging image-related code
Jordi Vilalta Prat
jvprat at jvprat.com
Wed Feb 2 23:18:13 CET 2011
2011/2/2 Filippos Karapetis:
> To sum up: honestly, if you guys believe that this code is unnecessary,
> that's fine
> with me (we got 3 votes so far: Willem, Matthew and Johannes). We can remove
> it
> if you want to, but I don't see the point. I personally did what I aimed
> for: to understand
> the PNG format and write a decoder for it, based on specs and other
> publically
> available code. So I personally gained something from it, but if it's not
> needed for the
> project, we can stick with libpng.
Personally I like the advantage of keeping the core as dependency-free
as possible, so I'm not against having our own PNG decoder. This
usually results in smaller code since we just implement the part of
the spec that we need, and it's easier to port because it's
implemented from the start using our own APIs. Nevertheless, using the
official libraries (for both PNG and JPEG) can have its benefits. For
example I'm sure libjpeg is much faster than our own JPEG decoder, and
it may even offer better quality.
Back to the start of this thread, I think it's a great idea to have a
common interface for image decoding, and I think the current
Video::Codec interface could be a good start (probably removing the
hasDirtyPalette method). For example it would allow having 2 PNG
decoders (the internal and one using libpng), selectable at configure
time, falling back to the internal one when libpng isn't available.
Regards,
Jordi Vilalta
More information about the Scummvm-devel
mailing list