MLT  7.34.0
mlt_image.h
Go to the documentation of this file.
1 
23 #ifndef MLT_IMAGE_H
24 #define MLT_IMAGE_H
25 
26 #include "mlt_export.h"
27 #include "mlt_types.h"
28 
33 #define MLT_IMAGE_MAX_PLANES 4
34 
36 {
38  int width;
39  int height;
43  void *data;
45  void *alpha;
48 };
49 
50 MLT_EXPORT mlt_image mlt_image_new();
51 MLT_EXPORT void mlt_image_close(mlt_image self);
52 MLT_EXPORT void mlt_image_set_values(
53  mlt_image self, void *data, mlt_image_format format, int width, int height);
54 MLT_EXPORT void mlt_image_get_values(
55  mlt_image self, void **data, mlt_image_format *format, int *width, int *height);
56 MLT_EXPORT void mlt_image_alloc_data(mlt_image self);
57 MLT_EXPORT void mlt_image_alloc_alpha(mlt_image self);
58 MLT_EXPORT int mlt_image_calculate_size(mlt_image self);
59 MLT_EXPORT void mlt_image_fill_black(mlt_image self);
60 MLT_EXPORT void mlt_image_fill_checkerboard(mlt_image self, double sample_aspect_ratio);
61 MLT_EXPORT void mlt_image_fill_white(mlt_image self, int full_range);
62 MLT_EXPORT void mlt_image_fill_opaque(mlt_image self);
63 MLT_EXPORT int mlt_image_is_opaque(mlt_image self);
64 MLT_EXPORT const char *mlt_image_format_name(mlt_image_format format);
65 MLT_EXPORT mlt_image_format mlt_image_format_id(const char *name);
66 MLT_EXPORT const char *mlt_image_color_trc_name(mlt_color_trc trc);
67 MLT_EXPORT mlt_color_trc mlt_image_color_trc_id(const char *name);
68 MLT_EXPORT const char *mlt_image_colorspace_name(mlt_colorspace colorspace);
69 MLT_EXPORT mlt_colorspace mlt_image_colorspace_id(const char *name);
70 MLT_EXPORT const char *mlt_image_color_pri_name(mlt_color_primaries primaries);
71 MLT_EXPORT mlt_color_primaries mlt_image_color_pri_id(const char *name);
72 MLT_EXPORT int mlt_image_rgba_opaque(uint8_t *image, int width, int height);
73 MLT_EXPORT int mlt_image_full_range(const char *color_range);
74 
75 // Deprecated functions
76 MLT_DEPRECATED_EXPORT int mlt_image_format_size(mlt_image_format format,
77  int width,
78  int height,
79  int *bpp);
80 MLT_DEPRECATED_EXPORT void mlt_image_format_planes(
81  mlt_image_format format, int width, int height, void *data, uint8_t *planes[4], int strides[4]);
82 
83 #endif
MLT_EXPORT mlt_image mlt_image_new()
Allocate a new Image object.
Definition: mlt_image.c:33
#define MLT_IMAGE_MAX_PLANES
Image class.
Definition: mlt_image.h:33
MLT_EXPORT mlt_color_primaries mlt_image_color_pri_id(const char *name)
Definition: mlt_image.c:443
MLT_EXPORT const char * mlt_image_color_pri_name(mlt_color_primaries primaries)
Definition: mlt_image.c:414
MLT_EXPORT mlt_colorspace mlt_image_colorspace_id(const char *name)
Definition: mlt_image.c:380
MLT_EXPORT const char * mlt_image_colorspace_name(mlt_colorspace colorspace)
Definition: mlt_image.c:345
Provides forward definitions of all public types.
void(* mlt_destructor)(void *)
pointer to destructor function
Definition: mlt_types.h:307
mlt_colorspace
Colorspace definitions.
Definition: mlt_types.h:99
mlt_color_trc
Definition: mlt_types.h:117
mlt_image_format
The set of supported image formats.
Definition: mlt_types.h:40
mlt_color_primaries
Definition: mlt_types.h:141
Definition: mlt_image.h:36
void mlt_image_alloc_alpha(mlt_image self)
Allocate the alpha field based on the other properties of the Image.
Definition: mlt_image.c:156
void mlt_image_close(mlt_image self)
Destroy an image object created by mlt_image_new().
Definition: mlt_image.c:46
void mlt_image_fill_opaque(mlt_image self)
Fill an image alpha channel with opaque if it exists.
Definition: mlt_image.c:746
void mlt_image_format_planes(mlt_image_format format, int width, int height, void *data, uint8_t *planes[4], int strides[4])
Build a planes pointers of image mapping.
Definition: mlt_image.c:878
mlt_image_format mlt_image_format_id(const char *name)
Get the id of image format from short name.
Definition: mlt_image.c:252
const char * mlt_image_format_name(mlt_image_format format)
Get the short name for an image format.
Definition: mlt_image.c:214
void mlt_image_fill_checkerboard(mlt_image self, double sample_aspect_ratio)
Fill an image with a checkerboard pattern.
Definition: mlt_image.c:555
void mlt_image_fill_white(mlt_image self, int full_range)
Fill an image with white.
Definition: mlt_image.c:673
const char * mlt_image_color_trc_name(mlt_color_trc trc)
Get the short name for a color transfer characteristics.
Definition: mlt_image.c:272
mlt_destructor release_alpha
Definition: mlt_image.h:46
void * data
Definition: mlt_image.h:43
void mlt_image_fill_black(mlt_image self)
Fill an image with black.
Definition: mlt_image.c:481
int colorspace
Definition: mlt_image.h:40
void mlt_image_get_values(mlt_image self, void **data, mlt_image_format *format, int *width, int *height)
Get the most common values for the image.
Definition: mlt_image.c:101
int mlt_image_rgba_opaque(uint8_t *image, int width, int height)
Check if the alpha channel of an rgba image is opaque.
Definition: mlt_image.c:948
int height
Definition: mlt_image.h:39
int mlt_image_full_range(const char *color_range)
Check if the string indicates full range.
Definition: mlt_image.c:963
void mlt_image_alloc_data(mlt_image self)
Allocate the data field based on the other properties of the Image.
Definition: mlt_image.c:123
uint8_t * planes[MLT_IMAGE_MAX_PLANES]
Definition: mlt_image.h:41
int mlt_image_calculate_size(mlt_image self)
Calculate the number of bytes needed for the Image data.
Definition: mlt_image.c:178
mlt_destructor release_data
Definition: mlt_image.h:44
int mlt_image_format_size(mlt_image_format format, int width, int height, int *bpp)
Get the number of bytes needed for an image.
Definition: mlt_image.c:817
mlt_image_format format
Definition: mlt_image.h:37
mlt_color_trc mlt_image_color_trc_id(const char *name)
Get the id of color transfer characteristics from short name.
Definition: mlt_image.c:324
int mlt_image_is_opaque(mlt_image self)
Check if the alpha channel of an image is opaque.
Definition: mlt_image.c:778
int width
Definition: mlt_image.h:38
void * alpha
Definition: mlt_image.h:45
int strides[MLT_IMAGE_MAX_PLANES]
Definition: mlt_image.h:42
void mlt_image_set_values(mlt_image self, void *data, mlt_image_format format, int width, int height)
Set the most common values for the image.
Definition: mlt_image.c:73
mlt_destructor close
Definition: mlt_image.h:47