Data Fields
PP_ImageDataFormat(* | GetNativeImageDataFormat )(void) |
PP_Bool(* | IsImageDataFormatSupported )(PP_ImageDataFormat format) |
PP_Resource(* | Create )(PP_Instance instance, PP_ImageDataFormat format, const struct PP_Size *size, PP_Bool init_to_zero) |
PP_Bool(* | IsImageData )(PP_Resource image_data) |
PP_Bool(* | Describe )(PP_Resource image_data, struct PP_ImageDataDesc *desc) |
void *(* | Map )(PP_Resource image_data) |
void(* | Unmap )(PP_Resource image_data) |
Detailed Description
The PPB_ImageData
interface contains pointers to several functions for determining the browser's treatment of image data.
Field Documentation
PP_Resource(* PPB_ImageData::Create)(PP_Instance instance, PP_ImageDataFormat format, const struct PP_Size *size, PP_Bool init_to_zero) |
Create() allocates an image data resource with the given format and size.
For security reasons, if uninitialized, the bitmap will not contain random memory, but may contain data from a previous image produced by the same module if the bitmap was cached and re-used.
- Parameters:
[in] instance A PP_Instance
identifying one instance of a module.[in] format The desired image data format. [in] size A pointer to a PP_Size
containing the image size.[in] init_to_zero A PP_Bool
to determine transparency at creation. Set theinit_to_zero
flag if you want the bitmap initialized to transparent during the creation process. If this flag is not set, the current contents of the bitmap will be undefined, and the module should be sure to set all the pixels.
- Returns:
- A
PP_Resource
with a nonzero ID on success or zero on failure. Failure means the instance, image size, or format was invalid.
PP_Bool(* PPB_ImageData::Describe)(PP_Resource image_data, struct PP_ImageDataDesc *desc) |
Describe() computes the description of the image data.
- Parameters:
[in] image_data A PP_Resource
corresponding to image data.[in,out] desc A pointer to a PP_ImageDataDesc
containing the description.
- Returns:
- A
PP_Bool
withPP_TRUE
on success orPP_FALSE
if the resource is not an image data. OnPP_FALSE
, thedesc
structure will be filled with 0.
GetNativeImageDataFormat() returns the browser's preferred format for image data.
The browser uses this format internally for painting. Other formats may require internal conversions to paint or may have additional restrictions depending on the function.
- Returns:
- A
PP_ImageDataFormat
containing the preferred format.
PP_Bool(* PPB_ImageData::IsImageData)(PP_Resource image_data) |
IsImageData() determines if a given resource is image data.
- Parameters:
[in] image_data A PP_Resource
corresponding to image data.
- Returns:
- A
PP_Bool
withPP_TRUE
if the given resource is an image data orPP_FALSE
if the resource is invalid or some type other than image data.
IsImageDataFormatSupported() determines if the given image data format is supported by the browser.
Note: PP_IMAGEDATAFORMAT_BGRA_PREMUL
and PP_IMAGEDATAFORMAT_RGBA_PREMUL
formats are always supported. Other image formats do not make this guarantee, and should be checked first with IsImageDataFormatSupported() before using.
- Parameters:
[in] format The image data format.
- Returns:
- A
PP_Bool
withPP_TRUE
if the given image data format is supported by the browser.
void*(* PPB_ImageData::Map)(PP_Resource image_data) |
Map() maps an image data into the module address space.
- Parameters:
[in] image_data A PP_Resource
corresponding to image data.
- Returns:
- A pointer to the beginning of the data.
void(* PPB_ImageData::Unmap)(PP_Resource image_data) |
Unmap is a pointer to a function that unmaps an image data from the module address space.
- Parameters:
[in] image_data A PP_Resource
corresponding to image data.
The documentation for this struct was generated from the following file: