00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018
00019 #ifndef VPX_IMAGE_H
00020 #define VPX_IMAGE_H
00021
00030 #define VPX_IMAGE_ABI_VERSION (1)
00033 #define IMG_FMT_PLANAR 0x100
00034 #define IMG_FMT_UV_FLIP 0x200
00035 #define IMG_FMT_HAS_ALPHA 0x400
00039 typedef enum img_fmt {
00040 IMG_FMT_NONE,
00041 IMG_FMT_RGB24,
00042 IMG_FMT_RGB32,
00043 IMG_FMT_RGB565,
00044 IMG_FMT_RGB555,
00045 IMG_FMT_UYVY,
00046 IMG_FMT_YUY2,
00047 IMG_FMT_YVYU,
00048 IMG_FMT_BGR24,
00049 IMG_FMT_RGB32_LE,
00050 IMG_FMT_ARGB,
00051 IMG_FMT_ARGB_LE,
00052 IMG_FMT_RGB565_LE,
00053 IMG_FMT_RGB555_LE,
00054 IMG_FMT_YV12 = IMG_FMT_PLANAR | IMG_FMT_UV_FLIP | 1,
00055 IMG_FMT_I420 = IMG_FMT_PLANAR | 2,
00056 IMG_FMT_VPXYV12 = IMG_FMT_PLANAR | IMG_FMT_UV_FLIP | 3,
00057 IMG_FMT_VPXI420 = IMG_FMT_PLANAR | 4,
00058 }
00059 img_fmt_t;
00063 typedef struct
00064 {
00065 img_fmt_t fmt;
00067
00068 unsigned int w;
00069 unsigned int h;
00071
00072 unsigned int d_w;
00073 unsigned int d_h;
00075
00076 unsigned int x_chroma_shift;
00077 unsigned int y_chroma_shift;
00079
00080 #define PLANE_PACKED 0
00081 #define PLANE_Y 0
00082 #define PLANE_U 1
00083 #define PLANE_V 2
00084 #define PLANE_ALPHA 3
00085 unsigned char *planes[4];
00086 int stride[4];
00088 int bps;
00090
00091
00092
00093 void *user_priv;
00096
00097 unsigned char *img_data;
00098 int img_data_owner;
00099 int self_allocd;
00100 } vpx_image_t;
00103 typedef struct vpx_image_rect
00104 {
00105 unsigned int x;
00106 unsigned int y;
00107 unsigned int w;
00108 unsigned int h;
00109 } vpx_image_rect_t;
00128 vpx_image_t *vpx_img_alloc(vpx_image_t *img,
00129 img_fmt_t fmt,
00130 unsigned int d_w,
00131 unsigned int d_h,
00132 unsigned int align);
00133
00153 vpx_image_t *vpx_img_wrap(vpx_image_t *img,
00154 img_fmt_t fmt,
00155 unsigned int d_w,
00156 unsigned int d_h,
00157 unsigned int align,
00158 unsigned char *img_data);
00159
00160
00174 int vpx_img_set_rect(vpx_image_t *img,
00175 unsigned int x,
00176 unsigned int y,
00177 unsigned int w,
00178 unsigned int h);
00179
00180
00188 void vpx_img_flip(vpx_image_t *img);
00189
00196 void vpx_img_free(vpx_image_t *img);
00197
00198 #endif
00199 #ifdef __cplusplus
00200 }
00201 #endif