Branch: Tag:

2002-04-06

2002-04-06 21:28:16 by Martin Nilsson <mani@lysator.liu.se>

not_extracted -> chapters

Rev: refdoc/structure/onepage.xml:1.3
Rev: refdoc/structure/traditional.xml:1.12

1:   <!doctype html><html><head><title>Pike Reference Manual</title>   <meta charset='utf-8'></head> - <body><dl><dt><h1 class='header'>9. 3D Vector Graphics</h1></dt><dd><dl><dt><h2 class='header'>Module <b class='ms datatype'>GL</b></h2> + <body><dl><dt><h1 class='header'>9. Image Module</h1></dt><dd><dl><dt><h2 class='header'>Class <b class='ms datatype'>Image.Image</b></h2>   </dt><dd><dl class='group--doc'>   <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Not implemented methods:</p> - <p><table class='box'> - <tr><td>glAreTexturesResident</td></tr> - <tr><td>glBitmap</td></tr> - <tr><td>glBlendColorEXT</td></tr> - <tr><td>glCallLists</td></tr> - <tr><td>glColorPointer</td></tr> - <tr><td>glDeleteTextures</td></tr> - <tr><td>glDrawElements</td></tr> - <tr><td>glEdgeFlagPointer</td></tr> - <tr><td>glEdgeFlagv</td></tr> - <tr><td>glEvalMesh</td></tr> - <tr><td>glFeedbackBuffer</td></tr> - <tr><td>glGenTextures</td></tr> - <tr><td>glGetBooleanv</td></tr> - <tr><td>glGetClipPlane</td></tr> - <tr><td>glGetDoublev</td></tr> - <tr><td>glGetFloatv</td></tr> - <tr><td>glGetIntegerv</td></tr> - <tr><td>glGetLightfv</td></tr> - <tr><td>glGetLightiv</td></tr> - <tr><td>glGetMapdv</td></tr> - <tr><td>glGetMapfv</td></tr> - <tr><td>glGetMapiv</td></tr> - <tr><td>glGetMaterialfv</td></tr> - <tr><td>glGetMaterialiv</td></tr> - <tr><td>glGetPixelMapfv</td></tr> - <tr><td>glGetPixelMapuiv</td></tr> - <tr><td>glGetPixelMapusv</td></tr> - <tr><td>glGetPointerv</td></tr> - <tr><td>glGetPolygonStipple</td></tr> - <tr><td>glGetTexEnvfv</td></tr> - <tr><td>glGetTexEnviv</td></tr> - <tr><td>glGetTexGendv</td></tr> - <tr><td>glGetTexGenfv</td></tr> - <tr><td>glGetTexGeniv</td></tr> - <tr><td>glGetTexImage</td></tr> - <tr><td>glGetTexLevelParameterfv</td></tr> - <tr><td>glGetTexLevelParameteriv</td></tr> - <tr><td>glGetTexParameterfv</td></tr> - <tr><td>glGetTexParameteriv</td></tr> - <tr><td>glIndexPointer</td></tr> - <tr><td>glInterleavedArrays</td></tr> - <tr><td>glMap1</td></tr> - <tr><td>glMap2</td></tr> - <tr><td>glMapGrid</td></tr> - <tr><td>glNormalPointer</td></tr> - <tr><td>glPixelMapfv</td></tr> - <tr><td>glPixelMapuiv</td></tr> - <tr><td>glPixelMapusv</td></tr> - <tr><td>glPixelStore</td></tr> - <tr><td>glPixelTransfer</td></tr> - <tr><td>glPolygonStipple</td></tr> - <tr><td>glPrioritizeTextures</td></tr> - <tr><td>glReadPixels</td></tr> - <tr><td>glRect</td></tr> - <tr><td>glSelectBuffer</td></tr> - <tr><td>glTexCoordPointer</td></tr> - <tr><td>glTexImage1D</td></tr> - <tr><td>glTexSubImage1D</td></tr> - <tr><td>glVertexPointer</td></tr> - </table> + <dd class='body--doc'> + <p> + The main object of the <code>Image</code> module, this object + is used as drawing area, mask or result of operations.</p> +  + <p>basic: <br /> + <code>clear</code>, + <code>clone</code>, + <code>create</code>, + <code>xsize</code>, + <code>ysize</code></p> +  + <p>plain drawing: <br /> + <code>box</code>, + <code>circle</code>, + <code>getpixel</code>, + <code>line</code>, + <code>setcolor</code>, + <code>setpixel</code>, + <code>threshold</code>, + <code>polyfill</code></p> +  + <p>operators: <br /> + <code>`&amp;</code>, + <code>`*</code>, + <code>`+</code>, + <code>`-</code>, + <code>`==</code>, + <code>`&gt;</code>, + <code>`&lt;</code>, + <code>`|</code></p> +  + <p>pasting images: <br /> + <code>paste</code>, + <code>paste_alpha</code>, + <code>paste_alpha_color</code>, + <code>paste_mask</code></p> +  + <p>getting subimages, scaling, rotating: <br /> + <code>autocrop</code>, + <code>clone</code>, + <code>copy</code>, + <code>dct</code>, + <code>mirrorx</code>, + <code>rotate</code>, + <code>rotate_ccw</code>, + <code>rotate_cw</code>, + <code>rotate_expand</code>, + <code>scale</code>, + <code>skewx</code>, + <code>skewx_expand</code>, + <code>skewy</code>, + <code>skewy_expand</code></p> +  + <p>calculation by pixels: <br /> + <code>apply_matrix</code>, + <code>change_color</code>, + <code>color</code>, + <code>distancesq</code>, + <code>grey</code>, + <code>invert</code>, + <code>modify_by_intensity</code>, + <code>outline</code> + <code>select_from</code>, + <code>rgb_to_hsv</code>, + <code>hsv_to_rgb</code>,<br /></p> +  + <p><code>average</code>, + <code>max</code>, + <code>min</code>, + <code>sum</code>, + <code>sumf</code>, + <code>find_min</code>, + <code>find_max</code></p> +  + <p>special pattern drawing:<br /> + <code>noise</code>, + <code>turbulence</code>, + <code>test</code>, + <code>tuned_box</code>, + <code>gradients</code>, + <code>random</code>   </p> - </dd></dl> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>Image</code>, <code>Image.Font</code>, <code>Image.Colortable</code>, <code>Image.X</code></p></dd></dl>      <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glAccum</b></span> + <span class='homogen--name'><b>`/</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>`%</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glAccum</span>(</b><code class='datatype'>int</code> <code class='argument'>op</code>, <code class='datatype'>float</code> <code class='argument'>value</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;/&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;/&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;/&#32;<code class='class'>value</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;%&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;%&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;%&#32;<code class='class'>value</code></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The accumulation buffer is an extended-range color buffer. - Images are not rendered into it. - Rather, - images rendered into one of the color buffers - are added to the contents of the accumulation buffer after rendering. - Effects such as antialiasing (of points, lines, and polygons), - motion blur, - and depth of field can be created - by accumulating images generated with different transformation matrices.</p> - <p>Each pixel in the accumulation buffer consists of - red, green, blue, and alpha values. - The number of bits per component in the accumulation buffer - depends on the implementation. You can examine this number - by calling <code>glGetIntegerv</code> four times, - with arguments <code>GL_ACCUM_RED_BITS</code>, - <code>GL_ACCUM_GREEN_BITS</code>, - <code>GL_ACCUM_BLUE_BITS</code>, - and <code>GL_ACCUM_ALPHA_BITS</code>. - Regardless of the number of bits per component, - the range of values stored by each component is [-1, 1]. - The accumulation buffer pixels are mapped one-to-one with frame buffer pixels.</p> - <p><code>glAccum</code> operates on the accumulation buffer. - The first argument, <i>op</i>, - is a symbolic constant that selects an accumulation buffer operation. - The second argument, <i>value</i>, - is a floating-point value to be used in that operation. - Five operations are specified: - <code>GL_ACCUM</code>, <code>GL_LOAD</code>, <code>GL_ADD</code>, - <code>GL_MULT</code>, and <code>GL_RETURN</code>.</p> - <p>All accumulation buffer operations are limited - to the area of the current scissor box and applied identically to - the red, green, blue, and alpha components of each pixel. - If a <code>glAccum</code> operation results in a value outside the range [-1, 1], - the contents of an accumulation buffer pixel component are undefined.</p> - <p>The operations are as follows:</p> - <p><table class='box'> - <tr><td><code>GL_ACCUM</code> - </td><td>Obtains R, G, B, and A values - from the buffer currently selected for reading (see <code>glReadBuffer</code>). - Each component value is divided by 2n1, - where n is the number of bits allocated to each color component - in the currently selected buffer. - The result is a floating-point value in the range [0, 1], - which is multiplied by <i>value</i> and added to the corresponding pixel component - in the accumulation buffer, - thereby updating the accumulation buffer. - </td></tr> - <tr><td><code>GL_LOAD</code> - </td><td>Similar to <code>GL_ACCUM</code>, - except that the current value in the accumulation buffer is not used - in the calculation of the new value. - That is, the R, G, B, and A values from the currently selected buffer - are divided by 2n1, - multiplied by <i>value</i>, - and then stored in the corresponding accumulation buffer cell, - overwriting the current value. - </td></tr> - <tr><td><code>GL_ADD</code> - </td><td>Adds <i>value</i> to each R, G, B, and A - in the accumulation buffer. - </td></tr> - <tr><td><code>GL_MULT</code> - </td><td>Multiplies each R, G, B, and A - in the accumulation buffer by <i>value</i> and returns the scaled component - to its corresponding accumulation buffer location. - </td></tr> - <tr><td><code>GL_RETURN</code> - </td><td>Transfers accumulation buffer values - to the color buffer or buffers currently selected for writing. - Each R, G, B, and A component is multiplied by <i>value</i>, - then multiplied by 2n1, - clamped to the range [0, 2n1 ], and stored - in the corresponding display buffer cell. - The only fragment operations that are applied to this transfer are - pixel ownership, - scissor, - dithering, - and color writemasks. - </td></tr> - </table> - </p> - <p>To clear the accumulation buffer, call <code>glClearAccum</code> with R, G, B, - and A values to set it to, then call <code>glClear</code> with the - accumulation buffer enabled.</p> + <dd class='body--doc'> + <p>Divides pixel values and creates a new image from the result or + the rest.</p>   </dd> - <dt class='head--doc'><span id='p-op'></span>Parameter <code class='parameter'>op</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the accumulation buffer operation. - Symbolic constants - <code>GL_ACCUM</code>, - <code>GL_LOAD</code>, - <code>GL_ADD</code>, - <code>GL_MULT</code>, - and - <code>GL_RETURN</code> are accepted.</p> - </dd> + <dt class='head--doc'><span id='p-operand'></span>Parameter <code class='parameter'>operand</code></dt> + <dd></dd><dd class='body--doc'><p>the other image to divide with; + the images must have the same size.</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd>   <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a floating-point value used in the accumulation buffer operation. - <i>op</i> determines how <i>value</i> is used.</p> + <dd></dd><dd class='body--doc'><p>if specified as color or value, it will act as a whole + image of that color (or value).</p> +  + <p></p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>op</i> is not an accepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if there is no accumulation buffer.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glAccum</code> - is executed between the execution of - <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>It isn't possible to do a modulo 256 either. (why?)</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>`-</code>, <code>`+</code>, <code>`|</code>, <code>`&amp;amp;</code>, <code>`*</code>, <code>Image.Layer</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glAlphaFunc</b></span> + <span class='homogen--name'><b>`&amp;</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glAlphaFunc</span>(</b><code class='datatype'>int</code> <code class='argument'>func</code>, <code class='datatype'>float</code> <code class='argument'>ref</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;&amp;&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;&amp;&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;&amp;&#32;<code class='class'>value</code></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The alpha test discards fragments depending on the outcome of a comparison - between an incoming fragment's alpha value and a constant reference value. - <code>glAlphaFunc</code> specifies the reference value and the comparison function. - The comparison is performed only if alpha testing is enabled. By - default, it is not enabled. - (See - <code>glEnable</code> and <code>glDisable</code> of <code>GL_ALPHA_TEST</code>.)</p> - <p><i>func</i> and <i>ref</i> specify the conditions under which - the pixel is drawn. - The incoming alpha value is compared to <i>ref</i> - using the function specified by <i>func</i>. - If the value passes the comparison, - the incoming fragment is drawn - if it also passes subsequent stencil and depth buffer tests. - If the value fails the comparison, - no change is made to the frame buffer at that pixel location. The - comparison functions are as follows: </p> - <p><table class='box'> - <tr><td><code>GL_NEVER</code> - </td><td>Never passes. - </td></tr> - <tr><td><code>GL_LESS</code> - </td><td>Passes if the incoming alpha value is less than the reference value. - </td></tr> - <tr><td><code>GL_EQUAL</code> - </td><td>Passes if the incoming alpha value is equal to the reference value. - </td></tr> - <tr><td><code>GL_LEQUAL</code> - </td><td>Passes if the incoming alpha value is less than or equal to the reference value. - </td></tr> - <tr><td><code>GL_GREATER</code> - </td><td>Passes if the incoming alpha value is greater than the reference value. - </td></tr> - <tr><td><code>GL_NOTEQUAL</code> - </td><td>Passes if the incoming alpha value is not equal to the reference value. - </td></tr> - <tr><td><code>GL_GEQUAL</code> - </td><td>Passes if the incoming alpha value is greater than or equal to - the reference value. - </td></tr> - <tr><td><code>GL_ALWAYS</code> - </td><td>Always passes (initial value). - </td></tr> - </table> + <dd class='body--doc'> + <p>makes a new image out of the minimum pixels values   </p> - <p><code>glAlphaFunc</code> operates on all pixel write operations, - including those resulting from the scan conversion of points, - lines, - polygons, - and bitmaps, - and from pixel draw and copy operations. - <code>glAlphaFunc</code> does not affect screen clear operations.</p> +    </dd> - <dt class='head--doc'><span id='p-func'></span>Parameter <code class='parameter'>func</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the alpha comparison function. - Symbolic constants - <code>GL_NEVER</code>, - <code>GL_LESS</code>, - <code>GL_EQUAL</code>, - <code>GL_LEQUAL</code>, - <code>GL_GREATER</code>, - <code>GL_NOTEQUAL</code>, - <code>GL_GEQUAL</code>, and - <code>GL_ALWAYS</code> are accepted. The initial value is <code>GL_ALWAYS</code>.</p> + <dt class='head--doc'><span id='p-operand'></span>Parameter <code class='parameter'>operand</code></dt> + <dd></dd><dd class='body--doc'><p>the other image to compare with; + the images must have the same size.</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd><dd class='body--doc'><p>an array in format ({r,g,b}), this is equal + to using an uniform-colored image.</p></dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>equal to ({value,value,value}).</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'><span id='p-ref'></span>Parameter <code class='parameter'>ref</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the reference value that incoming alpha values are compared to. - This value is clamped to the range 0 through 1, - where 0 represents the lowest possible alpha value - and 1 the highest possible value. - The initial reference value - is 0.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>`-</code>, <code>`+</code>, <code>`|</code>, <code>`*</code>, <code>Image.Layer</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>`*</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;*&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;*&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;*&#32;<code class='class'>value</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;*&#32;<code class='class'>value</code></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Multiplies pixel values and creates a new image. + This can be useful to lower the values of an image, + making it greyer, for instance:</p> +  + <p><pre>image=image*128+64;</pre> + </p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>func</i> is not an accepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glAlphaFunc</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'><span id='p-operand'></span>Parameter <code class='parameter'>operand</code></dt> + <dd></dd><dd class='body--doc'><p>the other image to multiply with; + the images must have the same size.</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd><dd class='body--doc'><p>an array in format ({r,g,b}), this is equal + to using an uniform-colored image.</p></dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>equal to ({value,value,value}). + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>`-</code>, <code>`+</code>, <code>`|</code>, <code>`&amp;amp;</code>, <code>Image.Layer</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glArrayElement</b></span> + <span class='homogen--name'><b>`+</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glArrayElement</span>(</b><code class='datatype'>int</code> <code class='argument'>i</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;+&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;+&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;+&#32;<code class='class'>value</code></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glArrayElement</code> commands are used within <code>glBegin</code>/<code>glEnd</code> pairs to - specify vertex and attribute data for point, line, and polygon - primitives. If <code>GL_VERTEX_ARRAY</code> is enabled when <code>glArrayElement</code> is called, a - single vertex is drawn, using - vertex and attribute data taken from location <i>i</i> of the enabled - arrays. If <code>GL_VERTEX_ARRAY</code> is not enabled, no drawing occurs but - the attributes corresponding to the enabled arrays are modified. </p> - <p>Use <code>glArrayElement</code> to construct primitives by indexing vertex data, rather than - by streaming through arrays of data in first-to-last order. Because - each call specifies only a single vertex, it is possible to explicitly - specify per-primitive attributes such as a single normal per - individual triangle.</p> - <p>Changes made to array data between the execution of <code>glBegin</code> and the - corresponding execution of <code>glEnd</code> may affect calls to <code>glArrayElement</code> that are made - within the same <code>glBegin</code>/<code>glEnd</code> period in non-sequential ways. - That is, a call to </p> - <p><code>glArrayElement</code> that precedes a change to array data may - access the changed data, and a call that follows a change to array data - may access original data.</p> + <dd class='body--doc'> + <p>adds two images; values are truncated at 255.</p>   </dd> - <dt class='head--doc'><span id='p-i'></span>Parameter <code class='parameter'>i</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies an index into the enabled vertex data arrays.</p> - </dd></dl> + <dt class='head--doc'><span id='p-operand'></span>Parameter <code class='parameter'>operand</code></dt> + <dd></dd><dd class='body--doc'><p>the image which to add.</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd><dd class='body--doc'><p>an array in format ({r,g,b}), this is equal + to using an uniform-colored image.</p></dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>equal to ({value,value,value}).</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>`-</code>, <code>`|</code>, <code>`&amp;amp;</code>, <code>`*</code>, <code>Image.Layer</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glBegin</b></span> + <span class='homogen--name'><b>`-</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glBegin</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;-&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;-&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;-&#32;<code class='class'>value</code></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glBegin</code> and <code>glEnd</code> delimit the vertices that define a primitive or - a group of like primitives. - <code>glBegin</code> accepts a single argument that specifies in which of ten ways the - vertices are interpreted. - Taking <i>n</i> as an integer count starting at one, - and <i>N</i> as the total number of vertices specified, - the interpretations are as follows:</p> - <p><table class='box'> - <tr><td><code>GL_POINTS</code> - </td><td>Treats each vertex as a single point. - Vertex <i>n</i> defines point <i>n</i>. - <i>N</i> points are drawn. - </td></tr> - <tr><td><code>GL_LINES</code> - </td><td>Treats each pair of vertices as an independent line segment. - Vertices <i>2n-1</i> and <i>2n</i> define line <i>n</i>. - <i>N/2</i> lines are drawn. - </td></tr> - <tr><td><code>GL_LINE_STRIP</code> - </td><td>Draws a connected group of line segments from the first vertex - to the last. - Vertices <i>n</i> and <i>n+1</i> define line <i>n</i>. - <i>N-1</i> lines are drawn. - </td></tr> - <tr><td><code>GL_LINE_LOOP</code> - </td><td>Draws a connected group of line segments from the first vertex - to the last, - then back to the first. - Vertices <i>n</i> and <i>n+1</i> define line <i>n</i>. - The last line, however, is defined by vertices <i>N</i> and <i>1</i>. - <i>N</i> lines are drawn. - </td></tr> - <tr><td><code>GL_TRIANGLES</code> - </td><td>Treats each triplet of vertices as an independent triangle. - Vertices <i>3n-2</i>, - <i>3n-1</i>, - and <i>3n</i> define triangle <i>n</i>. - <i>N/3</i> triangles are drawn. - </td></tr> - <tr><td><code>GL_TRIANGLE_STRIP</code> - </td><td>Draws a connected group of triangles. - One triangle is defined for each vertex presented after the first two vertices. - For odd <i>n</i>, vertices <i>n</i>, - <i>n+1</i>, - and <i>n+2</i> define triangle <i>n</i>. - For even <i>n</i>, - vertices <i>n+1</i>, - <i>n</i>, - and <i>n+2</i> define triangle <i>n</i>. - <i>N-2</i> triangles are drawn. - </td></tr> - <tr><td><code>GL_TRIANGLE_FAN</code> - </td><td>Draws a connected group of triangles. - One triangle is defined for each vertex presented after the first two vertices. - Vertices <i>1</i>, - <i>n+1</i>, - and <i>n+2</i> define triangle <i>n</i>. - <i>N-2</i> triangles are drawn. - </td></tr> - <tr><td><code>GL_QUADS</code> - </td><td>Treats each group of four vertices as an independent quadrilateral. - Vertices <i>4n-3</i>, - <i>4n-2</i>, - <i>4n-1</i>, - and <i>4n</i> define quadrilateral <i>n</i>. - <i>N/4</i> quadrilaterals are drawn. - </td></tr> - <tr><td><code>GL_QUAD_STRIP</code> - </td><td>Draws a connected group of quadrilaterals. - One quadrilateral is defined for each pair of vertices presented - after the first pair. - Vertices <i>2n-1</i>, - <i>2n</i>, - <i>2n+2</i>, - and <i>2n+1</i> define quadrilateral <i>n</i>. - <i>N/2-1</i> quadrilaterals are drawn. - Note that the order in which vertices are used to construct a quadrilateral - from strip data is different from that used with independent data. - </td></tr> - <tr><td><code>GL_POLYGON</code> - </td><td>Draws a single, - convex polygon. - Vertices <i>1</i> through <i>N</i> define this polygon. - </td></tr> - </table> - </p> - <p>Only a subset of GL commands can be used between <code>glBegin</code> and <code>glEnd</code>. - The commands are - <code>glVertex</code>, - <code>glColor</code>, - <code>glIndex</code>, - <code>glNormal</code>, - <code>glTexCoord</code>, - <code>glEvalCoord</code>, - <code>glEvalPoint</code>, - <code>glArrayElement</code>, - <code>glMaterial</code>, and - <code>glEdgeFlag</code>. - Also, - it is acceptable to use - <code>glCallList</code> or - <code>glCallLists</code> to execute - display lists that include only the preceding commands. - If any other GL command is executed between <code>glBegin</code> and <code>glEnd</code>, - the error flag is set and the command is ignored.</p> - <p>Regardless of the value chosen for <i>mode</i>, - there is no limit to the number of vertices that can be defined - between <code>glBegin</code> and <code>glEnd</code>. - Lines, - triangles, - quadrilaterals, - and polygons that are incompletely specified are not drawn. - Incomplete specification results when either too few vertices are - provided to specify even a single primitive or when an incorrect multiple - of vertices is specified. The incomplete primitive is ignored; the rest are drawn.</p> - <p>The minimum specification of vertices - for each primitive is as follows: - 1 for a point, - 2 for a line, - 3 for a triangle, - 4 for a quadrilateral, - and 3 for a polygon. - Modes that require a certain multiple of vertices are - <code>GL_LINES</code> (2), - <code>GL_TRIANGLES</code> (3), - <code>GL_QUADS</code> (4), - and <code>GL_QUAD_STRIP</code> (2).</p> + <dd class='body--doc'> + <p>makes a new image out of the difference</p>   </dd> - <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the primitive or primitives that will be created from vertices - presented between <code>glBegin</code> and the subsequent <code>glEnd</code>. - Ten symbolic constants are accepted: - <code>GL_POINTS</code>, - <code>GL_LINES</code>, - <code>GL_LINE_STRIP</code>, - <code>GL_LINE_LOOP</code>, - <code>GL_TRIANGLES</code>, - <code>GL_TRIANGLE_STRIP</code>, - <code>GL_TRIANGLE_FAN</code>, - <code>GL_QUADS</code>, - <code>GL_QUAD_STRIP</code>, and - <code>GL_POLYGON</code>.</p> + <dt class='head--doc'><span id='p-operand'></span>Parameter <code class='parameter'>operand</code></dt> + <dd></dd><dd class='body--doc'><p>the other image to compare with; + the images must have the same size.</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd><dd class='body--doc'><p>an array in format ({r,g,b}), this is equal + to using an uniform-colored image.</p></dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>equal to ({value,value,value}).</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is set to an unaccepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glBegin</code> is executed between a - <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEnd</code> is executed without being - preceded by a <code>glBegin</code>.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if a command other than - <code>glVertex</code>, - <code>glColor</code>, - <code>glIndex</code>, - <code>glNormal</code>, - <code>glTexCoord</code>, - <code>glEvalCoord</code>, - <code>glEvalPoint</code>, - <code>glArrayElement</code>, - <code>glMaterial</code>, - <code>glEdgeFlag</code>, - <code>glCallList</code>, or - <code>glCallLists</code> is executed between - the execution of <code>glBegin</code> and the corresponding - execution <code>glEnd</code>.</p> - <p>Execution of - <code>glEnableClientState</code>, - <code>glDisableClientState</code>, - <code>glEdgeFlagPointer</code>, - <code>glTexCoordPointer</code>, - <code>glColorPointer</code>, - <code>glIndexPointer</code>, - <code>glNormalPointer</code>,</p> - <p><code>glVertexPointer</code>, - <code>glInterleavedArrays</code>, or - <code>glPixelStore</code> is not allowed after a call to <code>glBegin</code> and before - the corresponding call to <code>glEnd</code>, - but an error may or may not be generated.</p> - </dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>`+</code>, <code>`|</code>, <code>`&amp;amp;</code>, <code>`*</code>, <code>Image.Layer</code>, <code>min</code>, <code>max</code>, <code>`==</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glBindTexture</b></span> + <span class='homogen--name'><b>`==</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>`&lt;</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>`&gt;</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glBindTexture</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>texture</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;==&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;==&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;==&#32;<code class='class'>value</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;&lt;&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;&lt;&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;&lt;&#32;<code class='class'>value</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;&gt;&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;&gt;&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>int </code> res = <code class='class'>Image.Image()</code>&#32;&gt;&#32;<code class='class'>value</code></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glBindTexture</code> lets you create or use a named texture. Calling <code>glBindTexture</code> with </p> - <p><i>target</i> set to - <code>GL_TEXTURE_1D</code> or <code>GL_TEXTURE_2D</code> and <i>texture</i> set to the name - of the newtexture binds the texture name to the target. - When a texture is bound to a target, the previous binding for that - target is automatically broken.</p> - <p>Texture names are unsigned integers. The value zero is reserved to - represent the default texture for each texture target. - Texture names and the corresponding texture contents are local to - the shared display-list space (see <code>glXCreateContext</code>) of the current - GL rendering context; - two rendering contexts share texture names only if they - also share display lists.</p> - <p>You may use <code>glGenTextures</code> to generate a set of new texture names.</p> - <p>When a texture is first bound, it assumes the dimensionality of its - target: A texture first bound to <code>GL_TEXTURE_1D</code> becomes - 1-dimensional and a texture first bound to <code>GL_TEXTURE_2D</code> becomes - 2-dimensional. The state of a 1-dimensional texture - immediately after it is first bound is equivalent to the state of the - default <code>GL_TEXTURE_1D</code> at GL initialization, and similarly for - 2-dimensional textures.</p> - <p>While a texture is bound, GL operations on the target to which it is - bound affect the bound texture, and queries of the target to which it - is bound return state from the bound texture. If texture mapping of - the dimensionality of the target to which a texture is bound is - active, the bound texture is used. - In effect, the texture targets become aliases for the textures currently - bound to them, and the texture name zero refers to the default textures - that were bound to them at initialization.</p> - <p>A texture binding created with <code>glBindTexture</code> remains active until a different - texture is bound to the same target, or until the bound texture is - deleted with <code>glDeleteTextures</code>.</p> - <p>Once created, a named texture may be re-bound to the target of the - matching dimensionality as often as needed. - It is usually much faster to use <code>glBindTexture</code> to bind an existing named - texture to one of the texture targets than it is to reload the texture image - using <code>glTexImage1D</code> or <code>glTexImage2D</code>. - For additional control over performance, use - <code>glPrioritizeTextures</code>.</p> - <p><code>glBindTexture</code> is included in display lists.</p> + <dd class='body--doc'> + <p>Compares an image with another image or a color.</p> +  + <p>Comparision is strict and on pixel-by-pixel basis. + (Means if not all pixel r,g,b values are + correct compared with the corresponding + pixel values, 0 is returned.) + </p>   </dd> - <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the target to which the texture is bound. - Must be either - <code>GL_TEXTURE_1D</code> or - <code>GL_TEXTURE_2D</code>.</p> + <dt class='head--doc'><span id='p-operand'></span>Parameter <code class='parameter'>operand</code></dt> + <dd></dd><dd class='body--doc'><p>the other image to compare with; + the images must have the same size.</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd><dd class='body--doc'><p>an array in format ({r,g,b}), this is equal + to using an uniform-colored image.</p></dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>equal to ({value,value,value}).</p> +  + <p></p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>true (1) or false (0).</p>   </dd> - <dt class='head--doc'><span id='p-texture'></span>Parameter <code class='parameter'>texture</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the name of a texture.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>`&lt; or `&gt; on empty ("no image") image objects or images + with different size will result in an error. + `== is always true on two empty image objects and + always false if one and only one of the image objects + is empty or the images differs in size.</p> +  + <p>a&gt;=b and a&lt;=b between objects is equal to !(a&lt;b) and !(a&gt;b), + which may not be what you want (since both &lt; and &gt; can return + false, comparing the same images).</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not one of the allowable - values.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <i>texture</i> has a dimensionality - which doesn't match that of <i>target</i>.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glBindTexture</code> is executed - between the execution of <code>glBegin</code> and the corresponding - execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>`-</code>, <code>`+</code>, <code>`|</code>, <code>`*</code>, <code>`&amp;amp;</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glBlendFunc</b></span> + <span class='homogen--name'><b>`|</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glBlendFunc</span>(</b><code class='datatype'>int</code> <code class='argument'>sfactor</code>, <code class='datatype'>int</code> <code class='argument'>dfactor</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;|&#32;<code class='class'>operand</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;|&#32;<code class='class'>color</code></code><br> + <code><code class='object unresolved'>object </code> res = <code class='class'>Image.Image()</code>&#32;|&#32;<code class='class'>value</code></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>In RGBA mode, pixels can be drawn using a function that blends - the incoming (source) RGBA values with the RGBA values - that are already in the frame buffer (the destination values). - Blending is initially disabled. - Use <code>glEnable</code> and <code>glDisable</code> with argument <code>GL_BLEND</code> - to enable and disable blending.</p> - <p><code>glBlendFunc</code> defines the operation of blending when it is enabled. - <i>sfactor</i> specifies which of nine methods is used to scale the - source color components. - <i>dfactor</i> specifies which of eight methods is used to scale the - destination color components. - The eleven possible methods are described in the following table. - Each method defines four scale factors, - one each for red, green, blue, and alpha.</p> - <p>In the table and in subsequent equations, source and destination - color components are referred to as - (R sub s , G sub s , B sub s , A sub s ) and - (R sub d , G sub d , B sub d , A sub d ). - They are understood to have integer values between 0 and - (k sub R , k sub G , k sub B , k sub A ), - where</p> - <p>.RS - .ce - k sub c ~=~ 2 sup m sub c - 1 - .RE</p> - <p>and - (m sub R , m sub G , m sub B , m sub A ) - is the number of red, - green, - blue, - and alpha bitplanes.</p> - <p>Source and destination scale factors are referred to as - (s sub R , s sub G , s sub B , s sub A ) and - (d sub R , d sub G , d sub B , d sub A ). - The scale factors described in the table, - denoted (f sub R , f sub G , f sub B , f sub A ), - represent either source or destination factors. - All scale factors have range [0,1].</p> - <p>.TS - center box ; - ci | ci - c | c . - parameter (f sub R , ~~ f sub G , ~~ f sub B , ~~ f sub A ) - = - <code>GL_ZERO</code> (0, ~0, ~0, ~0 ) - <code>GL_ONE</code> (1, ~1, ~1, ~1 ) - <code>GL_SRC_COLOR</code> (R sub s / k sub R , ~G sub s / k sub G , ~B sub s / k sub B , ~A sub s / k sub A ) - <code>GL_ONE_MINUS_SRC_COLOR</code> (1, ~1, ~1, ~1 ) ~-~ (R sub s / k sub R , ~G sub s / k sub G , ~B sub s / k sub B , ~A sub s / k sub A ) - <code>GL_DST_COLOR</code> (R sub d / k sub R , ~G sub d / k sub G , ~B sub d / k sub B , ~A sub d / k sub A ) - <code>GL_ONE_MINUS_DST_COLOR</code> (1, ~1, ~1, ~1 ) ~-~ (R sub d / k sub R , ~G sub d / k sub G , ~B sub d / k sub B , ~A sub d / k sub A ) - <code>GL_SRC_ALPHA</code> (A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A ) - <code>GL_ONE_MINUS_SRC_ALPHA</code> (1, ~1, ~1, ~1 ) ~-~ (A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A ) - <code>GL_DST_ALPHA</code> (A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A ) - <code>GL_ONE_MINUS_DST_ALPHA</code> (1, ~1, ~1, ~1 ) ~-~ (A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A ) - <code>GL_SRC_ALPHA_SATURATE</code> (i, ~i, ~i, ~1 ) - .TE - .sp - In the table,</p> - <p>.RS - .nf</p> - <p>i ~=~ min (A sub s , ~k sub A - A sub d ) ~/~ k sub A - .fi - .RE</p> - <p>To determine the blended RGBA values of a pixel when drawing in RGBA mode, - the system uses the following equations:</p> - <p>.RS - .nf</p> - <p>R sub d ~=~ min ( k sub R , ~~ R sub s s sub R + R sub d d sub R ) - G sub d ~=~ min ( k sub G , ~~ G sub s s sub G + G sub d d sub G ) - B sub d ~=~ min ( k sub B , ~~ B sub s s sub B + B sub d d sub B ) - A sub d ~=~ min ( k sub A , ~~ A sub s s sub A + A sub d d sub A ) - .fi - .RE</p> - <p>Despite the apparent precision of the above equations, - blending arithmetic is not exactly specified, - because blending operates with imprecise integer color values. - However, - a blend factor that should be equal to 1 - is guaranteed not to modify its multiplicand, - and a blend factor equal to 0 reduces its multiplicand to 0. - For example, - when <i>sfactor</i> is <code>GL_SRC_ALPHA</code>, - <i>dfactor</i> is <code>GL_ONE_MINUS_SRC_ALPHA</code>, - and A sub s is equal to k sub A, - the equations reduce to simple replacement:</p> - <p>.RS - .nf</p> - <p>R sub d ~=~ R sub s - G sub d ~=~ G sub s - B sub d ~=~ B sub s - A sub d ~=~ A sub s - .fi - .RE</p> + <dd class='body--doc'> + <p>makes a new image out of the maximum pixels values + </p>   </dd> - <dt class='head--doc'><span id='p-sfactor'></span>Parameter <code class='parameter'>sfactor</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies how the red, green, blue, - and alpha source blending factors are computed. - Nine symbolic constants are accepted: - <code>GL_ZERO</code>, - <code>GL_ONE</code>, - <code>GL_DST_COLOR</code>, - <code>GL_ONE_MINUS_DST_COLOR</code>, - <code>GL_SRC_ALPHA</code>, - <code>GL_ONE_MINUS_SRC_ALPHA</code>, - <code>GL_DST_ALPHA</code>, - <code>GL_ONE_MINUS_DST_ALPHA</code>, and - <code>GL_SRC_ALPHA_SATURATE</code>. The initial value is <code>GL_ONE</code>.</p> + <dt class='head--doc'><span id='p-operand'></span>Parameter <code class='parameter'>operand</code></dt> + <dd></dd><dd class='body--doc'><p>the other image to compare with; + the images must have the same size.</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd><dd class='body--doc'><p>an array in format ({r,g,b}), this is equal + to using an uniform-colored image.</p></dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>equal to ({value,value,value}).</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'><span id='p-dfactor'></span>Parameter <code class='parameter'>dfactor</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies how the red, green, blue, - and alpha destination blending factors are computed. - Eight symbolic constants are accepted: - <code>GL_ZERO</code>, - <code>GL_ONE</code>, - <code>GL_SRC_COLOR</code>, - <code>GL_ONE_MINUS_SRC_COLOR</code>, - <code>GL_SRC_ALPHA</code>, - <code>GL_ONE_MINUS_SRC_ALPHA</code>, - <code>GL_DST_ALPHA</code>, and - <code>GL_ONE_MINUS_DST_ALPHA</code>. The initial value is <code>GL_ZERO</code>.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if either <i>sfactor</i> or <i>dfactor</i> is not an - accepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glBlendFunc</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>`-</code>, <code>`+</code>, <code>`&amp;amp;</code>, <code>`*</code>, <code>Image.Layer</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glCallList</b></span> + <span class='homogen--name'><b>apply_curve</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCallList</span>(</b><code class='datatype'>int</code> <code class='argument'>list</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>apply_curve</span>(</b><code class='datatype'>object</code> <code class='argument'>array(int(0..255</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>apply_curve</span>(</b><code class='datatype'>object</code> <code class='argument'>array(int(0..255</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>apply_curve</span>(</b><code class='datatype'>object</code> <code class='argument'>stringchannel</code>, <code class='datatype'>object</code> <code class='argument'>array(int(0..255</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glCallList</code> causes the named display list to be executed. - The commands saved in the display list are executed in order, - just as if they were called without using a display list. - If <i>list</i> has not been defined as a display list, - <code>glCallList</code> is ignored.</p> - <p><code>glCallList</code> can appear inside a display list. - To avoid the possibility of infinite recursion resulting from display lists - calling one another, - a limit is placed on the nesting level of display - lists during display-list execution. - This limit is at least 64, and it depends on the implementation.</p> - <p>GL state is not saved and restored across a call to <code>glCallList</code>. - Thus, - changes made to GL state during the execution of a display list - remain after execution of the display list is completed. - Use <code>glPushAttrib</code>, - <code>glPopAttrib</code>, - <code>glPushMatrix</code>, - and <code>glPopMatrix</code> to preserve GL state across <code>glCallList</code> calls.</p> + <dd class='body--doc'> + <p>Apply a lookup-table on all pixels in an image. + If only one curve is passed, use the same curve for red, green and blue. + If 'channel' is specified, the curve is only applied to the + specified channel.</p> +  + <p></p>   </dd> - <dt class='head--doc'><span id='p-list'></span>Parameter <code class='parameter'>list</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the integer name of the display list to be executed.</p> - </dd></dl> + <dt class='head--doc'><span id='p-curve_r'></span>Parameter <code class='parameter'>curve_r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-curve_g'></span>Parameter <code class='parameter'>curve_g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-curve_b'></span>Parameter <code class='parameter'>curve_b</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-curve'></span>Parameter <code class='parameter'>curve</code></dt> + <dd></dd><dd class='body--doc'><p>An array with 256 elements, each between 0 and 255. + It is used as a look-up table, if the pixel value is 2 and + curve[2] is 10, the new pixel value will be 10. + </p></dd> + <dt class='head--doc'><span id='p-channel'></span>Parameter <code class='parameter'>channel</code></dt> + <dd></dd><dd class='body--doc'><p>one of "red", "green", "blue", "value", "saturation" and "hue". + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>a new image object</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>gamma</code>, <code>`*</code>, <code>modify_by_intensity</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glClear</b></span> + <span class='homogen--name'><b>apply_matrix</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClear</span>(</b><code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>apply_matrix</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>))) <code class='argument'>matrix</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>apply_matrix</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>))) <code class='argument'>matrix</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>apply_matrix</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>))) <code class='argument'>matrix</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>div</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glClear</code> sets the bitplane area of the window to values previously selected - by <code>glClearColor</code>, <code>glClearIndex</code>, <code>glClearDepth</code>, - <code>glClearStencil</code>, and <code>glClearAccum</code>. - Multiple color buffers can be cleared simultaneously by selecting - more than one buffer at a time using <code>glDrawBuffer</code>.</p> - <p>The pixel ownership test, - the scissor test, - dithering, and the buffer writemasks affect the operation of <code>glClear</code>. - The scissor box bounds the cleared region. - Alpha function, - blend function, - logical operation, - stenciling, - texture mapping, - and depth-buffering are ignored by <code>glClear</code>.</p> - <p><code>glClear</code> takes a single argument that is the bitwise OR of several - values indicating which buffer is to be cleared.</p> - <p>The values are as follows: </p> - <p><table class='box'> - <tr><td><code>GL_COLOR_BUFFER_BIT</code> - </td><td>Indicates the buffers currently enabled for color - writing. + <dd class='body--doc'> + <p>Applies a pixel-transform matrix, or filter, to the image.</p> +  + <p><pre> +  2 2 + pixel(x,y)= base+ k ( sum sum pixel(x+k-1,y+l-1)*matrix(k,l) ) +  k=0 l=0 + </pre></p> +  + <p>1/k is sum of matrix, or sum of matrix multiplied with div. + base is given by r,g,b and is normally black.</p> +  + <p><table><tr><td rowspan='2'> + blur (ie a 2d gauss function): + <pre> + ({({1,2,1}), +  ({2,5,2}), +  ({1,2,1})}) + </pre> + </td><td> + <img height='115' src='../images/predef.Image.Image.apply_matrix.1.png' width='80' /> + </td><td> + <img height='115' src='../images/predef.Image.Image.apply_matrix.2.png' width='80' />   </td></tr> - <tr><td><code>GL_DEPTH_BUFFER_BIT</code> - </td><td>Indicates the depth buffer. + <tr><td></td><td>original</td></tr> +  + <tr><td> + sharpen (k&gt;8, preferably 12 or 16): + <pre> + ({({-1,-1,-1}), +  ({-1, k,-1}), +  ({-1,-1,-1})}) + </pre> + </td><td> + <img height='115' src='../images/predef.Image.Image.apply_matrix.3.png' width='80' />   </td></tr> - <tr><td><code>GL_ACCUM_BUFFER_BIT</code> - </td><td>Indicates the accumulation buffer. +  + <tr><td> + edge detect: + <pre> + ({({1, 1,1}), +  ({1,-8,1}), +  ({1, 1,1})}) + </pre> + </td><td> + <img height='115' src='../images/predef.Image.Image.apply_matrix.4.png' width='80' />   </td></tr> - <tr><td><code>GL_STENCIL_BUFFER_BIT</code> - </td><td>Indicates the stencil buffer. +  + <tr><td> + horisontal edge detect (get the idea): + <pre> + ({({0, 0,0}), +  ({1,-2,1}), +  ({0, 0,0})}) + </pre> + </td><td> + <img height='115' src='../images/predef.Image.Image.apply_matrix.5.png' width='80' />   </td></tr> - </table> +  + <tr><td rowspan='2'> + emboss (might prefer to begin with a <code>grey</code> image): + <pre> + ({({2, 1, 0}), +  ({1, 0,-1}), +  ({0,-1,-2})}), 128,128,128, 3 + </pre> + </td><td> + <img height='115' src='../images/predef.Image.Image.apply_matrix.6.png' width='80' /> + </td><td> + <img height='115' src='../images/predef.Image.Image.apply_matrix.7.png' width='80' /> + </td></tr> + <tr><td></td><td>greyed</td></tr></table></p> +  + <p>This function is not very fast.   </p> - <p>The value to which each buffer is cleared depends on the setting of the - clear value for that buffer.</p> +    </dd> - <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> - <dd></dd><dd class='body--doc'><p>Bitwise OR of masks that indicate the buffers to be cleared. - The four masks are - <code>GL_COLOR_BUFFER_BIT</code>, - <code>GL_DEPTH_BUFFER_BIT</code>, - <code>GL_ACCUM_BUFFER_BIT</code>, and - <code>GL_STENCIL_BUFFER_BIT</code>.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if any bit other than the four defined - bits is set in <i>mask</i>.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glClear</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'><span id='p-array'></span>Parameter <code class='parameter'>array</code></dt> + <dd></dd><dd class='body--doc'><p>the matrix; innermost is a value or an array with red, green, blue + values for red, green, blue separation.</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>base level of result, default is zero</p></dd> + <dt class='head--doc'><span id='p-div'></span>Parameter <code class='parameter'>div</code></dt> + <dd></dd><dd class='body--doc'><p>division factor, default is 1.0.</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glClearAccum</b></span> + <span class='homogen--name'><b>apply_max</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearAccum</span>(</b><code class='datatype'>float</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>) <code class='argument'>red</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>green</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>blue</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>apply_max</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>))) <code class='argument'>matrix</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>apply_max</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>))) <code class='argument'>matrix</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>apply_max</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>))) <code class='argument'>matrix</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>div</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glClearAccum</code> specifies the red, green, blue, and alpha values used by <code>glClear</code> - to clear the accumulation buffer.</p> - <p>Values specified by <code>glClearAccum</code> are clamped to the - range [-1,1].</p> + <dd class='body--doc'> + <p>This is the same as apply_matrix, but it uses the maximum + instead.</p> +  + <p>This function is not very fast. + </p>   </dd> - <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the red, green, blue, and alpha values used when the - accumulation buffer is cleared. - The initial values are all 0.</p> + <dt class='head--doc'><span id='p-array'></span>Parameter <code class='parameter'>array</code></dt> + <dd></dd><dd class='body--doc'><p>the matrix; innermost is a value or an array with red, green, blue + values for red, green, blue separation.</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>base level of result, default is zero</p></dd> + <dt class='head--doc'><span id='p-div'></span>Parameter <code class='parameter'>div</code></dt> + <dd></dd><dd class='body--doc'><p>division factor, default is 1.0.</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearAccum</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p><b>experimental status</b>; may not be exact the same + output in later versions</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glClearColor</b></span> + <span class='homogen--name'><b>autocrop</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>find_autocrop</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearColor</span>(</b><code class='datatype'>float</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>) <code class='argument'>red</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>green</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>blue</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>autocrop</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>autocrop</span>(</b><code class='datatype'>int</code> <code class='argument'>border</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>autocrop</span>(</b><code class='datatype'>int</code> <code class='argument'>border</code>, <code class='object unresolved'>Color</code> <code class='argument'>color</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>autocrop</span>(</b><code class='datatype'>int</code> <code class='argument'>border</code>, <code class='datatype'>int</code> <code class='argument'>left</code>, <code class='datatype'>int</code> <code class='argument'>right</code>, <code class='datatype'>int</code> <code class='argument'>top</code>, <code class='datatype'>int</code> <code class='argument'>bottom</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>autocrop</span>(</b><code class='datatype'>int</code> <code class='argument'>border</code>, <code class='datatype'>int</code> <code class='argument'>left</code>, <code class='datatype'>int</code> <code class='argument'>right</code>, <code class='datatype'>int</code> <code class='argument'>top</code>, <code class='datatype'>int</code> <code class='argument'>bottom</code>, <code class='object unresolved'>Color</code> <code class='argument'>color</code><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>find_autocrop</span>(</b><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>find_autocrop</span>(</b><code class='datatype'>int</code> <code class='argument'>border</code><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>find_autocrop</span>(</b><code class='datatype'>int</code> <code class='argument'>border</code>, <code class='datatype'>int</code> <code class='argument'>left</code>, <code class='datatype'>int</code> <code class='argument'>right</code>, <code class='datatype'>int</code> <code class='argument'>top</code>, <code class='datatype'>int</code> <code class='argument'>bottom</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glClearColor</code> specifies the red, - green, - blue, - and alpha values used by <code>glClear</code> to clear the color buffers. - Values specified by <code>glClearColor</code> are clamped to the range [0,1].</p> + <dd class='body--doc'> + <p>Removes "unneccesary" borders around the image, adds one of + its own if wanted to, in selected directions.</p> +  + <p>"Unneccesary" is all pixels that are equal -- ie if all the same pixels + to the left are the same color, that column of pixels are removed.</p> +  + <p>The find_autocrop() function simply returns x1,y1,x2,y2 for the + kept area. (This can be used with <code>copy</code> later.) + </p>   </dd> - <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the red, green, blue, and alpha values used when the - color buffers are cleared. - The initial values are all 0.</p> + <dt class='head--doc'><span id='p-border'></span>Parameter <code class='parameter'>border</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-left'></span>Parameter <code class='parameter'>left</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-right'></span>Parameter <code class='parameter'>right</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-top'></span>Parameter <code class='parameter'>top</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-bottom'></span>Parameter <code class='parameter'>bottom</code></dt> + <dd></dd><dd class='body--doc'><p>which borders to scan and cut the image; + a typical example is removing the top and bottom unneccesary + pixels: + <pre>img=img-&gt;autocrop(0, 0,0,1,1);</pre> + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearColor</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>copy</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glClearDepth</b></span> + <span class='homogen--name'><b>average</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>min</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>max</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>sum</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>sumf</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearDepth</span>(</b><code class='datatype'>float</code> <code class='argument'>depth</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>float</code>) <b><span class='method'>average</span>(</b><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>min</span>(</b><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>max</span>(</b><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>sum</span>(</b><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>float</code>) <b><span class='method'>sumf</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glClearDepth</code> specifies the depth value used by <code>glClear</code> to clear the depth buffer. - Values specified by <code>glClearDepth</code> are clamped to the range [0,1].</p> + <dd class='body--doc'> + <p>Gives back the average, minimum, maximum color value, + and the sum of all pixel's color value. + </p>   </dd> - <dt class='head--doc'><span id='p-depth'></span>Parameter <code class='parameter'>depth</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the depth value used when the depth buffer is cleared. The - initial value is 1.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearDepth</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>sum() values can wrap! Most systems only have 31 bits + available for positive integers. (Meaning, be careful + with images that have more than 8425104 pixels.)</p> +  + <p>average() and sumf() may also wrap, but on a line basis. + (Meaning, be careful with images that are wider +  than 8425104 pixels.) These functions may have a precision + problem instead, during to limits in the 'double' C type and/or + 'float' Pike type.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glClearIndex</b></span> + <span class='homogen--name'><b>bitscale</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearIndex</span>(</b><code class='datatype'>float</code> <code class='argument'>c</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>bitscale</span>(</b><code class='datatype'>float</code> <code class='argument'>factor</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>bitscale</span>(</b><code class='datatype'>float</code> <code class='argument'>xfactor</code>, <code class='datatype'>float</code> <code class='argument'>yfactor</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glClearIndex</code> specifies the index used by <code>glClear</code> - to clear the color index buffers. - <i>c</i> is not clamped. - Rather, - <i>c</i> is converted to a fixed-point value with unspecified precision - to the right of the binary point. - The integer part of this value is then masked with 2 sup m -1, - where m is the number of bits in a color index stored in the frame buffer.</p> + <dd class='body--doc'> + <p>scales the image with a factor, without smoothing. + This routine is faster than scale, but gives less correct + results</p>   </dd> - <dt class='head--doc'><span id='p-c'></span>Parameter <code class='parameter'>c</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the index used when the color index buffers are cleared. - The initial value is 0.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearIndex</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'><span id='p-factor'></span>Parameter <code class='parameter'>factor</code></dt> + <dd></dd><dd class='body--doc'><p>factor to use for both x and y</p></dd> + <dt class='head--doc'><span id='p-xfactor'></span>Parameter <code class='parameter'>xfactor</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-yfactor'></span>Parameter <code class='parameter'>yfactor</code></dt> + <dd></dd><dd class='body--doc'><p>separate factors for x and y + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glClearStencil</b></span> + <span class='homogen--name'><b>bitscale</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearStencil</span>(</b><code class='datatype'>int</code> <code class='argument'>s</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>bitscale</span>(</b><code class='datatype'>int</code> <code class='argument'>newxsize</code>, <code class='datatype'>int</code> <code class='argument'>newysize</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>bitscale</span>(</b><code class='argument'>0</code>, <code class='datatype'>int</code> <code class='argument'>newysize</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>bitscale</span>(</b><code class='datatype'>int</code> <code class='argument'>newxsize</code>, <code class='argument'>0</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glClearStencil</code> specifies the index used by <code>glClear</code> to clear the stencil buffer. - <i>s</i> is masked with 2 sup m - 1, - where m is the number of bits in the stencil buffer.</p> + <dd class='body--doc'> + <p>scales the image to a specified new size, + if one of newxsize or newysize is 0, + the image aspect ratio is preserved.</p>   </dd> - <dt class='head--doc'><span id='p-s'></span>Parameter <code class='parameter'>s</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the index used when the stencil buffer is cleared. - The initial value is 0.</p> + <dt class='head--doc'><span id='p-newxsize'></span>Parameter <code class='parameter'>newxsize</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-newysize'></span>Parameter <code class='parameter'>newysize</code></dt> + <dd></dd><dd class='body--doc'><p>new image size in pixels + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearStencil</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>resulting image will be 1x1 pixels, at least</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glColor</b></span> + <span class='homogen--name'><b>box</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glColor</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>red</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>green</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>blue</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>box</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>box</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>box</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>The GL stores both a current single-valued color index - and a current four-valued RGBA color. - <code>glColor</code> sets a new four-valued RGBA color. - <code>glColor</code> has two major variants: - <code>glColor3</code> and <code>glColor4</code>. - <code>glColor3</code> variants specify new red, - green, - and blue values explicitly - and set the current alpha value to 1.0 (full intensity) implicitly. - <code>glColor4</code> variants specify all four color components explicitly.</p> - <p><code>glColor3b</code>, <code>glColor4b</code>, - <code>glColor3s</code>, <code>glColor4s</code>, <code>glColor3i</code>, and <code>glColor4i</code> take - three or four signed byte, short, or long integers as arguments. - When <code>v</code> is appended to the name, - the color commands can take a pointer to an array of such values.</p> - <p>Current color values are stored in floating-point format, - with unspecified mantissa and exponent sizes. - Unsigned integer color components, - when specified, - are linearly mapped to floating-point values such that the largest - representable value maps to 1.0 (full intensity), - and 0 maps to 0.0 (zero intensity). - Signed integer color components, - when specified, - are linearly mapped to floating-point values such that the most positive - representable value maps to 1.0, - and the most negative representable value maps to -1.0. (Note that - this mapping does not convert 0 precisely to 0.0.) - Floating-point values are mapped directly.</p> - <p>Neither floating-point nor signed integer values are clamped - to the range [0,1] before the current color is updated. - However, - color components are clamped to this range before they are interpolated - or written into a color buffer.</p> + <dd class='body--doc'> + <p>Draws a filled rectangle on the image.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.box.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.box.2.png' width='80' /></td> + </tr><tr> + <td>original</td> + <td>-&gt;box<br />(40,10,<br />10,80,<br />0,255,0)</td> + </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> - <dd></dd><dd class='body--doc'><p>Specify new red, green, and blue values for the current color.</p> - </dd> + <dt class='head--doc'><span id='p-x1'></span>Parameter <code class='parameter'>x1</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y1'></span>Parameter <code class='parameter'>y1</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-x2'></span>Parameter <code class='parameter'>x2</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y2'></span>Parameter <code class='parameter'>y2</code></dt> + <dd></dd><dd class='body--doc'><p>box corners</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>color of the box</p></dd>   <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a new alpha value for the current color. - Included only in the four-argument <code>glColor4</code> commands.</p> - </dd> - <dt class='head--doc'><span id='p-v'></span>Parameter <code class='parameter'>v</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array that contains red, green, blue, - and (sometimes) alpha values.</p> + <dd></dd><dd class='body--doc'><p>alpha value</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the object called</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glColorMask</b></span> + <span class='homogen--name'><b>cast</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glColorMask</span>(</b><code class='datatype'>int</code> <code class='argument'>red</code>, <code class='datatype'>int</code> <code class='argument'>green</code>, <code class='datatype'>int</code> <code class='argument'>blue</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> + <dd><p><code><b>(</b><span class='datatype'>int</span><b>)</b><span class='class'>Image.Image</span>()<br><b>(</b><span class='datatype'>float</span><b>)</b><span class='class'>Image.Image</span>()<br><b>(</b><span class='datatype'>string</span><b>)</b><span class='class'>Image.Image</span>()<br><b>(</b><span class='datatype'>array</span><b>)</b><span class='class'>Image.Image</span>()<br><b>(</b><span class='datatype'>mapping</span><b>)</b><span class='class'>Image.Image</span>()<br><b>(</b><span class='datatype'>multiset</span><b>)</b><span class='class'>Image.Image</span>()</code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glColorMask</code> specifies whether the individual color components in the frame buffer - can or cannot be written. - If <i>red</i> is <code>GL_FALSE</code>, - for example, - no change is made to the red component of any pixel in any of the - color buffers, - regardless of the drawing operation attempted.</p> - <p>Changes to individual bits of components cannot be controlled. - Rather, - changes are either enabled or disabled for entire color components.</p> + <dd class='body--doc'> + <p>Cast the image to another datatype. Currently supported + are string ("rgbrgbrgb...") and array (double array + of <code>Image.Color</code> objects).</p>   </dd> - <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> - <dd></dd><dd class='body--doc'><p>Specify whether red, green, blue, and alpha can or cannot be written - into the frame buffer. - The initial values are all <code>GL_TRUE</code>, - indicating that the color components can be written.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>Image.Color</code>, <code>Image.X</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>change_color</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>change_color</span>(</b><code class='datatype'>int</code> <code class='argument'>tor</code>, <code class='datatype'>int</code> <code class='argument'>tog</code>, <code class='datatype'>int</code> <code class='argument'>tob</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>change_color</span>(</b><code class='datatype'>int</code> <code class='argument'>fromr</code>, <code class='datatype'>int</code> <code class='argument'>fromg</code>, <code class='datatype'>int</code> <code class='argument'>fromb</code>, <code class='datatype'>object</code> <code class='argument'>inttor</code>, <code class='datatype'>int</code> <code class='argument'>tog</code>, <code class='datatype'>int</code> <code class='argument'>tob</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Changes one color (exakt match) to another. + If non-exakt-match is preferred, check <code>distancesq</code> + and <code>paste_alpha_color</code>.</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glColorMask</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'><span id='p-tor'></span>Parameter <code class='parameter'>tor</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-tog'></span>Parameter <code class='parameter'>tog</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-tob'></span>Parameter <code class='parameter'>tob</code></dt> + <dd></dd><dd class='body--doc'><p>destination color and next current color</p></dd> + <dt class='head--doc'><span id='p-fromr'></span>Parameter <code class='parameter'>fromr</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-fromg'></span>Parameter <code class='parameter'>fromg</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-fromb'></span>Parameter <code class='parameter'>fromb</code></dt> + <dd></dd><dd class='body--doc'><p>source color, default is current color</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>a new (the destination) image object</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glColorMaterial</b></span> + <span class='homogen--name'><b>circle</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glColorMaterial</span>(</b><code class='datatype'>int</code> <code class='argument'>face</code>, <code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>circle</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>rx</code>, <code class='datatype'>int</code> <code class='argument'>ry</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>circle</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>rx</code>, <code class='datatype'>int</code> <code class='argument'>ry</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>circle</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>rx</code>, <code class='datatype'>int</code> <code class='argument'>ry</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glColorMaterial</code> specifies which material parameters track the current color. - When <code>GL_COLOR_MATERIAL</code> is enabled, - the material parameter or parameters specified by <i>mode</i>, - of the material or materials specified by <i>face</i>, - track the current color at all times.</p> - <p>To enable and disable <code>GL_COLOR_MATERIAL</code>, call - <code>glEnable</code> and <code>glDisable</code> with argument <code>GL_COLOR_MATERIAL</code>. - <code>GL_COLOR_MATERIAL</code> is initially disabled.</p> + <dd class='body--doc'> + <p>Draws a circle on the image. The circle is <i>not</i> antialiased.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.circle.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.circle.2.png' width='80' /></td> + </tr><tr> + <td>original</td> + <td>-&gt;circle<br />(50,50,<br />30,50,<br />0,255,255)</td> + </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-face'></span>Parameter <code class='parameter'>face</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies whether front, - back, - or both front and back material parameters should track the current color. - Accepted values are - <code>GL_FRONT</code>, - <code>GL_BACK</code>, - and <code>GL_FRONT_AND_BACK</code>. - The initial value is <code>GL_FRONT_AND_BACK</code>.</p> - </dd> - <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies which of several material parameters track the current color. - Accepted values are - <code>GL_EMISSION</code>, - <code>GL_AMBIENT</code>, - <code>GL_DIFFUSE</code>, - <code>GL_SPECULAR</code>, - and <code>GL_AMBIENT_AND_DIFFUSE</code>. - The initial value is <code>GL_AMBIENT_AND_DIFFUSE</code>.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>face</i> or <i>mode</i> is not an - accepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glColorMaterial</code> is executed between - the execution of <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y'></span>Parameter <code class='parameter'>y</code></dt> + <dd></dd><dd class='body--doc'><p>circle center</p></dd> + <dt class='head--doc'><span id='p-rx'></span>Parameter <code class='parameter'>rx</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-ry'></span>Parameter <code class='parameter'>ry</code></dt> + <dd></dd><dd class='body--doc'><p>circle radius in pixels</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>color</p></dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>alpha value</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the object called</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glCopyPixels</b></span> + <span class='homogen--name'><b>clear</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyPixels</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code>, <code class='datatype'>int</code> <code class='argument'>type</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>void </code> <b><span class='method'>clear</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>void </code> <b><span class='method'>clear</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>void </code> <b><span class='method'>clear</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glCopyPixels</code> copies a screen-aligned rectangle of pixels - from the specified frame buffer location to a region relative to the - current raster position. - Its operation is well defined only if the entire pixel source region - is within the exposed portion of the window. - Results of copies from outside the window, - or from regions of the window that are not exposed, - are hardware dependent and undefined.</p> - <p><i>x</i> and <i>y</i> specify the window coordinates of - the lower left corner of the rectangular region to be copied. - <i>width</i> and <i>height</i> specify the dimensions of the - rectangular region to be copied. - Both <i>width</i> and <i>height</i> must not be negative.</p> - <p>Several parameters control the processing of the pixel data - while it is being copied. - These parameters are set with three commands: - <code>glPixelTransfer</code>, - <code>glPixelMap</code>, and - <code>glPixelZoom</code>. - This reference page describes the effects on <code>glCopyPixels</code> of most, - but not all, of the parameters specified by these three commands.</p> - <p><code>glCopyPixels</code> copies values from each pixel with the lower left-hand corner at - (<i>x</i> + i, <i>y</i> + j) for 0\(&lt;=i&lt;<i>width</i> and 0\(&lt;=j&lt;<i>height</i>. - This pixel is said to be the ith pixel in the jth row. - Pixels are copied in row order from the lowest to the highest row, - left to right in each row.</p> - <p><i>type</i> specifies whether color, depth, or stencil data is to be copied. - The details of the transfer for each data type are as follows:</p> - <p><table class='box'> - <tr><td><code>GL_COLOR</code> - </td><td>Indices or RGBA colors are read from the buffer currently specified as the - read source buffer (see <code>glReadBuffer</code>). - If the GL is in color index mode, - each index that is read from this buffer is converted - to a fixed-point format with an unspecified - number of bits to the right of the binary point. - Each index is then shifted left by <code>GL_INDEX_SHIFT</code> bits, - and added to <code>GL_INDEX_OFFSET</code>. - If <code>GL_INDEX_SHIFT</code> is negative, - the shift is to the right. - In either case, zero bits fill otherwise unspecified bit locations in the - result. - If <code>GL_MAP_COLOR</code> is true, - the index is replaced with the value that it references in lookup table - <code>GL_PIXEL_MAP_I_TO_I</code>. - Whether the lookup replacement of the index is done or not, - the integer part of the index is then ANDed with 2 sup b -1, - where b is the number of bits in a color index buffer. + <dd class='body--doc'> + <p>gives a new, cleared image with the same size of drawing area</p>    - If the GL is in RGBA mode, - the red, green, blue, and alpha components of each pixel that is read - are converted to an internal floating-point format with unspecified - precision. - The conversion maps the largest representable component value to 1.0, - and component value 0 to 0.0. - The resulting floating-point color values are then multiplied - by <code>GL_c_SCALE</code> and added to <code>GL_c_BIAS</code>, - where <i>c</i> is RED, GREEN, BLUE, and ALPHA - for the respective color components. - The results are clamped to the range [0,1]. - If <code>GL_MAP_COLOR</code> is true, - each color component is scaled by the size of lookup table - <code>GL_PIXEL_MAP_c_TO_c</code>, - then replaced by the value that it references in that table. - <i>c</i> is R, G, B, or A. + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.clear.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.clear.2.png' width='80' /></td> + </tr><tr> + <td>original</td> + <td>-&gt;clear<br />(0,128,255)</td> + </tr></table> + </p> + </dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>color of the new image</p></dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>new default alpha channel value</p></dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>copy</code>, <code>clone</code></p></dd></dl>    - The GL then converts the resulting indices or RGBA colors to fragments - by attaching the current raster position <i>z</i> coordinate and - texture coordinates to each pixel, - then assigning window coordinates - (x sub r + i , y sub r + j), - where (x sub r , y sub r) is the current raster position, - and the pixel was the ith pixel in the jth row. - These pixel fragments are then treated just like the fragments generated by - rasterizing points, lines, or polygons. - Texture mapping, - fog, - and all the fragment operations are applied before the fragments are written - to the frame buffer. - </td></tr> - <tr><td><code>GL_DEPTH</code> - </td><td>Depth values are read from the depth buffer and - converted directly to an internal floating-point format - with unspecified precision. - The resulting floating-point depth value is then multiplied - by <code>GL_DEPTH_SCALE</code> and added to <code>GL_DEPTH_BIAS</code>. - The result is clamped to the range [0,1]. +     - The GL then converts the resulting depth components to fragments - by attaching the current raster position color or color index and - texture coordinates to each pixel, - then assigning window coordinates - (x sub r + i , y sub r + j), - where (x sub r , y sub r) is the current raster position, - and the pixel was the ith pixel in the jth row. - These pixel fragments are then treated just like the fragments generated by - rasterizing points, lines, or polygons. - Texture mapping, - fog, - and all the fragment operations are applied before the fragments are written - to the frame buffer. - </td></tr> - <tr><td><code>GL_STENCIL</code> - </td><td>Stencil indices are read from the stencil buffer and - converted to an internal fixed-point format - with an unspecified number of bits to the right of the binary point. - Each fixed-point index is then shifted left by <code>GL_INDEX_SHIFT</code> bits, - and added to <code>GL_INDEX_OFFSET</code>. - If <code>GL_INDEX_SHIFT</code> is negative, - the shift is to the right. - In either case, zero bits fill otherwise unspecified bit locations in the - result. - If <code>GL_MAP_STENCIL</code> is true, - the index is replaced with the value that it references in lookup table - <code>GL_PIXEL_MAP_S_TO_S</code>. - Whether the lookup replacement of the index is done or not, - the integer part of the index is then ANDed with 2 sup b -1, - where b is the number of bits in the stencil buffer. - The resulting stencil indices are then written to the stencil buffer - such that the index read from the ith location of the jth row - is written to location - (x sub r + i , y sub r + j), - where (x sub r , y sub r) is the current raster position. - Only the pixel ownership test, - the scissor test, - and the stencil writemask affect these write operations. - </td></tr> - </table> + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>clone</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>clone</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>clone</span>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>clone</span>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>clone</span>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Copies to or initialize a new image object.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.clone.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.clone.2.png' width='80' /></td> + <td><img height='50' src='../images/predef.Image.Image.clone.3.png' width='50' /></td> + </tr><tr> + <td>original</td> + <td>clone</td> + <td>clone(50,50)</td> + </tr></table>   </p> - <p>The rasterization described thus far assumes pixel zoom factors of 1.0. - If </p> - <p><code>glPixelZoom</code> is used to change the x and y pixel zoom factors, - pixels are converted to fragments as follows. - If (x sub r, y sub r) is the current raster position, - and a given pixel is in the ith location in the jth row of the source - pixel rectangle, - then fragments are generated for pixels whose centers are in the rectangle - with corners at</p> - <p>.ce - (x sub r + zoom sub x i, y sub r + zoom sub y j) - .sp .5 - .ce -  and - .sp .5 - .ce - (x sub r + zoom sub x (i + 1), y sub r + zoom sub y ( j + 1 ))</p> - <p>where zoom sub x is the value of <code>GL_ZOOM_X</code> and - zoom sub y is the value of <code>GL_ZOOM_Y</code>.</p> +    </dd> - <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the lower left corner - of the rectangular region of pixels to be copied.</p> + <dt class='head--doc'><span id='p-xsize'></span>Parameter <code class='parameter'>xsize</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-ysize'></span>Parameter <code class='parameter'>ysize</code></dt> + <dd></dd><dd class='body--doc'><p>size of (new) image in pixels, called image + is cropped to that size</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>current color of the new image, + default is black. + Will also be the background color if the cloned image + is empty (no drawing area made).</p></dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>new default alpha channel value</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new object</p>   </dd> - <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the dimensions of the rectangular region of pixels to be copied. - Both must be nonnegative.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>copy</code>, <code>create</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>color</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>color</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>color</span>(</b><code class='datatype'>int</code> <code class='argument'>value</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>color</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Colorize an image.</p> +  + <p>The red, green and blue values of the pixels are multiplied + with the given value(s). This works best on a grey image...</p> +  + <p>The result is divided by 255, giving correct pixel values.</p> +  + <p>If no arguments are given, the current color is used as factors.</p> +  + <p> <table><tr valign='center'> +  <td><img height='115' src='../images/predef.Image.Image.color.1.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.color.2.png' width='80' /></td> +  </tr><tr valign='center'> +  <td>original</td> +  <td>-&gt;color(128,128,255);</td> +  </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-type'></span>Parameter <code class='parameter'>type</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies whether color values, - depth values, - or stencil values are to be copied. - Symbolic constants - <code>GL_COLOR</code>, - <code>GL_DEPTH</code>, - and <code>GL_STENCIL</code> are accepted.</p> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>red, green, blue factors</p></dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>factor + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is not an accepted value.</p> - <p><code>GL_INVALID_VALUE</code> is generated if either <i>width</i> or <i>height</i> is negative.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <i>type</i> is <code>GL_DEPTH</code> - and there is no depth buffer.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <i>type</i> is <code>GL_STENCIL</code> - and there is no stencil buffer.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyPixels</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>grey</code>, <code>`*</code>, <code>modify_by_intensity</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glCopyTexImage1D</b></span> + <span class='homogen--name'><b>copy</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexImage1D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>internalFormat</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>border</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>copy</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>copy</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>copy</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>copy</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glCopyTexImage1D</code> defines a one-dimensional texture image with pixels from the current - <code>GL_READ_BUFFER</code>.</p> - <p>The screen-aligned pixel row with left corner at ("x", "y") - and with a length of "width"~+~2~*~"border" - defines the texture array - at the mipmap level specified by <i>level</i>. - <i>internalFormat</i> specifies the internal format of the texture array.</p> - <p>The pixels in the row are processed exactly as if - <code>glCopyPixels</code> had been called, but the process stops just before - final conversion. - At this point all pixel component values are clamped to the range [0,\ 1] - and then converted to the texture's internal format for storage in the texel - array.</p> - <p>Pixel ordering is such that lower x screen coordinates correspond to - lower texture coordinates.</p> - <p>If any of the pixels within the specified row of the current - <code>GL_READ_BUFFER</code> are outside the window associated with the current - rendering context, then the values obtained for those pixels are undefined.</p> + <dd class='body--doc'> + <p>Copies this part of the image. The requested area can + be smaller, giving a cropped image, or bigger - + the new area will be filled with the given or current color.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.copy.1.png' width='80' /></td> + <td><img height='105' src='../images/predef.Image.Image.copy.2.png' width='70' /></td> + <td><img height='125' src='../images/predef.Image.Image.copy.3.png' width='90' /></td> + </tr><tr> + <td>original</td> + <td>-&gt;copy<br />(5,5,<br />XSIZE-6,YSIZE-6)</td> + <td>-&gt;copy<br />(-5,-5,<br />XSIZE+4,YSIZE+4,<br />10,75,10)</td> + </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the target texture. - Must be <code>GL_TEXTURE_1D</code>.</p> + <dt class='head--doc'><span id='p-x1'></span>Parameter <code class='parameter'>x1</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y1'></span>Parameter <code class='parameter'>y1</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-x2'></span>Parameter <code class='parameter'>x2</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y2'></span>Parameter <code class='parameter'>y2</code></dt> + <dd></dd><dd class='body--doc'><p>The requested new area. Default is the old image size.</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>color of the new image</p></dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>new default alpha channel value</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>a new image object</p>   </dd> - <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. - Level 0 is the base image level. - Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p><code>clone</code>(void) and <code>copy</code>(void) does the same + operation + </p>   </dd> - <dt class='head--doc'><span id='p-internalFormat'></span>Parameter <code class='parameter'>internalFormat</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the internal format of the texture. - Must be one of the following symbolic constants: - <code>GL_ALPHA</code>, - <code>GL_ALPHA4</code>, - <code>GL_ALPHA8</code>, - <code>GL_ALPHA12</code>, - <code>GL_ALPHA16</code>, - <code>GL_LUMINANCE</code>, - <code>GL_LUMINANCE4</code>, - <code>GL_LUMINANCE8</code>, - <code>GL_LUMINANCE12</code>, - <code>GL_LUMINANCE16</code>, - <code>GL_LUMINANCE_ALPHA</code>, - <code>GL_LUMINANCE4_ALPHA4</code>, - <code>GL_LUMINANCE6_ALPHA2</code>, - <code>GL_LUMINANCE8_ALPHA8</code>, - <code>GL_LUMINANCE12_ALPHA4</code>, - <code>GL_LUMINANCE12_ALPHA12</code>, - <code>GL_LUMINANCE16_ALPHA16</code>, - <code>GL_INTENSITY</code>, - <code>GL_INTENSITY4</code>, - <code>GL_INTENSITY8</code>, - <code>GL_INTENSITY12</code>, - <code>GL_INTENSITY16</code>, - <code>GL_RGB</code>, - <code>GL_R3_G3_B2</code>, - <code>GL_RGB4</code>, - <code>GL_RGB5</code>, - <code>GL_RGB8</code>, - <code>GL_RGB10</code>, - <code>GL_RGB12</code>, - <code>GL_RGB16</code>, - <code>GL_RGBA</code>, - <code>GL_RGBA2</code>, - <code>GL_RGBA4</code>, - <code>GL_RGB5_A1</code>, - <code>GL_RGBA8</code>, - <code>GL_RGB10_A2</code>, - <code>GL_RGBA12</code>, or - <code>GL_RGBA16</code>.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>clone</code>, <code>autocrop</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>create</b></span> + </dt> + <dd><p><code><span class='object'>Image.Image</span> <span class='class'>Image.Image</span><b>(</b><b>)</b></code><br> + <code><span class='object'>Image.Image</span> <span class='class'>Image.Image</span><b>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code><b>)</b></code><br> + <code><span class='object'>Image.Image</span> <span class='class'>Image.Image</span><b>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code>, <code class='object unresolved'>Color</code> <code class='argument'>color</code><b>)</b></code><br> + <code><span class='object'>Image.Image</span> <span class='class'>Image.Image</span><b>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><span class='object'>Image.Image</span> <span class='class'>Image.Image</span><b>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code><br> + <code><span class='object'>Image.Image</span> <span class='class'>Image.Image</span><b>(</b><code class='datatype'>int</code> <code class='argument'>xsize</code>, <code class='datatype'>int</code> <code class='argument'>ysize</code>, <code class='datatype'>string</code> <code class='argument'>method</code>, <code class='object unresolved'>method</code> <code class='argument'>...</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Initializes a new image object.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.create.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.create.2.png' width='80' /></td> + </tr><tr> + <td>Image.Image<br />(XSIZE,YSIZE)</td> + <td>Image.Image<br />(XSIZE,YSIZE,255,128,0)</td> + </tr></table></p> +  + <p>The image can also be calculated from some special methods, + for convinience:</p> +  + <p><pre> + channel modes; followed by a number of 1-char-per-pixel strings + or image objects (where red channel will be used), + or an integer value: +  "grey" : make a grey image (needs 1 source: grey) +  "rgb" : make an rgb image (needs 3 sources: red, green and blue) +  "cmyk" : make a rgb image from cmyk (cyan, magenta, yellow, black) +  + generate modes; all extra arguments is given to the + generation function. These has the same name as the method: +  "&lt;ref&gt;test&lt;/ref&gt;," +  "&lt;ref&gt;gradients&lt;/ref&gt;" +  "&lt;ref&gt;noise&lt;/ref&gt;" +  "&lt;ref&gt;turbulence&lt;/ref&gt;" +  "&lt;ref&gt;random&lt;/ref&gt;" +  "&lt;ref&gt;randomgrey&lt;/ref&gt;" + specials cases: +  "&lt;ref&gt;tuned_box&lt;/ref&gt;" (coordinates is automatic) + </pre> + </p>   </dd> - <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the left corner - of the row of pixels to be copied.</p> + <dt class='head--doc'><span id='p-xsize'></span>Parameter <code class='parameter'>xsize</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-ysize'></span>Parameter <code class='parameter'>ysize</code></dt> + <dd></dd><dd class='body--doc'><p>size of (new) image in pixels</p></dd> + <dt class='head--doc'><span id='p-color'></span>Parameter <code class='parameter'>color</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>background color (will also be current color), + default color is black</p></dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>default alpha channel value</p></dd> + <dt class='head--doc'>Bugs</dt> + <dd class='body--doc'> + <p>SIGSEGVS can be caused if the size is too big, due + to unchecked overflow - + (xsize*ysize)&amp;MAXINT is small enough to allocate.</p>   </dd> - <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the width of the texture image. - Must be 0 or 2**n ~+~ 2*<i>border</i> for some integer n. - The height of the texture image is 1.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>copy</code>, <code>clone</code>, <code>Image.Image</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>dct</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>dct</span>(</b><code class='datatype'>int</code> <code class='argument'>newx</code>, <code class='datatype'>int</code> <code class='argument'>newy</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Scales the image to a new size.</p> +  + <p>Method for scaling is rather complex; + the image is transformed via a cosine transform, + and then resampled back.</p> +  + <p>This gives a quality-conserving upscale, + but the algorithm used is n*n+n*m, where n + and m is pixels in the original and new image.</p> +  + <p>Recommended wrapping algorithm is to scale + overlapping parts of the image-to-be-scaled.</p> +  + <p>This functionality is actually added as an + true experiment, but works... + </p>   </dd> - <dt class='head--doc'><span id='p-border'></span>Parameter <code class='parameter'>border</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the width of the border. - Must be either 0 or 1.</p> + <dt class='head--doc'><span id='p-newx'></span>Parameter <code class='parameter'>newx</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-newy'></span>Parameter <code class='parameter'>newy</code></dt> + <dd></dd><dd class='body--doc'><p>new image size in pixels + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not one of the - allowable values.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. - .P - <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater - than log sub 2 max, - where max is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>. - .P - <code>GL_INVALID_VALUE</code> is generated if <i>internalFormat</i> is not an - allowable value. </p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>width</i> is less than 0 - or greater than - 2 + <code>GL_MAX_TEXTURE_SIZE</code>, - or if it cannot be represented as 2 ** n ~+~ 2~*~("border") - for some integer value of <i>n</i>.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>border</i> is not 0 or 1.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyTexImage1D</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>Do NOT use this function if you don't know what + you're dealing with! Read some signal theory first...</p> +  + <p>It write's dots on stderr, to indicate some sort + of progress. It doesn't use any fct (compare: fft) + algorithms.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glCopyTexImage2D</b></span> + <span class='homogen--name'><b>distancesq</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexImage2D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>internalFormat</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code>, <code class='datatype'>int</code> <code class='argument'>border</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>distancesq</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>distancesq</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glCopyTexImage2D</code> defines a two-dimensional texture image with pixels from the current - <code>GL_READ_BUFFER</code>.</p> - <p>The screen-aligned pixel rectangle with lower left corner at (<i>x</i>, - <i>y</i>) and with a width of <i>width</i>~+~2~*~<i>border</i> and a height of - <i>height</i>~+~2~*~<i>border</i> - defines the texture array - at the mipmap level specified by <i>level</i>. - <i>internalFormat</i> specifies the internal format of the texture array.</p> - <p>The pixels in the rectangle are processed exactly as if - <code>glCopyPixels</code> had been called, but the process stops just before - final conversion. - At this point all pixel component values are clamped to the range [0,1] - and then converted to the texture's internal format for storage in the texel - array.</p> - <p>Pixel ordering is such that lower x and y screen coordinates correspond to - lower s and t texture coordinates.</p> - <p>If any of the pixels within the specified rectangle of the current - <code>GL_READ_BUFFER</code> are outside the window associated with the current - rendering context, then the values obtained for those pixels are undefined.</p> + <dd class='body--doc'> + <p>Makes an grey-scale image, for alpha-channel use.</p> +  + <p>The given value (or current color) are used for coordinates + in the color cube. Each resulting pixel is the + distance from this point to the source pixel color, + in the color cube, squared, rightshifted 8 steps:</p> +  + <p><pre> + p = pixel color + o = given color + d = destination pixel + d.red=d.blue=d.green= +  ((o.red-p.red)²+(o.green-p.green)²+(o.blue-p.blue)²)&gt;&gt;8 + </pre></p> +  + <p> <table><tr valign='center'> +  <td><img height='115' src='../images/predef.Image.Image.distancesq.1.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.distancesq.2.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.distancesq.3.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.distancesq.4.png' width='80' /></td> +  </tr><tr valign='center'> +  <td>original</td> +  <td>distance² to cyan</td> +  <td>...to purple</td> +  <td>...to yellow</td> +  </tr></table></p> +  + <p></p>   </dd> - <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the target texture. - Must be <code>GL_TEXTURE_2D</code>.</p> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>red, green, blue coordinates + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. - Level 0 is the base image level. - Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>select_from</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>find_min</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>find_max</b></span><br> + </dt> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>find_min</span>(</b><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>find_max</span>(</b><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>find_min</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>find_max</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Gives back the position of the minimum or maximum + pixel value, weighted to grey. + </p>   </dd> - <dt class='head--doc'><span id='p-internalFormat'></span>Parameter <code class='parameter'>internalFormat</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the internal format of the texture. - Must be one of the following symbolic constants: - <code>GL_ALPHA</code>, - <code>GL_ALPHA4</code>, - <code>GL_ALPHA8</code>, - <code>GL_ALPHA12</code>, - <code>GL_ALPHA16</code>, - <code>GL_LUMINANCE</code>, - <code>GL_LUMINANCE4</code>, - <code>GL_LUMINANCE8</code>, - <code>GL_LUMINANCE12</code>, - <code>GL_LUMINANCE16</code>, - <code>GL_LUMINANCE_ALPHA</code>, - <code>GL_LUMINANCE4_ALPHA4</code>, - <code>GL_LUMINANCE6_ALPHA2</code>, - <code>GL_LUMINANCE8_ALPHA8</code>, - <code>GL_LUMINANCE12_ALPHA4</code>, - <code>GL_LUMINANCE12_ALPHA12</code>, - <code>GL_LUMINANCE16_ALPHA16</code>, - <code>GL_INTENSITY</code>, - <code>GL_INTENSITY4</code>, - <code>GL_INTENSITY8</code>, - <code>GL_INTENSITY12</code>, - <code>GL_INTENSITY16</code>, - <code>GL_RGB</code>, - <code>GL_R3_G3_B2</code>, - <code>GL_RGB4</code>, - <code>GL_RGB5</code>, - <code>GL_RGB8</code>, - <code>GL_RGB10</code>, - <code>GL_RGB12</code>, - <code>GL_RGB16</code>, - <code>GL_RGBA</code>, - <code>GL_RGBA2</code>, - <code>GL_RGBA4</code>, - <code>GL_RGB5_A1</code>, - <code>GL_RGBA8</code>, - <code>GL_RGB10_A2</code>, - <code>GL_RGBA12</code>, or - <code>GL_RGBA16</code>.</p> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>weight of color, default is r=87,g=127,b=41, same + as the <code>grey</code>() method.</p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>gamma</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>gamma</span>(</b><code class='datatype'>float</code> <code class='argument'>g</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>gamma</span>(</b><code class='datatype'>float</code> <code class='argument'>gred</code>, <code class='datatype'>object</code> <code class='argument'>floatggreen</code>, <code class='datatype'>object</code> <code class='argument'>floatgblue</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Calculate pixels in image by gamma curve.</p> +  + <p>Intensity of new pixels are calculated by:<br /> + <i>i</i>' = <i>i</i>^<i>g</i></p> +  + <p>For example, you are viewing your image on a screen + with gamma 2.2. To correct your image to the correct + gamma value, do something like:</p> +  + <p><tt>my_display_image(my_image()-&gt;gamma(1/2.2);</tt> + </p>   </dd> - <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the lower left corner - of the rectangular region of pixels to be copied.</p> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-gred'></span>Parameter <code class='parameter'>gred</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-ggreen'></span>Parameter <code class='parameter'>ggreen</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-gblue'></span>Parameter <code class='parameter'>gblue</code></dt> + <dd></dd><dd class='body--doc'><p>gamma value + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>a new image object</p>   </dd> - <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the width of the texture image. - Must be 0 or 2**n ~+~ 2*<i>border</i> for some integer n.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>grey</code>, <code>`*</code>, <code>color</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>getpixel</b></span> + </dt> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>int</code>) <b><span class='method'>getpixel</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p></p>   </dd> - <dt class='head--doc'><span id='p-height'></span>Parameter <code class='parameter'>height</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the height of the texture image. - Must be 0 or 2**m ~+~ 2*<i>border</i> for some integer m.</p> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y'></span>Parameter <code class='parameter'>y</code></dt> + <dd></dd><dd class='body--doc'><p>position of the pixel</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>color of the requested pixel -- ({int red,int green,int blue})</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>gradients</b></span> + </dt> + <dd><p><code><code class='object unresolved'>int </code> <b><span class='method'>gradients</span>(</b><code class='datatype'>array</code>(<code class='datatype'>int</code>) <code class='argument'>point</code>, <code class='datatype'>object</code> <code class='argument'>...</code><b>)</b></code><br> + <code><code class='object unresolved'>int </code> <b><span class='method'>gradients</span>(</b><code class='datatype'>array</code>(<code class='datatype'>int</code>) <code class='argument'>point</code>, <code class='datatype'>object</code> <code class='argument'>...</code>, <code class='datatype'>object</code> <code class='argument'>floatgrad</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.gradients.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.gradients.2.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.gradients.3.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.gradients.4.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.gradients.5.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.gradients.6.png' width='80' /></td> + </tr><tr> + <td>original</td> + <td>2 color<br />gradient</td> + <td>10 color<br />gradient</td> + <td>3 colors,<br />grad=4.0</td> + <td>3 colors,<br />grad=1.0</td> + <td>3 colors,<br />grad=0.25</td> + </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-border'></span>Parameter <code class='parameter'>border</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the width of the border. - Must be either 0 or 1.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_2D</code>.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. - .P - <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater - than log sub 2 max, - where max is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>width</i> or <i>height</i> is less than 0, - greater than 2~+~<code>GL_MAX_TEXTURE_SIZE</code>, or if <i>width</i> or <i>height</i> cannot be - represented as 2**k ~+~ 2~*~<i>border</i> for some integer - k.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>border</i> is not 0 or 1.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>internalFormat</i> is not one of the - allowable values.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyTexImage2D</code> is executed - between the execution of <code>glBegin</code> and the corresponding - execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glCopyTexSubImage1D</b></span> + <span class='homogen--name'><b>grey</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexSubImage1D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>xoffset</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>grey</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>grey</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glCopyTexSubImage1D</code> replaces a portion of a one-dimensional - texture image with pixels from the current <code>GL_READ_BUFFER</code> (rather - than from main memory, as is the case for <code>glTexSubImage1D</code>).</p> - <p>The screen-aligned pixel row with left corner at (<i>x</i>,\ <i>y</i>), and with - length <i>width</i> replaces the portion of the - texture array with x indices <i>xoffset</i> through "xoffset" ~+~ "width" ~-~ 1, - inclusive. The destination in the texture array may not - include any texels outside the texture array as it was - originally specified.</p> - <p>The pixels in the row are processed exactly as if - <code>glCopyPixels</code> had been called, but the process stops just before - final conversion. - At this point all pixel component values are clamped to the range [0,\ 1] - and then converted to the texture's internal format for storage in the texel - array.</p> - <p>It is not an error to specify a subtexture with zero width, but - such a specification has no effect. - If any of the pixels within the specified row of the current - <code>GL_READ_BUFFER</code> are outside the read window associated with the current - rendering context, then the values obtained for those pixels are undefined.</p> - <p>No change is made to the <i>internalformat</i>, <i>width</i>, - or <i>border</i> parameters of the specified texture - array or to texel values outside the specified subregion.</p> + <dd class='body--doc'> + <p>Makes a grey-scale image (with weighted values).</p> +  + <p> <table><tr valign='center'> +  <td><img height='115' src='../images/predef.Image.Image.grey.1.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.grey.2.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.grey.3.png' width='80' /></td> +  </tr><tr valign='center'> +  <td>original</td> +  <td>-&gt;grey();</td> +  <td>-&gt;grey(0,0,255);</td> +  </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the target texture. - Must be <code>GL_TEXTURE_1D</code>.</p> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>weight of color, default is r=87,g=127,b=41, + which should be pretty accurate of what the eyes see... + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. - Level 0 is the base image level. - Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>color</code>, <code>`*</code>, <code>modify_by_intensity</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>rgb_to_hsv</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>hsv_to_rgb</b></span><br> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>rgb_to_hsv</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>hsv_to_rgb</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Converts RGB data to HSV data, or the other way around. + When converting to HSV, the resulting data is stored like this: +  pixel.r = h; pixel.g = s; pixel.b = v;</p> +  + <p>When converting to RGB, the input data is asumed to be placed in + the pixels as above.</p> +  + <p> <table><tr valign='center'> +  <td><img height='115' src='../images/predef.Image.Image.rgb_to_hsv.1.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.rgb_to_hsv.2.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.rgb_to_hsv.3.png' width='80' /></td> +  </tr><tr valign='center'> +  <td>original</td> +  <td>-&gt;hsv_to_rgb();</td> +  <td>-&gt;rgb_to_hsv();</td> +  </tr><tr valign='center'> +  <td></td> +  <td></td> +  <td></td> +  </tr><tr valign='center'> +  <td>tuned box (below)</td> +  <td>the rainbow (below)</td> +  <td>same, but rgb_to_hsv()</td> +  </tr></table></p> +  + <p> + HSV to RGB calculation: + <pre> + in = input pixel + out = destination pixel + h=-pos*c_angle*3.1415/(float)NUM_SQUARES; + out.r=(in.b+in.g*cos(in.r)); + out.g=(in.b+in.g*cos(in.r + pi*2/3)); + out.b=(in.b+in.g*cos(in.r + pi*4/3)); + </pre></p> +  + <p>RGB to HSV calculation: Hmm. + <pre> + </pre></p> +  + <p> Example: Nice rainbow. +  <pre> +  object i = Image.Image(200,200); +  i = i-&gt;tuned_box(0,0, 200,200, +  ({ ({ 255,255,128 }), ({ 0,255,128 }), +  ({ 255,255,255 }), ({ 0,255,255 })})) +  -&gt;hsv_to_rgb(); +  </pre></p>   </dd> - <dt class='head--doc'><span id='p-xoffset'></span>Parameter <code class='parameter'>xoffset</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the texel offset within the texture array.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>invert</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>invert</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Invert an image. Each pixel value gets to be 255-x, where x + is the old value.</p> +  + <p> <table><tr valign='center'> +  <td><img height='115' src='../images/predef.Image.Image.invert.1.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.invert.2.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.invert.3.png' width='80' /></td> +  </tr><tr valign='center'> +  <td>original</td> +  <td>-&gt;invert();</td> +  <td>-&gt;rgb_to_hsv()-&gt;invert()-&gt;hsv_to_rgb();</td> +  </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the left corner - of the row of pixels to be copied.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>line</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>line</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>line</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>line</span>(</b><code class='datatype'>int</code> <code class='argument'>x1</code>, <code class='datatype'>int</code> <code class='argument'>y1</code>, <code class='datatype'>int</code> <code class='argument'>x2</code>, <code class='datatype'>int</code> <code class='argument'>y2</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Draws a line on the image. The line is <i>not</i> antialiased.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.line.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.line.2.png' width='80' /></td> + </tr><tr> + <td>original</td> + <td>-&gt;line<br />(50,10,<br />10,50,<br />255,0,0)</td> + </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the width of the texture subimage.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_1D</code>.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if the texture array has not - been defined by a previous <code>glTexImage1D</code> or <code>glCopyTexImage1D</code> operation.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. - .P - <code>GL_INVALID_VALUE</code> may be generated if <i>level</i>&gt;log sub 2<i> max</i>, - where <i>max</i> is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>y</i> ~&lt;~ ~-b - or if <i>width</i> ~&lt;~ ~-b, where b - is the border width of the texture array.</p> - <p><code>GL_INVALID_VALUE</code> is generated if "xoffset" ~&lt;~ ~-b, or - ("xoffset"~+~"width") ~&gt;~ (w-b), - where w is the <code>GL_TEXTURE_WIDTH</code>, and b is the <code>GL_TEXTURE_BORDER</code> - of the texture image being modified. - Note that w includes twice the border width.</p> + <dt class='head--doc'><span id='p-x1'></span>Parameter <code class='parameter'>x1</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y1'></span>Parameter <code class='parameter'>y1</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-x2'></span>Parameter <code class='parameter'>x2</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y2'></span>Parameter <code class='parameter'>y2</code></dt> + <dd></dd><dd class='body--doc'><p>line endpoints</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>color</p></dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>alpha value</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the object called</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glCopyTexSubImage2D</b></span> + <span class='homogen--name'><b>make_ascii</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexSubImage2D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>xoffset</code>, <code class='datatype'>int</code> <code class='argument'>yoffset</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>string </code> <b><span class='method'>make_ascii</span>(</b><code class='datatype'>object</code> <code class='argument'>orient1</code>, <code class='datatype'>object</code> <code class='argument'>objectorient2</code>, <code class='datatype'>object</code> <code class='argument'>objectorient3</code>, <code class='datatype'>object</code> <code class='argument'>objectorient4</code>, <code class='datatype'>object</code> <code class='argument'>int|voidxsize</code>, <code class='datatype'>object</code> <code class='argument'>int|voidysize</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glCopyTexSubImage2D</code> replaces a rectangular portion of a two-dimensional - texture image with pixels from the current <code>GL_READ_BUFFER</code> (rather - than from main memory, as is the case for <code>glTexSubImage2D</code>).</p> - <p>The screen-aligned pixel rectangle with lower left corner at - (<i>x</i>,\ <i>y</i>) and with - width <i>width</i> and height <i>height</i> replaces the portion of the - texture array with x indices <i>xoffset</i> through <i>xoffset</i>~+~<i>width</i>~-~1, - inclusive, and y indices <i>yoffset</i> through <i>yoffset</i>~+~<i>height</i>~-~1, - inclusive, at the mipmap level specified by <i>level</i>.</p> - <p>The pixels in the rectangle are processed exactly as if - <code>glCopyPixels</code> had been called, but the process stops just before - final conversion. - At this point, all pixel component values are clamped to the range [0,\ 1] - and then converted to the texture's internal format for storage in the texel - array.</p> - <p>The destination rectangle in the texture array may not include any texels - outside the texture array as it was originally specified. - It is not an error to specify a subtexture with zero width or height, but - such a specification has no effect.</p> - <p>If any of the pixels within the specified rectangle of the current - <code>GL_READ_BUFFER</code> are outside the read window associated with the current - rendering context, then the values obtained for those pixels are undefined.</p> - <p>No change is made to the <i>internalformat</i>, <i>width</i>, - <i>height</i>, or <i>border</i> parameters of the specified texture - array or to texel values outside the specified subregion.</p> + <dd class='body--doc'> + <p>This method creates a string that looks like + the image. Example: + <pre> +  //Stina is an image with a cat. +  array(object) Stina4=Stina-&gt;orient4(); +  Stina4[1]*=215; +  Stina4[3]*=215; +  string foo=Stina-&gt;make_ascii(@Stina4,40,4,8); + </pre> + </p>   </dd> - <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the target texture. - Must be <code>GL_TEXTURE_2D</code></p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>some nice acsii-art.</p>   </dd> - <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. - Level 0 is the base image level. - Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p><b>experimental status</b>; may not be exact the same + output in later versions + <pre> | / - \ +  hue= 0 64 128 192 (=red in an hsv image) + </pre></p>   </dd> - <dt class='head--doc'><span id='p-xoffset'></span>Parameter <code class='parameter'>xoffset</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a texel offset in the x direction within the texture array.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>orient</code>, <code>orient4</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>map_closest</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>map_fast</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>map_fs</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>select_colors</b></span><br> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>map_closest</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>colors</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>map_fast</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>colors</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>map_fs</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>colors</code><b>)</b></code><br> + <code><code class='object unresolved'>array </code> <b><span class='method'>select_colors</span>(</b><code class='datatype'>int</code> <code class='argument'>num</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Compatibility functions. Do not use!</p> +  + <p>Replacement examples:</p> +  + <p>Old code: + <pre>img=map_fs(img-&gt;select_colors(200));</pre> + New code: + <pre>img=Image.Colortable(img,200)-&gt;floyd_steinberg()-&gt;map(img);</pre></p> +  + <p>Old code: + <pre>img=map_closest(img-&gt;select_colors(17)+({({255,255,255}),({0,0,0})}));</pre> + New code: + <pre>img=Image.Colortable(img,19,({({255,255,255}),({0,0,0})}))-&gt;map(img);</pre></p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>match</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>match</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>scale</code>, <code class='datatype'>object</code> <code class='argument'>objectneedle</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>match</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>scale</code>, <code class='datatype'>object</code> <code class='argument'>objectneedle</code>, <code class='datatype'>object</code> <code class='argument'>objecthaystack_cert</code>, <code class='datatype'>object</code> <code class='argument'>objectneedle_cert</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>match</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>scale</code>, <code class='datatype'>object</code> <code class='argument'>objectneedle</code>, <code class='datatype'>object</code> <code class='argument'>objecthaystack_avoid</code>, <code class='datatype'>object</code> <code class='argument'>intfoo</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>match</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>scale</code>, <code class='datatype'>object</code> <code class='argument'>objectneedle</code>, <code class='datatype'>object</code> <code class='argument'>objecthaystack_cert</code>, <code class='datatype'>object</code> <code class='argument'>objectneedle_cert</code>, <code class='datatype'>object</code> <code class='argument'>objecthaystack_avoid</code>, <code class='datatype'>object</code> <code class='argument'>intfoo</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>This method creates an image that describes the + match in every pixel in the image and the + needle-Image.</p> +  + <p><pre> +  new pixel value = +  sum( my_abs(needle_pixel-haystack_pixel)) + </pre></p> +  + <p>The new image only have the red rgb-part set.</p> +  + <p></p>   </dd> - <dt class='head--doc'><span id='p-yoffset'></span>Parameter <code class='parameter'>yoffset</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a texel offset in the y direction within the texture array.</p> + <dt class='head--doc'><span id='p-scale'></span>Parameter <code class='parameter'>scale</code></dt> + <dd></dd><dd class='body--doc'><p>Every pixel is divided with this value. + Note that a proper value here depends on + the size of the neadle. + </p></dd> + <dt class='head--doc'><span id='p-needle'></span>Parameter <code class='parameter'>needle</code></dt> + <dd></dd><dd class='body--doc'><p>The image to use for the matching. + </p></dd> + <dt class='head--doc'><span id='p-haystack_cert'></span>Parameter <code class='parameter'>haystack_cert</code></dt> + <dd></dd><dd class='body--doc'><p>This image should be the same size as + the image itselves. A non-white-part of the + haystack_cert-image modifies the output + by lowering it. + </p></dd> + <dt class='head--doc'><span id='p-needle_cert'></span>Parameter <code class='parameter'>needle_cert</code></dt> + <dd></dd><dd class='body--doc'><p>The same, but for the needle-image. + </p></dd> + <dt class='head--doc'><span id='p-foo'></span>Parameter <code class='parameter'>foo</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-haystack_avoid'></span>Parameter <code class='parameter'>haystack_avoid</code></dt> + <dd></dd><dd class='body--doc'><p>This image should be the same size as + the image itselves. If foo is less than the red + value in haystack_avoid the corresponding + matching-calculating is not calculated. The avoided parts + are drawn in the color 0,100,0. + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the lower left corner - of the rectangular region of pixels to be copied.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p><b>experimental status</b>; may not be exact the same + output in later versions</p>   </dd> - <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the width of the texture subimage.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>phasev</code>, <code>phaseh</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>mirrorx</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>mirrorx</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>mirrors an image: + <table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.mirrorx.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.mirrorx.2.png' width='80' /></td> + </tr><tr valign='center'> + <td>original</td> + <td>-&gt;mirrorx();</td> + </tr></table></p>   </dd> - <dt class='head--doc'><span id='p-height'></span>Parameter <code class='parameter'>height</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the height of the texture subimage.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_2D</code>. </p> - <p><code>GL_INVALID_OPERATION</code> is generated if the texture array has not - been defined by a previous <code>glTexImage2D</code> or <code>glCopyTexImage2D</code> operation.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. - .P - <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater - than log sub 2 max, - where max is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>x</i> ~&lt;~ ~-b or if - <i>y</i> ~&lt;~ ~-b, - where b is the border width of the texture array.</p> - <p><code>GL_INVALID_VALUE</code> is generated if "xoffset" ~&lt;~ -b, - (<i>xoffset</i>~+~<i>width</i>)~&gt;~(w ~-~b), - <i>yoffset</i>~&lt;~ ~-b, or - (<i>yoffset</i>~+~<i>height</i>)~&gt;~(h ~-~b), - where w is the <code>GL_TEXTURE_WIDTH</code>, - h is the <code>GL_TEXTURE_HEIGHT</code>, - and b is the <code>GL_TEXTURE_BORDER</code> - of the texture image being modified. - Note that w and h - include twice the border width.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyTexSubImage2D</code> is executed - between the execution of <code>glBegin</code> and the corresponding - execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glCullFace</b></span> + <span class='homogen--name'><b>mirrory</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCullFace</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>mirrory</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glCullFace</code> specifies whether front- or back-facing facets are culled - (as specified by <i>mode</i>) when facet culling is enabled. Facet - culling is initially disabled. - To enable and disable facet culling, call the - <code>glEnable</code> and <code>glDisable</code> commands - with the argument <code>GL_CULL_FACE</code>. - Facets include triangles, - quadrilaterals, - polygons, - and rectangles.</p> - <p><code>glFrontFace</code> specifies which of the clockwise and counterclockwise facets - are front-facing and back-facing. - See <code>glFrontFace</code>.</p> - </dd> - <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies whether front- or back-facing facets are candidates for culling. - Symbolic constants - <code>GL_FRONT</code>, <code>GL_BACK</code>, and <code>GL_FRONT_AND_BACK</code> are accepted. - The initial value is <code>GL_BACK</code>.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCullFace</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dd class='body--doc'> + <p>mirrors an image: + <table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.mirrory.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.mirrory.2.png' width='80' /></td> + </tr><tr valign='center'> + <td>original</td> + <td>-&gt;mirrory();</td> + </tr></table> + </p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDeleteLists</b></span> + <span class='homogen--name'><b>modify_by_intensity</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDeleteLists</span>(</b><code class='datatype'>int</code> <code class='argument'>list</code>, <code class='datatype'>int</code> <code class='argument'>range</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>modify_by_intensity</span>(</b><code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>) ... <code class='argument'>vn</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glDeleteLists</code> causes a contiguous group of display lists to be deleted. - <i>list</i> is the name of the first display list to be deleted, - and <i>range</i> is the number of display lists to delete. - All display lists \fId\fP with <i>list</i> \(&lt;= \fId\fP \(&lt;= <i>list</i> + <i>range</i> - 1 - are deleted.</p> - <p>All storage locations allocated to the specified display lists are freed, - and the names are available for reuse at a later time. - Names within the range that do not have an associated display list are ignored. - If <i>range</i> is 0, nothing happens.</p> + <dd class='body--doc'> + <p>Recolor an image from intensity values.</p> +  + <p>For each color an intensity is calculated, from r, g and b factors + (see <code>grey</code>), this gives a value between 0 and max.</p> +  + <p>The color is then calculated from the values given, v1 representing + the intensity value of 0, vn representing max, and colors between + representing intensity values between, linear.</p> +  + <p> <table><tr valign='center'> +  <td><img height='115' src='../images/predef.Image.Image.modify_by_intensity.1.png' width='80' /></td> +  <td><img height='115' src='../images/predef.Image.Image.modify_by_intensity.2.png' width='80' /></td> +  </tr><tr valign='center'> +  <td>original</td> +  <td>-&gt;grey()-&gt;modify_by_intensity(1,0,0, 0,({255,0,0}),({0,255,0}));</td> +  </tr></table> + </p>   </dd> - <dt class='head--doc'><span id='p-list'></span>Parameter <code class='parameter'>list</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the integer name of the first display list to delete.</p> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>red, green, blue intensity factors</p></dd> + <dt class='head--doc'><span id='p-v1'></span>Parameter <code class='parameter'>v1</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-vn'></span>Parameter <code class='parameter'>vn</code></dt> + <dd></dd><dd class='body--doc'><p>destination color + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'><span id='p-range'></span>Parameter <code class='parameter'>range</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the number of display lists to delete.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>grey</code>, <code>`*</code>, <code>color</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>noise</b></span> + </dt> + <dd><p><code><code class='object unresolved'>void </code> <b><span class='method'>noise</span>(</b><code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>colorrange</code><b>)</b></code><br> + <code><code class='object unresolved'>void </code> <b><span class='method'>noise</span>(</b><code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>colorrange</code>, <code class='datatype'>float</code> <code class='argument'>scale</code>, <code class='datatype'>float</code> <code class='argument'>xdiff</code>, <code class='datatype'>float</code> <code class='argument'>ydiff</code>, <code class='datatype'>float</code> <code class='argument'>cscale</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Gives a new image with the old image's size, + filled width a 'noise' pattern.</p> +  + <p>The random seed may be different with each instance of pike.</p> +  + <p>Example: + <tt>-&gt;noise( ({0,({255,0,0}), 0.3,({0,255,0}), 0.6,({0,0,255}), 0.8,({255,255,0})}), 0.2,0.0,0.0,1.0 );</tt> + <br /><img height='100' src='../images/predef.Image.Image.noise.1.png' width='200' /> + </p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>range</i> is negative.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDeleteLists</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'><span id='p-colorrange'></span>Parameter <code class='parameter'>colorrange</code></dt> + <dd></dd><dd class='body--doc'><p>colorrange table</p></dd> + <dt class='head--doc'><span id='p-scale'></span>Parameter <code class='parameter'>scale</code></dt> + <dd></dd><dd class='body--doc'><p>default value is 0.1</p></dd> + <dt class='head--doc'><span id='p-xdiff'></span>Parameter <code class='parameter'>xdiff</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-ydiff'></span>Parameter <code class='parameter'>ydiff</code></dt> + <dd></dd><dd class='body--doc'><p>default value is 0,0</p></dd> + <dt class='head--doc'><span id='p-cscale'></span>Parameter <code class='parameter'>cscale</code></dt> + <dd></dd><dd class='body--doc'><p>default value is 1</p></dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>turbulence</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDepthFunc</b></span> + <span class='homogen--name'><b>orient</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>orient4</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDepthFunc</span>(</b><code class='datatype'>int</code> <code class='argument'>func</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>orient</span>(</b><code class='datatype'>void</code>|<code class='datatype'>array</code>(<code class='datatype'>object</code>) <code class='argument'>something</code><b>)</b></code><br> + <code><code class='datatype'>array</code>(<code class='datatype'>object</code>) <b><span class='method'>orient4</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glDepthFunc</code> specifies the function used to compare each incoming pixel depth value - with the depth value present in the depth buffer. - The comparison is performed only if depth testing is enabled. - (See <code>glEnable</code> and <code>glDisable</code> of <code>GL_DEPTH_TEST</code>.)</p> - <p><i>func</i> specifies the conditions under which the pixel will be drawn. - The comparison functions are as follows:</p> - <p><table class='box'> - <tr><td><code>GL_NEVER</code> - </td><td>Never passes. - </td></tr> - <tr><td><code>GL_LESS</code> - </td><td>Passes if the incoming depth value is less than the stored depth value. - </td></tr> - <tr><td><code>GL_EQUAL</code> - </td><td>Passes if the incoming depth value is equal to the stored depth value. - </td></tr> - <tr><td><code>GL_LEQUAL</code> - </td><td>Passes if the incoming depth value is less than or equal to - the stored depth value. - </td></tr> - <tr><td><code>GL_GREATER</code> - </td><td>Passes if the incoming depth value is greater than the stored depth value. - </td></tr> - <tr><td><code>GL_NOTEQUAL</code> - </td><td>Passes if the incoming depth value is not equal to the stored depth value. - </td></tr> - <tr><td><code>GL_GEQUAL</code> - </td><td>Passes if the incoming depth value is greater than or equal to - the stored depth value. - </td></tr> - <tr><td><code>GL_ALWAYS</code> - </td><td>Always passes. - </td></tr> - </table> + <dd class='body--doc'> + <p>Draws images describing the orientation + of the current image.</p> +  + <p><tt>orient</tt> gives an HSV image + (run a <code>hsv_to_rgb</code> pass on it + to get a viewable image). + corresponding to the angle of the + orientation: + <pre> | / - \ +  hue= 0 64 128 192 (=red in an hsv image) +  purple cyan green red + </pre> + Red, green and blue channels are added + and not compared separately.</p> +  + <p>If you first use orient4 you can give its + output as input to this function.</p> +  + <p>The <tt>orient4</tt> function gives back + 4 image objects, corresponding to the + amount of different directions, see above.   </p> - <p>The initial value of <i>func</i> is <code>GL_LESS</code>. - Initially, depth testing is disabled. - .NOTES - Even if the depth buffer exists and the depth mask is non-zero, the - depth buffer is not updated if the depth test is disabled.</p> +    </dd> - <dt class='head--doc'><span id='p-func'></span>Parameter <code class='parameter'>func</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the depth comparison function. - Symbolic constants - <code>GL_NEVER</code>, - <code>GL_LESS</code>, - <code>GL_EQUAL</code>, - <code>GL_LEQUAL</code>, - <code>GL_GREATER</code>, - <code>GL_NOTEQUAL</code>, - <code>GL_GEQUAL</code>, and - <code>GL_ALWAYS</code> are accepted. - The initial value is <code>GL_LESS</code>.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>an image or an array of the four new image objects</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>func</i> is not an accepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDepthFunc</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>experimental status; may not be exact the same + output in later versions</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDepthMask</b></span> + <span class='homogen--name'><b>outline</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>outline_mask</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDepthMask</span>(</b><code class='datatype'>int</code> <code class='argument'>flag</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>outline</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline</span>(</b><code class='datatype'>int</code> <code class='argument'>olr</code>, <code class='datatype'>int</code> <code class='argument'>olg</code>, <code class='datatype'>int</code> <code class='argument'>olb</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline</span>(</b><code class='datatype'>int</code> <code class='argument'>olr</code>, <code class='datatype'>int</code> <code class='argument'>olg</code>, <code class='datatype'>int</code> <code class='argument'>olb</code>, <code class='datatype'>int</code> <code class='argument'>bkgr</code>, <code class='datatype'>int</code> <code class='argument'>bkgg</code>, <code class='datatype'>int</code> <code class='argument'>bkgb</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>mask</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>mask</code>, <code class='datatype'>int</code> <code class='argument'>olr</code>, <code class='datatype'>int</code> <code class='argument'>olg</code>, <code class='datatype'>int</code> <code class='argument'>olb</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>mask</code>, <code class='datatype'>int</code> <code class='argument'>olr</code>, <code class='datatype'>int</code> <code class='argument'>olg</code>, <code class='datatype'>int</code> <code class='argument'>olb</code>, <code class='datatype'>int</code> <code class='argument'>bkgr</code>, <code class='datatype'>int</code> <code class='argument'>bkgg</code>, <code class='datatype'>int</code> <code class='argument'>bkgb</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline_mask</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline_mask</span>(</b><code class='datatype'>int</code> <code class='argument'>bkgr</code>, <code class='datatype'>int</code> <code class='argument'>bkgg</code>, <code class='datatype'>int</code> <code class='argument'>bkgb</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline_mask</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>mask</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>outline_mask</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>int</code>)) <code class='argument'>mask</code>, <code class='datatype'>int</code> <code class='argument'>bkgr</code>, <code class='datatype'>int</code> <code class='argument'>bkgg</code>, <code class='datatype'>int</code> <code class='argument'>bkgb</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glDepthMask</code> specifies whether the depth buffer is enabled for writing. - If <i>flag</i> is <code>GL_FALSE</code>, - depth buffer writing is disabled. - Otherwise, it is enabled. - Initially, depth buffer writing is enabled.</p> + <dd class='body--doc'> + <p>Makes an outline of this image, ie paints with the + given color around the non-background pixels.</p> +  + <p>Default is to paint above, below, to the left and the right of + these pixels.</p> +  + <p>You can also run your own outline mask.</p> +  + <p>The outline_mask function gives the calculated outline as an + alpha channel image of white and black instead.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.outline.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.outline.2.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.outline.3.png' width='80' /></td> + </tr><tr> + <td>original</td> + <td>masked<br />through<br />threshold</td> + <td>...and<br />outlined<br />with red</td> + </tr></table></p> +  + <p></p>   </dd> - <dt class='head--doc'><span id='p-flag'></span>Parameter <code class='parameter'>flag</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies whether the depth buffer is enabled for writing. - If <i>flag</i> is <code>GL_FALSE</code>, - depth buffer writing is disabled. - Otherwise, it is enabled. - Initially, depth buffer writing is enabled.</p> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>mask matrix. Default is <tt>({({0,1,0}),({1,1,1}),({0,1,0})})</tt>.</p></dd> + <dt class='head--doc'><span id='p-olr'></span>Parameter <code class='parameter'>olr</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-olg'></span>Parameter <code class='parameter'>olg</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-olb'></span>Parameter <code class='parameter'>olb</code></dt> + <dd></dd><dd class='body--doc'><p>outline color. Default is current.</p></dd> + <dt class='head--doc'><span id='p-bkgr'></span>Parameter <code class='parameter'>bkgr</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-bkgg'></span>Parameter <code class='parameter'>bkgg</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-bkgb'></span>Parameter <code class='parameter'>bkgb</code></dt> + <dd></dd><dd class='body--doc'><p>background color (what color to outline to); + default is color of pixel 0,0.</p></dd> + <dt class='head--doc'><span id='p-div'></span>Parameter <code class='parameter'>div</code></dt> + <dd></dd><dd class='body--doc'><p>division factor, default is 1.0. + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glDepthMask</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>no antialias!</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDepthRange</b></span> + <span class='homogen--name'><b>paste</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDepthRange</span>(</b><code class='datatype'>float</code> <code class='argument'>zNear</code>, <code class='datatype'>float</code> <code class='argument'>zFar</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>paste</span>(</b><code class='datatype'>object</code> <code class='argument'>image</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste</span>(</b><code class='datatype'>object</code> <code class='argument'>image</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>After clipping and division by <i>w</i>, - depth coordinates range from -1 to 1, - corresponding to the near and far clipping planes. - <code>glDepthRange</code> specifies a linear mapping of the normalized depth coordinates - in this range to window depth coordinates. - Regardless of the actual depth buffer implementation, - window coordinate depth values are treated as though they range - from 0 through 1 (like color components). - Thus, - the values accepted by <code>glDepthRange</code> are both clamped to this range - before they are accepted.</p> - <p>The setting of (0,1) maps the near plane to 0 and - the far plane to 1. - With this mapping, - the depth buffer range is fully utilized.</p> + <dd class='body--doc'> + <p>Pastes a given image over the current image. + </p>   </dd> - <dt class='head--doc'><span id='p-zNear'></span>Parameter <code class='parameter'>zNear</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the mapping of the near clipping plane to window coordinates. - The initial value is 0.</p> + <dt class='head--doc'><span id='p-image'></span>Parameter <code class='parameter'>image</code></dt> + <dd></dd><dd class='body--doc'><p>image to paste (may be empty, needs to be an image object)</p></dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y'></span>Parameter <code class='parameter'>y</code></dt> + <dd></dd><dd class='body--doc'><p>where to paste the image; default is 0,0 + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the object called</p>   </dd> - <dt class='head--doc'><span id='p-zFar'></span>Parameter <code class='parameter'>zFar</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the mapping of the far clipping plane to window coordinates. - The initial value is 1.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glDepthRange</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>paste_mask</code>, <code>paste_alpha</code>, <code>paste_alpha_color</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDisable</b></span> + <span class='homogen--name'><b>paste_alpha</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDisable</span>(</b><code class='datatype'>int</code> <code class='argument'>cap</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha</span>(</b><code class='datatype'>object</code> <code class='argument'>image</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha</span>(</b><code class='datatype'>object</code> <code class='argument'>image</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glEnable</code> and <code>glDisable</code> enable and disable various capabilities. - Use <code>glIsEnabled</code> or <code>glGet</code> to determine the current setting - of any capability. The initial value for each capability with the - exception of <code>GL_DITHER</code> is <code>GL_FALSE</code>. The initial value for - <code>GL_DITHER</code> is <code>GL_TRUE</code>. </p> - <p>Both <code>glEnable</code> and <code>glDisable</code> take a single argument, <i>cap</i>, - which can assume one of the following values:</p> - <p><table class='box'> - <tr><td><code>GL_ALPHA_TEST</code> - </td><td>If enabled, - do alpha testing. See - <code>glAlphaFunc</code>. - </td></tr> - <tr><td><code>GL_AUTO_NORMAL</code> - </td><td>If enabled, - generate normal vectors when either - <code>GL_MAP2_VERTEX_3</code> or - <code>GL_MAP2_VERTEX_4</code> is used to generate vertices. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_BLEND</code> - </td><td>If enabled, - blend the incoming RGBA color values with the values in the color - buffers. See <code>glBlendFunc</code>. - </td></tr> - <tr><td><code>GL_CLIP_PLANE</code><i>i</i> - </td><td>If enabled, - clip geometry against user-defined clipping plane <i>i</i>. - See <code>glClipPlane</code>. - </td></tr> - <tr><td><code>GL_COLOR_LOGIC_OP</code> - </td><td>If enabled, - apply the currently selected logical operation to the incoming RGBA - color and color buffer values. See <code>glLogicOp</code>. - </td></tr> - <tr><td><code>GL_COLOR_MATERIAL</code> - </td><td>If enabled, - have one or more material parameters track the current color. - See <code>glColorMaterial</code>. - </td></tr> - <tr><td><code>GL_CULL_FACE</code> - </td><td>If enabled, - cull polygons based on their winding in window coordinates. - See <code>glCullFace</code>. - </td></tr> - <tr><td><code>GL_DEPTH_TEST</code> - </td><td>If enabled, - do depth comparisons and update the depth buffer. Note that even if - the depth buffer exists and the depth mask is non-zero, the - depth buffer is not updated if the depth test is disabled. See - <code>glDepthFunc</code> and + <dd class='body--doc'> + <p>Pastes a given image over the current image, with + the specified alpha channel value.</p>    - <code>glDepthRange</code>. - </td></tr> - <tr><td><code>GL_DITHER</code> - </td><td>If enabled, - dither color components or indices before they are written to the - color buffer. - </td></tr> - <tr><td><code>GL_FOG</code> - </td><td>If enabled, - blend a fog color into the posttexturing color. - See <code>glFog</code>. - </td></tr> - <tr><td><code>GL_INDEX_LOGIC_OP</code> - </td><td>If enabled, - apply the currently selected logical operation to the incoming index and color - buffer indices. See + <p>An alpha channel value of 0 leaves nothing of the original + image in the paste area, 255 is meaningless and makes the + given image invisible. + </p> + </dd> + <dt class='head--doc'><span id='p-image'></span>Parameter <code class='parameter'>image</code></dt> + <dd></dd><dd class='body--doc'><p>image to paste</p></dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>alpha channel value</p></dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y'></span>Parameter <code class='parameter'>y</code></dt> + <dd></dd><dd class='body--doc'><p>where to paste the image; default is 0,0 + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the object called</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>paste_mask</code>, <code>paste</code>, <code>paste_alpha_color</code></p></dd></dl>    - <code>glLogicOp</code>. - </td></tr> - <tr><td><code>GL_LIGHT</code><i>i</i> - </td><td>If enabled, - include light <i>i</i> in the evaluation of the lighting - equation. See <code>glLightModel</code> and <code>glLight</code>. - </td></tr> - <tr><td><code>GL_LIGHTING</code> - </td><td>If enabled, - use the current lighting parameters to compute the vertex color or index. - Otherwise, simply associate the current color or index with each - vertex. See +     - <code>glMaterial</code>, <code>glLightModel</code>, and <code>glLight</code>. - </td></tr> - <tr><td><code>GL_LINE_SMOOTH</code> - </td><td>If enabled, - draw lines with correct filtering. - Otherwise, - draw aliased lines. - See <code>glLineWidth</code>. - </td></tr> - <tr><td><code>GL_LINE_STIPPLE</code> - </td><td>If enabled, - use the current line stipple pattern when drawing lines. See - <code>glLineStipple</code>. - </td></tr> - <tr><td><code>GL_MAP1_COLOR_4</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate RGBA values. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_INDEX</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate color indices. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_NORMAL</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate normals. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_TEXTURE_COORD_1</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate - <i>s</i> - texture coordinates. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_TEXTURE_COORD_2</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate - <i>s</i> and - <i>t</i> texture coordinates. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_TEXTURE_COORD_3</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate - <i>s</i>, - <i>t</i>, and - <i>r</i> texture coordinates. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_TEXTURE_COORD_4</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate - <i>s</i>, - <i>t</i>, - <i>r</i>, and - <i>q</i> texture coordinates. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_VERTEX_3</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate - <i>x</i>, <i>y</i>, and <i>z</i> vertex coordinates. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP1_VERTEX_4</code> - </td><td>If enabled, - calls to - <code>glEvalCoord1</code>, - <code>glEvalMesh1</code>, and - <code>glEvalPoint1</code> generate - homogeneous - <i>x</i>, - <i>y</i>, - <i>z</i>, and - <i>w</i> vertex coordinates. - See <code>glMap1</code>. - </td></tr> - <tr><td><code>GL_MAP2_COLOR_4</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate RGBA values. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_INDEX</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate color indices. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_NORMAL</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate normals. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_TEXTURE_COORD_1</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate - <i>s</i> - texture coordinates. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_TEXTURE_COORD_2</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate - <i>s</i> and - <i>t</i> texture coordinates. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_TEXTURE_COORD_3</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate - <i>s</i>, - <i>t</i>, and - <i>r</i> texture coordinates. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_TEXTURE_COORD_4</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate - <i>s</i>, - <i>t</i>, - <i>r</i>, and - <i>q</i> texture coordinates. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_VERTEX_3</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate - <i>x</i>, <i>y</i>, and <i>z</i> vertex coordinates. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_MAP2_VERTEX_4</code> - </td><td>If enabled, - calls to - <code>glEvalCoord2</code>, - <code>glEvalMesh2</code>, and - <code>glEvalPoint2</code> generate - homogeneous - <i>x</i>, - <i>y</i>, - <i>z</i>, and - <i>w</i> vertex coordinates. - See <code>glMap2</code>. - </td></tr> - <tr><td><code>GL_NORMALIZE</code> - </td><td>If enabled, - normal vectors specified with <code>glNormal</code> are scaled to unit length - after transformation. See <code>glNormal</code>. - </td></tr> - <tr><td><code>GL_POINT_SMOOTH</code> - </td><td>If enabled, - draw points with proper filtering. - Otherwise, - draw aliased points. - See <code>glPointSize</code>. - </td></tr> - <tr><td><code>GL_POLYGON_OFFSET_FILL</code> - </td><td>If enabled, and if the polygon is rendered in - <code>GL_FILL</code> mode, an offset is added to depth values of a polygon's - fragments before the depth comparison is performed. See - <code>glPolygonOffset</code>. - </td></tr> - <tr><td><code>GL_POLYGON_OFFSET_LINE</code> - </td><td>If enabled, and if the polygon is rendered in - <code>GL_LINE</code> mode, an offset is added to depth values of a polygon's - fragments before the depth comparison is performed. See <code>glPolygonOffset</code>. - </td></tr> - <tr><td><code>GL_POLYGON_OFFSET_POINT</code> - </td><td>If enabled, an offset is added to depth values of a polygon's fragments - before the depth comparison is performed, if the polygon is rendered in - <code>GL_POINT</code> mode. See + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>paste_alpha_color</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha_color</span>(</b><code class='datatype'>object</code> <code class='argument'>mask</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha_color</span>(</b><code class='datatype'>object</code> <code class='argument'>mask</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha_color</span>(</b><code class='datatype'>object</code> <code class='argument'>mask</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha_color</span>(</b><code class='datatype'>object</code> <code class='argument'>mask</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha_color</span>(</b><code class='datatype'>object</code> <code class='argument'>mask</code>, <code class='object unresolved'>Color</code> <code class='argument'>color</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste_alpha_color</span>(</b><code class='datatype'>object</code> <code class='argument'>mask</code>, <code class='object unresolved'>Color</code> <code class='argument'>color</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code><b>)</b></code></p></dd>    - <code>glPolygonOffset</code>. - </td></tr> - <tr><td><code>GL_POLYGON_SMOOTH</code> - </td><td>If enabled, draw polygons with proper filtering. - Otherwise, draw aliased polygons. For correct anti-aliased polygons, - an alpha buffer is needed and the polygons must be sorted front to - back. - </td></tr> - <tr><td><code>GL_POLYGON_STIPPLE</code> - </td><td>If enabled, - use the current polygon stipple pattern when rendering - polygons. See <code>glPolygonStipple</code>. - </td></tr> - <tr><td><code>GL_SCISSOR_TEST</code> - </td><td>If enabled, - discard fragments that are outside the scissor rectangle. - See <code>glScissor</code>. - </td></tr> - <tr><td><code>GL_STENCIL_TEST</code> - </td><td>If enabled, - do stencil testing and update the stencil buffer. - See <code>glStencilFunc</code> and <code>glStencilOp</code>. - </td></tr> - <tr><td><code>GL_TEXTURE_1D</code> - </td><td>If enabled, - one-dimensional texturing is performed - (unless two-dimensional texturing is also enabled). See <code>glTexImage1D</code>. - </td></tr> - <tr><td><code>GL_TEXTURE_2D</code> - </td><td>If enabled, - two-dimensional texturing is performed. See <code>glTexImage2D</code>. - </td></tr> - <tr><td><code>GL_TEXTURE_GEN_Q</code> - </td><td>If enabled, - the <i>q</i> texture coordinate is computed using - the texture generation function defined with <code>glTexGen</code>. - Otherwise, the current <i>q</i> texture coordinate is used. - See <code>glTexGen</code>. - </td></tr> - <tr><td><code>GL_TEXTURE_GEN_R</code> - </td><td>If enabled, - the <i>r</i> texture coordinate is computed using - the texture generation function defined with <code>glTexGen</code>. - Otherwise, the current <i>r</i> texture coordinate is used. - See <code>glTexGen</code>. - </td></tr> - <tr><td><code>GL_TEXTURE_GEN_S</code> - </td><td>If enabled, - the <i>s</i> texture coordinate is computed using - the texture generation function defined with <code>glTexGen</code>. - Otherwise, the current <i>s</i> texture coordinate is used. - See <code>glTexGen</code>. - </td></tr> - <tr><td><code>GL_TEXTURE_GEN_T</code> - </td><td>If enabled, - the <i>t</i> texture coordinate is computed using - the texture generation function defined with <code>glTexGen</code>. - Otherwise, the current <i>t</i> texture coordinate is used. - See <code>glTexGen</code>. - </td></tr> - </table> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Pastes a given color over the current image, + using the given mask as opaque channel.</p> +  + <p>A pixel value of 255 makes the result become the color given, + 0 doesn't change anything.</p> +  + <p>The masks red, green and blue values are used separately. + If no color are given, the current is used.   </p>   </dd> - <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating a GL capability.</p> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>mask image</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>what color to paint with; default is current</p></dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y'></span>Parameter <code class='parameter'>y</code></dt> + <dd></dd><dd class='body--doc'><p>where to paste the image; default is 0,0 + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the object called</p>   </dd> - <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating a GL capability.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>paste_mask</code>, <code>paste_alpha</code>, <code>paste_alpha_color</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>paste_mask</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>paste_mask</span>(</b><code class='datatype'>object</code> <code class='argument'>image</code>, <code class='datatype'>object</code> <code class='argument'>mask</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>paste_mask</span>(</b><code class='datatype'>object</code> <code class='argument'>image</code>, <code class='datatype'>object</code> <code class='argument'>mask</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>Pastes a given image over the current image, + using the given mask as opaque channel.</p> +  + <p>A pixel value of 255 makes the result become a pixel + from the given image, 0 doesn't change anything.</p> +  + <p>The masks red, green and blue values are used separately. + </p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>cap</i> is not one of the values - listed previously.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEnable</code> or <code>glDisable</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'><span id='p-image'></span>Parameter <code class='parameter'>image</code></dt> + <dd></dd><dd class='body--doc'><p>image to paste</p></dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>mask image</p></dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-y'></span>Parameter <code class='parameter'>y</code></dt> + <dd></dd><dd class='body--doc'><p>where to paste the image; default is 0,0 + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the object called</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>paste</code>, <code>paste_alpha</code>, <code>paste_alpha_color</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDisableClientState</b></span> + <span class='homogen--name'><b>phaseh</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>phasev</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>phasevh</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>phasehv</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDisableClientState</span>(</b><code class='datatype'>int</code> <code class='argument'>cap</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>phaseh</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>phasev</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>phasevh</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>phasehv</span>(</b><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glEnableClientState</code> and <code>glDisableClientState</code> - enable or disable individual client-side capabilities. By default, all - client-side capabilities are disabled. - Both - <code>glEnableClientState</code> and <code>glDisableClientState</code> take a - single argument, <i>cap</i>, which can assume one of the following - values: </p> - <p><table class='box'> - <tr><td><code>GL_COLOR_ARRAY</code> - </td><td>If enabled, the color array is enabled for writing and used during - rendering when <code>glDrawArrays</code> or - <code>glDrawElement</code> is called. See - <code>glColorPointer</code>. - </td></tr> - <tr><td><code>GL_EDGE_FLAG_ARRAY</code> - </td><td>If enabled, the edge flag array is enabled for writing and used during - rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is called. See - <code>glEdgeFlagPointer</code>. - </td></tr> - <tr><td><code>GL_INDEX_ARRAY</code> - </td><td>If enabled, the index array is enabled for writing and used during - rendering when <code>glDrawArrays</code> or - <code>glDrawElements</code> is called. See - <code>glIndexPointer</code>. - </td></tr> - <tr><td><code>GL_NORMAL_ARRAY</code> - </td><td>If enabled, the normal array is enabled for writing and used during - rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is called. See - <code>glNormalPointer</code>. - </td></tr> - <tr><td><code>GL_TEXTURE_COORD_ARRAY</code> - </td><td>If enabled, the texture coordinate array is enabled for writing and - used for rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is - called. See <code>glTexCoordPointer</code>. - </td></tr> - <tr><td><code>GL_VERTEX_ARRAY</code> - </td><td>If enabled, the vertex array is enabled for writing and used during - rendering when <code>glDrawArrays</code> or - <code>glDrawElements</code> is called. See - <code>glVertexPointer</code>. - </td></tr> + <dd class='body--doc'> + <p>Draws images describing the phase + of the current image. phaseh gives the + horizontal phase and phasev the vertical + phase.</p> +  + <p><tt>phaseh</tt> gives an image + where + <pre> +  max falling min rising + value= 0 64 128 192 + </pre></p> +  + <p>0 is set if there is no way to determine + if it is rising or falling. This is done + for the every red, green and blue part of + the image.</p> +  + <p>Phase images can be used to create ugly + effects or to find meta-information + in the orginal image.</p> +  + <p><table border='0'> + <tr> + <td><img height='115' src='../images/predef.Image.Image.phaseh.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.phaseh.2.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.phaseh.3.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.phaseh.4.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.phaseh.5.png' width='80' /></td> + </tr> + <tr> + <td>original </td> + <td>phaseh() </td> + <td>phasev() </td> + <td>phasevh()</td> + <td>phasehv()</td> + </tr>   </table>   </p>   </dd> - <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the capability to enable. - Symbolic constants - <code>GL_COLOR_ARRAY</code>, - <code>GL_EDGE_FLAG_ARRAY</code>, - <code>GL_INDEX_ARRAY</code>, - <code>GL_NORMAL_ARRAY</code>, - <code>GL_TEXTURE_COORD_ARRAY</code>, and - <code>GL_VERTEX_ARRAY</code> - are accepted.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd> - <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the capability to disable.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p><b>experimental status</b>; may not be exact the same + output in later versions</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>cap</i> is not an accepted value.</p> - <p><code>glEnableClientState</code> is not allowed between the execution of <code>glBegin</code> and the - corresponding <code>glEnd</code>, but an error may or may not be generated. If - no error is generated, the behavior is undefined.</p> + <dt class='head--doc'>Bugs</dt> + <dd class='body--doc'> + <p>0 should not be set as explained above.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDrawArrays</b></span> + <span class='homogen--name'><b>polyfill</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDrawArrays</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code>, <code class='datatype'>int</code> <code class='argument'>first</code>, <code class='datatype'>int</code> <code class='argument'>count</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>polyfill</span>(</b><code class='datatype'>array</code>(<code class='datatype'>int</code>|<code class='datatype'>float</code>) ... <code class='argument'>curve</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glDrawArrays</code> specifies multiple geometric primitives - with very few subroutine calls. Instead of calling a GL procedure - to pass each individual vertex, normal, texture coordinate, edge - flag, or color, you can prespecify - separate arrays of vertexes, normals, and colors and use them to - construct a sequence of primitives with a single - call to <code>glDrawArrays</code>.</p> - <p>When <code>glDrawArrays</code> is called, it uses <i>count</i> sequential elements from each - enabled array to construct a sequence of geometric primitives, - beginning with element <i>first</i>. <i>mode</i> specifies what kind of - primitives are constructed, and how the array elements - construct those primitives. If <code>GL_VERTEX_ARRAY</code> is not enabled, no - geometric primitives are generated.</p> - <p>Vertex attributes that are modified by <code>glDrawArrays</code> have an - unspecified value after <code>glDrawArrays</code> returns. For example, if - <code>GL_COLOR_ARRAY</code> is enabled, the value of the current color is - undefined after <code>glDrawArrays</code> executes. Attributes that aren't - modified remain well defined.</p> + <dd class='body--doc'> + <p>fills an area with the current color + </p>   </dd> - <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies what kind of primitives to render. - Symbolic constants - <code>GL_POINTS</code>, - <code>GL_LINE_STRIP</code>, - <code>GL_LINE_LOOP</code>, - <code>GL_LINES</code>, - <code>GL_TRIANGLE_STRIP</code>, - <code>GL_TRIANGLE_FAN</code>, - <code>GL_TRIANGLES</code>, - <code>GL_QUAD_STRIP</code>, - <code>GL_QUADS</code>, - and <code>GL_POLYGON</code> are accepted.</p> + <dt class='head--doc'><span id='p-curve'></span>Parameter <code class='parameter'>curve</code></dt> + <dd></dd><dd class='body--doc'><p>curve(s), <tt>({x1,y1,x2,y2,...,xn,yn})</tt>, + automatically closed.</p> +  + <p>If any given curve is inside another, it + will make a hole. + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the current object</p>   </dd> - <dt class='head--doc'><span id='p-first'></span>Parameter <code class='parameter'>first</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the starting index in the enabled arrays.</p> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'> + <p>Lines in the polygon may <i>not</i> be crossed without + the crossing coordinate specified in both lines. + </p>   </dd> - <dt class='head--doc'><span id='p-count'></span>Parameter <code class='parameter'>count</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the number of indices to be rendered.</p> + <dt class='head--doc'>Bugs</dt> + <dd class='body--doc'> + <p>Inverted lines reported on Intel and Alpha processors. + </p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> - <p><code>GL_INVALID_VALUE</code> is generated if <i>count</i> is negative.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDrawArrays</code> is executed between - the execution of <code>glBegin</code> and the corresponding <code>glEnd</code>.</p> - </dd></dl> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>setcolor</code></p></dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDrawBuffer</b></span> + <span class='homogen--name'><b>random</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>randomgrey</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDrawBuffer</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>random</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>random</span>(</b><code class='datatype'>int</code> <code class='argument'>seed</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>randomgrey</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>random</span>(</b><code class='object unresolved'>greyint</code> <code class='argument'>seed</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>When colors are written to the frame buffer, - they are written into the color buffers specified by <code>glDrawBuffer</code>. - The specifications are as follows:</p> - <p><table class='box'> - <tr><td><code>GL_NONE</code> - </td><td>No color buffers are written. - </td></tr> - <tr><td><code>GL_FRONT_LEFT</code> - </td><td>Only the front left color buffer is written. - </td></tr> - <tr><td><code>GL_FRONT_RIGHT</code> - </td><td>Only the front right color buffer is written. - </td></tr> - <tr><td><code>GL_BACK_LEFT</code> - </td><td>Only the back left color buffer is written. - </td></tr> - <tr><td><code>GL_BACK_RIGHT</code> - </td><td>Only the back right color buffer is written. - </td></tr> - <tr><td><code>GL_FRONT</code> - </td><td>Only the front left and front right color buffers are written. - If there is no front right color buffer, - only the front left color buffer is written. - </td></tr> - <tr><td><code>GL_BACK</code> - </td><td>Only the back left and back right color buffers are written. - If there is no back right color buffer, - only the back left color buffer is written. - </td></tr> - <tr><td><code>GL_LEFT</code> - </td><td>Only the front left and back left color buffers are written. - If there is no back left color buffer, - only the front left color buffer is written. - </td></tr> - <tr><td><code>GL_RIGHT</code> - </td><td>Only the front right and back right color buffers are written. - If there is no back right color buffer, - only the front right color buffer is written. - </td></tr> - <tr><td><code>GL_FRONT_AND_BACK</code> - </td><td>All the front and back color buffers - (front left, front right, back left, back right) - are written. - If there are no back color buffers, - only the front left and front right color buffers are written. - If there are no right color buffers, - only the front left and back left color buffers are written. - If there are no right or back color buffers, - only the front left color buffer is written. - </td></tr> - <tr><td><code>GL_AUX</code><i>i</i> - </td><td>Only auxiliary color buffer <i>i</i> is written. - </td></tr> - </table> + <dd class='body--doc'> + <p>Gives a randomized image;<br /> + <table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.random.1.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.random.2.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.random.3.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.random.4.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.random.5.png' width='80' /></td> + <td><img height='115' src='../images/predef.Image.Image.random.6.png' width='80' /></td> + </tr><tr> + <td>original</td> + <td>-&gt;random()</td> + <td>-&gt;random(17)</td> + <td>greyed<br />(same again)</td> + <td>color(red)<br />(same again)</td> + <td>...red channel<br /></td> + </tr></table></p> +  + <p>Use with -&gt;<code>grey</code>() or -&gt;<code>color</code>() + for one-color-results.   </p> - <p>If more than one color buffer is selected for drawing, - then blending or logical operations are computed and applied independently - for each color buffer and can produce different results in each buffer.</p> - <p>Monoscopic contexts include only - .I left - buffers, and stereoscopic contexts include both - .I left - and - .I right - buffers. - Likewise, single-buffered contexts include only - .I front - buffers, and double-buffered contexts include both - .I front - and - .I back - buffers. - The context is selected at GL initialization.</p> +    </dd> - <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies up to four color buffers to be drawn into. - Symbolic constants - <code>GL_NONE</code>, - <code>GL_FRONT_LEFT</code>, - <code>GL_FRONT_RIGHT</code>, - <code>GL_BACK_LEFT</code>, - <code>GL_BACK_RIGHT</code>, - <code>GL_FRONT</code>, - <code>GL_BACK</code>, - <code>GL_LEFT</code>, - <code>GL_RIGHT</code>, - <code>GL_FRONT_AND_BACK</code>, and - <code>GL_AUX</code><i>i</i>, - where <i>i</i> is between 0 and ``<code>GL_AUX_BUFFERS</code>'' -1, - are accepted (<code>GL_AUX_BUFFERS</code> is not the upper limit; use <code>glGet</code> - to query the number of available aux buffers.) - The initial value is <code>GL_FRONT</code> for single-buffered contexts, - and <code>GL_BACK</code> for double-buffered contexts.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>a new image</p>   </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if none of the buffers indicated - by <i>mode</i> exists.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDrawBuffer</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'> + <p><code>test</code>, <code>noise</code></p></dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>write_lsb_rgb</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>write_lsb_grey</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>read_lsb_rgb</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>read_lsb_grey</b></span><br> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>write_lsb_rgb</span>(</b><code class='datatype'>string</code> <code class='argument'>what</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>write_lsb_grey</span>(</b><code class='datatype'>string</code> <code class='argument'>what</code><b>)</b></code><br> + <code><code class='object unresolved'>string </code> <b><span class='method'>read_lsb_rgb</span>(</b><b>)</b></code><br> + <code><code class='object unresolved'>string </code> <b><span class='method'>read_lsb_grey</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>These functions read/write in the least significant bit + of the image pixel values. The _rgb() functions + read/write on each of the red, green and blue values, + and the grey keeps the same lsb on all three.</p> +  + <p>The string is nullpadded or cut to fit. + </p> + </dd> + <dt class='head--doc'><span id='p-what'></span>Parameter <code class='parameter'>what</code></dt> + <dd></dd><dd class='body--doc'><p>the hidden message</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the current object or the read string</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glDrawPixels</b></span> + <span class='homogen--name'><b>rotate</b></span><br> + <span class='homogen--type'>Method</span> + <span class='homogen--name'><b>rotate_expand</b></span><br>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDrawPixels</span>(</b><code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>width</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>height</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>format</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>type</code>, <code class='datatype'>array</code>(<code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>)) <code class='argument'>pixels</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>rotate</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>angle</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>rotate</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>angle</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>rotate_expand</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>angle</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>rotate_expand</span>(</b><code class='datatype'>int</code>|<code class='datatype'>float</code> <code class='argument'>angle</code>, <code class='datatype'>int</code> <code class='argument'>r</code>, <code class='datatype'>int</code> <code class='argument'>g</code>, <code class='datatype'>int</code> <code class='argument'>b</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p><code>glDrawPixels</code> reads pixel data from memory and writes it into the frame buffer - relative to the current raster position. - Use <code>glRasterPos</code> to set the current raster position; use - <code>glGet</code> with argument <code>GL_CURRENT_RASTER_POSITION</code> - to query the raster position.</p> - <p>Several parameters define the encoding of pixel data in memory - and control the processing of the pixel data - before it is placed in the frame buffer. - These parameters are set with four commands: - <code>glPixelStore</code>, - <code>glPixelTransfer</code>, - <code>glPixelMap</code>, and <code>glPixelZoom</code>. - This reference page describes the effects on <code>glDrawPixels</code> of many, - but not all, of the parameters specified by these four commands.</p> - <p>Data is read from <i>pixels</i> as a sequence of signed or unsigned bytes, - signed or unsigned shorts, - signed or unsigned integers, - or single-precision floating-point values, - depending on <i>type</i>. - Each of these bytes, shorts, integers, or floating-point values is - interpreted as one color or depth component, - or one index, - depending on <i>format</i>. - Indices are always treated individually. - Color components are treated as groups of one, - two, - three, - or four values, - again based on <i>format</i>. - Both individual indices and groups of components are - referred to as pixels. - If <i>type</i> is <code>GL_BITMAP</code>, - the data must be unsigned bytes, - and <i>format</i> must be either <code>GL_COLOR_INDEX</code> or <code>GL_STENCIL_INDEX</code>. - Each unsigned byte is treated as eight 1-bit pixels, - with bit ordering determined by - <code>GL_UNPACK_LSB_FIRST</code> (see <code>glPixelStore</code>).</p> - <p><i>width</i>times<i>height</i> pixels are read from memory, - starting at location <i>pixels</i>. - By default, these pixels are taken from adjacent memory locations, - except that after all <i>width</i> pixels are read, - the read pointer is advanced to the next four-byte boundary. - The four-byte row alignment is specified by <code>glPixelStore</code> with - argument <code>GL_UNPACK_ALIGNMENT</code>, - and it can be set to one, two, four, or eight bytes. - Other pixel store parameters specify different read pointer advancements, - both before the first pixel is read - and after all <i>width</i> pixels are read. - See the </p> - <p><code>glPixelStore</code> reference page for details on these options.</p> - <p>The <i>width</i>times<i>height</i> pixels that are read from memory are - each operated on in the same way, - based on the values of several parameters specified by <code>glPixelTransfer</code> - and <code>glPixelMap</code>. - The details of these operations, - as well as the target buffer into which the pixels are drawn, - are specific to the format of the pixels, - as specified by <i>format</i>. - <i>format</i> can assume one of eleven symbolic values:</p> - <p><table class='box'> - <tr><td><code>GL_COLOR_INDEX</code> - </td><td>Each pixel is a single value, - a color index. - It is converted to fixed-point format, - with an unspecified number of bits to the right of the binary point, - regardless of the memory data type. - Floating-point values convert to true fixed-point values. - Signed and unsigned integer data is converted with all fraction bits - set to 0. - Bitmap data convert to either 0 or 1. + <dd class='body--doc'> + <p>Rotates an image a certain amount of degrees (360° is + a complete rotation) counter-clockwise:</p>    - Each fixed-point index is then shifted left by <code>GL_INDEX_SHIFT</code> bits - and added to <code>GL_INDEX_OFFSET</code>. - If <code>GL_INDEX_SHIFT</code> is negative, - the shift is to the right. - In either case, zero bits fill otherwise unspecified bit locations in the - result. + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.rotate.1.png' width='80' /></td> + <td><img height='141' src='../images/predef.Image.Image.rotate.2.png' width='113' /></td> + <td><img height='141' src='../images/predef.Image.Image.rotate.3.png' width='113' /></td> + </tr><tr valign='center'> + <td>original</td> + <td>-&gt;rotate(15,255,0,0);</td> + <td>-&gt;rotate_expand(15);</td> + </tr></table></p>    - If the GL is in RGBA mode, - the resulting index is converted to an RGBA pixel - with the help of the <code>GL_PIXEL_MAP_I_TO_R</code>, - <code>GL_PIXEL_MAP_I_TO_G</code>, - <code>GL_PIXEL_MAP_I_TO_B</code>, - and <code>GL_PIXEL_MAP_I_TO_A</code> tables. - If the GL is in color index mode, - and if <code>GL_MAP_COLOR</code> is true, - the index is replaced with the value that it references in lookup table - <code>GL_PIXEL_MAP_I_TO_I</code>. - Whether the lookup replacement of the index is done or not, - the integer part of the index is then ANDed with 2 sup b -1, - where b is the number of bits in a color index buffer. + <p>The "expand" variant of functions stretches the + image border pixels rather then filling with + the given or current color.</p>    - The GL then converts the resulting indices or RGBA colors to fragments - by attaching the current raster position <i>z</i> coordinate and - texture coordinates to each pixel, - then assigning x and y window coordinates to the nth fragment such that - .sp - .RS - .ce - x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" - .sp - .ce - y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf - .ce 0 - .sp - .RE + <p>This rotate uses the <code>skewx</code>() and <code>skewy</code>() functions.</p> + </dd> + <dt class='head--doc'><span id='p-angle'></span>Parameter <code class='parameter'>angle</code></dt> + <dd></dd><dd class='body--doc'><p>the number of degrees to rotate</p></dd> + <dt class='head--doc'><span id='p-r'></span>Parameter <code class='parameter'>r</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-g'></span>Parameter <code class='parameter'>g</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-b'></span>Parameter <code class='parameter'>b</code></dt> + <dd></dd><dd class='body--doc'><p>color to fill with; default is current</p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p> + </dd></dl>    - where (x sub r , y sub r) is the current raster position. - These pixel fragments are then treated just like the fragments generated by - rasterizing points, lines, or polygons. - Texture mapping, - fog, - and all the fragment operations are applied before the fragments are written - to the frame buffer. - </td></tr> - <tr><td><code>GL_STENCIL_INDEX</code> - </td><td>Each pixel is a single value, - a stencil index. - It is converted to fixed-point format, - with an unspecified number of bits to the right of the binary point, - regardless of the memory data type. - Floating-point values convert to true fixed-point values. - Signed and unsigned integer data is converted with all fraction bits - set to 0. - Bitmap data convert to either 0 or 1. +     - Each fixed-point index is then shifted left by <code>GL_INDEX_SHIFT</code> bits, - and added to <code>GL_INDEX_OFFSET</code>. - If <code>GL_INDEX_SHIFT</code> is negative, - the shift is to the right. - In either case, zero bits fill otherwise unspecified bit locations in the - result. - If <code>GL_MAP_STENCIL</code> is true, - the index is replaced with the value that it references in lookup table - <code>GL_PIXEL_MAP_S_TO_S</code>. - Whether the lookup replacement of the index is done or not, - the integer part of the index is then ANDed with 2 sup b -1, - where b is the number of bits in the stencil buffer. - The resulting stencil indices are then written to the stencil buffer - such that the nth index is written to location - </td></tr> - </table> - </p> - <p>.RS - .ce - x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" - .sp - .ce - y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf - .fi - .sp - .RE</p> - <p>where (x sub r , y sub r) is the current raster position. - Only the pixel ownership test, - the scissor test, - and the stencil writemask affect these write operations.</p> - <p><table class='box'> - <tr><td><code>GL_DEPTH_COMPONENT</code> - </td><td>Each pixel is a single-depth component. - Floating-point data is converted directly to an internal floating-point - format with unspecified precision. - Signed integer data is mapped linearly to the internal floating-point - format such that the most positive representable integer value maps to 1.0, - and the most negative representable value maps to -1.0. - Unsigned integer data is mapped similarly: - the largest integer value maps to 1.0, - and 0 maps to 0.0. - The resulting floating-point depth value is then multiplied by - by <code>GL_DEPTH_SCALE</code> and added to <code>GL_DEPTH_BIAS</code>. - The result is clamped to the range [0,1]. + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>rotate_ccw</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>rotate_ccw</span>(</b><b>)</b></code></p></dd>    - The GL then converts the resulting depth components to fragments - by attaching the current raster position color or color index and - texture coordinates to each pixel, - then assigning x and y window coordinates to the nth fragment such that - </td></tr> - </table> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>rotates an image counter-clockwise, 90 degrees.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.rotate_ccw.1.png' width='80' /></td> + <td><img height='80' src='../images/predef.Image.Image.rotate_ccw.2.png' width='115' /></td> + </tr><tr valign='center'> + <td>original</td> + <td>-&gt;rotate_ccw();</td> + </tr></table>   </p> - <p>.RS - .ce - x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" - .sp - .ce - y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf - .ce 0 - .sp - .RE</p> - <p>where (x sub r , y sub r) is the current raster position. - These pixel fragments are then treated just like the fragments generated by - rasterizing points, lines, or polygons. - Texture mapping, - fog, - and all the fragment operations are applied before the fragments are written - to the frame buffer.</p> - <p><table class='box'> - <tr><td><code>GL_RGBA</code> - </td><td>Each pixel is a four-component group: for <code>GL_RGBA</code>, the red - component is first, followed by green, followed by blue, followed by - alpha. - Floating-point values are converted directly to an internal floating-point - format with unspecified precision. - Signed integer values are mapped linearly to the internal floating-point - format such that the most positive representable integer value maps to 1.0, - and the most negative representable value maps to -1.0. (Note that - this mapping does not convert 0 precisely to 0.0.) - Unsigned integer data is mapped similarly: - the largest integer value maps to 1.0, - and 0 maps to 0.0. - The resulting floating-point color values are then multiplied - by <code>GL_c_SCALE</code> and added to <code>GL_c_BIAS</code>, - where <i>c</i> is RED, GREEN, BLUE, and ALPHA - for the respective color components. - The results are clamped to the range [0,1]. + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p> + </dd></dl>    - If <code>GL_MAP_COLOR</code> is true, - each color component is scaled by the size of lookup table - <code>GL_PIXEL_MAP_c_TO_c</code>, - then replaced by the value that it references in that table. - <i>c</i> is R, G, B, or A respectively. +     - The GL then converts the resulting RGBA colors to fragments - by attaching the current raster position <i>z</i> coordinate and - texture coordinates to each pixel, - then assigning x and y window coordinates to the nth fragment such that - </td></tr> - </table> - </p> - <p>.RS - .ce - x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" - .sp - .ce - y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf - .ce 0 - .sp - .RE</p> - <p>where (x sub r , y sub r) is the current raster position. - These pixel fragments are then treated just like the fragments generated by - rasterizing points, lines, or polygons. - Texture mapping, - fog, - and all the fragment operations are applied before the fragments are written - to the frame buffer.</p> - <p><table class='box'> - <tr><td><code>GL_RED</code> - </td><td>Each pixel is a single red component. - This component is converted to the internal floating-point format in - the same way the red component of an RGBA pixel is. It is - then converted to an RGBA pixel with green and blue set to 0, - and alpha set to 1. - After this conversion, the pixel is treated as if it had been read - as an RGBA pixel. - </td></tr> - <tr><td><code>GL_GREEN</code> - </td><td>Each pixel is a single green component. - This component is converted to the internal floating-point format in - the same way the green component of an RGBA pixel is. - It is then converted to an RGBA pixel with red and blue set to 0, - and alpha set to 1. - After this conversion, the pixel is treated as if it had been read - as an RGBA pixel. - </td></tr> - <tr><td><code>GL_BLUE</code> - </td><td>Each pixel is a single blue component. - This component is converted to the internal floating-point format in - the same way the blue component of an RGBA pixel is. - It is then converted to an RGBA pixel with red and green set to 0, - and alpha set to 1. - After this conversion, the pixel is treated as if it had been read - as an RGBA pixel. - </td></tr> - <tr><td><code>GL_ALPHA</code> - </td><td>Each pixel is a single alpha component. - This component is converted to the internal floating-point format in - the same way the alpha component of an RGBA pixel is. - It is then converted to an RGBA pixel with red, green, and blue set to 0. - After this conversion, the pixel is treated as if it had been read - as an RGBA pixel. - </td></tr> - <tr><td><code>GL_RGB</code> - </td><td>Each pixel is a three-component group: - red first, followed by green, followed by blue. - Each component is converted to the internal floating-point format in - the same way the red, green, and blue components of an RGBA pixel are. - The color triple is converted to an RGBA pixel with alpha set to 1. - After this conversion, the pixel is treated as if it had been read - as an RGBA pixel. - </td></tr> - <tr><td><code>GL_LUMINANCE</code> - </td><td>Each pixel is a single luminance component. - This component is converted to the internal floating-point format in - the same way the red component of an RGBA pixel is. - It is then converted to an RGBA pixel with red, green, and blue set to the - converted luminance value, - and alpha set to 1. - After this conversion, the pixel is treated as if it had been read - as an RGBA pixel. - </td></tr> - <tr><td><code>GL_LUMINANCE_ALPHA</code> - </td><td>Each pixel is a two-component group: - luminance first, followed by alpha. - The two components are converted to the internal floating-point format in - the same way the red component of an RGBA pixel is. - They are then converted to an RGBA pixel with red, green, and blue set to the - converted luminance value, - and alpha set to the converted alpha value. - After this conversion, the pixel is treated as if it had been read - as an RGBA pixel. - </td></tr> - </table> - </p> - <p>The following table summarizes the meaning of the valid constants for the - <i>type</i> parameter: - .sp 2 - .TS - center box ; - ci | ci - c | c . - type corresponding type - = - GL_UNSIGNED_BYTE unsigned 8-bit integer - GL_BYTE signed 8-bit integer - GL_BITMAP single bits in unsigned 8-bit integers - GL_UNSIGNED_SHORT unsigned 16-bit integer - GL_SHORT signed 16-bit integer - GL_UNSIGNED_INT unsigned 32-bit integer - GL_INT 32-bit integer - GL_FLOAT single-precision floating-point - .TE - .sp</p> - <p>The rasterization described so far assumes pixel zoom factors of 1. - If </p> - <p><code>glPixelZoom</code> is used to change the x and y pixel zoom factors, - pixels are converted to fragments as follows. - If (x sub r, y sub r) is the current raster position, - and a given pixel is in the nth column and mth row - of the pixel rectangle, - then fragments are generated for pixels whose centers are in the rectangle - with corners at - .sp - .RS - .ce - (x sub r + zoom sub x n, y sub r + zoom sub y m) - .sp - .ce - (x sub r + zoom sub x (n + 1), y sub r + zoom sub y ( m + 1 )) - .ce 0 - .sp - .RE</p> - <p>where zoom sub x is the value of <code>GL_ZOOM_X</code> and - zoom sub y is the value of <code>GL_ZOOM_Y</code>.</p> + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>rotate_cw</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>rotate_cw</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>rotates an image clockwise, 90 degrees.</p> +  + <p><table><tr valign='center'> + <td><img height='115' src='../images/predef.Image.Image.rotate_cw.1.png' width='80' /></td> + <td><img height='80' src='../images/predef.Image.Image.rotate_cw.2.png' width='115' /></td> + </tr><tr valign='center'> + <td>original</td> + <td>-&gt;rotate_cw();</td> + </tr></table></p>   </dd> - <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> - <dd></dd><dd class='body--doc'><p>Specify the dimensions of the pixel rectangle to be written - into the frame buffer.</p> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>scale</b></span> + </dt> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>scale</span>(</b><code class='datatype'>float</code> <code class='argument'>factor</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>scale</span>(</b><code class='argument'>0.5</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>scale</span>(</b><code class='datatype'>float</code> <code class='argument'>xfactor</code>, <code class='datatype'>float</code> <code class='argument'>yfactor</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'> + <p>scales the image with a factor, + 0.5 is an optimized case.</p>   </dd> - <dt class='head--doc'><span id='p-format'></span>Parameter <code class='parameter'>format</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the format of the pixel data. - Symbolic constants - <code>GL_COLOR_INDEX</code>, - <code>GL_STENCIL_INDEX</code>, - <code>GL_DEPTH_COMPONENT</code>, - <code>GL_RGBA</code>, - <code>GL_RED</code>, - <code>GL_GREEN</code>, - <code>GL_BLUE</code>, - <code>GL_ALPHA</code>, - <code>GL_RGB</code>, - <code>GL_LUMINANCE</code>, and - <code>GL_LUMINANCE_ALPHA</code> are accepted.</p> - </dd> - <dt class='head--doc'><span id='p-type'></span>Parameter <code class='parameter'>type</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies the data type for <i>pixels</i>. - Symbolic constants - <code>GL_UNSIGNED_BYTE</code>, - <code>GL_BYTE</code>, - <code>GL_BITMAP</code>, - <code>GL_UNSIGNED_SHORT</code>, - <code>GL_SHORT</code>, - <code>GL_UNSIGNED_INT</code>, - <code>GL_INT</code>, and - <code>GL_FLOAT</code> are accepted.</p> - </dd> - <dt class='head--doc'><span id='p-pixels'></span>Parameter <code class='parameter'>pixels</code></dt> - <dd></dd><dd class='body--doc'><p>Specifies a pointer to the pixel data.</p> - </dd> - <dt class='head--doc'>Throws</dt> - <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if either <i>width</i> or <i>height</i> is negative.</p> - <p><code>GL_INVALID_ENUM</code> is generated if <i>format</i> or <i>type</i> is not one of - the accepted values.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <i>format</i> is - <code>GL_RED</code>, - <code>GL_GREEN</code>, - <code>GL_BLUE</code>, - <code>GL_ALPHA</code>, - <code>GL_RGB</code>, - <code>GL_RGBA</code>, - <code>GL_LUMINANCE</code>, - or - <code>GL_LUMINANCE_ALPHA</code>, - and the GL is in color index mode.</p> - <p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is <code>GL_BITMAP</code> and - <i>format</i> is not either <code>GL_COLOR_INDEX</code> or <code>GL_STENCIL_INDEX</code>.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <i>format</i> is <code>GL_STENCIL_INDEX</code> - and there is no stencil buffer.</p> - <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDrawPixels</code> - is executed between the execution of <code>glBegin</code> - and the corresponding execution of <code>glEnd</code>.</p> + <dt class='head--doc'><span id='p-factor'></span>Parameter <code class='parameter'>factor</code></dt> + <dd></dd><dd class='body--doc'><p>factor to use for both x and y</p></dd> + <dt class='head--doc'><span id='p-xfactor'></span>Parameter <code class='parameter'>xfactor</code></dt> + <dd></dd> + <dt class='head--doc'><span id='p-yfactor'></span>Parameter <code class='parameter'>yfactor</code></dt> + <dd></dd><dd class='body--doc'><p>separate factors for x and y + </p></dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'> + <p>the new image object</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> - <span class='homogen--name'><b>glEdgeFlag</b></span> + <span class='homogen--name'><b>scale</b></span>   </dt> - <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEdgeFlag</span>(</b><code class='datatype'>int</code> <code class='argument'>flag</code><b>)</b></code></p></dd> + <dd><p><code><code class='object unresolved'>object </code> <b><span class='method'>scale</span>(</b><code class='datatype'>int</code> <code class='argument'>newxsize</code>, <code class='datatype'>int</code> <code class='argument'>newysize</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>scale</span>(</b><code class='argument'>0</code>, <code class='datatype'>int</code> <code class='argument'>newysize</code><b>)</b></code><br> + <code><code class='object unresolved'>object </code> <b><span class='method'>scale</span>(</b><code class='datatype'>int</code> <code class='argument'>newxsize</code>, <code class='argument'>0</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt> - <dd class='body--doc'><p>Each vertex of a polygon, - separate triangle, - or separate quadrilateral specified between a <code>glBegin</code>/<code>glEnd</code> pair - is marked as the start of either a boundary or nonboundary edge. - If the current edge flag is true when the vertex is specified, - the vertex is marked as the start of a boundary edge. - Otherwise, the vertex is marked as the start of a nonboundary edge. - <code>glEdgeFlag</code> sets the edge flag bit to <code>GL_TRUE</code> if <i>flag</i> is <code>GL_TRUE</code>, -