<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Gg.Color.html"> <link rel="Up" href="Gg.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Gg" rel="Chapter" href="Gg.html"><link title="Scalar types and buffers" rel="Section" href="#scalars"> <link title="Sample semantics" rel="Section" href="#semantics"> <link title="Sample format" rel="Section" href="#samples"> <link title="Raster data" rel="Section" href="#raster"> <link title="Constructor, accessors" rel="Subsection" href="#2_Constructoraccessors"> <link title="Functions" rel="Subsection" href="#2_Functions"> <link title="Predicates and comparisons" rel="Subsection" href="#2_Predicatesandcomparisons"> <link title="Printers" rel="Subsection" href="#2_Printers"> <title>Gg.Raster</title> </head> <body> <div class="navbar"><a class="pre" href="Gg.Color.html" title="Gg.Color">Previous</a> <a class="up" href="Gg.html" title="Gg">Up</a> </div> <h1>Module <a href="type_Gg.Raster.html">Gg.Raster</a></h1> <pre><span class="keyword">module</span> Raster: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Raster.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info"> Raster data. <p> <b>WARNING.</b> This interface is subject to change in the future. <p> Raster data organizes data samples of any dimension in discrete 1D, 2D (images) or 3D space. <p> A sample has a <a href="Gg.Raster.html#TYPEsample_semantics"><em>semantics</em></a> that defines its dimension and the meaning of its <em>components</em>. For example a 4D sample could represent a linear sRGBA sample. Samples are stored in a <a href="Gg.Raster.html#TYPEbuffer">linear buffer</a> of <em>scalars</em> of a given <a href="Gg.Raster.html#TYPEscalar_type">type</a>. A sample can use one scalar per component, can be packed in a single scalar or may have no direct obvious relationship to buffer scalars (compressed data). A <a href="Gg.Raster.html#TYPEsample_format">sample format</a> defines the semantics and scalar storage of a sample. <p> A <a href="Gg.Raster.html#TYPEt"><em>raster data</em></a> value is a collection of samples indexed by width, height and depth (i.e. x, y, z) stored in a buffer. It defines the sample data, the extents of the index and the sample format. <p> <b>Spatial convention.</b> If the sample index has to be interpreted spatially. It must be interpreted relative to the origin of a right-handed coordinate system. This means that the first sample, indexed by <code class="code">(0, 0, 0)</code> is the bottom-left backmost sample (bottom-left sample for an image).<br> </div> <hr width="100%"> <br> <h1 id="scalars">Scalar types and buffers</h1><br> <pre><span id="TYPEscalar_type"><span class="keyword">type</span> <code class="type"></code>scalar_type</span> = <code class="type">[ `Float16<br> | `Float32<br> | `Float64<br> | `Int16<br> | `Int32<br> | `Int64<br> | `Int8<br> | `UInt16<br> | `UInt32<br> | `UInt64<br> | `UInt8 ]</code> </pre> <div class="info"> The type for scalar types.<br> </div> <pre><span id="VALscalar_type_byte_count"><span class="keyword">val</span> scalar_type_byte_count</span> : <code class="type"><a href="Gg.Raster.html#TYPEscalar_type">scalar_type</a> -> int</code></pre><div class="info"> <code class="code">scalar_type_byte_count st</code> is the number of bytes used by a scalar of type <code class="code">st</code>.<br> </div> <pre><span id="VALpp_scalar_type"><span class="keyword">val</span> pp_scalar_type</span> : <code class="type">Format.formatter -> <a href="Gg.Raster.html#TYPEscalar_type">scalar_type</a> -> unit</code></pre><div class="info"> <code class="code">pp_scalar_type ppf st</code> prints a textual representation of <code class="code">st</code> on <code class="code">ppf</code>.<br> </div> <pre><span id="TYPEb_array"><span class="keyword">type</span> <code class="type">('a, 'b)</code> b_array</span> = <code class="type">('a, 'b, Bigarray.c_layout) Bigarray.Array1.t</code> </pre> <div class="info"> The type for big arrays.<br> </div> <pre><span id="TYPEbuffer"><span class="keyword">type</span> <code class="type"></code>buffer</span> = <code class="type">[ `A_Float64 of float array<br> | `B_Float16 of (int, Bigarray.int16_unsigned_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_Float32 of (float, Bigarray.float32_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_Float64 of (float, Bigarray.float64_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_Int16 of (int, Bigarray.int16_signed_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_Int32 of (int32, Bigarray.int32_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_Int64 of (int64, Bigarray.int64_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_Int8 of (int, Bigarray.int8_signed_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_UInt16 of (int, Bigarray.int16_unsigned_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_UInt32 of (int32, Bigarray.int32_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_UInt64 of (int64, Bigarray.int64_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `B_UInt8 of (int, Bigarray.int8_unsigned_elt) <a href="Gg.Raster.html#TYPEb_array">b_array</a><br> | `S_UInt8 of string ]</code> </pre> <div class="info"> The type for linear buffer of scalars.<br> </div> <pre><span id="VALbuffer_scalar_type"><span class="keyword">val</span> buffer_scalar_type</span> : <code class="type"><a href="Gg.Raster.html#TYPEbuffer">buffer</a> -> <a href="Gg.Raster.html#TYPEscalar_type">scalar_type</a></code></pre><div class="info"> <code class="code">buffer_scalar_type b</code> is <code class="code">b</code>'s buffer scalar type.<br> </div> <pre><span id="VALpp_buffer"><span class="keyword">val</span> pp_buffer</span> : <code class="type">Format.formatter -> <a href="Gg.Raster.html#TYPEbuffer">buffer</a> -> unit</code></pre><div class="info"> <code class="code">pp_buffer b</code> prints a textual representation of <code class="code">b</code> on <code class="code">ppf</code>. Does not print the buffer's data.<br> </div> <br> <h1 id="semantics">Sample semantics</h1><br> <pre><span id="TYPEsample_semantics"><span class="keyword">type</span> <code class="type"></code>sample_semantics</span> = <code class="type">[ `Color of <a href="Gg.Color.html#TYPEprofile">Gg.Color.profile</a> * bool | `Other of string * int ]</code> </pre> <div class="info"> The type for sample semantics. <ul> <li><code class="code"><span class="keywordsign">`</span><span class="constructor">Color</span> (p, alpha)</code> is for color samples from the color profile <code class="code">p</code>. <code class="code">alpha</code> indicates if there's an alpha component on the <em>right</em> of the color components.</li> <li><code class="code"><span class="keywordsign">`</span><span class="constructor">Other</span>(label, dim)</code> is for samples of <code class="code">dim</code> dimension identified by <code class="code">label</code>.</li> </ul> <br> </div> <pre><span id="VALrgb_l"><span class="keyword">val</span> rgb_l</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_semantics">sample_semantics</a></code></pre><div class="info"> <code class="code">rgb_l</code> is for linear RGB samples from the <a href="Gg.Color.html#VALp_rgb_l"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Color</span>.p_rgb_l</code></a> profile.<br> </div> <pre><span id="VALrgba_l"><span class="keyword">val</span> rgba_l</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_semantics">sample_semantics</a></code></pre><div class="info"> <code class="code">rgba_l</code> is for linear RGB samples from the <a href="Gg.Color.html#VALp_rgb_l"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Color</span>.p_rgb_l</code></a> profile with an alpha component.<br> </div> <pre><span id="VALgray_l"><span class="keyword">val</span> gray_l</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_semantics">sample_semantics</a></code></pre><div class="info"> <code class="code">gray_l</code> is for linear Gray samples from the <a href="Gg.Color.html#VALp_gray_l"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Color</span>.p_gray_l</code></a> profile.<br> </div> <pre><span id="VALgraya_l"><span class="keyword">val</span> graya_l</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_semantics">sample_semantics</a></code></pre><div class="info"> <code class="code">graya_l</code> is for linear Gray samples from the <a href="Gg.Color.html#VALp_gray_l"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Color</span>.p_gray_l</code></a> luminance with an alpha component.<br> </div> <pre><span id="VALpp_sample_semantics"><span class="keyword">val</span> pp_sample_semantics</span> : <code class="type">Format.formatter -> <a href="Gg.Raster.html#TYPEsample_semantics">sample_semantics</a> -> unit</code></pre><div class="info"> <code class="code">pp_sample_semantics ppf sem</code> prints a textual representation of <code class="code">sem</code> on <code class="code">ppf</code>.<br> </div> <br> <h1 id="samples">Sample format</h1><br> <pre><span id="TYPEsample_pack"><span class="keyword">type</span> <code class="type"></code>sample_pack</span> = <code class="type">[ `FourCC of string * <a href="Gg.Raster.html#TYPEscalar_type">scalar_type</a> option<br> | `Other of string * <a href="Gg.Raster.html#TYPEscalar_type">scalar_type</a> option<br> | `PU8888 ]</code> </pre> <div class="info"> The type for sample packs. A sample pack describes storage for samples that do not use one scalar per component. <ul> <li><code class="code"><span class="keywordsign">`</span><span class="constructor">PU8888</span></code>. An arbitrary 4D sample X, Y, Z, W with unsigned 8 bits components packed in a single <code class="code"><span class="keywordsign">`</span><span class="constructor">Uint32</span></code> scalar as <code class="code">0xXXYYZZWWl</code>.</li> <li><code class="code"><span class="keywordsign">`</span><span class="constructor">FourCC</span>(code, restrict)</code>. A sample is stored according to the format specified by the FourCC <code class="code">code</code>, a string of length 4. If <code class="code">restrict</code> is specified the pack can only be used with the corresponding scalar type. For example <code class="code"><span class="keywordsign">`</span><span class="constructor">FourCC</span>(<span class="string">"DXT5"</span>, <span class="constructor">Some</span> <span class="keywordsign">`</span><span class="constructor">Uint64</span>)</code> can be used to specify a buffer of DXT5 compressed data. <code class="code"><span class="keywordsign">`</span><span class="constructor">FourCC</span></code> can also be used to describe the numerous YUV packed pixel formats.</li> <li><code class="code"><span class="keywordsign">`</span><span class="constructor">Other</span>(label, restrict)</code>. A sample is stored in some other packing scheme identified by <code class="code">label</code>, <code class="code">restrict</code> has the same meaning as in <code class="code"><span class="keywordsign">`</span><span class="constructor">FourCC</span></code>.</li> </ul> <br> </div> <pre><span id="VALpp_sample_pack"><span class="keyword">val</span> pp_sample_pack</span> : <code class="type">Format.formatter -> <a href="Gg.Raster.html#TYPEsample_pack">sample_pack</a> -> unit</code></pre><div class="info"> <code class="code">pp_sample_pack ppf pack</code> prints a textual representation of <code class="code">pack</code> on <code class="code">ppf</code>.<br> </div> <pre><span id="TYPEsample_format"><span class="keyword">type</span> <code class="type"></code>sample_format</span> </pre> <div class="info"> The type for sample formats.<br> </div> <pre><span id="VALsample_format_v"><span class="keyword">val</span> sample_format_v</span> : <code class="type">?pack:<a href="Gg.Raster.html#TYPEsample_pack">sample_pack</a> -><br> <a href="Gg.Raster.html#TYPEsample_semantics">sample_semantics</a> -><br> <a href="Gg.Raster.html#TYPEscalar_type">scalar_type</a> -> <a href="Gg.Raster.html#TYPEsample_format">sample_format</a></code></pre><div class="info"> <code class="code">sample_format_v pack sem st</code> is a sample format with semantics <code class="code">sem</code> and scalar type <code class="code">st</code>. If <code class="code">pack</code> is absent one scalar of type <code class="code">st</code> per sample component is used. If present, see <a href="Gg.Raster.html#TYPEsample_pack"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Raster</span>.sample_pack</code></a>.<br> <b>Raises</b> <code>Invalid_argument</code> if <code class="code">pack</code> is incompatible with <code class="code">st</code>, see <a href="Gg.Raster.html#TYPEsample_pack"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Raster</span>.sample_pack</code></a> or if a <code class="code">pack</code> <code class="code"><span class="keywordsign">`</span><span class="constructor">FourCC</span></code> code is not made of 4 bytes.<br> </div> <pre><span id="VALsf_semantics"><span class="keyword">val</span> sf_semantics</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_format">sample_format</a> -> <a href="Gg.Raster.html#TYPEsample_semantics">sample_semantics</a></code></pre><div class="info"> <code class="code">sf_semantics sf</code> is <code class="code">sf</code>'s semantics.<br> </div> <pre><span id="VALsf_scalar_type"><span class="keyword">val</span> sf_scalar_type</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_format">sample_format</a> -> <a href="Gg.Raster.html#TYPEscalar_type">scalar_type</a></code></pre><div class="info"> <code class="code">sf_scalar_type sf</code> is <code class="code">sf</code>'s buffer scalar type<br> </div> <pre><span id="VALsf_pack"><span class="keyword">val</span> sf_pack</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_format">sample_format</a> -> <a href="Gg.Raster.html#TYPEsample_pack">sample_pack</a> option</code></pre><div class="info"> <code class="code">sf_pack sf</code> is <code class="code">sf</code>'s sample pack, if any.<br> </div> <pre><span id="VALsf_dim"><span class="keyword">val</span> sf_dim</span> : <code class="type"><a href="Gg.Raster.html#TYPEsample_format">sample_format</a> -> int</code></pre><div class="info"> <code class="code">sf_dim sf</code> is <code class="code">sf</code>'s sample dimension.<br> </div> <pre><span id="VALsf_scalar_count"><span class="keyword">val</span> sf_scalar_count</span> : <code class="type">?first:int -><br> ?w_skip:int -><br> ?h_skip:int -> w:int -> ?h:int -> ?d:int -> <a href="Gg.Raster.html#TYPEsample_format">sample_format</a> -> int</code></pre><div class="info"> <code class="code">sf_scalar_count first w_skip h_skip w h d sf</code> is the minimal number of scalars needed to hold a raster data with the corresponding parameters, see <a href="Gg.Raster.html#VALv"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Raster</span>.v</code></a> for their description.<br> <b>Raises</b> <code>Invalid_argument</code> if <code class="code">sf</code> is packed.<br> </div> <pre><span id="VALpp_sample_format"><span class="keyword">val</span> pp_sample_format</span> : <code class="type">Format.formatter -> <a href="Gg.Raster.html#TYPEsample_format">sample_format</a> -> unit</code></pre><div class="info"> <code class="code">pp_sample_format ppf sf</code> prints a textual representation of <code class="code">sf</code> on <code class="code">ppf</code>.<br> </div> <br> <h1 id="raster">Raster data</h1><br> <pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type"><a href="Gg.html#TYPEraster">Gg.raster</a></code> </pre> <div class="info"> The type for raster data.<br> </div> <br> <h2 id="2_Constructoraccessors">Constructor, accessors</h2><br> <pre><span id="VALv"><span class="keyword">val</span> v</span> : <code class="type">?res:<a href="Gg.html#TYPEv3">Gg.v3</a> -><br> ?first:int -><br> ?w_skip:int -><br> ?h_skip:int -><br> w:int -><br> ?h:int -><br> ?d:int -> <a href="Gg.Raster.html#TYPEsample_format">sample_format</a> -> <a href="Gg.Raster.html#TYPEbuffer">buffer</a> -> <a href="Gg.Raster.html#TYPEt">t</a></code></pre><div class="info"> <code class="code">v res first w_skip h_skip w h d sf buf</code> is raster data with sample format <code class="code">sf</code> and buffer <code class="code">b</code>. <ul> <li><code class="code">w</code>, <code class="code">h</code>, <code class="code">d</code>, specify the index width, height and depth, in number of <em>samples</em>. <code class="code">h</code> and <code class="code">d</code> default to <code class="code">1</code>.</li> <li><code class="code">first</code>, <em>buffer scalar</em> index where the data of the first sample is stored.</li> <li><code class="code">w_skip</code>, number of <em>buffer scalars</em> to skip between two consecutive lines, defaults to <code class="code">0</code>.</li> <li><code class="code">h_skip</code>, number of <em>buffer scalars</em> to skip between two consecutive planes, defaults to <code class="code">0</code>.</li> <li><code class="code">res</code>, is an optional sample resolution specification in samples per meters.</li> </ul> For certain sample formats <code class="code">first</code>, <code class="code">w_skip</code> and <code class="code">h_skip</code> can be used to specify subspaces in the collection of samples, see <a href="Gg.Raster.html#VALsub"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Raster</span>.sub</code></a>. <p> The function <a href="Gg.Raster.html#VALpitches"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Raster</span>.pitches</code></a> can be used to easily compute the buffer scalar index where a sample <code class="code">(x,y,z)</code> starts.<br> <b>Raises</b> <code>Invalid_argument</code> if <code class="code">w</code>, <code class="code">h</code> or <code class="code">d</code> is not positive or if <code class="code">first</code>, <code class="code">w_skip</code> or <code class="code">h_skip</code> is negative. Or if the scalar type of <code class="code">sf</code> doesn't match <code class="code">(<span class="constructor">Raster</span>.buffer_scalar_type b)</code>.<br> </div> <pre><span id="VALres"><span class="keyword">val</span> res</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.html#TYPEv3">Gg.v3</a> option</code></pre><div class="info"> <code class="code">res r</code> is <code class="code">r</code>'s resolution in sample per meters, if any.<br> </div> <pre><span id="VALfirst"><span class="keyword">val</span> first</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">first r</code> is the <em>buffer scalar</em> index where the first sample is stored.<br> </div> <pre><span id="VALw_skip"><span class="keyword">val</span> w_skip</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">w_skip r</code> is the number of <em>buffer scalars</em> to skip between two consecutive lines.<br> </div> <pre><span id="VALh_skip"><span class="keyword">val</span> h_skip</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">f_h_skip r</code> is the number of <em>buffer scalars</em> to skip between two consecutive planes.<br> </div> <pre><span id="VALw"><span class="keyword">val</span> w</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">w r</code> is the index width in number of <em>samples</em>.<br> </div> <pre><span id="VALh"><span class="keyword">val</span> h</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">h r</code> is the index height in number of <em>samples</em>.<br> </div> <pre><span id="VALd"><span class="keyword">val</span> d</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">d r</code> is the index depth in number of <em>samples</em>.<br> </div> <pre><span id="VALsample_format"><span class="keyword">val</span> sample_format</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.Raster.html#TYPEsample_format">sample_format</a></code></pre><div class="info"> <code class="code">f_sample_format r</code> is <code class="code">r</code>'s sample format.<br> </div> <pre><span id="VALbuffer"><span class="keyword">val</span> buffer</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.Raster.html#TYPEbuffer">buffer</a></code></pre><div class="info"> <code class="code">buffer r</code> is <code class="code">r</code>'s format.<br> </div> <br> <h2 id="2_Functions">Functions</h2><br> <pre><span id="VALdim"><span class="keyword">val</span> dim</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">dim r</code> is <code class="code">r</code>'s index dimension from 1 to 3.<br> </div> <pre><span id="VALsize2"><span class="keyword">val</span> size2</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.html#TYPEsize2">Gg.size2</a></code></pre><div class="info"> <code class="code">size2 r</code> is <code class="code">r</code>'s index width and height as floats.<br> </div> <pre><span id="VALsize3"><span class="keyword">val</span> size3</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.html#TYPEsize3">Gg.size3</a></code></pre><div class="info"> <code class="code">size3 r</code> is <code class="code">r</code>'s index width, height and depth as floats.<br> </div> <pre><span id="VALsub"><span class="keyword">val</span> sub</span> : <code class="type">?x:int -><br> ?y:int -> ?z:int -> ?w:int -> ?h:int -> ?d:int -> <a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.Raster.html#TYPEt">t</a></code></pre><div class="info"> <code class="code">sub x y z w h d r</code> is a raster corresponding to a subset of the index of <code class="code">r</code>. Both <code class="code">r</code> and the resulting raster share the same buffer. <ul> <li><code class="code">x</code>, <code class="code">y</code>, <code class="code">z</code>, new sample origin of the raster data, defaults to <code class="code">(0, 0, 0)</code>.</li> <li><code class="code">w</code>, <code class="code">h</code>, <code class="code">d</code>, new size of the index, defaults to <code class="code">r</code>'s sizes minus the new sample origin.</li> </ul> <br> <b>Raises</b> <code>Invalid_argument,</code> if the sample format of <code class="code">r</code> is packed, if the origin is out of bounds or if new size is larger than <code class="code">r</code>'s size.<br> </div> <pre><span id="VALpitches"><span class="keyword">val</span> pitches</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> int * int * int</code></pre><div class="info"> <code class="code">pitches r</code> is <code class="code">(x_pitch, y_pitch, z_pitch)</code> where <ul> <li><code class="code">x_pitch</code> is the number of buffer scalars from sample to sample.</li> <li><code class="code">y_pitch</code> is the number of buffer scalars from line to line.</li> <li><code class="code">z_pitch</code> is the number of buffer scalars from plane to plane.</li> </ul> The buffer index where the sample <code class="code">(x,y,z)</code> starts is given by: <pre class="codepre"><code class="code">(<span class="constructor">Raster</span>.first r) + z * z_pitch + y * y_pitch + x * x_pitch<br> </code></pre><br> <b>Raises</b> <code>Invalid_argument</code> if the sample format of <code class="code">r</code> is packed.<br> </div> <br> <h2 id="2_Predicatesandcomparisons">Predicates and comparisons</h2><br> <pre><span id="VALequal"><span class="keyword">val</span> equal</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.Raster.html#TYPEt">t</a> -> bool</code></pre><div class="info"> <code class="code">equal r r'</code> is <code class="code">r = r'</code>.<br> </div> <pre><span id="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> <a href="Gg.Raster.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">compare r r'</code> is <code class="code"><span class="constructor">Pervasives</span>.compare r r'</code>.<br> </div> <br> <h2 id="2_Printers">Printers</h2><br> <pre><span id="VALto_string"><span class="keyword">val</span> to_string</span> : <code class="type"><a href="Gg.Raster.html#TYPEt">t</a> -> string</code></pre><div class="info"> <code class="code">to_string r</code> is a textual representation of <code class="code">r</code>. Doesn't print the buffer samples.<br> </div> <pre><span id="VALpp"><span class="keyword">val</span> pp</span> : <code class="type">Format.formatter -> <a href="Gg.Raster.html#TYPEt">t</a> -> unit</code></pre><div class="info"> <code class="code">pp ppf t</code> prints a textual represenation of <code class="code">t</code> on <code class="code">ppf</code>. Doesn't print the buffer samples.<br> </div> </body></html>