From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- media/omx-plugin/include/ics/pixelflinger/format.h | 136 +++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 media/omx-plugin/include/ics/pixelflinger/format.h (limited to 'media/omx-plugin/include/ics/pixelflinger/format.h') diff --git a/media/omx-plugin/include/ics/pixelflinger/format.h b/media/omx-plugin/include/ics/pixelflinger/format.h new file mode 100644 index 000000000..82eeca4d7 --- /dev/null +++ b/media/omx-plugin/include/ics/pixelflinger/format.h @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2005 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_PIXELFLINGER_FORMAT_H +#define ANDROID_PIXELFLINGER_FORMAT_H + +#include +#include + +enum GGLPixelFormat { + // these constants need to match those + // in graphics/PixelFormat.java, ui/PixelFormat.h, BlitHardware.h + GGL_PIXEL_FORMAT_UNKNOWN = 0, + GGL_PIXEL_FORMAT_NONE = 0, + + GGL_PIXEL_FORMAT_RGBA_8888 = 1, // 4x8-bit ARGB + GGL_PIXEL_FORMAT_RGBX_8888 = 2, // 3x8-bit RGB stored in 32-bit chunks + GGL_PIXEL_FORMAT_RGB_888 = 3, // 3x8-bit RGB + GGL_PIXEL_FORMAT_RGB_565 = 4, // 16-bit RGB + GGL_PIXEL_FORMAT_BGRA_8888 = 5, // 4x8-bit BGRA + GGL_PIXEL_FORMAT_RGBA_5551 = 6, // 16-bit RGBA + GGL_PIXEL_FORMAT_RGBA_4444 = 7, // 16-bit RGBA + + GGL_PIXEL_FORMAT_A_8 = 8, // 8-bit A + GGL_PIXEL_FORMAT_L_8 = 9, // 8-bit L (R=G=B = L) + GGL_PIXEL_FORMAT_LA_88 = 0xA, // 16-bit LA + GGL_PIXEL_FORMAT_RGB_332 = 0xB, // 8-bit RGB (non paletted) + + // reserved range. don't use. + GGL_PIXEL_FORMAT_RESERVED_10 = 0x10, + GGL_PIXEL_FORMAT_RESERVED_11 = 0x11, + GGL_PIXEL_FORMAT_RESERVED_12 = 0x12, + GGL_PIXEL_FORMAT_RESERVED_13 = 0x13, + GGL_PIXEL_FORMAT_RESERVED_14 = 0x14, + GGL_PIXEL_FORMAT_RESERVED_15 = 0x15, + GGL_PIXEL_FORMAT_RESERVED_16 = 0x16, + GGL_PIXEL_FORMAT_RESERVED_17 = 0x17, + + // reserved/special formats + GGL_PIXEL_FORMAT_Z_16 = 0x18, + GGL_PIXEL_FORMAT_S_8 = 0x19, + GGL_PIXEL_FORMAT_SZ_24 = 0x1A, + GGL_PIXEL_FORMAT_SZ_8 = 0x1B, + + // reserved range. don't use. + GGL_PIXEL_FORMAT_RESERVED_20 = 0x20, + GGL_PIXEL_FORMAT_RESERVED_21 = 0x21, +}; + +enum GGLFormatComponents { + GGL_STENCIL_INDEX = 0x1901, + GGL_DEPTH_COMPONENT = 0x1902, + GGL_ALPHA = 0x1906, + GGL_RGB = 0x1907, + GGL_RGBA = 0x1908, + GGL_LUMINANCE = 0x1909, + GGL_LUMINANCE_ALPHA = 0x190A, +}; + +enum GGLFormatComponentIndex { + GGL_INDEX_ALPHA = 0, + GGL_INDEX_RED = 1, + GGL_INDEX_GREEN = 2, + GGL_INDEX_BLUE = 3, + GGL_INDEX_STENCIL = 0, + GGL_INDEX_DEPTH = 1, + GGL_INDEX_Y = 0, + GGL_INDEX_CB = 1, + GGL_INDEX_CR = 2, +}; + +typedef struct { +#ifdef __cplusplus + enum { + ALPHA = GGL_INDEX_ALPHA, + RED = GGL_INDEX_RED, + GREEN = GGL_INDEX_GREEN, + BLUE = GGL_INDEX_BLUE, + STENCIL = GGL_INDEX_STENCIL, + DEPTH = GGL_INDEX_DEPTH, + LUMA = GGL_INDEX_Y, + CHROMAB = GGL_INDEX_CB, + CHROMAR = GGL_INDEX_CR, + }; + inline uint32_t mask(int i) const { + return ((1<<(c[i].h-c[i].l))-1)<