Java Code Examples for android.graphics.PixelFormat#RGB_332

The following examples show how to use android.graphics.PixelFormat#RGB_332 . 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: PhysicalDisplayAndroid.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
private int bitsPerComponent(int pixelFormatId) {
    switch (pixelFormatId) {
        case PixelFormat.RGBA_4444:
            return 4;

        case PixelFormat.RGBA_5551:
            return 5;

        case PixelFormat.RGBA_8888:
        case PixelFormat.RGBX_8888:
        case PixelFormat.RGB_888:
            return 8;

        case PixelFormat.RGB_332:
            return 2;

        case PixelFormat.RGB_565:
            return 5;

        // Non-RGB formats.
        case PixelFormat.A_8:
        case PixelFormat.LA_88:
        case PixelFormat.L_8:
            return 0;

        // Unknown format. Use 8 as a sensible default.
        default:
            return 8;
    }
}
 
Example 2
Source File: DeviceDisplayInfo.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * @return Bits per component.
 */
@SuppressWarnings("deprecation")
@CalledByNative
public int getBitsPerComponent() {
    int format = getPixelFormat();
    switch (format) {
    case PixelFormat.RGBA_4444:
        return 4;

    case PixelFormat.RGBA_5551:
        return 5;

    case PixelFormat.RGBA_8888:
    case PixelFormat.RGBX_8888:
    case PixelFormat.RGB_888:
        return 8;

    case PixelFormat.RGB_332:
        return 2;

    case PixelFormat.RGB_565:
        return 5;

    // Non-RGB formats.
    case PixelFormat.A_8:
    case PixelFormat.LA_88:
    case PixelFormat.L_8:
        return 0;

    // Unknown format. Use 8 as a sensible default.
    default:
        return 8;
    }
}
 
Example 3
Source File: DeviceDisplayInfo.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * @return Bits per component.
 */
@SuppressWarnings("deprecation")
@CalledByNative
public int getBitsPerComponent() {
    int format = getPixelFormat();
    switch (format) {
    case PixelFormat.RGBA_4444:
        return 4;

    case PixelFormat.RGBA_5551:
        return 5;

    case PixelFormat.RGBA_8888:
    case PixelFormat.RGBX_8888:
    case PixelFormat.RGB_888:
        return 8;

    case PixelFormat.RGB_332:
        return 2;

    case PixelFormat.RGB_565:
        return 5;

    // Non-RGB formats.
    case PixelFormat.A_8:
    case PixelFormat.LA_88:
    case PixelFormat.L_8:
        return 0;

    // Unknown format. Use 8 as a sensible default.
    default:
        return 8;
    }
}