40 #ifndef SWITCH_VIDEO_H
41 #define SWITCH_VIDEO_H
92 struct switch_png_opaque_s;
156 unsigned char *img_data);
319 int x,
int y, const
char *text,
320 const
char *font_family, const
char *font_color, const
char *bgcolor, uint16_t font_size,
double angle);
381 const uint8_t* src_u,
int src_stride_u,
382 const uint8_t* src_v,
int src_stride_v,
383 uint8_t* dst_y,
int dst_stride_y,
384 uint8_t* dst_u,
int dst_stride_u,
385 uint8_t* dst_v,
int dst_stride_v,
386 int width,
int height);
388 uint8_t *dst_planes[],
int dst_stride[],
389 int width,
int height);
switch_status_t switch_I420_copy2(uint8_t *src_planes[], int src_stride[], uint8_t *dst_planes[], int dst_stride[], int width, int height)
void switch_img_patch(switch_image_t *IMG, switch_image_t *img, int x, int y)
patch a small img to a big IMG at position x,y
void switch_img_patch_rect(switch_image_t *IMG, int X, int Y, switch_image_t *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
patch part of a small img (x,y,w,h) to a big IMG at position X,Y
switch_img_position_t parse_img_position(const char *name)
void switch_img_free(switch_image_t **img)
Close an image descriptor.
#define SWITCH_END_EXTERN_C
void switch_color_set_yuv(switch_yuv_color_t *color, const char *color_str)
Set YUV color with a string.
switch_bool_t switch_core_has_video(void)
struct switch_png_s switch_png_t
switch_status_t switch_img_from_raw(switch_image_t *dest, void *src, switch_img_fmt_t fmt, int width, int height)
convert raw memory to switch_img_t
switch_memory_pool_t * pool
Representation of a rectangle on a surface.
switch_status_t switch_img_txt_handle_create(switch_img_txt_handle_t **handleP, const char *font_family, const char *font_color, const char *bgcolor, uint16_t font_size, double angle, switch_memory_pool_t *pool)
Created a text handle.
void switch_img_find_position(switch_img_position_t pos, int sw, int sh, int iw, int ih, int *xP, int *yP)
switch_image_t * switch_img_alloc(switch_image_t *img, switch_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int align)
Open a descriptor, allocating storage for the underlying image.
void switch_png_free(switch_png_t **pngP)
struct switch_image_rect switch_image_rect_t
Representation of a rectangle on a surface.
switch_png_opaque_t * pvt
switch_img_fit_t parse_img_fit(const char *name)
void switch_img_rotate_copy(switch_image_t *img, switch_image_t **new_img, switch_image_rotation_mode_t mode)
void switch_img_draw_text(switch_image_t *IMG, int x, int y, switch_rgb_color_t color, uint16_t font_size, char *text)
void switch_img_copy(switch_image_t *img, switch_image_t **new_img)
Copy image to a new image.
switch_status_t switch_img_fit(switch_image_t **srcP, int width, int height, switch_img_fit_t fit)
switch_byte_t switch_byte_t uint32_t switch_bitpack_mode_t mode
switch_image_t * switch_img_read_png(const char *file_name, switch_img_fmt_t img_fmt)
switch_status_t switch_png_patch_img(switch_png_t *use_png, switch_image_t *img, int x, int y)
switch_image_t * switch_img_copy_rect(switch_image_t *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
Copy part of an image to a new image.
struct switch_png_opaque_s switch_png_opaque_t
switch_status_t switch_img_scale(switch_image_t *src, switch_image_t **destP, int width, int height)
void switch_img_patch_hole(switch_image_t *IMG, switch_image_t *img, int x, int y, switch_image_rect_t *rect)
switch_status_t switch_img_letterbox(switch_image_t *img, switch_image_t **imgP, int width, int height, const char *color)
void switch_color_set_rgb(switch_rgb_color_t *color, const char *color_str)
Set RGB color with a string.
vpx_img_fmt_t switch_img_fmt_t
switch_status_t switch_I420_copy(const uint8_t *src_y, int src_stride_y, const uint8_t *src_u, int src_stride_u, const uint8_t *src_v, int src_stride_v, uint8_t *dst_y, int dst_stride_y, uint8_t *dst_u, int dst_stride_u, uint8_t *dst_v, int dst_stride_v, int width, int height)
I420 to I420 Copy.
struct switch_rgb_color_s switch_rgb_color_t
switch_status_t
Common return values.
void switch_img_fill(switch_image_t *img, int x, int y, int w, int h, switch_rgb_color_t *color)
Fill image with color.
switch_status_t switch_png_open(switch_png_t **pngP, const char *file_name)
void switch_img_txt_handle_destroy(switch_img_txt_handle_t **handleP)
Free a text handle.
switch_status_t switch_img_to_raw(switch_image_t *src, void *dest, switch_size_t size, switch_img_fmt_t fmt)
convert img to raw format
struct apr_pool_t switch_memory_pool_t
switch_status_t switch_img_write_png(switch_image_t *img, char *file_name)
switch_image_t * switch_img_read_file(const char *file_name)
switch_image_rotation_mode_t
void switch_img_overlay(switch_image_t *IMG, switch_image_t *img, int x, int y, uint8_t percent)
put a small img over a big IMG at position x,y, with alpha transparency
switch_image_t * switch_img_write_text_img(int w, int h, switch_bool_t full, const char *text)
void switch_img_add_text(void *buffer, int w, int x, int y, char *s)
struct switch_yuv_color_s switch_yuv_color_t
void switch_img_rotate(switch_image_t **img, switch_image_rotation_mode_t mode)
Flip the image vertically (top for bottom)
switch_image_t * switch_img_wrap(switch_image_t *img, switch_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.
uint32_t switch_img_txt_handle_render(switch_img_txt_handle_t *handle, switch_image_t *img, int x, int y, const char *text, const char *font_family, const char *font_color, const char *bgcolor, uint16_t font_size, double angle)
Render text to an img.
int switch_img_set_rect(switch_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.
#define SWITCH_BEGIN_EXTERN_C