Android Bitmap.Config - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Bitmap.Config class.

This code example shows how to use the following methods:ordinal
 * (c) 2011 Zynga Inc. 
 * 
 * @author Nicolas Gramlich 
 * @since 19:41:39 - 07.06.2011 
 */ 
public class ColorSwapBitmapTextureAtlasSource extends BaseBitmapTextureAtlasSource { 
	// =========================================================== 
	// Constants 
	// =========================================================== 
 
	private static final int TOLERANCE_DEFAULT = 0;
 
	// =========================================================== 
	// Fields 
	// =========================================================== 
 
	protected final int mColorKeyColorARGBPackedInt;
	protected final int mTolerance;
	protected final int mColorSwapColorARGBPackedInt;
 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:ordinal
		this.gltype = t; 
		this.bitpixel = b; 
	} 
 
	public static PixelFormat getPixelFormat(final Config config) { 
		switch (config) { 
		case ARGB_4444: 
			return RGBA_4444; 
		case ARGB_8888: 
			return RGBA_8888; 
		case RGB_565: 
			return RGB_565; 
		case ALPHA_8: 
			return A_8; 
		default: 
			return RGBA_8888; 
		} 
	} 
 
	public int getGLFormat() { 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:ordinal
import android.graphics.PorterDuff.Mode; 
import android.net.Uri; 
import android.os.ParcelFileDescriptor; 
import android.util.Log; 
 
public class ImageUtil { 
	private ImageUtil() { } 
 
	public static final String TAG = ImageUtil.class.getSimpleName();
 
	public static final long MAX_BITMAP_SIZE   = 1024 * 1024 * 4; //允许的图片最大值;
	public static final long SAFE_DISTANCE     = 1024 * 100;      //至少要保留多大预留空间;
 
	public static final long SCALE_BOUND_SIZE  = 1024;          //图片宽高最小值大于这个时,选择缩小图片而不是画质.
 
	public static final int ROTATE_MAX_SIZE = 512; //旋转图片时,图片缩放的最大尺寸
 
	public static final int UNCONSTRAINED = -1;
 
	/* 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hashCode
        public Config config;
        public int length;
 
        @Override 
        public int hashCode() { 
            int x = config.hashCode() ^ length;
            return vertical ? x : -x;
        } 
 
        @Override 
        public boolean equals(Object object) {
            if (!(object instanceof BorderKey)) return false;
            BorderKey o = (BorderKey) object;
            return vertical == o.vertical
                    && config == o.config && length == o.length;
        } 
 
        @Override 
        public BorderKey clone() { 
            try { 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hashCode
        public Config config;
        public int length;
 
        @Override 
        public int hashCode() { 
            int x = config.hashCode() ^ length;
            return vertical ? x : -x;
        } 
 
        @Override 
        public boolean equals(Object object) {
            if (!(object instanceof BorderKey)) return false;
            BorderKey o = (BorderKey) object;
            return vertical == o.vertical
                    && config == o.config && length == o.length;
        } 
 
        @Override 
        public BorderKey clone() { 
            try { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hashCode
        public Config config;
        public int length;
 
        @Override 
        public int hashCode() { 
            int x = config.hashCode() ^ length;
            return vertical ? x : -x;
        } 
 
        @Override 
        public boolean equals(Object object) {
            if (!(object instanceof BorderKey)) return false;
            BorderKey o = (BorderKey) object;
            return vertical == o.vertical
                    && config == o.config && length == o.length;
        } 
 
        @Override 
        public BorderKey clone() { 
            try { 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hashCode
        public Config config;
        public int length;
 
        @Override 
        public int hashCode() { 
            int x = config.hashCode() ^ length;
            return vertical ? x : -x;
        } 
 
        @Override 
        public boolean equals(Object object) {
            if (!(object instanceof BorderKey)) return false;
            BorderKey o = (BorderKey) object;
            return vertical == o.vertical
                    && config == o.config && length == o.length;
        } 
 
        @Override 
        public BorderKey clone() { 
            try { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:ordinal
	// Methods 
	// =========================================================== 
 
	protected Bitmap swapColor(final Bitmap pBitmap) {
		final Config config = pBitmap.getConfig();
		switch (config) {
			case ARGB_8888:
				return ColorSwapBitmapTextureAtlasSource.swapColorARGB_8888(pBitmap, this.mColorKeyColorARGBPackedInt, this.mTolerance, this.mColorSwapColorARGBPackedInt);
			default: 
				Debug.w("Unexpected " + Bitmap.Config.class.getSimpleName() + ": '" + config + "'.");
				return pBitmap;
		} 
	} 
 
	protected static final Bitmap swapColorARGB_8888(final Bitmap pBitmap, final int pColorKeyColorARGBPackedInt, final int pTolerance, final int pColorSwapColorARGBPackedInt) {
		final int[] pixelsARGB_8888 = GLHelper.getPixelsARGB_8888(pBitmap);
		pBitmap.recycle();
 
		final int keyRed = (pColorKeyColorARGBPackedInt >> Color.ARGB_PACKED_RED_SHIFT) & 0xFF;
		final int keyGreen = (pColorKeyColorARGBPackedInt >> Color.ARGB_PACKED_GREEN_SHIFT) & 0xFF;
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hashCode
        public Config config;
        public int length;
 
        @Override 
        public int hashCode() { 
            int x = config.hashCode() ^ length;
            return vertical ? x : -x;
        } 
 
        @Override 
        public boolean equals(Object object) {
            if (!(object instanceof BorderKey)) return false;
            BorderKey o = (BorderKey) object;
            return vertical == o.vertical
                    && config == o.config && length == o.length;
        } 
 
        @Override 
        public BorderKey clone() { 
            try { 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:ordinal
import android.graphics.Bitmap.Config; 
 
/** 
 * TurboJPEG decompressor 
 */ 
public class TJDecompressor { 
 
	private final static String NO_ASSOC_ERROR = "No JPEG image is associated with this instance";
 
	/** 
	 * Create a TurboJPEG decompresssor instance. 
	 */ 
	public TJDecompressor() throws Exception { 
		init(); 
	} 
 
	/** 
	 * Create a TurboJPEG decompressor instance and associate the JPEG image 
	 * stored in <code>jpegImage</code> with the newly-created instance. 
	 *  
3
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android Bitmap.Config Questions & Answers:

See Code Examples for Android Bitmap.Config Methods: