Data Structures | |
struct | gavl_rectangle_i_t |
struct | gavl_rectangle_f_t |
Functions | |
GAVL_PUBLIC void | gavl_rectangle_i_crop_to_format (gavl_rectangle_i_t *r, const gavl_video_format_t *format) |
Crop an integer rectangle so it fits into the image size of a video format. | |
GAVL_PUBLIC void | gavl_rectangle_f_crop_to_format (gavl_rectangle_f_t *r, const gavl_video_format_t *format) |
Crop a floating point rectangle so it fits into the image size of a video format. | |
GAVL_PUBLIC void | gavl_rectangle_crop_to_format_noscale (gavl_rectangle_i_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format) |
Set 2 rectangles as source and destination when no scaling is available. | |
GAVL_PUBLIC void | gavl_rectangle_crop_to_format_scale (gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format) |
Crop 2 rectangles to their formats when scaling is available. | |
GAVL_PUBLIC void | gavl_rectangle_i_set_all (gavl_rectangle_i_t *r, const gavl_video_format_t *format) |
Let an integer rectangle span the whole image size of a video format. | |
GAVL_PUBLIC void | gavl_rectangle_f_set_all (gavl_rectangle_f_t *r, const gavl_video_format_t *format) |
Let a float rectangle span the whole image size of a video format. | |
GAVL_PUBLIC void | gavl_rectangle_i_crop_left (gavl_rectangle_i_t *r, int num_pixels) |
Crop an integer rectangle by some pixels from the left border. | |
GAVL_PUBLIC void | gavl_rectangle_i_crop_right (gavl_rectangle_i_t *r, int num_pixels) |
Crop an integer rectangle by some pixels from the right border. | |
GAVL_PUBLIC void | gavl_rectangle_i_crop_top (gavl_rectangle_i_t *r, int num_pixels) |
Crop an integer rectangle by some pixels from the top border. | |
GAVL_PUBLIC void | gavl_rectangle_i_crop_bottom (gavl_rectangle_i_t *r, int num_pixels) |
Crop an integer rectangle by some pixels from the bottom border. | |
GAVL_PUBLIC void | gavl_rectangle_f_crop_left (gavl_rectangle_f_t *r, double num_pixels) |
Crop a float rectangle by some pixels from the left border. | |
GAVL_PUBLIC void | gavl_rectangle_f_crop_right (gavl_rectangle_f_t *r, double num_pixels) |
Crop a float rectangle by some pixels from the right border. | |
GAVL_PUBLIC void | gavl_rectangle_f_crop_top (gavl_rectangle_f_t *r, double num_pixels) |
Crop a float rectangle by some pixels from the top border. | |
GAVL_PUBLIC void | gavl_rectangle_f_crop_bottom (gavl_rectangle_f_t *r, double num_pixels) |
Crop a float rectangle by some pixels from the bottom border. | |
GAVL_PUBLIC void | gavl_rectangle_i_align (gavl_rectangle_i_t *r, int h_align, int v_align) |
Align a rectangle. | |
GAVL_PUBLIC void | gavl_rectangle_i_align_to_format (gavl_rectangle_i_t *r, const gavl_video_format_t *format) |
Align a rectangle to a format. | |
GAVL_PUBLIC void | gavl_rectangle_i_copy (gavl_rectangle_i_t *dst, const gavl_rectangle_i_t *src) |
Copy an integer rectangle. | |
GAVL_PUBLIC void | gavl_rectangle_f_copy (gavl_rectangle_f_t *dst, const gavl_rectangle_f_t *src) |
Copy a float rectangle. | |
GAVL_PUBLIC void | gavl_rectangle_i_to_f (gavl_rectangle_f_t *dst, const gavl_rectangle_i_t *src) |
Convert an integer rectangle to a floating point rectangle. | |
GAVL_PUBLIC void | gavl_rectangle_f_to_i (gavl_rectangle_i_t *dst, const gavl_rectangle_f_t *src) |
Convert a floating point rectangle to an integer rectangle. | |
GAVL_PUBLIC int | gavl_rectangle_i_is_empty (const gavl_rectangle_i_t *r) |
Check if an integer rectangle is empty. | |
GAVL_PUBLIC int | gavl_rectangle_f_is_empty (const gavl_rectangle_f_t *r) |
Check if a float rectangle is empty. | |
GAVL_PUBLIC void | gavl_rectangle_fit_aspect (gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_rectangle_f_t *src_rect, const gavl_video_format_t *dst_format, float zoom, float squeeze) |
Calculate a destination rectangle for scaling. | |
GAVL_PUBLIC void | gavl_rectangle_i_dump (const gavl_rectangle_i_t *r) |
Dump a rectangle to stderr. | |
GAVL_PUBLIC void | gavl_rectangle_f_dump (const gavl_rectangle_f_t *r) |
Dump a floating point rectangle to stderr. |
Define rectangular areas in a video frame
GAVL_PUBLIC void gavl_rectangle_i_crop_to_format | ( | gavl_rectangle_i_t * | r, | |
const gavl_video_format_t * | format | |||
) |
Crop an integer rectangle so it fits into the image size of a video format.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_crop_to_format | ( | gavl_rectangle_f_t * | r, | |
const gavl_video_format_t * | format | |||
) |
Crop a floating point rectangle so it fits into the image size of a video format.
r | A floating point rectangle
|
GAVL_PUBLIC void gavl_rectangle_crop_to_format_noscale | ( | gavl_rectangle_i_t * | src_rect, | |
gavl_rectangle_i_t * | dst_rect, | |||
const gavl_video_format_t * | src_format, | |||
const gavl_video_format_t * | dst_format | |||
) |
Set 2 rectangles as source and destination when no scaling is available.
src_rect | Source rectangle
|
GAVL_PUBLIC void gavl_rectangle_crop_to_format_scale | ( | gavl_rectangle_f_t * | src_rect, | |
gavl_rectangle_i_t * | dst_rect, | |||
const gavl_video_format_t * | src_format, | |||
const gavl_video_format_t * | dst_format | |||
) |
Crop 2 rectangles to their formats when scaling is available.
src_rect | Source rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_set_all | ( | gavl_rectangle_i_t * | r, | |
const gavl_video_format_t * | format | |||
) |
Let an integer rectangle span the whole image size of a video format.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_set_all | ( | gavl_rectangle_f_t * | r, | |
const gavl_video_format_t * | format | |||
) |
Let a float rectangle span the whole image size of a video format.
r | A float rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_crop_left | ( | gavl_rectangle_i_t * | r, | |
int | num_pixels | |||
) |
Crop an integer rectangle by some pixels from the left border.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_crop_right | ( | gavl_rectangle_i_t * | r, | |
int | num_pixels | |||
) |
Crop an integer rectangle by some pixels from the right border.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_crop_top | ( | gavl_rectangle_i_t * | r, | |
int | num_pixels | |||
) |
Crop an integer rectangle by some pixels from the top border.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_crop_bottom | ( | gavl_rectangle_i_t * | r, | |
int | num_pixels | |||
) |
Crop an integer rectangle by some pixels from the bottom border.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_crop_left | ( | gavl_rectangle_f_t * | r, | |
double | num_pixels | |||
) |
Crop a float rectangle by some pixels from the left border.
r | A float rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_crop_right | ( | gavl_rectangle_f_t * | r, | |
double | num_pixels | |||
) |
Crop a float rectangle by some pixels from the right border.
r | A float rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_crop_top | ( | gavl_rectangle_f_t * | r, | |
double | num_pixels | |||
) |
Crop a float rectangle by some pixels from the top border.
r | A float rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_crop_bottom | ( | gavl_rectangle_f_t * | r, | |
double | num_pixels | |||
) |
Crop a float rectangle by some pixels from the bottom border.
r | A float rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_align | ( | gavl_rectangle_i_t * | r, | |
int | h_align, | |||
int | v_align | |||
) |
Align a rectangle.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_align_to_format | ( | gavl_rectangle_i_t * | r, | |
const gavl_video_format_t * | format | |||
) |
Align a rectangle to a format.
r | An integer rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_copy | ( | gavl_rectangle_i_t * | dst, | |
const gavl_rectangle_i_t * | src | |||
) |
Copy an integer rectangle.
dst | Destination rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_copy | ( | gavl_rectangle_f_t * | dst, | |
const gavl_rectangle_f_t * | src | |||
) |
Copy a float rectangle.
dst | Destination rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_to_f | ( | gavl_rectangle_f_t * | dst, | |
const gavl_rectangle_i_t * | src | |||
) |
Convert an integer rectangle to a floating point rectangle.
dst | Destination rectangle
|
GAVL_PUBLIC void gavl_rectangle_f_to_i | ( | gavl_rectangle_i_t * | dst, | |
const gavl_rectangle_f_t * | src | |||
) |
Convert a floating point rectangle to an integer rectangle.
dst | Destination rectangle
|
GAVL_PUBLIC int gavl_rectangle_i_is_empty | ( | const gavl_rectangle_i_t * | r | ) |
Check if an integer rectangle is empty.
r | Rectangle
|
GAVL_PUBLIC int gavl_rectangle_f_is_empty | ( | const gavl_rectangle_f_t * | r | ) |
Check if a float rectangle is empty.
r | Rectangle
|
GAVL_PUBLIC void gavl_rectangle_fit_aspect | ( | gavl_rectangle_i_t * | dst_rect, | |
const gavl_video_format_t * | src_format, | |||
const gavl_rectangle_f_t * | src_rect, | |||
const gavl_video_format_t * | dst_format, | |||
float | zoom, | |||
float | squeeze | |||
) |
Calculate a destination rectangle for scaling.
dst_rect | Destination rectangle
|
GAVL_PUBLIC void gavl_rectangle_i_dump | ( | const gavl_rectangle_i_t * | r | ) |
Dump a rectangle to stderr.
r | Rectangle |
GAVL_PUBLIC void gavl_rectangle_f_dump | ( | const gavl_rectangle_f_t * | r | ) |
Dump a floating point rectangle to stderr.
r | Floating point rectangle |