RockX  1.0.0
Functions
rockx_image_util.h File Reference
#include "rockx_type.h"

Go to the source code of this file.

Functions

int rockx_image_get_channels (rockx_image_t *img)
 
rockx_ret_t rockx_image_convert (rockx_image_t *src, rockx_image_t *dst, int dst_width, int dst_heigh, rockx_pixel_format dst_pixel_format)
 
rockx_ret_t rockx_image_convert_keep_ration (rockx_image_t *src, rockx_image_t *dst, int dst_width, int dst_heigh, rockx_pixel_format dst_pixel_format, int pad_color, float *scale_w, float *scale_h)
 
rockx_ret_t rockx_image_read (const char *img_path, rockx_image_t *image, int flag)
 
rockx_ret_t rockx_image_write (const char *path, rockx_image_t *img)
 
rockx_image_trockx_image_clone (rockx_image_t *img)
 
rockx_ret_t rockx_image_release (rockx_image_t *img)
 
rockx_ret_t rockx_image_draw_circle (rockx_image_t *img, rockx_point_t point, int radius, rockx_color_t color, int thickness)
 
rockx_ret_t rockx_image_draw_line (rockx_image_t *img, rockx_point_t pt1, rockx_point_t pt2, rockx_color_t color, int thickness)
 
rockx_ret_t rockx_image_draw_rect (rockx_image_t *img, rockx_point_t pt1, rockx_point_t pt2, rockx_color_t color, int thickness)
 
rockx_ret_t rockx_image_draw_text (rockx_image_t *img, const char *text, rockx_point_t pt, rockx_color_t color, int thickness)
 

Function Documentation

◆ rockx_image_clone()

rockx_image_t* rockx_image_clone ( rockx_image_t img)

Clone Image

Parameters
img[in] Source image
Returns
cloned image

◆ rockx_image_convert()

rockx_ret_t rockx_image_convert ( rockx_image_t src,
rockx_image_t dst,
int  dst_width,
int  dst_heigh,
rockx_pixel_format  dst_pixel_format 
)

Convert Image Size and Color

Parameters
src[in] Source image
dst[out] Destination image
dst_width[in] Destination Width
dst_heigh[in] Destination Height
dst_pixel_format[in] Destination image format
Returns
rockx_ret_t

◆ rockx_image_convert_keep_ration()

rockx_ret_t rockx_image_convert_keep_ration ( rockx_image_t src,
rockx_image_t dst,
int  dst_width,
int  dst_heigh,
rockx_pixel_format  dst_pixel_format,
int  pad_color,
float *  scale_w,
float *  scale_h 
)

Convert Image Size(Keep Ration) and Color

Parameters
src[in] Source image
dst[out] Destination image
dst_width[in] Destination Width
dst_heigh[in] Destination Height
dst_pixel_format[in] Destination image format
pad_color[in] padding color
scale_w[out] width resize scale
scale_h[out] height resize scale
Returns
rockx_ret_t

◆ rockx_image_draw_circle()

rockx_ret_t rockx_image_draw_circle ( rockx_image_t img,
rockx_point_t  point,
int  radius,
rockx_color_t  color,
int  thickness 
)

Draw Circle on Image

Parameters
img[in] Image to Draw
point[in] Circle Center Point
radius[in] Circle Radius
color[in] Color
thickness[in] ThickNess
Returns
rockx_ret_t

◆ rockx_image_draw_line()

rockx_ret_t rockx_image_draw_line ( rockx_image_t img,
rockx_point_t  pt1,
rockx_point_t  pt2,
rockx_color_t  color,
int  thickness 
)

Draw Line on Image

Parameters
img[in] Image to Draw
pt1[in] Start Point
pt2[in] End Point
color[in] Color
thickness[in] ThickNess
Returns
rockx_ret_t

◆ rockx_image_draw_rect()

rockx_ret_t rockx_image_draw_rect ( rockx_image_t img,
rockx_point_t  pt1,
rockx_point_t  pt2,
rockx_color_t  color,
int  thickness 
)

Draw Rect on Image

Parameters
img[in] Image to Draw
pt1[in] RectAngle Left Top Point
pt2[in] RectAngle Right Bottom Point
color[in] Color
thickness[in] ThickNess
Returns
rockx_ret_t

◆ rockx_image_draw_text()

rockx_ret_t rockx_image_draw_text ( rockx_image_t img,
const char *  text,
rockx_point_t  pt,
rockx_color_t  color,
int  thickness 
)

Draw Text on Image

Parameters
img[in] Image to Draw
text[in] Text
pt[in] Origin Point
color[in] Color
thickness[in] ThickNess
Returns
rockx_ret_t

◆ rockx_image_get_channels()

int rockx_image_get_channels ( rockx_image_t img)

Get Channels of a rockx_image_t

Parameters
[in]imgImage
Returns
Channels

◆ rockx_image_read()

rockx_ret_t rockx_image_read ( const char *  img_path,
rockx_image_t image,
int  flag 
)

Read Image From File(Need Release If Not Use release_rockx_image)

Parameters
img_path[in] Image file path
image[out] Read Image
flag[in] 0: gray; 1: color
Returns
rockx_ret_t

◆ rockx_image_release()

rockx_ret_t rockx_image_release ( rockx_image_t img)

Release Image

Parameters
img[in] Image to release
Returns
rockx_ret_t

◆ rockx_image_write()

rockx_ret_t rockx_image_write ( const char *  path,
rockx_image_t img 
)

Write Image To File

Parameters
path[in] File path to write
img[in] Image to write
Returns
rockx_ret_t