Loading api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -12510,6 +12510,7 @@ package android.graphics { field public int inTargetDensity; field public int inTargetDensity; field public byte[] inTempStorage; field public byte[] inTempStorage; field public deprecated boolean mCancel; field public deprecated boolean mCancel; field public android.graphics.ColorSpace outColorSpace; field public android.graphics.Bitmap.Config outConfig; field public android.graphics.Bitmap.Config outConfig; field public int outHeight; field public int outHeight; field public java.lang.String outMimeType; field public java.lang.String outMimeType; api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -13243,6 +13243,7 @@ package android.graphics { field public int inTargetDensity; field public int inTargetDensity; field public byte[] inTempStorage; field public byte[] inTempStorage; field public deprecated boolean mCancel; field public deprecated boolean mCancel; field public android.graphics.ColorSpace outColorSpace; field public android.graphics.Bitmap.Config outConfig; field public android.graphics.Bitmap.Config outConfig; field public int outHeight; field public int outHeight; field public java.lang.String outMimeType; field public java.lang.String outMimeType; api/test-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -12560,6 +12560,7 @@ package android.graphics { field public int inTargetDensity; field public int inTargetDensity; field public byte[] inTempStorage; field public byte[] inTempStorage; field public deprecated boolean mCancel; field public deprecated boolean mCancel; field public android.graphics.ColorSpace outColorSpace; field public android.graphics.Bitmap.Config outConfig; field public android.graphics.Bitmap.Config outConfig; field public int outHeight; field public int outHeight; field public java.lang.String outMimeType; field public java.lang.String outMimeType; core/jni/android/graphics/BitmapFactory.cpp +110 −1 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ jfieldID gOptions_widthFieldID; jfieldID gOptions_heightFieldID; jfieldID gOptions_heightFieldID; jfieldID gOptions_mimeFieldID; jfieldID gOptions_mimeFieldID; jfieldID gOptions_outConfigFieldID; jfieldID gOptions_outConfigFieldID; jfieldID gOptions_outColorSpaceFieldID; jfieldID gOptions_mCancelID; jfieldID gOptions_mCancelID; jfieldID gOptions_bitmapFieldID; jfieldID gOptions_bitmapFieldID; Loading @@ -50,6 +51,20 @@ jmethodID gInsetStruct_constructorMethodID; jclass gBitmapConfig_class; jclass gBitmapConfig_class; jmethodID gBitmapConfig_nativeToConfigMethodID; jmethodID gBitmapConfig_nativeToConfigMethodID; jclass gColorSpace_class; jmethodID gColorSpace_getMethodID; jmethodID gColorSpace_matchMethodID; jclass gColorSpaceRGB_class; jmethodID gColorSpaceRGB_constructorMethodID; jclass gColorSpace_Named_class; jfieldID gColorSpace_Named_sRGBFieldID; jfieldID gColorSpace_Named_LinearExtendedSRGBFieldID; jclass gTransferParameters_class; jmethodID gTransferParameters_constructorMethodID; using namespace android; using namespace android; jstring encodedFormatToString(JNIEnv* env, SkEncodedImageFormat format) { jstring encodedFormatToString(JNIEnv* env, SkEncodedImageFormat format) { Loading Loading @@ -228,6 +243,70 @@ static bool needsFineScale(const SkISize fullSize, const SkISize decodedSize, needsFineScale(fullSize.height(), decodedSize.height(), sampleSize); needsFineScale(fullSize.height(), decodedSize.height(), sampleSize); } } static jobject getColorSpace(JNIEnv* env, sk_sp<SkColorSpace>& decodeColorSpace, SkColorType decodeColorType) { jobject colorSpace = nullptr; // No need to match, we know what the output color space will be if (decodeColorType == kRGBA_F16_SkColorType) { jobject linearExtendedSRGB = env->GetStaticObjectField( gColorSpace_Named_class, gColorSpace_Named_LinearExtendedSRGBFieldID); colorSpace = env->CallStaticObjectMethod(gColorSpace_class, gColorSpace_getMethodID, linearExtendedSRGB); } else { // Same here, no need to match if (decodeColorSpace->isSRGB()) { jobject sRGB = env->GetStaticObjectField( gColorSpace_Named_class, gColorSpace_Named_sRGBFieldID); colorSpace = env->CallStaticObjectMethod(gColorSpace_class, gColorSpace_getMethodID, sRGB); } else if (decodeColorSpace.get() != nullptr) { // Try to match against known RGB color spaces using the CIE XYZ D50 // conversion matrix and numerical transfer function parameters SkMatrix44 xyzMatrix(SkMatrix44::kUninitialized_Constructor); LOG_ALWAYS_FATAL_IF(!decodeColorSpace->toXYZD50(&xyzMatrix)); SkColorSpaceTransferFn transferParams; // We can only handle numerical transfer functions at the moment LOG_ALWAYS_FATAL_IF(!decodeColorSpace->isNumericalTransferFn(&transferParams)); jobject params = env->NewObject(gTransferParameters_class, gTransferParameters_constructorMethodID, transferParams.fA, transferParams.fB, transferParams.fC, transferParams.fD, transferParams.fE, transferParams.fF, transferParams.fG); jfloatArray xyzArray = env->NewFloatArray(9); jfloat xyz[9] = { xyzMatrix.getFloat(0, 0), xyzMatrix.getFloat(1, 0), xyzMatrix.getFloat(2, 0), xyzMatrix.getFloat(0, 1), xyzMatrix.getFloat(1, 1), xyzMatrix.getFloat(2, 1), xyzMatrix.getFloat(0, 2), xyzMatrix.getFloat(1, 2), xyzMatrix.getFloat(2, 2) }; env->SetFloatArrayRegion(xyzArray, 0, 9, xyz); colorSpace = env->CallStaticObjectMethod(gColorSpace_class, gColorSpace_matchMethodID, xyzArray, params); if (colorSpace == nullptr) { // We couldn't find an exact match, let's create a new color space // instance with the 3x3 conversion matrix and transfer function colorSpace = env->NewObject(gColorSpaceRGB_class, gColorSpaceRGB_constructorMethodID, env->NewStringUTF("Unknown"), xyzArray, params); } env->DeleteLocalRef(xyzArray); } } return colorSpace; } static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding, jobject options) { static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding, jobject options) { // This function takes ownership of the input stream. Since the SkAndroidCodec // This function takes ownership of the input stream. Since the SkAndroidCodec // will take ownership of the stream, we don't necessarily need to take ownership // will take ownership of the stream, we don't necessarily need to take ownership Loading Loading @@ -263,6 +342,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding env->SetIntField(options, gOptions_heightFieldID, -1); env->SetIntField(options, gOptions_heightFieldID, -1); env->SetObjectField(options, gOptions_mimeFieldID, 0); env->SetObjectField(options, gOptions_mimeFieldID, 0); env->SetObjectField(options, gOptions_outConfigFieldID, 0); env->SetObjectField(options, gOptions_outConfigFieldID, 0); env->SetObjectField(options, gOptions_outColorSpaceFieldID, 0); jobject jconfig = env->GetObjectField(options, gOptions_configFieldID); jobject jconfig = env->GetObjectField(options, gOptions_configFieldID); prefColorType = GraphicsJNI::getNativeBitmapColorType(env, jconfig); prefColorType = GraphicsJNI::getNativeBitmapColorType(env, jconfig); Loading Loading @@ -319,6 +399,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding // Set the decode colorType // Set the decode colorType SkColorType decodeColorType = codec->computeOutputColorType(prefColorType); SkColorType decodeColorType = codec->computeOutputColorType(prefColorType); sk_sp<SkColorSpace> decodeColorSpace = codec->computeOutputColorSpace(decodeColorType); // Set the options and return if the client only wants the size. // Set the options and return if the client only wants the size. if (options != NULL) { if (options != NULL) { Loading @@ -345,6 +426,9 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding gBitmapConfig_nativeToConfigMethodID, configID); gBitmapConfig_nativeToConfigMethodID, configID); env->SetObjectField(options, gOptions_outConfigFieldID, config); env->SetObjectField(options, gOptions_outConfigFieldID, config); env->SetObjectField(options, gOptions_outColorSpaceFieldID, getColorSpace(env, decodeColorSpace, decodeColorType)); if (onlyDecodeSize) { if (onlyDecodeSize) { return nullptr; return nullptr; } } Loading Loading @@ -412,7 +496,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding SkAlphaType alphaType = codec->computeOutputAlphaType(requireUnpremultiplied); SkAlphaType alphaType = codec->computeOutputAlphaType(requireUnpremultiplied); const SkImageInfo decodeInfo = SkImageInfo::Make(size.width(), size.height(), const SkImageInfo decodeInfo = SkImageInfo::Make(size.width(), size.height(), decodeColorType, alphaType, codec->computeOutputColorSpace(decodeColorType)); decodeColorType, alphaType, decodeColorSpace); // For wide gamut images, we will leave the color space on the SkBitmap. Otherwise, // For wide gamut images, we will leave the color space on the SkBitmap. Otherwise, // use the default. // use the default. Loading Loading @@ -725,6 +809,8 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { gOptions_mimeFieldID = GetFieldIDOrDie(env, options_class, "outMimeType", "Ljava/lang/String;"); gOptions_mimeFieldID = GetFieldIDOrDie(env, options_class, "outMimeType", "Ljava/lang/String;"); gOptions_outConfigFieldID = GetFieldIDOrDie(env, options_class, "outConfig", gOptions_outConfigFieldID = GetFieldIDOrDie(env, options_class, "outConfig", "Landroid/graphics/Bitmap$Config;"); "Landroid/graphics/Bitmap$Config;"); gOptions_outColorSpaceFieldID = GetFieldIDOrDie(env, options_class, "outColorSpace", "Landroid/graphics/ColorSpace;"); gOptions_mCancelID = GetFieldIDOrDie(env, options_class, "mCancel", "Z"); gOptions_mCancelID = GetFieldIDOrDie(env, options_class, "mCancel", "Z"); jclass bitmap_class = FindClassOrDie(env, "android/graphics/Bitmap"); jclass bitmap_class = FindClassOrDie(env, "android/graphics/Bitmap"); Loading @@ -741,6 +827,29 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { gBitmapConfig_nativeToConfigMethodID = GetStaticMethodIDOrDie(env, gBitmapConfig_class, gBitmapConfig_nativeToConfigMethodID = GetStaticMethodIDOrDie(env, gBitmapConfig_class, "nativeToConfig", "(I)Landroid/graphics/Bitmap$Config;"); "nativeToConfig", "(I)Landroid/graphics/Bitmap$Config;"); gColorSpace_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace")); gColorSpace_getMethodID = GetStaticMethodIDOrDie(env, gColorSpace_class, "get", "(Landroid/graphics/ColorSpace$Named;)Landroid/graphics/ColorSpace;"); gColorSpace_matchMethodID = GetStaticMethodIDOrDie(env, gColorSpace_class, "match", "([FLandroid/graphics/ColorSpace$Rgb$TransferParameters;)Landroid/graphics/ColorSpace;"); gColorSpaceRGB_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace$Rgb")); gColorSpaceRGB_constructorMethodID = GetMethodIDOrDie(env, gColorSpaceRGB_class, "<init>", "(Ljava/lang/String;[FLandroid/graphics/ColorSpace$Rgb$TransferParameters;)V"); gColorSpace_Named_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace$Named")); gColorSpace_Named_sRGBFieldID = GetStaticFieldIDOrDie(env, gColorSpace_Named_class, "SRGB", "Landroid/graphics/ColorSpace$Named;"); gColorSpace_Named_LinearExtendedSRGBFieldID = GetStaticFieldIDOrDie(env, gColorSpace_Named_class, "LINEAR_EXTENDED_SRGB", "Landroid/graphics/ColorSpace$Named;"); gTransferParameters_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace$Rgb$TransferParameters")); gTransferParameters_constructorMethodID = GetMethodIDOrDie(env, gTransferParameters_class, "<init>", "(DDDDDDD)V"); return android::RegisterMethodsOrDie(env, "android/graphics/BitmapFactory", return android::RegisterMethodsOrDie(env, "android/graphics/BitmapFactory", gMethods, NELEM(gMethods)); gMethods, NELEM(gMethods)); } } docs/html/reference/images/graphics/composite_ADD.png 0 → 100644 +4.42 KiB Loading image diff... Loading
api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -12510,6 +12510,7 @@ package android.graphics { field public int inTargetDensity; field public int inTargetDensity; field public byte[] inTempStorage; field public byte[] inTempStorage; field public deprecated boolean mCancel; field public deprecated boolean mCancel; field public android.graphics.ColorSpace outColorSpace; field public android.graphics.Bitmap.Config outConfig; field public android.graphics.Bitmap.Config outConfig; field public int outHeight; field public int outHeight; field public java.lang.String outMimeType; field public java.lang.String outMimeType;
api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -13243,6 +13243,7 @@ package android.graphics { field public int inTargetDensity; field public int inTargetDensity; field public byte[] inTempStorage; field public byte[] inTempStorage; field public deprecated boolean mCancel; field public deprecated boolean mCancel; field public android.graphics.ColorSpace outColorSpace; field public android.graphics.Bitmap.Config outConfig; field public android.graphics.Bitmap.Config outConfig; field public int outHeight; field public int outHeight; field public java.lang.String outMimeType; field public java.lang.String outMimeType;
api/test-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -12560,6 +12560,7 @@ package android.graphics { field public int inTargetDensity; field public int inTargetDensity; field public byte[] inTempStorage; field public byte[] inTempStorage; field public deprecated boolean mCancel; field public deprecated boolean mCancel; field public android.graphics.ColorSpace outColorSpace; field public android.graphics.Bitmap.Config outConfig; field public android.graphics.Bitmap.Config outConfig; field public int outHeight; field public int outHeight; field public java.lang.String outMimeType; field public java.lang.String outMimeType;
core/jni/android/graphics/BitmapFactory.cpp +110 −1 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ jfieldID gOptions_widthFieldID; jfieldID gOptions_heightFieldID; jfieldID gOptions_heightFieldID; jfieldID gOptions_mimeFieldID; jfieldID gOptions_mimeFieldID; jfieldID gOptions_outConfigFieldID; jfieldID gOptions_outConfigFieldID; jfieldID gOptions_outColorSpaceFieldID; jfieldID gOptions_mCancelID; jfieldID gOptions_mCancelID; jfieldID gOptions_bitmapFieldID; jfieldID gOptions_bitmapFieldID; Loading @@ -50,6 +51,20 @@ jmethodID gInsetStruct_constructorMethodID; jclass gBitmapConfig_class; jclass gBitmapConfig_class; jmethodID gBitmapConfig_nativeToConfigMethodID; jmethodID gBitmapConfig_nativeToConfigMethodID; jclass gColorSpace_class; jmethodID gColorSpace_getMethodID; jmethodID gColorSpace_matchMethodID; jclass gColorSpaceRGB_class; jmethodID gColorSpaceRGB_constructorMethodID; jclass gColorSpace_Named_class; jfieldID gColorSpace_Named_sRGBFieldID; jfieldID gColorSpace_Named_LinearExtendedSRGBFieldID; jclass gTransferParameters_class; jmethodID gTransferParameters_constructorMethodID; using namespace android; using namespace android; jstring encodedFormatToString(JNIEnv* env, SkEncodedImageFormat format) { jstring encodedFormatToString(JNIEnv* env, SkEncodedImageFormat format) { Loading Loading @@ -228,6 +243,70 @@ static bool needsFineScale(const SkISize fullSize, const SkISize decodedSize, needsFineScale(fullSize.height(), decodedSize.height(), sampleSize); needsFineScale(fullSize.height(), decodedSize.height(), sampleSize); } } static jobject getColorSpace(JNIEnv* env, sk_sp<SkColorSpace>& decodeColorSpace, SkColorType decodeColorType) { jobject colorSpace = nullptr; // No need to match, we know what the output color space will be if (decodeColorType == kRGBA_F16_SkColorType) { jobject linearExtendedSRGB = env->GetStaticObjectField( gColorSpace_Named_class, gColorSpace_Named_LinearExtendedSRGBFieldID); colorSpace = env->CallStaticObjectMethod(gColorSpace_class, gColorSpace_getMethodID, linearExtendedSRGB); } else { // Same here, no need to match if (decodeColorSpace->isSRGB()) { jobject sRGB = env->GetStaticObjectField( gColorSpace_Named_class, gColorSpace_Named_sRGBFieldID); colorSpace = env->CallStaticObjectMethod(gColorSpace_class, gColorSpace_getMethodID, sRGB); } else if (decodeColorSpace.get() != nullptr) { // Try to match against known RGB color spaces using the CIE XYZ D50 // conversion matrix and numerical transfer function parameters SkMatrix44 xyzMatrix(SkMatrix44::kUninitialized_Constructor); LOG_ALWAYS_FATAL_IF(!decodeColorSpace->toXYZD50(&xyzMatrix)); SkColorSpaceTransferFn transferParams; // We can only handle numerical transfer functions at the moment LOG_ALWAYS_FATAL_IF(!decodeColorSpace->isNumericalTransferFn(&transferParams)); jobject params = env->NewObject(gTransferParameters_class, gTransferParameters_constructorMethodID, transferParams.fA, transferParams.fB, transferParams.fC, transferParams.fD, transferParams.fE, transferParams.fF, transferParams.fG); jfloatArray xyzArray = env->NewFloatArray(9); jfloat xyz[9] = { xyzMatrix.getFloat(0, 0), xyzMatrix.getFloat(1, 0), xyzMatrix.getFloat(2, 0), xyzMatrix.getFloat(0, 1), xyzMatrix.getFloat(1, 1), xyzMatrix.getFloat(2, 1), xyzMatrix.getFloat(0, 2), xyzMatrix.getFloat(1, 2), xyzMatrix.getFloat(2, 2) }; env->SetFloatArrayRegion(xyzArray, 0, 9, xyz); colorSpace = env->CallStaticObjectMethod(gColorSpace_class, gColorSpace_matchMethodID, xyzArray, params); if (colorSpace == nullptr) { // We couldn't find an exact match, let's create a new color space // instance with the 3x3 conversion matrix and transfer function colorSpace = env->NewObject(gColorSpaceRGB_class, gColorSpaceRGB_constructorMethodID, env->NewStringUTF("Unknown"), xyzArray, params); } env->DeleteLocalRef(xyzArray); } } return colorSpace; } static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding, jobject options) { static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding, jobject options) { // This function takes ownership of the input stream. Since the SkAndroidCodec // This function takes ownership of the input stream. Since the SkAndroidCodec // will take ownership of the stream, we don't necessarily need to take ownership // will take ownership of the stream, we don't necessarily need to take ownership Loading Loading @@ -263,6 +342,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding env->SetIntField(options, gOptions_heightFieldID, -1); env->SetIntField(options, gOptions_heightFieldID, -1); env->SetObjectField(options, gOptions_mimeFieldID, 0); env->SetObjectField(options, gOptions_mimeFieldID, 0); env->SetObjectField(options, gOptions_outConfigFieldID, 0); env->SetObjectField(options, gOptions_outConfigFieldID, 0); env->SetObjectField(options, gOptions_outColorSpaceFieldID, 0); jobject jconfig = env->GetObjectField(options, gOptions_configFieldID); jobject jconfig = env->GetObjectField(options, gOptions_configFieldID); prefColorType = GraphicsJNI::getNativeBitmapColorType(env, jconfig); prefColorType = GraphicsJNI::getNativeBitmapColorType(env, jconfig); Loading Loading @@ -319,6 +399,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding // Set the decode colorType // Set the decode colorType SkColorType decodeColorType = codec->computeOutputColorType(prefColorType); SkColorType decodeColorType = codec->computeOutputColorType(prefColorType); sk_sp<SkColorSpace> decodeColorSpace = codec->computeOutputColorSpace(decodeColorType); // Set the options and return if the client only wants the size. // Set the options and return if the client only wants the size. if (options != NULL) { if (options != NULL) { Loading @@ -345,6 +426,9 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding gBitmapConfig_nativeToConfigMethodID, configID); gBitmapConfig_nativeToConfigMethodID, configID); env->SetObjectField(options, gOptions_outConfigFieldID, config); env->SetObjectField(options, gOptions_outConfigFieldID, config); env->SetObjectField(options, gOptions_outColorSpaceFieldID, getColorSpace(env, decodeColorSpace, decodeColorType)); if (onlyDecodeSize) { if (onlyDecodeSize) { return nullptr; return nullptr; } } Loading Loading @@ -412,7 +496,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding SkAlphaType alphaType = codec->computeOutputAlphaType(requireUnpremultiplied); SkAlphaType alphaType = codec->computeOutputAlphaType(requireUnpremultiplied); const SkImageInfo decodeInfo = SkImageInfo::Make(size.width(), size.height(), const SkImageInfo decodeInfo = SkImageInfo::Make(size.width(), size.height(), decodeColorType, alphaType, codec->computeOutputColorSpace(decodeColorType)); decodeColorType, alphaType, decodeColorSpace); // For wide gamut images, we will leave the color space on the SkBitmap. Otherwise, // For wide gamut images, we will leave the color space on the SkBitmap. Otherwise, // use the default. // use the default. Loading Loading @@ -725,6 +809,8 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { gOptions_mimeFieldID = GetFieldIDOrDie(env, options_class, "outMimeType", "Ljava/lang/String;"); gOptions_mimeFieldID = GetFieldIDOrDie(env, options_class, "outMimeType", "Ljava/lang/String;"); gOptions_outConfigFieldID = GetFieldIDOrDie(env, options_class, "outConfig", gOptions_outConfigFieldID = GetFieldIDOrDie(env, options_class, "outConfig", "Landroid/graphics/Bitmap$Config;"); "Landroid/graphics/Bitmap$Config;"); gOptions_outColorSpaceFieldID = GetFieldIDOrDie(env, options_class, "outColorSpace", "Landroid/graphics/ColorSpace;"); gOptions_mCancelID = GetFieldIDOrDie(env, options_class, "mCancel", "Z"); gOptions_mCancelID = GetFieldIDOrDie(env, options_class, "mCancel", "Z"); jclass bitmap_class = FindClassOrDie(env, "android/graphics/Bitmap"); jclass bitmap_class = FindClassOrDie(env, "android/graphics/Bitmap"); Loading @@ -741,6 +827,29 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) { gBitmapConfig_nativeToConfigMethodID = GetStaticMethodIDOrDie(env, gBitmapConfig_class, gBitmapConfig_nativeToConfigMethodID = GetStaticMethodIDOrDie(env, gBitmapConfig_class, "nativeToConfig", "(I)Landroid/graphics/Bitmap$Config;"); "nativeToConfig", "(I)Landroid/graphics/Bitmap$Config;"); gColorSpace_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace")); gColorSpace_getMethodID = GetStaticMethodIDOrDie(env, gColorSpace_class, "get", "(Landroid/graphics/ColorSpace$Named;)Landroid/graphics/ColorSpace;"); gColorSpace_matchMethodID = GetStaticMethodIDOrDie(env, gColorSpace_class, "match", "([FLandroid/graphics/ColorSpace$Rgb$TransferParameters;)Landroid/graphics/ColorSpace;"); gColorSpaceRGB_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace$Rgb")); gColorSpaceRGB_constructorMethodID = GetMethodIDOrDie(env, gColorSpaceRGB_class, "<init>", "(Ljava/lang/String;[FLandroid/graphics/ColorSpace$Rgb$TransferParameters;)V"); gColorSpace_Named_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace$Named")); gColorSpace_Named_sRGBFieldID = GetStaticFieldIDOrDie(env, gColorSpace_Named_class, "SRGB", "Landroid/graphics/ColorSpace$Named;"); gColorSpace_Named_LinearExtendedSRGBFieldID = GetStaticFieldIDOrDie(env, gColorSpace_Named_class, "LINEAR_EXTENDED_SRGB", "Landroid/graphics/ColorSpace$Named;"); gTransferParameters_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace$Rgb$TransferParameters")); gTransferParameters_constructorMethodID = GetMethodIDOrDie(env, gTransferParameters_class, "<init>", "(DDDDDDD)V"); return android::RegisterMethodsOrDie(env, "android/graphics/BitmapFactory", return android::RegisterMethodsOrDie(env, "android/graphics/BitmapFactory", gMethods, NELEM(gMethods)); gMethods, NELEM(gMethods)); } }