chromium/native_client_sdk/doc_generated/pepper_beta/c/struct_p_p_b___image_data__1__0.html

{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_ImageData Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
  <div>
<!-- Generated by Doxygen 1.7.6.1 -->


</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPB_ImageData" --><h2>
Data Fields</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga2ee7ad01799553e5f17bdaa35dd952ee">PP_ImageDataFormat</a>(*&#160;</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>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</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>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(*&#160;</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>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</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>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</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>
<tr><td class="memItemLeft" align="right" valign="top">void *(*&#160;</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>
<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</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>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<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>
</div><hr /><h2>Field Documentation</h2>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
<tr><td class="paramdir">[in]</td><td class="paramname">format</td><td>The desired image data format. </td></tr>
<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>
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="a0598a298c53b777d9909f80c70987629"></a><!-- doxytag: member="PPB_ImageData::Describe" ref="a0598a298c53b777d9909f80c70987629" args=")(PP_Resource image_data, struct PP_ImageDataDesc *desc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data. </td></tr>
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="adba78e8f9e623809b6b23419dbce4d65"></a><!-- doxytag: member="PPB_ImageData::GetNativeImageDataFormat" ref="adba78e8f9e623809b6b23419dbce4d65" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<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>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_ImageDataFormat</code> containing the preferred format. </dd></dl>
</div>
</div>
<a class="anchor" id="a1e208943ea241fc4050d0190a0e92492"></a><!-- doxytag: member="PPB_ImageData::IsImageData" ref="a1e208943ea241fc4050d0190a0e92492" args=")(PP_Resource image_data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data.</td></tr>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="a451a583a5caa74bdc735e324de282b82"></a><!-- doxytag: member="PPB_ImageData::IsImageDataFormatSupported" ref="a451a583a5caa74bdc735e324de282b82" args=")(PP_ImageDataFormat format)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">format</td><td>The image data format.</td></tr>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="a2e7d4b40b88c0680b263db05745055e9"></a><!-- doxytag: member="PPB_ImageData::Map" ref="a2e7d4b40b88c0680b263db05745055e9" args=")(PP_Resource image_data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the beginning of the data. </dd></dl>
</div>
</div>
<a class="anchor" id="ab0fc702469c51be79b2f8b74d9148c81"></a><!-- doxytag: member="PPB_ImageData::Unmap" ref="ab0fc702469c51be79b2f8b74d9148c81" args=")(PP_Resource image_data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unmap is a pointer to a function that unmaps an image data from the module address space. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">image_data</td><td>A <code>PP_Resource</code> corresponding to image data. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__image__data_8h.html">ppb_image_data.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}