Skip to content

Conversation

@tobybell
Copy link

@tobybell tobybell commented Sep 9, 2024

This merge request is to share back something I implemented in a downstream copy of the project. No pressure to accept it; just sharing in case it's useful.

Previously, spng_encode_image would always interpret the img data pointer as pointing to image data in top-to-bottom order, despite some image data APIs storing image data in bottom-to-top order (most notably, OpenGL functions like glReadPixels).

This merge request adds a flag, SPNG_ENCODE_INVERT_ROWS to allow spng_encode_image to interpret the given image data pointer as containing rows in bottom-to-top order, instead of top-to-bottom. This allows saving PNG images directly from glReadPixels calls when using OpenGL, without an additional copy to reverse the row data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant