Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70fb9085 authored by Wu-cheng Li's avatar Wu-cheng Li
Browse files

Add camera bayer image format.

The API are hidden.

bug:5086073

Change-Id: Ic9a53e5d5007ad3f12a28406ee25098227f14cbc
parent bb1e275c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1708,6 +1708,7 @@ public class Camera {
        private static final String PIXEL_FORMAT_YUV420P = "yuv420p";
        private static final String PIXEL_FORMAT_RGB565 = "rgb565";
        private static final String PIXEL_FORMAT_JPEG = "jpeg";
        private static final String PIXEL_FORMAT_BAYER_RGGB = "bayer-rggb";

        private HashMap<String, String> mMap;

@@ -2258,6 +2259,7 @@ public class Camera {
            case ImageFormat.YV12:      return PIXEL_FORMAT_YUV420P;
            case ImageFormat.RGB_565:   return PIXEL_FORMAT_RGB565;
            case ImageFormat.JPEG:      return PIXEL_FORMAT_JPEG;
            case ImageFormat.BAYER_RGGB: return PIXEL_FORMAT_BAYER_RGGB;
            default:                    return null;
            }
        }
+13 −1
Original line number Diff line number Diff line
@@ -83,6 +83,16 @@ public class ImageFormat {
     */
    public static final int JPEG = 0x100;

    /**
     * Raw bayer format used for images, which is 10 bit precision samples
     * stored in 16 bit words. The filter pattern is RGGB. Whether this format
     * is supported by the camera hardware can be determined by
     * {@link android.hardware.Camera.Parameters#getSupportedPreviewFormats()}.
     *
     * @hide
     */
    public static final int BAYER_RGGB = 0x200;

    /**
     * Use this function to retrieve the number of bits per pixel of an
     * ImageFormat.
@@ -103,6 +113,8 @@ public class ImageFormat {
                return 12;
            case NV21:
                return 12;
            case BAYER_RGGB:
                return 16;
        }
        return -1;
    }
+3 −0
Original line number Diff line number Diff line
@@ -573,6 +573,9 @@ public:
    static const char PIXEL_FORMAT_RGB565[];
    static const char PIXEL_FORMAT_RGBA8888[];
    static const char PIXEL_FORMAT_JPEG[];
    // Raw bayer format used for images, which is 10 bit precision samples
    // stored in 16 bit words. The filter pattern is RGGB.
    static const char PIXEL_FORMAT_BAYER_RGGB[];

    // Values for focus mode settings.
    // Auto-focus mode. Applications should call
+1 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ const char CameraParameters::PIXEL_FORMAT_YUV420P[] = "yuv420p";
const char CameraParameters::PIXEL_FORMAT_RGB565[] = "rgb565";
const char CameraParameters::PIXEL_FORMAT_RGBA8888[] = "rgba8888";
const char CameraParameters::PIXEL_FORMAT_JPEG[] = "jpeg";
const char CameraParameters::PIXEL_FORMAT_BAYER_RGGB[] = "bayer-rggb";

// Values for focus mode settings.
const char CameraParameters::FOCUS_MODE_AUTO[] = "auto";