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

Commit 22edf7e6 authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "Add alpha to AndroidBitmapInfo"

parents edb7ba15 0dd622ef
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;

/**