heif_region_get_inline_mask_data

Function heif_region_get_inline_mask_data 

Source
pub unsafe extern "C" fn heif_region_get_inline_mask_data(
    region: *const heif_region,
    out_x: *mut i32,
    out_y: *mut i32,
    out_width: *mut u32,
    out_height: *mut u32,
    out_mask_data: *mut u8,
) -> heif_error
Expand description

Get data for an inline mask region.

This returns the values in the reference coordinate space (from the parent region item). The mask location is represented by a top left corner position, and a size defined by a width and height.

The mask is held as inline data on the region, one bit per pixel, most significant bit first pixel, no padding. If the bit value is 1, the corresponding pixel is part of the region. If the bit value is 0, the corresponding pixel is not part of the region.

Possible usage (in C++): @code long unsigned int data_len = heif_region_get_inline_mask_data_len(region); int32_t x, y; uint32_t width, height; std::vector<uint8_t> mask_data(data_len); err = heif_region_get_inline_mask(region, &x, &y, &width, &height, mask_data.data()); @endcode

@param region the region to query, which must be of type #heif_region_type_inline_mask. @param out_x the X coordinate for the top left corner, where 0 is the left-most column. @param out_y the Y coordinate for the top left corner, where 0 is the top-most row. @param out_width the width of the mask region @param out_height the height of the mask region @param out_mask_data the location to return the mask data @return heif_error_ok on success, or an error value indicating the problem on failure