Closed
Conversation
Collaborator
|
I think I'd prefer png to farbfeld as I can't find much on image editor support for farbfeld (can I open it in preview on Mac or what software do I need on Linux?) I don't have an issue with adding the extra dependency to the samples/ app. |
Collaborator
Author
|
See #301 for PNG export. |
dneto0
requested changes
Feb 20, 2019
Collaborator
dneto0
left a comment
There was a problem hiding this comment.
farbfeld is super simple!
|
|
||
| namespace { | ||
|
|
||
| char byte0(uint32_t word) { |
Collaborator
There was a problem hiding this comment.
I'd use uint8_t instead of char.
| // Farbfeld format details: https://tools.suckless.org/farbfeld/ | ||
|
|
||
| // Farbfeld header | ||
| std::string image = "farbfeld"; |
Collaborator
There was a problem hiding this comment.
Recommend adding image.reserve(8 +4 +4 + width * height * 4 * 2);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently image export is done in PPM format, which unfortunately lacks support of alpha channel. Alpha channel support is crucial for graphicsfuzz experiments.
This change adds a possible export to farbfeld format, which both supports alpha channel and is trivial to implement, bypassing the need for a third party library. For more info, see https://tools.suckless.org/farbfeld/faq/
EDIT: PNG export would be nice as PNG is supported virtually everywhere. I prepared this farbfeld export because I assumed adding a third-party PNG library (e.g. lodepng https://github.com/lvandeve/lodepng) as an Amber dependency would be frowned upon. Yet if you can see a way of easily adding PNG export support, please let me know!