struct.ImageDescriptor.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="rustdoc">
  7. <meta name="description" content="API documentation for the Rust `ImageDescriptor` struct in crate `ocl`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, ImageDescriptor">
  9. <title>ocl::builders::ImageDescriptor - Rust</title>
  10. <link rel="stylesheet" type="text/css" href="../../normalize.css">
  11. <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
  12. <link rel="stylesheet" type="text/css" href="../../dark.css">
  13. <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
  14. <script src="../../storage.js"></script>
  15. </head>
  16. <body class="rustdoc struct">
  17. <!--[if lte IE 8]>
  18. <div class="warning">
  19. This old browser is unsupported and will most likely display funky
  20. things.
  21. </div>
  22. <![endif]-->
  23. <nav class="sidebar">
  24. <div class="sidebar-menu">&#9776;</div>
  25. <p class='location'>Struct ImageDescriptor</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.image_type">image_type</a><a href="#structfield.image_width">image_width</a><a href="#structfield.image_height">image_height</a><a href="#structfield.image_depth">image_depth</a><a href="#structfield.image_array_size">image_array_size</a><a href="#structfield.image_row_pitch">image_row_pitch</a><a href="#structfield.image_slice_pitch">image_slice_pitch</a><a href="#structfield.buffer">buffer</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.to_raw">to_raw</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div></div><p class='location'><a href='../index.html'>ocl</a>::<wbr><a href='index.html'>builders</a></p><script>window.sidebarCurrent = {name: 'ImageDescriptor', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
  26. </nav>
  27. <div class="theme-picker">
  28. <button id="theme-picker" aria-label="Pick another theme!">
  29. <img src="../../brush.svg" width="18" alt="Pick another theme!">
  30. </button>
  31. <div id="theme-choices"></div>
  32. </div>
  33. <script src="../../theme.js"></script>
  34. <nav class="sub">
  35. <form class="search-form js-only">
  36. <div class="search-container">
  37. <input class="search-input" name="search"
  38. autocomplete="off"
  39. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  40. type="search">
  41. </div>
  42. </form>
  43. </nav>
  44. <section id='main' class="content">
  45. <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>ocl</a>::<wbr><a href='index.html'>builders</a>::<wbr><a class="struct" href=''>ImageDescriptor</a></span><span class='out-of-band'><span id='render-detail'>
  46. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  47. [<span class='inner'>&#x2212;</span>]
  48. </a>
  49. </span><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#955-966' title='goto source code'>[src]</a></span></h1>
  50. <pre class='rust struct'>pub struct ImageDescriptor {
  51. pub image_type: <a class="enum" href="../../ocl/enums/enum.MemObjectType.html" title="enum ocl::enums::MemObjectType">MemObjectType</a>,
  52. pub image_width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
  53. pub image_height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
  54. pub image_depth: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
  55. pub image_array_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
  56. pub image_row_pitch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
  57. pub image_slice_pitch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>,
  58. pub buffer: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../ocl_core/types/abs/struct.Mem.html" title="struct ocl_core::types::abs::Mem">Mem</a>&gt;,
  59. // some fields omitted
  60. }</pre><div class='docblock'><p>An image descriptor use in the creation of <code>Image</code>.</p>
  61. <p>image_type
  62. Describes the image type and must be either CL_MEM_OBJECT_IMAGE1D, CL_MEM_OBJECT_IMAGE1D_BUFFER, CL_MEM_OBJECT_IMAGE1D_ARRAY, CL_MEM_OBJECT_IMAGE2D, CL_MEM_OBJECT_IMAGE2D_ARRAY, or CL_MEM_OBJECT_IMAGE3D.</p>
  63. <p>image_width
  64. The width of the image in pixels. For a 2D image and image array, the image width must be ≤ CL_DEVICE_IMAGE2D_MAX_WIDTH. For a 3D image, the image width must be ≤ CL_DEVICE_IMAGE3D_MAX_WIDTH. For a 1D image buffer, the image width must be ≤ CL_DEVICE_IMAGE_MAX_BUFFER_SIZE. For a 1D image and 1D image array, the image width must be ≤ CL_DEVICE_IMAGE2D_MAX_WIDTH.</p>
  65. <p>image_height
  66. The height of the image in pixels. This is only used if the image is a 2D, 3D or 2D image array. For a 2D image or image array, the image height must be ≤ CL_DEVICE_IMAGE2D_MAX_HEIGHT. For a 3D image, the image height must be ≤ CL_DEVICE_IMAGE3D_MAX_HEIGHT.</p>
  67. <p>image_depth
  68. The depth of the image in pixels. This is only used if the image is a 3D image and must be a value ≥ 1 and ≤ CL_DEVICE_IMAGE3D_MAX_DEPTH.</p>
  69. <p>image_array_size
  70. The number of images in the image array. This is only used if the image is a 1D or 2D image array. The values for image_array_size, if specified, must be a value ≥ 1 and ≤ CL_DEVICE_IMAGE_MAX_ARRAY_SIZE.</p>
  71. <p>Note that reading and writing 2D image arrays from a kernel with image_array_size = 1 may be lower performance than 2D images.</p>
  72. <p>image_row_pitch
  73. The scan-line pitch in bytes. This must be 0 if host_ptr is NULL and can be either 0 or ≥ image_width * size of element in bytes if host_ptr is not NULL. If host_ptr is not NULL and image_row_pitch = 0, image_row_pitch is calculated as image_width * size of element in bytes. If image_row_pitch is not 0, it must be a multiple of the image element size in bytes.</p>
  74. <p>image_slice_pitch
  75. The size in bytes of each 2D slice in the 3D image or the size in bytes of each image in a 1D or 2D image array. This must be 0 if host_ptr is NULL. If host_ptr is not NULL, image_slice_pitch can be either 0 or ≥ image_row_pitch * image_height for a 2D image array or 3D image and can be either 0 or ≥ image_row_pitch for a 1D image array. If host_ptr is not NULL and image_slice_pitch = 0, image_slice_pitch is calculated as image_row_pitch * image_height for a 2D image array or 3D image and image_row_pitch for a 1D image array. If image_slice_pitch is not 0, it must be a multiple of the image_row_pitch.</p>
  76. <p>num_mip_level, num_samples
  77. Must be 0.</p>
  78. <p>buffer
  79. Refers to a valid buffer memory object if image_type is CL_MEM_OBJECT_IMAGE1D_BUFFER. Otherwise it must be NULL. For a 1D image buffer object, the image pixels are taken from the buffer object's data store. When the contents of a buffer object's data store are modified, those changes are reflected in the contents of the 1D image buffer object and vice-versa at corresponding sychronization points. The image_width * size of element in bytes must be ≤ size of buffer object data store.</p>
  80. <p>Note
  81. Concurrent reading from, writing to and copying between both a buffer object and 1D image buffer object associated with the buffer object is undefined. Only reading from both a buffer object and 1D image buffer object associated with the buffer object is defined.</p>
  82. </div><h2 id='fields' class='fields small-section-header'>
  83. Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.image_type" class="structfield small-section-header">
  84. <a href="#structfield.image_type" class="anchor field"></a>
  85. <span id="image_type.v" class='invisible'>
  86. <code>image_type: <a class="enum" href="../../ocl/enums/enum.MemObjectType.html" title="enum ocl::enums::MemObjectType">MemObjectType</a></code>
  87. </span></span><span id="structfield.image_width" class="structfield small-section-header">
  88. <a href="#structfield.image_width" class="anchor field"></a>
  89. <span id="image_width.v" class='invisible'>
  90. <code>image_width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code>
  91. </span></span><span id="structfield.image_height" class="structfield small-section-header">
  92. <a href="#structfield.image_height" class="anchor field"></a>
  93. <span id="image_height.v" class='invisible'>
  94. <code>image_height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code>
  95. </span></span><span id="structfield.image_depth" class="structfield small-section-header">
  96. <a href="#structfield.image_depth" class="anchor field"></a>
  97. <span id="image_depth.v" class='invisible'>
  98. <code>image_depth: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code>
  99. </span></span><span id="structfield.image_array_size" class="structfield small-section-header">
  100. <a href="#structfield.image_array_size" class="anchor field"></a>
  101. <span id="image_array_size.v" class='invisible'>
  102. <code>image_array_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code>
  103. </span></span><span id="structfield.image_row_pitch" class="structfield small-section-header">
  104. <a href="#structfield.image_row_pitch" class="anchor field"></a>
  105. <span id="image_row_pitch.v" class='invisible'>
  106. <code>image_row_pitch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code>
  107. </span></span><span id="structfield.image_slice_pitch" class="structfield small-section-header">
  108. <a href="#structfield.image_slice_pitch" class="anchor field"></a>
  109. <span id="image_slice_pitch.v" class='invisible'>
  110. <code>image_slice_pitch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code>
  111. </span></span><span id="structfield.buffer" class="structfield small-section-header">
  112. <a href="#structfield.buffer" class="anchor field"></a>
  113. <span id="buffer.v" class='invisible'>
  114. <code>buffer: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../ocl_core/types/abs/struct.Mem.html" title="struct ocl_core::types::abs::Mem">Mem</a>&gt;</code>
  115. </span></span>
  116. <h2 id='methods' class='small-section-header'>
  117. Methods<a href='#methods' class='anchor'></a>
  118. </h2>
  119. <h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="struct" href="../../ocl/builders/struct.ImageDescriptor.html" title="struct ocl::builders::ImageDescriptor">ImageDescriptor</a></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#968-1003' title='goto source code'>[src]</a></span></h3>
  120. <div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>pub fn <a href='#method.new' class='fnname'>new</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;image_type: <a class="enum" href="../../ocl/enums/enum.MemObjectType.html" title="enum ocl::enums::MemObjectType">MemObjectType</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;depth: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;array_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;row_pitch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;slc_pitch: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;buffer: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../ocl_core/types/abs/struct.Mem.html" title="struct ocl_core::types::abs::Mem">Mem</a>&gt;<br>) -&gt; <a class="struct" href="../../ocl/builders/struct.ImageDescriptor.html" title="struct ocl::builders::ImageDescriptor">ImageDescriptor</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#969-984' title='goto source code'>[src]</a></span></h4>
  121. <h4 id='method.to_raw' class="method"><span id='to_raw.v' class='invisible'><code>pub fn <a href='#method.to_raw' class='fnname'>to_raw</a>(&amp;self) -&gt; <a class="struct" href="../../cl_sys/cl_h/struct.cl_image_desc.html" title="struct cl_sys::cl_h::cl_image_desc">cl_image_desc</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#986-1002' title='goto source code'>[src]</a></span></h4>
  122. </div>
  123. <h2 id='implementations' class='small-section-header'>
  124. Trait Implementations<a href='#implementations' class='anchor'></a>
  125. </h2>
  126. <h3 id='impl-Clone' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../ocl/builders/struct.ImageDescriptor.html" title="struct ocl::builders::ImageDescriptor">ImageDescriptor</a></code><a href='#impl-Clone' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#954' title='goto source code'>[src]</a></span></h3>
  127. <div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="struct" href="../../ocl/builders/struct.ImageDescriptor.html" title="struct ocl::builders::ImageDescriptor">ImageDescriptor</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#954' title='goto source code'>[src]</a></span></h4>
  128. <div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
  129. </div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#112-114' title='goto source code'>[src]</a></span></h4>
  130. <div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
  131. </div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../ocl/builders/struct.ImageDescriptor.html" title="struct ocl::builders::ImageDescriptor">ImageDescriptor</a></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#954' title='goto source code'>[src]</a></span></h3>
  132. <div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl_core/types/structs.rs.html#954' title='goto source code'>[src]</a></span></h4>
  133. <div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
  134. </div></div></section>
  135. <section id='search' class="content hidden"></section>
  136. <section class="footer"></section>
  137. <aside id="help" class="hidden">
  138. <div>
  139. <h1 class="hidden">Help</h1>
  140. <div class="shortcuts">
  141. <h2>Keyboard Shortcuts</h2>
  142. <dl>
  143. <dt><kbd>?</kbd></dt>
  144. <dd>Show this help dialog</dd>
  145. <dt><kbd>S</kbd></dt>
  146. <dd>Focus the search field</dd>
  147. <dt><kbd>↑</kbd></dt>
  148. <dd>Move up in search results</dd>
  149. <dt><kbd>↓</kbd></dt>
  150. <dd>Move down in search results</dd>
  151. <dt><kbd>↹</kbd></dt>
  152. <dd>Switch tab</dd>
  153. <dt><kbd>&#9166;</kbd></dt>
  154. <dd>Go to active search result</dd>
  155. <dt><kbd>+</kbd></dt>
  156. <dd>Expand all sections</dd>
  157. <dt><kbd>-</kbd></dt>
  158. <dd>Collapse all sections</dd>
  159. </dl>
  160. </div>
  161. <div class="infos">
  162. <h2>Search Tricks</h2>
  163. <p>
  164. Prefix searches with a type followed by a colon (e.g.
  165. <code>fn:</code>) to restrict the search to a given type.
  166. </p>
  167. <p>
  168. Accepted types are: <code>fn</code>, <code>mod</code>,
  169. <code>struct</code>, <code>enum</code>,
  170. <code>trait</code>, <code>type</code>, <code>macro</code>,
  171. and <code>const</code>.
  172. </p>
  173. <p>
  174. Search functions by type signature (e.g.
  175. <code>vec -> usize</code> or <code>* -> vec</code>)
  176. </p>
  177. </div>
  178. </div>
  179. </aside>
  180. <script>
  181. window.rootPath = "../../";
  182. window.currentCrate = "ocl";
  183. </script>
  184. <script src="../../main.js"></script>
  185. <script defer src="../../search-index.js"></script>
  186. </body>
  187. </html>