draw

draw

Functions

void ucil_convert_color ()
void ucil_draw_box ()
void ucil_draw_line ()
void ucil_draw_rect ()
void ucil_fill ()
void ucil_set_pixel ()

Description

Functions

ucil_convert_color ()

void
ucil_convert_color (ucil_color_t *src,
                    ucil_color_t *dest);

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
src.colorspace = UCIL_COLORSPACE_RGB24;
src.rgb24.r = 0xff;
src.rgb24.g = 0xff;
src.rgb24.b = 0xff;
dest.colorspace = UCIL_COLORSPACE_YUV;
ucil_convert_color( &dest, &src );

Parameters

dest

target color

 

src

source color

 

ucil_draw_box ()

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

Parameters

data_buffer

target buffer

 

color

an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer.

 

x1

starting point of the box ( x position )

 

y1

starting point of the box ( y position )

 

x2

endpoint of the box ( x position )

 

y2

endpoint of the box ( y position )

 

ucil_draw_line ()

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

Parameters

data_buffer

target buffer

 

color

an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer.

 

x1

starting point of the line ( x position )

 

y1

starting point of the line ( y position )

 

x2

endpoint of the line ( x position )

 

y2

endpoint of the line ( y position )

 

ucil_draw_rect ()

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.

Parameters

data_buffer

target buffer

 

color

an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer.

 

x1

starting point of the rectangle ( x position )

 

y1

starting point of the rectangle ( y position )

 

x2

endpoint of the rectangle ( x position )

 

y2

endpoint of the rectangle ( y position )

 

ucil_fill ()

void
ucil_fill (unicap_data_buffer_t *data_buffer,
           ucil_color_t *color);

Fill the buffer with a color.

Parameters

data_buffer

target buffer

 

color

an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer.

 

ucil_set_pixel ()

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.

Parameters

data_buffer

target buffer

 

color

an ucil_color_t. The colorspace of the color has to match the colorspace of the data_buffer.

 

x

x position

 

y

y position