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

Commit 0dd622ef authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Add alpha to AndroidBitmapInfo

Bug: 135133301
Test: If8859321c1b7e5149029f931e4d11ec6eeeb260a
Change-Id: I3577602444837b703fcbf6498bd00e1ee1c97e09
parent c60275b6
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -64,6 +64,20 @@ enum AndroidBitmapFormat {
    ANDROID_BITMAP_FORMAT_RGBA_F16  = 9,
};

/** Bitmap alpha format */
enum {
    /** Pixel components are premultiplied by alpha. */
    ANDROID_BITMAP_FLAGS_ALPHA_PREMUL   = 0,
    /** Pixels are opaque. */
    ANDROID_BITMAP_FLAGS_ALPHA_OPAQUE   = 1,
    /** Pixel components are independent of alpha. */
    ANDROID_BITMAP_FLAGS_ALPHA_UNPREMUL = 2,
    /** Bit mask for AndroidBitmapFormat.flags to isolate the alpha. */
    ANDROID_BITMAP_FLAGS_ALPHA_MASK     = 0x3,
    /** Shift for AndroidBitmapFormat.flags to isolate the alpha. */
    ANDROID_BITMAP_FLAGS_ALPHA_SHIFT    = 0,
};

/** Bitmap info, see AndroidBitmap_getInfo(). */
typedef struct {
    /** The bitmap width in pixels. */
@@ -74,8 +88,9 @@ typedef struct {
    uint32_t    stride;
    /** The bitmap pixel format. See {@link AndroidBitmapFormat} */
    int32_t     format;
    /** Unused. */
    uint32_t    flags;      // 0 for now
    /** Two bits are used to encode alpha. Use ANDROID_BITMAP_FLAGS_ALPHA_MASK
      * and ANDROID_BITMAP_FLAGS_ALPHA_SHIFT to retrieve them. */
    uint32_t    flags;
} AndroidBitmapInfo;

/**