MLT  7.28.0
Public Member Functions | Data Fields
mlt_image_s Struct Reference

#include <mlt_image.h>

Public Member Functions

void mlt_image_alloc_alpha (mlt_image self)
 Allocate the alpha field based on the other properties of the Image. More...
 
void mlt_image_alloc_data (mlt_image self)
 Allocate the data field based on the other properties of the Image. More...
 
int mlt_image_calculate_size (mlt_image self)
 Calculate the number of bytes needed for the Image data. More...
 
void mlt_image_close (mlt_image self)
 Destroy an image object created by mlt_image_new(). More...
 
void mlt_image_fill_black (mlt_image self)
 Fill an image with black. More...
 
void mlt_image_fill_checkerboard (mlt_image self, double sample_aspect_ratio)
 Fill an image with a checkerboard pattern. More...
 
void mlt_image_fill_opaque (mlt_image self)
 Fill an image alpha channel with opaque if it exists. More...
 
void mlt_image_fill_white (mlt_image self, int full_range)
 Fill an image with white. More...
 
mlt_image_format mlt_image_format_id (const char *name)
 Get the id of image format from short name. More...
 
const char * mlt_image_format_name (mlt_image_format format)
 Get the short name for an image format. More...
 
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. More...
 
int mlt_image_format_size (mlt_image_format format, int width, int height, int *bpp)
 Get the number of bytes needed for an image. More...
 
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. More...
 
int mlt_image_rgba_opaque (uint8_t *image, int width, int height)
 Check if the alpha channel of an rgba image is opaque. More...
 
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. More...
 

Data Fields

void * alpha
 
mlt_destructor close
 
int colorspace
 
void * data
 
mlt_image_format format
 
int height
 
uint8_t * planes [MLT_IMAGE_MAX_PLANES]
 
mlt_destructor release_alpha
 
mlt_destructor release_data
 
int strides [MLT_IMAGE_MAX_PLANES]
 
int width
 

Member Function Documentation

◆ mlt_image_alloc_alpha()

void mlt_image_alloc_alpha ( mlt_image  self)

Allocate the alpha field based on the other properties of the Image.

If the alpha field is already set, and a destructor function exists, the data will be released. Else, the data pointer will be overwritten without being released.

After this function call, the release_data field will be set and can be used to release the data when necessary.

Parameters
selfthe Image object

◆ mlt_image_alloc_data()

void mlt_image_alloc_data ( mlt_image  self)

Allocate the data field based on the other properties of the Image.

If the data field is already set, and a destructor function exists, the data will be released. Else, the data pointer will be overwritten without being released.

After this function call, the release_data field will be set and can be used to release the data when necessary.

Parameters
selfthe Image object

◆ mlt_image_calculate_size()

int mlt_image_calculate_size ( mlt_image  self)

Calculate the number of bytes needed for the Image data.

Parameters
selfthe Image object
Returns
the number of bytes

◆ mlt_image_close()

void mlt_image_close ( mlt_image  self)

Destroy an image object created by mlt_image_new().

Parameters
selfthe Image object

◆ mlt_image_fill_black()

void mlt_image_fill_black ( mlt_image  self)

Fill an image with black.

Bug:
This does not respect full range YUV if needed.
Parameters
selfa mlt_image

◆ mlt_image_fill_checkerboard()

void mlt_image_fill_checkerboard ( mlt_image  self,
double  sample_aspect_ratio 
)

Fill an image with a checkerboard pattern.

Parameters
selfa mlt_image
sample_aspect_ratiothe pixel aspect ratio

◆ mlt_image_fill_opaque()

void mlt_image_fill_opaque ( mlt_image  self)

Fill an image alpha channel with opaque if it exists.

◆ mlt_image_fill_white()

void mlt_image_fill_white ( mlt_image  self,
int  full_range 
)

Fill an image with white.

Parameters
selfa mlt_image
full_rangewhether to use full color range

◆ mlt_image_format_id()

mlt_image_format mlt_image_format_id ( const char *  name)

Get the id of image format from short name.

Parameters
namethe image format short name
Returns
a image format

◆ mlt_image_format_name()

const char * mlt_image_format_name ( mlt_image_format  format)

Get the short name for an image format.

Parameters
formatthe image format
Returns
a string

◆ mlt_image_format_planes()

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.

For proper and unified planar image processing, planes sizes and planes pointers should be provides to processing code.

Parameters
formatthe image format
widthwidth of the image in pixels
heightheight of the image in pixels
[in]datapointer to allocated image
[out]planespointers to plane's pointers will be set
[out]stridespointers to plane's strides will be set

◆ mlt_image_format_size()

int mlt_image_format_size ( mlt_image_format  format,
int  width,
int  height,
int *  bpp 
)

Get the number of bytes needed for an image.

Parameters
formatthe image format
widthwidth of the image in pixels
heightheight of the image in pixels
[out]bppthe number of bytes per pixel (optional)
Returns
the number of bytes

◆ mlt_image_get_values()

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.

Parameters
selfthe Image object
[out]datathe buffer that contains the image data
[out]formatthe image format
[out]widththe width of the image
[out]heightthe height of the image

◆ mlt_image_rgba_opaque()

int mlt_image_rgba_opaque ( uint8_t *  image,
int  width,
int  height 
)

Check if the alpha channel of an rgba image is opaque.

Parameters
imagethe image buffer
widthwidth of the image in pixels
heightheight of the image in pixels

◆ mlt_image_set_values()

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.

Less common values will be set to reasonable defaults.

Parameters
selfthe Image object
datathe buffer that contains the image data
formatthe image format
widththe width of the image
heightthe height of the image

Field Documentation

◆ alpha

void* mlt_image_s::alpha

◆ close

mlt_destructor mlt_image_s::close

◆ colorspace

int mlt_image_s::colorspace

◆ data

void* mlt_image_s::data

◆ format

mlt_image_format mlt_image_s::format

◆ height

int mlt_image_s::height

◆ planes

uint8_t* mlt_image_s::planes[MLT_IMAGE_MAX_PLANES]

◆ release_alpha

mlt_destructor mlt_image_s::release_alpha

◆ release_data

mlt_destructor mlt_image_s::release_data

◆ strides

int mlt_image_s::strides[MLT_IMAGE_MAX_PLANES]

◆ width

int mlt_image_s::width

The documentation for this struct was generated from the following files: