Native Client

PPB_ImageData Struct Reference

The PPB_ImageData interface contains pointers to several functions for determining the browser's treatment of image data. More...


Detailed Description

The PPB_ImageData interface contains pointers to several functions for determining the browser's treatment of image data.

Data Fields List

PP_ImageDataFormat(* GetNativeImageDataFormat )()
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)

Data Fields Details

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]instanceA PP_Instance identifying one instance of a module.
[in]formatThe desired image data format.
[in]sizeA pointer to a PP_Size containing the image size.
[in]init_to_zeroA PP_Bool to determine transparency at creation. Set the init_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.

Describe() computes the description of the image data.

Parameters:
[in]image_dataA PP_Resource corresponding to image data.
[in,out]descA pointer to a PP_ImageDataDesc containing the description.
Returns:
A PP_Bool with PP_TRUE on success or PP_FALSE if the resource is not an image data. On PP_FALSE, the desc 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.

IsImageData() determines if a given resource is image data.

Parameters:
[in]image_dataA PP_Resource corresponding to image data.
Returns:
A PP_Bool with PP_TRUE if the given resource is an image data or PP_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.

Parameters:
[in]formatThe image data format.
Returns:
A PP_Bool with PP_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_dataA 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_dataA PP_Resource corresponding to image data.

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

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.