![]() |
![]() |
![]() |
UCIL Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define UCIL_FOURCC (a, b, c, d) typedef ucil_rgb24_t; struct ucil_rgb32; typedef ucil_rgb32_t; struct ucil_yuv; typedef ucil_yuv_t; struct ucil_y8; typedef ucil_y8_t; struct ucil_color; typedef ucil_color_t; struct ucil_convolution_mask; typedef ucil_convolution_mask_t; struct ucil_font_object; typedef ucil_font_object_t; struct ucil_video_file_object; typedef ucil_video_file_object_t; unicap_status_t ucil_check_version (unsigned int major
,unsigned int minor
,unsigned int micro
); void ucil_set_pixel (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x
,int y
); void ucil_set_pixel_alpha (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int alpha
,int x
,int y
); void ucil_draw_line (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x1
,int y1
,int x2
,int y2
); void ucil_draw_rect (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x1
,int y1
,int x2
,int y2
); void ucil_fill (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
); void ucil_draw_box (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x1
,int y1
,int x2
,int y2
); void ucil_draw_circle (unicap_data_buffer_t *dest
,ucil_color_t *color
,int cx
,int cy
,int r
); ucil_font_object_t * ucil_create_font_object (int size
,const char *font
); void ucil_draw_text (unicap_data_buffer_t *dest
,ucil_color_t *color
,ucil_font_object_t *fobj
,const char *text
,int x
,int y
); void ucil_destroy_font_object (ucil_font_object_t *fobj
); void ucil_text_get_size (ucil_font_object_t *fobj
,const char *text
,int *width
,int *height
); void ucil_get_pixel (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x
,int y
); void ucil_convert_color (ucil_color_t *dest
,ucil_color_t *src
); unicap_status_t ucil_convert_buffer (unicap_data_buffer_t *dest
,unicap_data_buffer_t *src
); int ucil_conversion_supported (unsigned int dest_fourcc
,unsigned int src_fourcc
); ucil_colorspace_t ucil_get_colorspace_from_fourcc (unsigned int fourcc
); void ucil_blend_alpha (unicap_data_buffer_t *dest
,unicap_data_buffer_t *bg
,unicap_data_buffer_t *fg
,int alpha
); ucil_convolution_mask_t * ucil_create_convolution_mask (unsigned char *array
,int size
,ucil_colorspace_t cs
,int mode
); ucil_video_file_object_t * ucil_create_video_file (const char *path
,unicap_format_t *format
,const char *codec
,...
); unicap_status_t ucil_encode_frame (ucil_video_file_object_t *vobj
,unicap_data_buffer_t *buffer
); unicap_status_t ucil_close_video_file (ucil_video_file_object_t *vobj
); unicap_status_t ucil_open_video_file (unicap_handle_t *unicap_handle
,char *filename
); const char * ucil_get_video_file_extension (const char *codec
);
#define UCIL_FOURCC(a,b,c,d) (unsigned int)((((unsigned int)d)<<24)+(((unsigned int)c)<<16)+(((unsigned int)b)<<8)+a)
struct ucil_rgb32 { unsigned char r; unsigned char g; unsigned char b; unsigned char a; };
struct ucil_color { ucil_colorspace_t colorspace; union { ucil_yuv_t yuv; ucil_rgb24_t rgb24; ucil_rgb32_t rgb32; ucil_y8_t y8; }; };
struct ucil_convolution_mask { ucil_colorspace_t colorspace; ucil_color_t *mask; int size; };
Apply a convolution mask
ucil_color_t * |
an ucil_convolution_mask |
unicap_status_t ucil_check_version (unsigned int major
,unsigned int minor
,unsigned int micro
);
void ucil_set_pixel (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x
,int y
);
Draws a pixel on the data buffer.
void ucil_set_pixel_alpha (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int alpha
,int x
,int y
);
Draws a pixel on the data buffer, applying an alpha ( transparency ) value to the pixel.
|
target buffer |
|
an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer. |
|
the alpha value that should be applied to this pixel |
|
x position |
|
y position |
void ucil_draw_line (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x1
,int y1
,int x2
,int y2
);
Draws a line on the data buffer. The endpoints are clipped to the buffer dimensions
void ucil_draw_rect (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x1
,int y1
,int x2
,int y2
);
Draws a rectangle filled with color.
void ucil_fill (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
);
Fill the buffer with a color.
void ucil_draw_box (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x1
,int y1
,int x2
,int y2
);
Draws a box
void ucil_draw_circle (unicap_data_buffer_t *dest
,ucil_color_t *color
,int cx
,int cy
,int r
);
Draws a circle.
|
an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer. |
|
center of the circle ( x position ) |
|
center of the circle ( y position ) |
|
radius |
ucil_font_object_t * ucil_create_font_object (int size
,const char *font
);
Creates a font object required for text operations. The application must free the font object with ucil_destroy_font_object.
|
size of font in points |
|
name of font or NULL to use default font |
Returns : |
a new ucil_font_object_t |
void ucil_draw_text (unicap_data_buffer_t *dest
,ucil_color_t *color
,ucil_font_object_t *fobj
,const char *text
,int x
,int y
);
Draws a text string onto the target buffer.
|
target buffer |
|
an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer. |
|
an ucil_font_object_t |
|
text string to draw |
|
x position |
|
y position |
void ucil_destroy_font_object (ucil_font_object_t *fobj
);
Frees all resources allocated by the font object
void ucil_text_get_size (ucil_font_object_t *fobj
,const char *text
,int *width
,int *height
);
Determines the size in pixels a text string will take up when drawn onto a buffer.
|
an ucil_font_object_t |
|
text string |
|
pointer to int which will receive the width of the text |
|
pointer to int which will receive the height of the text |
void ucil_get_pixel (unicap_data_buffer_t *data_buffer
,ucil_color_t *color
,int x
,int y
);
Reads the pixel at position (x,y) and stores the result in color
.
|
buffer |
|
pointer to an ucil_color_t to store the result |
|
x position |
|
y position |
void ucil_convert_color (ucil_color_t *dest
,ucil_color_t *src
);
Convert colors between colorspaces. The
colorspace
field of
dest needs to be set to the target
colorspace, like in this example:
1 2 3 4 5 6 7 8 9 |