Java Code Examples for android.graphics.PixelFormat#RGBX_8888

The following examples show how to use android.graphics.PixelFormat#RGBX_8888 . 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;
    }
}
 
Example 4
Source File: StreamConfigurationMap.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
private String formatToString(int format) {
    switch (format) {
        case ImageFormat.YV12:
            return "YV12";
        case ImageFormat.YUV_420_888:
            return "YUV_420_888";
        case ImageFormat.NV21:
            return "NV21";
        case ImageFormat.NV16:
            return "NV16";
        case PixelFormat.RGB_565:
            return "RGB_565";
        case PixelFormat.RGBA_8888:
            return "RGBA_8888";
        case PixelFormat.RGBX_8888:
            return "RGBX_8888";
        case PixelFormat.RGB_888:
            return "RGB_888";
        case ImageFormat.JPEG:
            return "JPEG";
        case ImageFormat.YUY2:
            return "YUY2";
        case ImageFormat.Y8:
            return "Y8";
        case ImageFormat.Y16:
            return "Y16";
        case ImageFormat.RAW_SENSOR:
            return "RAW_SENSOR";
        case ImageFormat.RAW_PRIVATE:
            return "RAW_PRIVATE";
        case ImageFormat.RAW10:
            return "RAW10";
        case ImageFormat.DEPTH16:
            return "DEPTH16";
        case ImageFormat.DEPTH_POINT_CLOUD:
            return "DEPTH_POINT_CLOUD";
        case ImageFormat.RAW_DEPTH:
            return "RAW_DEPTH";
        case ImageFormat.PRIVATE:
            return "PRIVATE";
        default:
            return "UNKNOWN";
    }
}