android.graphics.AvoidXfermode Java Examples

The following examples show how to use android.graphics.AvoidXfermode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XulGIFDecoder.java    From starcor.xul with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static GIFAnimationRender createAnimationRenderer(GIFFrame[] gifFrames, boolean noLoop, boolean noTransparent) {
	GIFAnimationRender render = new GIFAnimationRender();
	GIFFrame gifFrame0 = gifFrames[0];
	render._frameImage = BitmapTools.createBitmap(gifFrame0._screenW, gifFrame0._screenH, Bitmap.Config.ARGB_8888);
	render._gifFrames = gifFrames;
	render._isCurrentFrameDecoded = false;
	render._currentFrame = 0;
	render._noLoop = noLoop;
	if (noTransparent || gifFrame0._backgroundColor == 0xFFFFFF) {
		render._colorKeyXferMode = null;
	} else {
		render._colorKeyXferMode = new AvoidXfermode(gifFrame0._backgroundColor, 0, AvoidXfermode.Mode.AVOID);
	}
	//render._colorKeyXferMode = new PixelXorXfermode(gifFrame0._backgroundColor);
	return render;
}
 
Example #2
Source File: ColorSwapBitmapTextureAtlasSourceDecorator.java    From tilt-game-android with MIT License 5 votes vote down vote up
public ColorSwapBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int pColorKeyColorARGBPackedInt, final int pTolerance, final int pColorSwapColorARGBPackedInt, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
	super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);

	this.mColorKeyColorARGBPackedInt = pColorKeyColorARGBPackedInt;
	this.mTolerance = pTolerance;
	this.mColorSwapColorARGBPackedInt = pColorSwapColorARGBPackedInt;
	this.mPaint.setXfermode(new AvoidXfermode(pColorKeyColorARGBPackedInt, pTolerance, Mode.TARGET));
	this.mPaint.setColor(pColorSwapColorARGBPackedInt);

	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.JELLY_BEAN)) {
		Debug.w("The class " + ColorSwapBitmapTextureAtlasSourceDecorator.class.getSimpleName() + " is deprecated for Android API Level: '" + Build.VERSION_CODES.JELLY_BEAN + "' and higher, since the class " + AvoidXfermode.class.getSimpleName() + " is deprecated since then.");
	}
}
 
Example #3
Source File: ColorSwapBitmapTextureAtlasSourceDecorator.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
public ColorSwapBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int pColorKeyColorARGBPackedInt, final int pTolerance, final int pColorSwapColorARGBPackedInt, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
	super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);

	this.mColorKeyColorARGBPackedInt = pColorKeyColorARGBPackedInt;
	this.mTolerance = pTolerance;
	this.mColorSwapColorARGBPackedInt = pColorSwapColorARGBPackedInt;
	this.mPaint.setXfermode(new AvoidXfermode(pColorKeyColorARGBPackedInt, pTolerance, Mode.TARGET));
	this.mPaint.setColor(pColorSwapColorARGBPackedInt);
}