[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10 Pixels, bitmaps and images

Pixel operations

Function: gl-bitmap width height xbo ybo xbi ybi bitmap

Draws a bitmap. Width and height gives the dimension of the bitmap. Xbo, ybo, xbi, and ybi specifies the origin and increment of the current raster position. Bitmap is the actual bitmap data, packed in a u8vector.

Function: gl-read-pixels x y width height format type

Reads pixel data from the framebuffer. Returns the pixel data in a uniform vector of the type determined by format and type (check out OpenGL doc to find out the actual data format).

Function: gl-draw-pixels width height format type pixels

Draws a pixel data pixels at the current raster position. Pixels must be a uniform vector compatible to the specified format and type values.

Function: gl-copy-pixels x y width height buffer

Copies pixel data in a rectangle area of the framebuffer, specified by lower-left corner (x, y) and dimensions (width, height). Buffer specifies which buffer is used, and should be one of GL_COLOR, GL_STENCIL or GL_DEPTH.

Function: gl-pixel-store pname param

Sets the pixel stroage models. Check out the OpenGL doc for the possible pname and param values.

Function: gl-pixel-transfer pname param

Sets the pixel transfer modes. Check out the OpenGL doc for the possible pname and param values.

Function: gl-pixel-map map values

Sets the pixel map table map with values, which must be either u16, u32 or f32vecotor. Check out the OpenGL doc for the possible map values.

Function: gl-pixel-zoom xfactor yfactor

Sets the magnification/reduction factors for pixel-write operations.

Function: gl-get-pixel-map map &optional type

Returns the current pixel map table as an uniform vector specified by type, which must be either a class <u32vector> (default), <u16vector>, or <f32vector>.

Function: gl-get-pixel-map! map values

Like gl-get-pixel-map, but instead of allocating a new vector, it stores the result to a uniform vector passed to values. It is a caller's responsibility to ensure values has enough size.

Color tables

Function: gl-color-table target internal-format width format type data

[GL_ARB_imaging] Specifies one of the color table target. Data should be a uniform vector compatible to the format and type parameters.

Function: gl-color-table-parameter target pname param

[GL_ARB_imaging] Sets the color table parameter pname (either GL_COLOR_TABLE_SCALE or GL_COLOR_TABLE_BIAS), of the color table target. Param must be an f32 or s32vector of size 4.

Function: gl-copy-color-table target internal-format x y width

[GL_ARB_imaging] Creates a color table target using framebuffer data. The pixels are read from the current buffer for read (specified by glReadBuffer).

Function: gl-color-sub-table target start count format type data

[GL_ARB_imaging] Replaces a part of color table target, starting start and count entries. Values are given in data as a uniform vector compatible to the format and type arguments.

Function: gl-copy-color-sub-table target start x y width

[GL_ARB_imaging] Replaces a part of color table entries using framebuffer data.

Function: gl-get-color-table! target format type data

[GL_ARB_imaging] Reads the color table target and store it in data, in the format specified by format and type. Data must be a uniform vector compatible to the format and type arguments. The caller must ensure that data has enough size to contain the result.

Convolutions

Function: gl-convolution-filter-2d target internal-format width height format type data

[GL_ARB_imaging] Defines a 2D convolution filter. Target must be GL_CONVOLUTION_2D. Data must be a uniform vector compatible to the format and type arguments, and must have enough size.

Function: gl-copy-convolution-filter-2d target internal-format x y width height

[GL_ARB_imaging] Defines a 2D convolution filter, taking the convolution filter data from the current color buffer to read.

Function: gl-separable-filetr-2d target internal-format width height format type row column

[GL_ARB_imaging] Defines a 2D convolution filter by a product of a 1D row vector and 1D column vector. Target must be GL_SEPARABLE_2D. Both row and column must be a uniform vector, compatible with the format and type arguments, and must have enough size.

Function: gl-convolution-filter-1d target internal-format width format type data

[GL_ARB_imaging] Defines 1D convolution filter. Target must be GL_CONVOLUTION_1D. Data must be a uniform vector compatible to the format and type arguments, and must have enough size.

Function: gl-copy-convolution-filter-1d target internal-format x y width

[GL_ARB_imaging] Defines 1D convolution filter, taking the convolution filter data from the current color buffer to read.

Function: gl-convolution-parameter target pname param

[GL_ARB_imaging] Sets a parameter for a convolution filter target, which can be either GL_CONVOLUTION_2D, GL_SEPARABLE_2D, or GL_CONVOLUTION_1D. Possible values of pname and their acceptable param are as follows.

GL_CONVOLUTION_BORDER_MODE

Either one of the constants: GL_REDUCE, GL_CONSTNAT_BORDER, GL_REPLICATE_BORDER

GL_CONVOLUTION_FILTER_SCALE, GL_CONVOLUTION_FILTER_BIAS

An s32 or f32vector of size 4, specifying color values.

Histogram

Function: gl-histogram target width internal-format sink

[GL_ARB_imaging] Specifies the way the histogram data is stored. Target must be either GL_HISTOGRAM or GL_PROXY_HISTOGRAM. Width is the number of entires of the histogram, and has to be a power of 2. Sink is a boolean value to indicate whether pixels should be discarded or sent down further to the pipeline.

Function: gl-reset-histogram target

[GL_ARB_imaging] Resets the histogram counters. Target must be GL_HISTOGRAM.

Function: gl-get-histogram target reset format type

[GL_ARB_imaging] Returns histogram data in a uniform vector, whose type and size are determined by format and type. A boolean value reset specifies whether the histogram should be reset or not.

Function: gl-get-histogram-parameter target pname

[GL_ARB_imaging] Returns the parameter value of the histogram. Pname can be either one of GL_HISTOGRAM_WIDTH, GL_HISTOGRAM_FORMAT, GL_HISTOGRAM_RED_SIZE, GL_HISTOGRAM_GREEN_SIZE, GL_HISTOGRAM_BLUE_SIZE, GL_HISTOGRAM_ALPHA_SIZE, GL_HISTOGRAM_LUMINANCE_SIZE, or GL_HISTOGRAM_SINK. The returned value is an integer, except the case of GL_HISTOGRAM_SINK, which returns a boolean value.

Minmax

Function: gl-minmax target internal-format sink

[GL_ARB_imaging] Computes the minimum and maximum pixel values for an image. Target must be GL_MINMAX. Sink is a boolean value to indicate whether pixels should be discarded or sent down further to the pipeline.

Function: gl-get-minmax target reset format type

[GL_ARB_imaging] Returns the results of the minmax operation in a uniform vector, whose type and size are determined by the format and type arguments. A boolean value reset specifies whether the histogram should be reset or not.

Function: gl-reset-minmax target

[GL_ARB_imaging] Resets the minmax counter.

Function: gl-get-minmax-parameter target pname

[GL_ARB_imaging] Returns the parameter value of the histogram. Pname can be either GL_MINMAX_SINK (returns a boolean value) or GL_MINMAX_FORMAT (returns an integer).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Shiro Kawai on June, 7 2008 using texi2html 1.78.