00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00015 #ifndef VPX_VPX_IMAGE_H_
00016 #define VPX_VPX_IMAGE_H_
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00030 #define VPX_IMAGE_ABI_VERSION (4)
00032 #define VPX_IMG_FMT_PLANAR 0x100
00033 #define VPX_IMG_FMT_UV_FLIP 0x200
00034 #define VPX_IMG_FMT_HAS_ALPHA 0x400
00035 #define VPX_IMG_FMT_HIGHBITDEPTH 0x800
00038 typedef enum vpx_img_fmt {
00039 VPX_IMG_FMT_NONE,
00040 VPX_IMG_FMT_RGB24,
00041 VPX_IMG_FMT_RGB32,
00042 VPX_IMG_FMT_RGB565,
00043 VPX_IMG_FMT_RGB555,
00044 VPX_IMG_FMT_UYVY,
00045 VPX_IMG_FMT_YUY2,
00046 VPX_IMG_FMT_YVYU,
00047 VPX_IMG_FMT_BGR24,
00048 VPX_IMG_FMT_RGB32_LE,
00049 VPX_IMG_FMT_ARGB,
00050 VPX_IMG_FMT_ARGB_LE,
00051 VPX_IMG_FMT_RGB565_LE,
00052 VPX_IMG_FMT_RGB555_LE,
00053 VPX_IMG_FMT_YV12 =
00054 VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1,
00055 VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2,
00056 VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP |
00057 3,
00058 VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4,
00059 VPX_IMG_FMT_I422 = VPX_IMG_FMT_PLANAR | 5,
00060 VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6,
00061 VPX_IMG_FMT_I440 = VPX_IMG_FMT_PLANAR | 7,
00062 VPX_IMG_FMT_444A = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_HAS_ALPHA | 6,
00063 VPX_IMG_FMT_I42016 = VPX_IMG_FMT_I420 | VPX_IMG_FMT_HIGHBITDEPTH,
00064 VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGHBITDEPTH,
00065 VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGHBITDEPTH,
00066 VPX_IMG_FMT_I44016 = VPX_IMG_FMT_I440 | VPX_IMG_FMT_HIGHBITDEPTH
00067 } vpx_img_fmt_t;
00070 typedef enum vpx_color_space {
00071 VPX_CS_UNKNOWN = 0,
00072 VPX_CS_BT_601 = 1,
00073 VPX_CS_BT_709 = 2,
00074 VPX_CS_SMPTE_170 = 3,
00075 VPX_CS_SMPTE_240 = 4,
00076 VPX_CS_BT_2020 = 5,
00077 VPX_CS_RESERVED = 6,
00078 VPX_CS_SRGB = 7
00079 } vpx_color_space_t;
00082 typedef enum vpx_color_range {
00083 VPX_CR_STUDIO_RANGE = 0,
00084 VPX_CR_FULL_RANGE = 1
00085 } vpx_color_range_t;
00088 typedef struct vpx_image {
00089 vpx_img_fmt_t fmt;
00090 vpx_color_space_t cs;
00091 vpx_color_range_t range;
00093
00094 unsigned int w;
00095 unsigned int h;
00096 unsigned int bit_depth;
00098
00099 unsigned int d_w;
00100 unsigned int d_h;
00102
00103 unsigned int r_w;
00104 unsigned int r_h;
00106
00107 unsigned int x_chroma_shift;
00108 unsigned int y_chroma_shift;
00110
00111 #define VPX_PLANE_PACKED 0
00112 #define VPX_PLANE_Y 0
00113 #define VPX_PLANE_U 1
00114 #define VPX_PLANE_V 2
00115 #define VPX_PLANE_ALPHA 3
00116 unsigned char *planes[4];
00117 int stride[4];
00119 int bps;
00124 void *user_priv;
00125
00126
00127 unsigned char *img_data;
00128 int img_data_owner;
00129 int self_allocd;
00131 void *fb_priv;
00132 } vpx_image_t;
00135 typedef struct vpx_image_rect {
00136 unsigned int x;
00137 unsigned int y;
00138 unsigned int w;
00139 unsigned int h;
00140 } vpx_image_rect_t;
00160 vpx_image_t *vpx_img_alloc(vpx_image_t *img, vpx_img_fmt_t fmt,
00161 unsigned int d_w, unsigned int d_h,
00162 unsigned int align);
00163
00183 vpx_image_t *vpx_img_wrap(vpx_image_t *img, vpx_img_fmt_t fmt, unsigned int d_w,
00184 unsigned int d_h, unsigned int align,
00185 unsigned char *img_data);
00186
00200 int vpx_img_set_rect(vpx_image_t *img, unsigned int x, unsigned int y,
00201 unsigned int w, unsigned int h);
00202
00210 void vpx_img_flip(vpx_image_t *img);
00211
00218 void vpx_img_free(vpx_image_t *img);
00219
00220 #ifdef __cplusplus
00221 }
00222 #endif
00223
00224 #endif // VPX_VPX_IMAGE_H_