Skip to content

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