Classes | Defines | Typedefs | Enumerations | Functions

vpx_image.h File Reference

Describes the vpx image descriptor and associated operations. More...

This graph shows which files directly or indirectly include this file:

Classes

struct  vpx_image
 Image Descriptor. More...
struct  vpx_image_rect
 Representation of a rectangle on a surface. More...

Defines

#define VPX_IMAGE_ABI_VERSION
 Current ABI version number.
#define VPX_IMG_FMT_PLANAR   0x100
 Image is a planar format.
#define VPX_IMG_FMT_UV_FLIP   0x200
 V plane precedes U plane in memory.
#define VPX_IMG_FMT_HAS_ALPHA   0x400
 Image has an alpha channel componnent.
#define IMG_FMT_PLANAR   VPX_IMG_FMT_PLANAR
#define IMG_FMT_UV_FLIP   VPX_IMG_FMT_UV_FLIP
#define IMG_FMT_HAS_ALPHA   VPX_IMG_FMT_HAS_ALPHA
#define img_fmt   vpx_img_fmt
 Deprecated list of supported image formats.
#define img_fmt_t   vpx_img_fmt_t
 alias for enum img_fmt.
#define IMG_FMT_NONE   VPX_IMG_FMT_NONE
#define IMG_FMT_RGB24   VPX_IMG_FMT_RGB24
#define IMG_FMT_RGB32   VPX_IMG_FMT_RGB32
#define IMG_FMT_RGB565   VPX_IMG_FMT_RGB565
#define IMG_FMT_RGB555   VPX_IMG_FMT_RGB555
#define IMG_FMT_UYVY   VPX_IMG_FMT_UYVY
#define IMG_FMT_YUY2   VPX_IMG_FMT_YUY2
#define IMG_FMT_YVYU   VPX_IMG_FMT_YVYU
#define IMG_FMT_BGR24   VPX_IMG_FMT_BGR24
#define IMG_FMT_RGB32_LE   VPX_IMG_FMT_RGB32_LE
#define IMG_FMT_ARGB   VPX_IMG_FMT_ARGB
#define IMG_FMT_ARGB_LE   VPX_IMG_FMT_ARGB_LE
#define IMG_FMT_RGB565_LE   VPX_IMG_FMT_RGB565_LE
#define IMG_FMT_RGB555_LE   VPX_IMG_FMT_RGB555_LE
#define IMG_FMT_YV12   VPX_IMG_FMT_YV12
#define IMG_FMT_I420   VPX_IMG_FMT_I420
#define IMG_FMT_VPXYV12   VPX_IMG_FMT_VPXYV12
#define IMG_FMT_VPXI420   VPX_IMG_FMT_VPXI420
#define VPX_PLANE_PACKED   0
 To be used for all packed formats.
#define VPX_PLANE_Y   0
 Y (Luminance) plane.
#define VPX_PLANE_U   1
 U (Chroma) plane.
#define VPX_PLANE_V   2
 V (Chroma) plane.
#define VPX_PLANE_ALPHA   3
 A (Transparancy) plane.
#define PLANE_PACKED   VPX_PLANE_PACKED
#define PLANE_Y   VPX_PLANE_Y
#define PLANE_U   VPX_PLANE_U
#define PLANE_V   VPX_PLANE_V
#define PLANE_ALPHA   VPX_PLANE_ALPHA

Typedefs

typedef enum vpx_img_fmt vpx_img_fmt_t
 List of supported image formats.
typedef struct vpx_image vpx_image_t
 Image Descriptor.
typedef struct vpx_image_rect vpx_image_rect_t
 Representation of a rectangle on a surface.

Enumerations

enum  vpx_img_fmt {
  VPX_IMG_FMT_NONE, VPX_IMG_FMT_RGB24, VPX_IMG_FMT_RGB32, VPX_IMG_FMT_RGB565,
  VPX_IMG_FMT_RGB555, VPX_IMG_FMT_UYVY, VPX_IMG_FMT_YUY2, VPX_IMG_FMT_YVYU,
  VPX_IMG_FMT_BGR24, VPX_IMG_FMT_RGB32_LE, VPX_IMG_FMT_ARGB, VPX_IMG_FMT_ARGB_LE,
  VPX_IMG_FMT_RGB565_LE, VPX_IMG_FMT_RGB555_LE, VPX_IMG_FMT_YV12 = 0x100 | 0x200 | 1, VPX_IMG_FMT_I420 = 0x100 | 2,
  VPX_IMG_FMT_VPXYV12 = 0x100 | 0x200 | 3, VPX_IMG_FMT_VPXI420 = 0x100 | 4
}
 

List of supported image formats.

More...

Functions

vpx_image_tvpx_img_alloc (vpx_image_t *img, vpx_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int align)
 Open a descriptor, allocating storage for the underlying image.
vpx_image_tvpx_img_wrap (vpx_image_t *img, vpx_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int align, unsigned char *img_data)
 Open a descriptor, using existing storage for the underlying image.
int vpx_img_set_rect (vpx_image_t *img, unsigned int x, unsigned int y, unsigned int w, unsigned int h)
 Set the rectangle identifying the displayed portion of the image.
void vpx_img_flip (vpx_image_t *img)
 Flip the image vertically (top for bottom).
void vpx_img_free (vpx_image_t *img)
 Close an image descriptor.

Detailed Description

Describes the vpx image descriptor and associated operations.


Define Documentation

#define img_fmt   vpx_img_fmt

Deprecated list of supported image formats.

Deprecated:
New code should use vpx_img_fmt
#define IMG_FMT_ARGB   VPX_IMG_FMT_ARGB
#define IMG_FMT_ARGB_LE   VPX_IMG_FMT_ARGB_LE
#define IMG_FMT_BGR24   VPX_IMG_FMT_BGR24
#define IMG_FMT_HAS_ALPHA   VPX_IMG_FMT_HAS_ALPHA
#define IMG_FMT_I420   VPX_IMG_FMT_I420
#define IMG_FMT_NONE   VPX_IMG_FMT_NONE
#define IMG_FMT_PLANAR   VPX_IMG_FMT_PLANAR
#define IMG_FMT_RGB24   VPX_IMG_FMT_RGB24
#define IMG_FMT_RGB32   VPX_IMG_FMT_RGB32
#define IMG_FMT_RGB32_LE   VPX_IMG_FMT_RGB32_LE
#define IMG_FMT_RGB555   VPX_IMG_FMT_RGB555
#define IMG_FMT_RGB555_LE   VPX_IMG_FMT_RGB555_LE
#define IMG_FMT_RGB565   VPX_IMG_FMT_RGB565
#define IMG_FMT_RGB565_LE   VPX_IMG_FMT_RGB565_LE
#define img_fmt_t   vpx_img_fmt_t

alias for enum img_fmt.

Deprecated:
New code should use vpx_img_fmt_t
#define IMG_FMT_UV_FLIP   VPX_IMG_FMT_UV_FLIP
#define IMG_FMT_UYVY   VPX_IMG_FMT_UYVY
#define IMG_FMT_VPXI420   VPX_IMG_FMT_VPXI420
#define IMG_FMT_VPXYV12   VPX_IMG_FMT_VPXYV12
#define IMG_FMT_YUY2   VPX_IMG_FMT_YUY2
#define IMG_FMT_YV12   VPX_IMG_FMT_YV12
#define IMG_FMT_YVYU   VPX_IMG_FMT_YVYU
#define PLANE_ALPHA   VPX_PLANE_ALPHA
#define PLANE_PACKED   VPX_PLANE_PACKED
#define PLANE_U   VPX_PLANE_U
#define PLANE_V   VPX_PLANE_V
#define PLANE_Y   VPX_PLANE_Y
#define VPX_IMAGE_ABI_VERSION

Current ABI version number.

#define VPX_IMG_FMT_HAS_ALPHA   0x400

Image has an alpha channel componnent.

#define VPX_IMG_FMT_PLANAR   0x100

Image is a planar format.

#define VPX_IMG_FMT_UV_FLIP   0x200

V plane precedes U plane in memory.

#define VPX_PLANE_ALPHA   3

A (Transparancy) plane.

#define VPX_PLANE_PACKED   0

To be used for all packed formats.

#define VPX_PLANE_U   1

U (Chroma) plane.

#define VPX_PLANE_V   2

V (Chroma) plane.

#define VPX_PLANE_Y   0

Y (Luminance) plane.


Typedef Documentation

Representation of a rectangle on a surface.

alias for struct vpx_image_rect

typedef struct vpx_image vpx_image_t

Image Descriptor.

alias for struct vpx_image

typedef enum vpx_img_fmt vpx_img_fmt_t

List of supported image formats.

alias for enum vpx_img_fmt


Enumeration Type Documentation

List of supported image formats.

Enumerator:
VPX_IMG_FMT_NONE 
VPX_IMG_FMT_RGB24 

24 bit per pixel packed RGB

VPX_IMG_FMT_RGB32 

32 bit per pixel packed 0RGB

VPX_IMG_FMT_RGB565 

16 bit per pixel, 565

VPX_IMG_FMT_RGB555 

16 bit per pixel, 555

VPX_IMG_FMT_UYVY 

UYVY packed YUV.

VPX_IMG_FMT_YUY2 

YUYV packed YUV.

VPX_IMG_FMT_YVYU 

YVYU packed YUV.

VPX_IMG_FMT_BGR24 

24 bit per pixel packed BGR

VPX_IMG_FMT_RGB32_LE 

32 bit packed BGR0

VPX_IMG_FMT_ARGB 

32 bit packed ARGB, alpha=255

VPX_IMG_FMT_ARGB_LE 

32 bit packed BGRA, alpha=255

VPX_IMG_FMT_RGB565_LE 

16 bit per pixel, gggbbbbb rrrrrggg

VPX_IMG_FMT_RGB555_LE 

16 bit per pixel, gggbbbbb 0rrrrrgg

VPX_IMG_FMT_YV12 

Image is a planar format.

V plane precedes U plane in memory planar YVU

VPX_IMG_FMT_I420 

Image is a planar format.

VPX_IMG_FMT_VPXYV12 

Image is a planar format.

V plane precedes U plane in memory

VPX_IMG_FMT_VPXI420 

< planar 4:2:0 format with vpx color space

Image is a planar format


Function Documentation

vpx_image_t* vpx_img_alloc ( vpx_image_t img,
vpx_img_fmt_t  fmt,
unsigned int  d_w,
unsigned int  d_h,
unsigned int  align 
)

Open a descriptor, allocating storage for the underlying image.

Returns a descriptor for storing an image of the given format. The storage for the descriptor is allocated on the heap.

Parameters:
[in] img Pointer to storage for descriptor. If this parameter is NULL, the storage for the descriptor will be allocated on the heap.
[in] fmt Format for the image
[in] d_w Width of the image
[in] d_h Height of the image
[in] align Alignment, in bytes, of each row in the image.
Returns:
Returns a pointer to the initialized image descriptor. If the img parameter is non-null, the value of the img parameter will be returned.
void vpx_img_flip ( vpx_image_t img  ) 

Flip the image vertically (top for bottom).

Adjusts the image descriptor's pointers and strides to make the image be referenced upside-down.

Parameters:
[in] img Image descriptor
void vpx_img_free ( vpx_image_t img  ) 

Close an image descriptor.

Frees all allocated storage associated with an image descriptor.

Parameters:
[in] img Image descriptor
int vpx_img_set_rect ( vpx_image_t img,
unsigned int  x,
unsigned int  y,
unsigned int  w,
unsigned int  h 
)

Set the rectangle identifying the displayed portion of the image.

Updates the displayed rectangle (aka viewport) on the image surface to match the specified coordinates and size.

Parameters:
[in] img Image descriptor
[in] x leftmost column
[in] y topmost row
[in] w width
[in] h height
Returns:
0 if the requested rectangle is valid, nonzero otherwise.
vpx_image_t* vpx_img_wrap ( vpx_image_t img,
vpx_img_fmt_t  fmt,
unsigned int  d_w,
unsigned int  d_h,
unsigned int  align,
unsigned char *  img_data 
)

Open a descriptor, using existing storage for the underlying image.

Returns a descriptor for storing an image of the given format. The storage for descriptor has been allocated elsewhere, and a descriptor is desired to "wrap" that storage.

Parameters:
[in] img Pointer to storage for descriptor. If this parameter is NULL, the storage for the descriptor will be allocated on the heap.
[in] fmt Format for the image
[in] d_w Width of the image
[in] d_h Height of the image
[in] align Alignment, in bytes, of each row in the image.
[in] img_data Storage to use for the image
Returns:
Returns a pointer to the initialized image descriptor. If the img parameter is non-null, the value of the img parameter will be returned.