Pepper_47_C++_interfaces
|
#include <image_data.h>
Public Member Functions | |
ImageData () | |
ImageData (PassRef, PP_Resource resource) | |
ImageData (const ImageData &other) | |
ImageData (const InstanceHandle &instance, PP_ImageDataFormat format, const Size &size, bool init_to_zero) | |
ImageData & | operator= (const ImageData &other) |
PP_ImageDataFormat | format () const |
pp::Size | size () const |
int32_t | stride () const |
void * | data () const |
const uint32_t * | GetAddr32 (const Point &coord) const |
uint32_t * | GetAddr32 (const Point &coord) |
![]() | |
Resource () | |
The default constructor. More... | |
Resource (const Resource &other) | |
virtual | ~Resource () |
Destructor. More... | |
Resource & | operator= (const Resource &other) |
bool | is_null () const |
PP_Resource | pp_resource () const |
PP_Resource | detach () |
Static Public Member Functions | |
static bool | IsImageDataFormatSupported (PP_ImageDataFormat format) |
static PP_ImageDataFormat | GetNativeImageDataFormat () |
Additional Inherited Members | |
![]() | |
Resource (PP_Resource resource) | |
Resource (PassRef, PP_Resource resource) | |
void | PassRefFromConstructor (PP_Resource resource) |
void | Clear () |
Sets this resource to null. This releases ownership of the resource. More... | |
Definition at line 20 of file image_data.h.
pp::ImageData::ImageData | ( | ) |
Default constructor for creating an is_null() ImageData
object.
Definition at line 25 of file image_data.cc.
pp::ImageData::ImageData | ( | PassRef | , |
PP_Resource | resource | ||
) |
A constructor used when you have received a PP_Resource
as a return value that has already been reference counted.
[in] | resource | A PP_Resource corresponding to image data. |
Definition at line 35 of file image_data.cc.
pp::ImageData::ImageData | ( | const ImageData & | other | ) |
The copy constructor for ImageData
. This constructor produces an ImageData
object that shares the underlying Image
resource with other
.
[in] | other | A pointer to an image data. |
Definition at line 29 of file image_data.cc.
pp::ImageData::ImageData | ( | const InstanceHandle & | instance, |
PP_ImageDataFormat | format, | ||
const Size & | size, | ||
bool | init_to_zero | ||
) |
A constructor that allocates a new ImageData
in the browser with the provided parameters. The resulting object will be is_null() if the allocation failed.
[in] | instance | The instance with which this resource will be associated. |
[in] | format | A PP_ImageDataFormat containing desired image format. PP_ImageDataFormat is an enumeration of the different types of image data formats. Refer to ppb_image_data.h for further information. |
[in] | size | A pointer to a Size containing the image size. |
[in] | init_to_zero | A bool used 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. |
Definition at line 42 of file image_data.cc.
References format(), pp::Resource::PassRefFromConstructor(), pp::InstanceHandle::pp_instance(), and pp::Size::pp_size().
|
inline |
A getter function for returning a raw pointer to the image pixels.
Definition at line 112 of file image_data.h.
Referenced by GetAddr32().
|
inline |
A getter function for returning the current format for images.
PP_ImageDataFormat
containing the preferred format. Definition at line 97 of file image_data.h.
Referenced by ImageData().
const uint32_t * pp::ImageData::GetAddr32 | ( | const Point & | coord | ) | const |
This function is used retrieve the address of the given pixel for 32-bit pixel formats.
[in] | coord | A Point representing the x and y coordinates for a specific pixel. |
Definition at line 65 of file image_data.cc.
uint32_t * pp::ImageData::GetAddr32 | ( | const Point & | coord | ) |
This function is used retrieve the address of the given pixel for 32-bit pixel formats.
[in] | coord | A Point representing the x and y coordinates for a specific pixel. |
Definition at line 70 of file image_data.cc.
References data(), stride(), pp::Point::x(), and pp::Point::y().
|
static |
GetNativeImageDataFormat() determines the browser's preferred format for images. Using this format guarantees no extra conversions will occur when painting.
PP_ImageDataFormat
containing the preferred format. Definition at line 86 of file image_data.cc.
|
static |
IsImageDataFormatSupported() returns true
if the supplied 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.
[in] | format | Image data format. |
true
if the format is supported by the browser. Definition at line 78 of file image_data.cc.
This function decrements the reference count of this ImageData
and increments the reference count of the other
ImageData
. This ImageData
shares the underlying image resource with other
.
[in] | other | An other image data. |
Definition at line 58 of file image_data.cc.
References pp::Resource::operator=().
|
inline |
A getter function for returning the image size.
Definition at line 102 of file image_data.h.
|
inline |
A getter function for returning the row width in bytes.
Definition at line 107 of file image_data.h.
Referenced by GetAddr32().