Skip to content

Remove use of Bitmap pool in TransformationUtils to fix gainmap issues. #5505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aadityaprakash04
Copy link

Description

This pull request modifies the fitCenter and centerCrop methods, located in TransformationUtils, to address gain map handling. The previous implementation used applyMatrix with the Canvas API, which dropped gain map data.

This PR replaces applyMatrix with createBitmap APIs to ensure proper gain map handling in fitCenter and centerCrop. This change avoids using the bitmap pool.

Motivation and Context

The original fitCenter and centerCrop implementation lost gain map information, which is crucial for HDR images.

The applyMatrix method's use of the Canvas API caused this issue, as Canvas doesn't preserve gain maps. We now use createBitmap, which retains this data. The bitmap pool was avoided because, The BitmapPool is keyed off of three attributes, 1) width, 2) height and 3) config (bit depth). The usages of the BitmapPool do not strive to override other properties of the Bitmap like the color space before the bitmap is reused. This ensures correct fitCenter and centerCrop behavior with gain maps.

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