<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
              "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glMinmax">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>glMinmax</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glMinmax</refname>
        <refpurpose>define minmax table</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glMinmax</function></funcdef>
                <paramdef>GLenum <parameter>target</parameter></paramdef>
                <paramdef>GLenum <parameter>internalformat</parameter></paramdef>
                <paramdef>GLboolean <parameter>sink</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>target</parameter></term>
            <listitem>
                <para>
                    The minmax table whose parameters are to be set.
                    Must be
                    <constant>GL_MINMAX</constant>.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><parameter>internalformat</parameter></term>
            <listitem>
                <para>
                    The format of entries in the minmax table.
                    Must be one of
                    <constant>GL_ALPHA</constant>,
                    <constant>GL_ALPHA4</constant>,
                    <constant>GL_ALPHA8</constant>,
                    <constant>GL_ALPHA12</constant>,
                    <constant>GL_ALPHA16</constant>,
                    <constant>GL_LUMINANCE</constant>,
                    <constant>GL_LUMINANCE4</constant>,
                    <constant>GL_LUMINANCE8</constant>,
                    <constant>GL_LUMINANCE12</constant>,
                    <constant>GL_LUMINANCE16</constant>,
                    <constant>GL_LUMINANCE_ALPHA</constant>,
                    <constant>GL_LUMINANCE4_ALPHA4</constant>,
                    <constant>GL_LUMINANCE6_ALPHA2</constant>,
                    <constant>GL_LUMINANCE8_ALPHA8</constant>,
                    <constant>GL_LUMINANCE12_ALPHA4</constant>,
                    <constant>GL_LUMINANCE12_ALPHA12</constant>,
                    <constant>GL_LUMINANCE16_ALPHA16</constant>,
                    <constant>GL_R3_G3_B2</constant>,
                    <constant>GL_RGB</constant>,
                    <constant>GL_RGB4</constant>,
                    <constant>GL_RGB5</constant>,
                    <constant>GL_RGB8</constant>,
                    <constant>GL_RGB10</constant>,
                    <constant>GL_RGB12</constant>,
                    <constant>GL_RGB16</constant>,
                    <constant>GL_RGBA</constant>,
                    <constant>GL_RGBA2</constant>,
                    <constant>GL_RGBA4</constant>,
                    <constant>GL_RGB5_A1</constant>,
                    <constant>GL_RGBA8</constant>,
                    <constant>GL_RGB10_A2</constant>,
                    <constant>GL_RGBA12</constant>, or
                    <constant>GL_RGBA16</constant>.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><parameter>sink</parameter></term>
            <listitem>
                <para>
                    If <constant>GL_TRUE</constant>, pixels will be consumed by the minmax
                    process and no drawing or texture loading will take place.
                    If <constant>GL_FALSE</constant>, pixels will proceed to the final conversion process after
                    minmax.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            When <constant>GL_MINMAX</constant> is enabled, the RGBA components of incoming pixels are
            compared to the minimum and maximum values for each component, which are
            stored in the two-element minmax table.
            (The first element stores the minima, and the second element stores
            the maxima.)
            If a pixel component is greater than the corresponding component
            in the maximum element, then the maximum element is updated with the
            pixel component value.
            If a pixel component is less than the corresponding component in
            the minimum element, then the minimum element is updated with the
            pixel component value.
            (In both cases, if the internal format of the minmax table includes
            luminance, then the R color component of incoming pixels is used
            for comparison.)
            The contents of the minmax table may be retrieved at a later time
            by calling <citerefentry><refentrytitle>glGetMinmax</refentrytitle></citerefentry>.
            The minmax operation is enabled or disabled by calling <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> or
            <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry>, respectively, with an argument of <constant>GL_MINMAX</constant>.
        </para>
        <para>
            <function>glMinmax</function> redefines the current minmax table to have entries of the format
            specified by <parameter>internalformat</parameter>.
            The maximum element is initialized with the smallest possible component
            values, and the minimum element is initialized with the largest possible
            component values.
            The values in the previous minmax table, if any, are lost.
            If <parameter>sink</parameter> is <constant>GL_TRUE</constant>, then pixels are discarded after minmax;
            no further processing of the pixels takes place, and no drawing,
            texture loading, or pixel readback will result.
        </para>
        <para>
        </para>
    </refsect1>
    <refsect1 id="notes"><title>Notes</title>
        <para>
            <function>glMinmax</function> is present only if <code>ARB_imaging</code> is returned when <citerefentry><refentrytitle>glGetString</refentrytitle></citerefentry>
            is called with an argument of <constant>GL_EXTENSIONS</constant>.
        </para>
    </refsect1>
    <refsect1 id="errors"><title>Errors</title>
        <para>
            <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not one of the allowable
            values.
        </para>
        <para>
            <constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not one of the
            allowable values.
        </para>
        <para>
            <constant>GL_INVALID_OPERATION</constant> is generated if <function>glMinmax</function> is executed
            between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
            execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
        </para>
    </refsect1>
    <refsect1 id="associatedgets"><title>Associated Gets</title>
        <para>
            <citerefentry><refentrytitle>glGetMinmaxParameter</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glGetMinmax</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glResetMinmax</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"></trademark> 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
        </para>
    </refsect1>
</refentry>
