Add BitmapFactory.Options.inColorSpace
This allows applications to load bitmap in a preferred target color space, similar to inPreferredConfig for configurations. This change also applies recent changes made to BitmapFactory to BitmapRegionDecoder: support for outColorSpace, inColorSpace and outConfig. Bug: 32984164, 36905374 Test: CtsGraphicsTestCase (BitmapColorSpaceTest/BitmapRegionDecoderTest) Change-Id: I4eded9190d1aa9c7f3033f9bb78a6854cc48a3ef
This commit is contained in:
@@ -180,7 +180,9 @@ public final class BitmapRegionDecoder {
|
||||
* decoded.
|
||||
* @throws IllegalArgumentException if {@link BitmapFactory.Options#inPreferredConfig}
|
||||
* is {@link android.graphics.Bitmap.Config#HARDWARE}
|
||||
* and {@link BitmapFactory.Options#inMutable} is set.
|
||||
* and {@link BitmapFactory.Options#inMutable} is set, if the specified color space
|
||||
* is not {@link ColorSpace.Model#RGB RGB}, or if the specified color space's transfer
|
||||
* function is not an {@link ColorSpace.Rgb.TransferParameters ICC parametric curve}
|
||||
*/
|
||||
public Bitmap decodeRegion(Rect rect, BitmapFactory.Options options) {
|
||||
BitmapFactory.Options.validate(options);
|
||||
|
||||
Reference in New Issue
Block a user