1 {{+bindTo:partials.standard_nacl_article}}
2 <h1>PPB_ImageData Struct Reference</h1>
4 <!-- Generated by Doxygen 1.7.6.1 -->
10 <!-- doxytag: class="PPB_ImageData" --><h2>
11 Data Fields</h2><table class="memberdecls">
13 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga2ee7ad01799553e5f17bdaa35dd952ee">PP_ImageDataFormat</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___image_data__1__0.html#adba78e8f9e623809b6b23419dbce4d65">GetNativeImageDataFormat</a> )(void)</td></tr>
14 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___image_data__1__0.html#a451a583a5caa74bdc735e324de282b82">IsImageDataFormatSupported</a> )(<a class="el" href="group___enums.html#ga2ee7ad01799553e5f17bdaa35dd952ee">PP_ImageDataFormat</a> format)</td></tr>
15 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___image_data__1__0.html#ab7146e66c91e651259ef9d81bcee7776">Create</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, <a class="el" href="group___enums.html#ga2ee7ad01799553e5f17bdaa35dd952ee">PP_ImageDataFormat</a> format, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> init_to_zero)</td></tr>
16 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___image_data__1__0.html#a1e208943ea241fc4050d0190a0e92492">IsImageData</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data)</td></tr>
17 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___image_data__1__0.html#a0598a298c53b777d9909f80c70987629">Describe</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data, struct <a class="el" href="struct_p_p___image_data_desc.html">PP_ImageDataDesc</a> *desc)</td></tr>
18 <tr><td class="memItemLeft" align="right" valign="top">void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___image_data__1__0.html#a2e7d4b40b88c0680b263db05745055e9">Map</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data)</td></tr>
19 <tr><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___image_data__1__0.html#ab0fc702469c51be79b2f8b74d9148c81">Unmap</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data)</td></tr>
21 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
22 <div class="textblock"><p>The <code>PPB_ImageData</code> interface contains pointers to several functions for determining the browser's treatment of image data. </p>
23 </div><hr /><h2>Field Documentation</h2>
24 <a class="anchor" id="ab7146e66c91e651259ef9d81bcee7776"></a><!-- doxytag: member="PPB_ImageData::Create" ref="ab7146e66c91e651259ef9d81bcee7776" args=")(PP_Instance instance, PP_ImageDataFormat format, const struct PP_Size *size, PP_Bool init_to_zero)" -->
26 <div class="memproto">
27 <table class="memname">
29 <td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___image_data__1__0.html#ab7146e66c91e651259ef9d81bcee7776">PPB_ImageData::Create</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, <a class="el" href="group___enums.html#ga2ee7ad01799553e5f17bdaa35dd952ee">PP_ImageDataFormat</a> format, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> init_to_zero)</td>
34 <p><a class="el" href="struct_p_p_b___image_data__1__0.html#ab7146e66c91e651259ef9d81bcee7776" title="Create() allocates an image data resource with the given format and size.">Create()</a> allocates an image data resource with the given format and size. </p>
35 <p>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.</p>
36 <dl class="params"><dt><b>Parameters:</b></dt><dd>
37 <table class="params">
38 <tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>A <code>PP_Instance</code> identifying one instance of a module. </td></tr>
39 <tr><td class="paramdir">[in]</td><td class="paramname">format</td><td>The desired image data format. </td></tr>
40 <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>A pointer to a <code><a class="el" href="struct_p_p___size.html" title="The PP_Size struct contains the size of a 2D rectangle.">PP_Size</a></code> containing the image size. </td></tr>
41 <tr><td class="paramdir">[in]</td><td class="paramname">init_to_zero</td><td>A <code>PP_Bool</code> to determine transparency at creation. Set the <code>init_to_zero</code> 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.</td></tr>
45 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> with a nonzero ID on success or zero on failure. Failure means the instance, image size, or format was invalid. </dd></dl>
48 <a class="anchor" id="a0598a298c53b777d9909f80c70987629"></a><!-- doxytag: member="PPB_ImageData::Describe" ref="a0598a298c53b777d9909f80c70987629" args=")(PP_Resource image_data, struct PP_ImageDataDesc *desc)" -->
50 <div class="memproto">
51 <table class="memname">
53 <td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___image_data__1__0.html#a0598a298c53b777d9909f80c70987629">PPB_ImageData::Describe</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data, struct <a class="el" href="struct_p_p___image_data_desc.html">PP_ImageDataDesc</a> *desc)</td>
58 <p><a class="el" href="struct_p_p_b___image_data__1__0.html#a0598a298c53b777d9909f80c70987629" title="Describe() computes the description of the image data.">Describe()</a> computes the description of the image data. </p>
59 <dl class="params"><dt><b>Parameters:</b></dt><dd>
60 <table class="params">
61 <tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data. </td></tr>
62 <tr><td class="paramdir">[in,out]</td><td class="paramname">desc</td><td>A pointer to a <code><a class="el" href="struct_p_p___image_data_desc.html" title="The PP_ImageDataDesc structure represents a description of image data.">PP_ImageDataDesc</a></code> containing the description.</td></tr>
66 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> with <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if the resource is not an image data. On <code>PP_FALSE</code>, the <code>desc</code> structure will be filled with 0. </dd></dl>
69 <a class="anchor" id="adba78e8f9e623809b6b23419dbce4d65"></a><!-- doxytag: member="PPB_ImageData::GetNativeImageDataFormat" ref="adba78e8f9e623809b6b23419dbce4d65" args=")(void)" -->
71 <div class="memproto">
72 <table class="memname">
74 <td class="memname"><a class="el" href="group___enums.html#ga2ee7ad01799553e5f17bdaa35dd952ee">PP_ImageDataFormat</a>(* <a class="el" href="struct_p_p_b___image_data__1__0.html#adba78e8f9e623809b6b23419dbce4d65">PPB_ImageData::GetNativeImageDataFormat</a>)(void)</td>
79 <p><a class="el" href="struct_p_p_b___image_data__1__0.html#adba78e8f9e623809b6b23419dbce4d65" title="GetNativeImageDataFormat() returns the browser's preferred format for image data.">GetNativeImageDataFormat()</a> returns the browser's preferred format for image data. </p>
80 <p>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.</p>
81 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_ImageDataFormat</code> containing the preferred format. </dd></dl>
84 <a class="anchor" id="a1e208943ea241fc4050d0190a0e92492"></a><!-- doxytag: member="PPB_ImageData::IsImageData" ref="a1e208943ea241fc4050d0190a0e92492" args=")(PP_Resource image_data)" -->
86 <div class="memproto">
87 <table class="memname">
89 <td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___image_data__1__0.html#a1e208943ea241fc4050d0190a0e92492">PPB_ImageData::IsImageData</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data)</td>
94 <p><a class="el" href="struct_p_p_b___image_data__1__0.html#a1e208943ea241fc4050d0190a0e92492" title="IsImageData() determines if a given resource is image data.">IsImageData()</a> determines if a given resource is image data. </p>
95 <dl class="params"><dt><b>Parameters:</b></dt><dd>
96 <table class="params">
97 <tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data.</td></tr>
101 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given resource is an image data or <code>PP_FALSE</code> if the resource is invalid or some type other than image data. </dd></dl>
104 <a class="anchor" id="a451a583a5caa74bdc735e324de282b82"></a><!-- doxytag: member="PPB_ImageData::IsImageDataFormatSupported" ref="a451a583a5caa74bdc735e324de282b82" args=")(PP_ImageDataFormat format)" -->
105 <div class="memitem">
106 <div class="memproto">
107 <table class="memname">
109 <td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___image_data__1__0.html#a451a583a5caa74bdc735e324de282b82">PPB_ImageData::IsImageDataFormatSupported</a>)(<a class="el" href="group___enums.html#ga2ee7ad01799553e5f17bdaa35dd952ee">PP_ImageDataFormat</a> format)</td>
114 <p><a class="el" href="struct_p_p_b___image_data__1__0.html#a451a583a5caa74bdc735e324de282b82" title="IsImageDataFormatSupported() determines if the given image data format is supported by the browser...">IsImageDataFormatSupported()</a> determines if the given image data format is supported by the browser. </p>
115 <p>Note: <code>PP_IMAGEDATAFORMAT_BGRA_PREMUL</code> and <code>PP_IMAGEDATAFORMAT_RGBA_PREMUL</code> formats are always supported. Other image formats do not make this guarantee, and should be checked first with <a class="el" href="struct_p_p_b___image_data__1__0.html#a451a583a5caa74bdc735e324de282b82" title="IsImageDataFormatSupported() determines if the given image data format is supported by the browser...">IsImageDataFormatSupported()</a> before using.</p>
116 <dl class="params"><dt><b>Parameters:</b></dt><dd>
117 <table class="params">
118 <tr><td class="paramdir">[in]</td><td class="paramname">format</td><td>The image data format.</td></tr>
122 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given image data format is supported by the browser. </dd></dl>
125 <a class="anchor" id="a2e7d4b40b88c0680b263db05745055e9"></a><!-- doxytag: member="PPB_ImageData::Map" ref="a2e7d4b40b88c0680b263db05745055e9" args=")(PP_Resource image_data)" -->
126 <div class="memitem">
127 <div class="memproto">
128 <table class="memname">
130 <td class="memname">void*(* <a class="el" href="struct_p_p_b___image_data__1__0.html#a2e7d4b40b88c0680b263db05745055e9">PPB_ImageData::Map</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data)</td>
135 <p><a class="el" href="struct_p_p_b___image_data__1__0.html#a2e7d4b40b88c0680b263db05745055e9" title="Map() maps an image data into the module address space.">Map()</a> maps an image data into the module address space. </p>
136 <dl class="params"><dt><b>Parameters:</b></dt><dd>
137 <table class="params">
138 <tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data.</td></tr>
142 <dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the beginning of the data. </dd></dl>
145 <a class="anchor" id="ab0fc702469c51be79b2f8b74d9148c81"></a><!-- doxytag: member="PPB_ImageData::Unmap" ref="ab0fc702469c51be79b2f8b74d9148c81" args=")(PP_Resource image_data)" -->
146 <div class="memitem">
147 <div class="memproto">
148 <table class="memname">
150 <td class="memname">void(* <a class="el" href="struct_p_p_b___image_data__1__0.html#ab0fc702469c51be79b2f8b74d9148c81">PPB_ImageData::Unmap</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data)</td>
155 <p>Unmap is a pointer to a function that unmaps an image data from the module address space. </p>
156 <dl class="params"><dt><b>Parameters:</b></dt><dd>
157 <table class="params">
158 <tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data. </td></tr>
164 <hr />The documentation for this struct was generated from the following file:<ul>
165 <li><a class="el" href="ppb__image__data_8h.html">ppb_image_data.h</a></li>
167 </div><!-- contents -->
168 {{/partials.standard_nacl_article}}