40 #ifndef SWITCH_VIDEO_H 41 #define SWITCH_VIDEO_H 47 #define CHROMAKEY_MAX_MASK 25 93 #if SWITCH_BYTE_ORDER == __BIG_ENDIAN 139 struct switch_png_opaque_s;
203 unsigned char *img_data);
385 int x,
int y,
const char *text,
386 const char *font_family,
const char *font_color,
const char *bgcolor, uint16_t font_size,
double angle);
461 const uint8_t* src_u,
int src_stride_u,
462 const uint8_t* src_v,
int src_stride_v,
463 uint8_t* dst_y,
int dst_stride_y,
464 uint8_t* dst_u,
int dst_stride_u,
465 uint8_t* dst_v,
int dst_stride_v,
466 int width,
int height);
468 uint8_t *dst_planes[],
int dst_stride[],
469 int width,
int height);
474 const uint8_t *src_u,
int src_stride_u,
475 const uint8_t *src_v,
int src_stride_v,
476 uint8_t *dst_argb,
int dst_stride_argb,
477 int width,
int height);
480 uint8_t* dst_argb,
int dst_stride_argb,
481 int width,
int height);
483 uint8_t* dst_argb,
int dst_stride_argb,
484 int width,
int height);
486 uint8_t* dst_argb,
int dst_stride_argb,
487 int width,
int height);
void switch_img_gray(switch_image_t *img, int x, int y, int w, int h)
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_chromakey(switch_image_t *img, switch_rgb_color_t *mask, int threshold)
chromakey an img, img must be RGBA and return modified img
void switch_core_video_parse_filter_string(switch_core_video_filter_t *filters, const char *filter_str)
switch_status_t switch_img_data_url(switch_image_t *img, char **urlP, const char *type, int quality)
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.
void switch_chromakey_process(switch_chromakey_t *ck, switch_image_t *img)
#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_ARGBToARGB(const uint8_t *src_frame, int src_stride_frame, uint8_t *dst_argb, int dst_stride_argb, int width, int height)
switch_status_t switch_I420ToARGB(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_argb, int dst_stride_argb, int width, int height)
I420 to ARGB Convertion.
switch_memory_pool_t * pool
Representation of a rectangle on a surface.
void switch_img_calc_fit(switch_image_t *src, int width, int height, int *new_wP, int *new_hP)
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_fill_noalpha(switch_image_t *img, int x, int y, int w, int h, switch_rgb_color_t *color)
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_chromakey_cache_image(switch_chromakey_t *ck)
void switch_chromakey_set_default_threshold(switch_chromakey_t *ck, uint32_t threshold)
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)
switch_status_t switch_img_mirror(switch_image_t *src, switch_image_t **destP)
switch_status_t switch_chromakey_autocolor(switch_chromakey_t *ck, switch_shade_t autocolor, uint32_t threshold)
struct switch_hsl_color_s switch_hsl_color_t
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_status_t switch_img_to_raw(switch_image_t *src, void *dest, int stride, switch_img_fmt_t fmt)
convert img to raw format
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)
void switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *img, int x, int y, switch_bool_t noalpha)
patch a small img to a big IMG at position x,y
switch_shade_t switch_chromakey_str2shade(switch_chromakey_t *ck, const char *shade_name)
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_img_attenuate(switch_image_t *img)
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.
switch_status_t switch_img_from_raw(switch_image_t **destP, void *src, switch_img_fmt_t fmt, int width, int height)
convert raw memory to switch_img_t
void switch_img_sepia(switch_image_t *img, int x, int y, int w, int h)
struct switch_rgb_color_s switch_rgb_color_t
switch_status_t
Common return values.
switch_status_t switch_chromakey_clear_colors(switch_chromakey_t *ck)
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_8bit(switch_image_t *img)
void switch_img_txt_handle_destroy(switch_img_txt_handle_t **handleP)
Free a text handle.
switch_status_t switch_chromakey_create(switch_chromakey_t **ckP)
switch_status_t switch_ABGRToARGB(const uint8_t *src_frame, int src_stride_frame, uint8_t *dst_argb, int dst_stride_argb, int width, int height)
switch_status_t switch_img_write_to_file(switch_image_t *img, const char *file_name, int quality)
Write an image file, supported formats png,jpg,bmp,tga,hdr.
switch_status_t switch_img_data_url_png(switch_image_t *img, char **urlP)
switch_status_t switch_img_write_png(switch_image_t *img, char *file_name)
switch_image_t * switch_img_read_from_file(const char *file_name, switch_img_fmt_t img_fmt)
Read an image file to switch_image_t.
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
struct fspr_pool_t switch_memory_pool_t
switch_status_t switch_chromakey_add_color(switch_chromakey_t *ck, switch_rgb_color_t *color, uint32_t threshold)
switch_image_t * switch_img_write_text_img(int w, int h, switch_bool_t full, const char *text)
switch_status_t switch_RGBAToARGB(const uint8_t *src_frame, int src_stride_frame, uint8_t *dst_argb, int dst_stride_argb, int width, int height)
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_status_t switch_chromakey_destroy(switch_chromakey_t **ckP)
switch_image_t * switch_img_read_png_from_memory(void *mem, size_t size, switch_img_fmt_t img_fmt)
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
switch_core_video_filter_t