godot
godot copied to clipboard
QOI Image Support
- Production edit: This closes https://github.com/godotengine/godot-proposals/issues/3726.
Missing acknowledgement in COPYRIGHT.txt
Files: ./thirdparty/qoi/
Comment: Quite OK Image Format
Copyright: 2024, Dominic Szablewski
License: Expat
Thanks for the comments! I opened this as a draft as I knew I had a few more passes to go though before it was ready for review.
My biggest question is what should be done about MovieWriterPNGWAV? What I did makes a lot of sense, but then the name of the classes is a bit odd? Options as I see it are:
- Don't change anything.
- Rename this class to MovieWriterImgWAV
- Make a new class MovieWriterQOIWAV, with mostly duplicate code.
- Rename this class to MovieWriterImgWAV
Renaming classes is considered compatibility break, and should only be done between major versions.
- Make a new class MovieWriterQOIWAV, with mostly duplicate code.
I see some parallels with my QOA implementation. The original version was a module to import and play QOA files, but since QOA isn't a popular format to be converted to (unlike QOI, although not widely adopted as something like JPEG XL) I added a converter from WAV, with a lot of duplicated code.
But because I was never satisfied with that implementation, I ended up rewriting it inside the WAV code, as a compression mode rather than a separate format. No class renames and most importantly: no duplicated code.
IMHO, the best alternative would be 1. Making a new class and duplicating code has a considerable impact on binary size.
I suggest keeping the class name as-is, while adding a note in the class reference about why the class is named PNGWAV
even if it supports QOI.
For instance, you can add this at the bottom of doc/classes/MovieWriterPNGWAV.xml
's <description>
tag:
[b]Note:[/b] For historical reasons, this class is named MovieWriterPNGWAV even though it also supports writing the QOI image format.
- Rename this class to MovieWriterImgWAV
Renaming classes is considered compatibility break, and should only be done between major versions.
- Make a new class MovieWriterQOIWAV, with mostly duplicate code.
I see some parallels with my QOA implementation. The original version was a module to import and play QOA files, but since QOA isn't a popular format to be converted to (unlike QOI, although not widely adopted as something like JPEG XL) I added a converter from WAV, with a lot of duplicated code.
But because I was never satisfied with that implementation, I ended up rewriting it inside the WAV code, as a compression mode rather than a separate format. No class renames and most importantly: no duplicated code.
IMHO, the best alternative would be 1. Making a new class and duplicating code has a considerable impact on binary size.
I noticed in the QOA patch, you added the header file to misc instead of making a separate folder. I suppose I should do that here too.
MovieWriterPNGWAV
Seems like that class isnt documented because its not reflected directly.