    {-# OPTIONS_HADDOCK hide #-}
    --------------------------------------------------------------------------------
    -- |
    -- Module      :  Graphics.Rendering.OpenGL.GL.Texturing.PixelInternalFormat
    -- Copyright   :  (c) Sven Panne 2002-2019
    -- License     :  BSD3
    --
    -- Maintainer  :  Sven Panne <svenpanne@gmail.com>
    -- Stability   :  stable
    -- Portability :  portable
    --
    -- This is a purely internal module for (un-)marshaling PixelInternalFormat.
    --
    --------------------------------------------------------------------------------

    module Graphics.Rendering.OpenGL.GL.Texturing.PixelInternalFormat (
       PixelInternalFormat(..), marshalPixelInternalFormat,
       marshalPixelInternalFormat', unmarshalPixelInternalFormat,
    ) where

    import Graphics.GL

    --------------------------------------------------------------------------------

    data PixelInternalFormat =
         Alpha'
       | DepthComponent'
       | Luminance'
       | LuminanceAlpha'
       | Intensity
       | R8
       | R16
       | RG8
       | RG16
       | RGB'
       | RGBA'
       | SRGB
       | SRGBAlpha
       | SLuminance
       | SLuminanceAlpha
       | Alpha4
       | Alpha8
       | Alpha12
       | Alpha16
       | DepthComponent16
       | DepthComponent24
       | DepthComponent32
       | Luminance4
       | Luminance8
       | Luminance12
       | Luminance16
       | Luminance4Alpha4
       | Luminance6Alpha2
       | Luminance8Alpha8
       | Luminance12Alpha4
       | Luminance12Alpha12
       | Luminance16Alpha16
       | Intensity4
       | Intensity8
       | Intensity12
       | Intensity16
       | R3G3B2
       | RGB4
       | RGB5
       | RGB8
       | RGB10
       | RGB12
       | RGB16
       | RGBA2
       | RGBA4
       | RGB5A1
       | RGBA8
       | RGB10A2
       | RGBA12
       | RGBA16
       | SRGB8
       | SRGB8Alpha8
       | R16F
       | RG16F
       | RGB16F
       | RGBA16F
       | R32F
       | RG32F
       | RGB32F
       | RGBA32F
       | R8I
       | R8UI
       | R16I
       | R16UI
       | R32I
       | R32UI
       | RG8I
       | RG8UI
       | RG16I
       | RG16UI
       | RG32I
       | RG32UI
       | RGB8I
       | RGB8UI
       | RGB16I
       | RGB16UI
       | RGB32I
       | RGB32UI
       | RGBA8I
       | RGBA8UI
       | RGBA16I
       | RGBA16UI
       | RGBA32I
       | RGBA32UI
       | SLuminance8
       | SLuminance8Alpha8
       | CompressedAlpha
       | CompressedLuminance
       | CompressedLuminanceAlpha
       | CompressedIntensity
       | CompressedRed
       | CompressedRG
       | CompressedRGB
       | CompressedRGBA
       | CompressedSRGB
       | CompressedSRGBAlpha
       | CompressedSLuminance
       | CompressedSLuminanceAlpha
       | CompressedRedRGTC1
       | CompressedSignedRedRGTC1
       | CompressedRG_RGTC2
       | CompressedSignedRG_RGTC2
       | DepthComponent32f
       | Depth32fStencil8
       | RGB9E5
       | R11fG11fB10f
       | StencilIndex1
       | StencilIndex4
       | StencilIndex8
       | StencilIndex16
       | RGBS3TC
       | RGB4S3TC
       | RGBAS3TC
       | RGBA4S3TC
       | RGBADXT5S3TC
       | RGBA4DXT5S3TC
       | CompressedRGBAS3TCDXT1
       | CompressedRGBAS3TCDXT3
       | CompressedRGBAS3TCDXT5
       | CompressedRGBS3TCDXT1
       | Alpha32F
       | Intensity32F
       | Luminance32F
       | LuminanceAlpha32F
       | Alpha16F
       | Intensity16F
       | Luminance16F
       | LuminanceAlpha16F
       | Depth24Stencil8
       deriving ( PixelInternalFormat -> PixelInternalFormat -> Bool
    (PixelInternalFormat -> PixelInternalFormat -> Bool)
    -> (PixelInternalFormat -> PixelInternalFormat -> Bool)
    -> Eq PixelInternalFormat
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PixelInternalFormat -> PixelInternalFormat -> Bool
    == :: PixelInternalFormat -> PixelInternalFormat -> Bool
    $c/= :: PixelInternalFormat -> PixelInternalFormat -> Bool
    /= :: PixelInternalFormat -> PixelInternalFormat -> Bool
    Eq, Eq PixelInternalFormat
    Eq PixelInternalFormat =>
    (PixelInternalFormat -> PixelInternalFormat -> Ordering)
    -> (PixelInternalFormat -> PixelInternalFormat -> Bool)
    -> (PixelInternalFormat -> PixelInternalFormat -> Bool)
    -> (PixelInternalFormat -> PixelInternalFormat -> Bool)
    -> (PixelInternalFormat -> PixelInternalFormat -> Bool)
    -> (PixelInternalFormat
        -> PixelInternalFormat -> PixelInternalFormat)
    -> (PixelInternalFormat
        -> PixelInternalFormat -> PixelInternalFormat)
    -> Ord PixelInternalFormat
    PixelInternalFormat -> PixelInternalFormat -> Bool
    PixelInternalFormat -> PixelInternalFormat -> Ordering
    PixelInternalFormat -> PixelInternalFormat -> PixelInternalFormat
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: PixelInternalFormat -> PixelInternalFormat -> Ordering
    compare :: PixelInternalFormat -> PixelInternalFormat -> Ordering
    $c< :: PixelInternalFormat -> PixelInternalFormat -> Bool
    < :: PixelInternalFormat -> PixelInternalFormat -> Bool
    $c<= :: PixelInternalFormat -> PixelInternalFormat -> Bool
    <= :: PixelInternalFormat -> PixelInternalFormat -> Bool
    $c> :: PixelInternalFormat -> PixelInternalFormat -> Bool
    > :: PixelInternalFormat -> PixelInternalFormat -> Bool
    $c>= :: PixelInternalFormat -> PixelInternalFormat -> Bool
    >= :: PixelInternalFormat -> PixelInternalFormat -> Bool
    $cmax :: PixelInternalFormat -> PixelInternalFormat -> PixelInternalFormat
    max :: PixelInternalFormat -> PixelInternalFormat -> PixelInternalFormat
    $cmin :: PixelInternalFormat -> PixelInternalFormat -> PixelInternalFormat
    min :: PixelInternalFormat -> PixelInternalFormat -> PixelInternalFormat
    Ord, Int -> PixelInternalFormat -> ShowS
    [PixelInternalFormat] -> ShowS
    PixelInternalFormat -> String
    (Int -> PixelInternalFormat -> ShowS)
    -> (PixelInternalFormat -> String)
    -> ([PixelInternalFormat] -> ShowS)
    -> Show PixelInternalFormat
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PixelInternalFormat -> ShowS
    showsPrec :: Int -> PixelInternalFormat -> ShowS
    $cshow :: PixelInternalFormat -> String
    show :: PixelInternalFormat -> String
    $cshowList :: [PixelInternalFormat] -> ShowS
    showList :: [PixelInternalFormat] -> ShowS
    Show )

    marshalPixelInternalFormat :: PixelInternalFormat -> GLint
    marshalPixelInternalFormat :: PixelInternalFormat -> GLint
    marshalPixelInternalFormat PixelInternalFormat
    x = GLenum -> GLint
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (GLenum -> GLint) -> GLenum -> GLint
    forall a b. (a -> b) -> a -> b
    $ case PixelInternalFormat
    x of
       PixelInternalFormat
    Alpha' -> GLenum
    GL_ALPHA
       PixelInternalFormat
    DepthComponent' -> GLenum
    GL_DEPTH_COMPONENT
       PixelInternalFormat
    Luminance' -> GLenum
    GL_LUMINANCE
       PixelInternalFormat
    LuminanceAlpha' -> GLenum
    GL_LUMINANCE_ALPHA
       PixelInternalFormat
    R8 -> GLenum
    GL_R8
       PixelInternalFormat
    R16 -> GLenum
    GL_R16
       PixelInternalFormat
    RG8 -> GLenum
    GL_RG8
       PixelInternalFormat
    RG16 -> GLenum
    GL_RG16
       PixelInternalFormat
    RGB' -> GLenum
    GL_RGB
       PixelInternalFormat
    RGBA' -> GLenum
    GL_RGBA
       PixelInternalFormat
    SRGB -> GLenum
    GL_SRGB
       PixelInternalFormat
    SRGBAlpha -> GLenum
    GL_SRGB_ALPHA
       PixelInternalFormat
    SLuminance -> GLenum
    GL_SLUMINANCE
       PixelInternalFormat
    SLuminanceAlpha -> GLenum
    GL_SLUMINANCE_ALPHA
       PixelInternalFormat
    Alpha4 -> GLenum
    GL_ALPHA4
       PixelInternalFormat
    Alpha8 -> GLenum
    GL_ALPHA8
       PixelInternalFormat
    Alpha12 -> GLenum
    GL_ALPHA12
       PixelInternalFormat
    Alpha16 -> GLenum
    GL_ALPHA16
       PixelInternalFormat
    DepthComponent16 -> GLenum
    GL_DEPTH_COMPONENT16
       PixelInternalFormat
    DepthComponent24 -> GLenum
    GL_DEPTH_COMPONENT24
       PixelInternalFormat
    DepthComponent32 -> GLenum
    GL_DEPTH_COMPONENT32
       PixelInternalFormat
    Luminance4 -> GLenum
    GL_LUMINANCE4
       PixelInternalFormat
    Luminance8 -> GLenum
    GL_LUMINANCE8
       PixelInternalFormat
    Luminance12 -> GLenum
    GL_LUMINANCE12
       PixelInternalFormat
    Luminance16 -> GLenum
    GL_LUMINANCE16
       PixelInternalFormat
    Luminance4Alpha4 -> GLenum
    GL_LUMINANCE4_ALPHA4
       PixelInternalFormat
    Luminance6Alpha2 -> GLenum
    GL_LUMINANCE6_ALPHA2
       PixelInternalFormat
    Luminance8Alpha8 -> GLenum
    GL_LUMINANCE8_ALPHA8
       PixelInternalFormat
    Luminance12Alpha4 -> GLenum
    GL_LUMINANCE12_ALPHA4
       PixelInternalFormat
    Luminance12Alpha12 -> GLenum
    GL_LUMINANCE12_ALPHA12
       PixelInternalFormat
    Luminance16Alpha16 -> GLenum
    GL_LUMINANCE16_ALPHA16
       PixelInternalFormat
    Intensity -> GLenum
    GL_INTENSITY
       PixelInternalFormat
    Intensity4 -> GLenum
    GL_INTENSITY4
       PixelInternalFormat
    Intensity8 -> GLenum
    GL_INTENSITY8
       PixelInternalFormat
    Intensity12 -> GLenum
    GL_INTENSITY12
       PixelInternalFormat
    Intensity16 -> GLenum
    GL_INTENSITY16
       PixelInternalFormat
    R3G3B2 -> GLenum
    GL_R3_G3_B2
       PixelInternalFormat
    RGB4 -> GLenum
    GL_RGB4
       PixelInternalFormat
    RGB5 -> GLenum
    GL_RGB5
       PixelInternalFormat
    RGB8 -> GLenum
    GL_RGB8
       PixelInternalFormat
    RGB10 -> GLenum
    GL_RGB10
       PixelInternalFormat
    RGB12 -> GLenum
    GL_RGB12
       PixelInternalFormat
    RGB16 -> GLenum
    GL_RGB16
       PixelInternalFormat
    RGBA2 -> GLenum
    GL_RGBA2
       PixelInternalFormat
    RGBA4 -> GLenum
    GL_RGBA4
       PixelInternalFormat
    RGB5A1 -> GLenum
    GL_RGB5_A1
       PixelInternalFormat
    RGBA8 -> GLenum
    GL_RGBA8
       PixelInternalFormat
    RGB10A2 -> GLenum
    GL_RGB10_A2
       PixelInternalFormat
    RGBA12 -> GLenum
    GL_RGBA12
       PixelInternalFormat
    RGBA16 -> GLenum
    GL_RGBA16
       PixelInternalFormat
    SRGB8 -> GLenum
    GL_SRGB8
       PixelInternalFormat
    SRGB8Alpha8 -> GLenum
    GL_SRGB8_ALPHA8
       PixelInternalFormat
    R16F -> GLenum
    GL_R16F
       PixelInternalFormat
    RG16F -> GLenum
    GL_RG16F
       PixelInternalFormat
    RGB16F -> GLenum
    GL_RGB16F
       PixelInternalFormat
    RGBA16F -> GLenum
    GL_RGBA16F
       PixelInternalFormat
    R32F -> GLenum
    GL_R32F
       PixelInternalFormat
    RG32F -> GLenum
    GL_RG32F
       PixelInternalFormat
    RGB32F -> GLenum
    GL_RGB32F
       PixelInternalFormat
    RGBA32F -> GLenum
    GL_RGBA32F
       PixelInternalFormat
    R8I -> GLenum
    GL_R8I
       PixelInternalFormat
    R8UI -> GLenum
    GL_R8UI
       PixelInternalFormat
    R16I -> GLenum
    GL_R16I
       PixelInternalFormat
    R16UI -> GLenum
    GL_R16UI
       PixelInternalFormat
    R32I -> GLenum
    GL_R32I
       PixelInternalFormat
    R32UI -> GLenum
    GL_R32UI
       PixelInternalFormat
    RG8I -> GLenum
    GL_RG8I
       PixelInternalFormat
    RG8UI -> GLenum
    GL_RG8UI
       PixelInternalFormat
    RG16I -> GLenum
    GL_RG16I
       PixelInternalFormat
    RG16UI -> GLenum
    GL_RG16UI
       PixelInternalFormat
    RG32I -> GLenum
    GL_R32I
       PixelInternalFormat
    RG32UI -> GLenum
    GL_R32UI
       PixelInternalFormat
    RGB8I -> GLenum
    GL_RGB8I
       PixelInternalFormat
    RGB8UI -> GLenum
    GL_RGB8UI
       PixelInternalFormat
    RGB16I -> GLenum
    GL_RGB16I
       PixelInternalFormat
    RGB16UI -> GLenum
    GL_RGB16UI
       PixelInternalFormat
    RGB32I -> GLenum
    GL_RGB32I
       PixelInternalFormat
    RGB32UI -> GLenum
    GL_RGB32UI
       PixelInternalFormat
    RGBA8I -> GLenum
    GL_RGBA8I
       PixelInternalFormat
    RGBA8UI -> GLenum
    GL_RGBA8UI
       PixelInternalFormat
    RGBA16I -> GLenum
    GL_RGBA16I
       PixelInternalFormat
    RGBA16UI -> GLenum
    GL_RGBA16UI
       PixelInternalFormat
    RGBA32I -> GLenum
    GL_RGBA32I
       PixelInternalFormat
    RGBA32UI -> GLenum
    GL_RGBA32UI
       PixelInternalFormat
    SLuminance8 -> GLenum
    GL_SLUMINANCE8
       PixelInternalFormat
    SLuminance8Alpha8 -> GLenum
    GL_SLUMINANCE8_ALPHA8
       PixelInternalFormat
    CompressedAlpha -> GLenum
    GL_COMPRESSED_ALPHA
       PixelInternalFormat
    CompressedLuminance -> GLenum
    GL_COMPRESSED_LUMINANCE
       PixelInternalFormat
    CompressedLuminanceAlpha -> GLenum
    GL_COMPRESSED_LUMINANCE_ALPHA
       PixelInternalFormat
    CompressedIntensity -> GLenum
    GL_COMPRESSED_INTENSITY
       PixelInternalFormat
    CompressedRed -> GLenum
    GL_COMPRESSED_RED
       PixelInternalFormat
    CompressedRG -> GLenum
    GL_COMPRESSED_RG
       PixelInternalFormat
    CompressedRGB -> GLenum
    GL_COMPRESSED_RGB
       PixelInternalFormat
    CompressedRGBA -> GLenum
    GL_COMPRESSED_RGBA
       PixelInternalFormat
    CompressedSRGB -> GLenum
    GL_COMPRESSED_SRGB
       PixelInternalFormat
    CompressedSRGBAlpha -> GLenum
    GL_COMPRESSED_SRGB_ALPHA
       PixelInternalFormat
    CompressedSLuminance -> GLenum
    GL_COMPRESSED_SLUMINANCE
       PixelInternalFormat
    CompressedSLuminanceAlpha -> GLenum
    GL_COMPRESSED_SLUMINANCE_ALPHA
       PixelInternalFormat
    CompressedRedRGTC1 -> GLenum
    GL_COMPRESSED_RED_RGTC1
       PixelInternalFormat
    CompressedSignedRedRGTC1 -> GLenum
    GL_COMPRESSED_SIGNED_RED_RGTC1
       PixelInternalFormat
    CompressedRG_RGTC2 -> GLenum
    GL_COMPRESSED_RG_RGTC2
       PixelInternalFormat
    CompressedSignedRG_RGTC2 -> GLenum
    GL_COMPRESSED_SIGNED_RG_RGTC2
       PixelInternalFormat
    DepthComponent32f -> GLenum
    GL_DEPTH_COMPONENT32F
       PixelInternalFormat
    Depth32fStencil8 -> GLenum
    GL_DEPTH32F_STENCIL8
       PixelInternalFormat
    RGB9E5 -> GLenum
    GL_RGB9_E5
       PixelInternalFormat
    R11fG11fB10f -> GLenum
    GL_R11F_G11F_B10F
       PixelInternalFormat
    StencilIndex1 -> GLenum
    GL_STENCIL_INDEX1
       PixelInternalFormat
    StencilIndex4 -> GLenum
    GL_STENCIL_INDEX4
       PixelInternalFormat
    StencilIndex8 -> GLenum
    GL_STENCIL_INDEX8
       PixelInternalFormat
    StencilIndex16 -> GLenum
    GL_STENCIL_INDEX16
       PixelInternalFormat
    RGBS3TC -> GLenum
    GL_RGB_S3TC
       PixelInternalFormat
    RGB4S3TC -> GLenum
    GL_RGB4_S3TC
       PixelInternalFormat
    RGBAS3TC -> GLenum
    GL_RGBA_S3TC
       PixelInternalFormat
    RGBA4S3TC -> GLenum
    GL_RGBA4_S3TC
       PixelInternalFormat
    RGBADXT5S3TC -> GLenum
    GL_RGBA_DXT5_S3TC
       PixelInternalFormat
    RGBA4DXT5S3TC -> GLenum
    GL_RGBA4_DXT5_S3TC
       PixelInternalFormat
    CompressedRGBAS3TCDXT1 -> GLenum
    GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
       PixelInternalFormat
    CompressedRGBAS3TCDXT3 -> GLenum
    GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
       PixelInternalFormat
    CompressedRGBAS3TCDXT5 -> GLenum
    GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
       PixelInternalFormat
    CompressedRGBS3TCDXT1 -> GLenum
    GL_COMPRESSED_RGB_S3TC_DXT1_EXT
       PixelInternalFormat
    Alpha32F -> GLenum
    GL_ALPHA32F_ARB
       PixelInternalFormat
    Intensity32F -> GLenum
    GL_INTENSITY32F_ARB
       PixelInternalFormat
    Luminance32F -> GLenum
    GL_LUMINANCE32F_ARB
       PixelInternalFormat
    LuminanceAlpha32F -> GLenum
    GL_LUMINANCE_ALPHA32F_ARB
       PixelInternalFormat
    Alpha16F -> GLenum
    GL_ALPHA16F_ARB
       PixelInternalFormat
    Intensity16F -> GLenum
    GL_INTENSITY16F_ARB
       PixelInternalFormat
    Luminance16F -> GLenum
    GL_LUMINANCE16F_ARB
       PixelInternalFormat
    LuminanceAlpha16F -> GLenum
    GL_LUMINANCE_ALPHA16F_ARB
       PixelInternalFormat
    Depth24Stencil8 -> GLenum
    GL_DEPTH24_STENCIL8_EXT

    -- *sigh* The OpenGL API is sometimes a bit creative in its usage of types...
    marshalPixelInternalFormat' :: PixelInternalFormat -> GLenum
    marshalPixelInternalFormat' :: PixelInternalFormat -> GLenum
    marshalPixelInternalFormat' = GLint -> GLenum
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (GLint -> GLenum)
    -> (PixelInternalFormat -> GLint) -> PixelInternalFormat -> GLenum
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . PixelInternalFormat -> GLint
    marshalPixelInternalFormat

    unmarshalPixelInternalFormat :: GLint -> PixelInternalFormat
    unmarshalPixelInternalFormat :: GLint -> PixelInternalFormat
    unmarshalPixelInternalFormat GLint
    x
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ALPHA = PixelInternalFormat
    Alpha'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DEPTH_COMPONENT = PixelInternalFormat
    DepthComponent'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE = PixelInternalFormat
    Luminance'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE_ALPHA = PixelInternalFormat
    LuminanceAlpha'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB = PixelInternalFormat
    RGB'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA = PixelInternalFormat
    RGBA'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SRGB = PixelInternalFormat
    SRGB
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SRGB_ALPHA = PixelInternalFormat
    SRGBAlpha
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SLUMINANCE = PixelInternalFormat
    SLuminance
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SLUMINANCE_ALPHA = PixelInternalFormat
    SLuminanceAlpha
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ALPHA4 = PixelInternalFormat
    Alpha4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ALPHA8 = PixelInternalFormat
    Alpha8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ALPHA12 = PixelInternalFormat
    Alpha12
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ALPHA16 = PixelInternalFormat
    Alpha16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DEPTH_COMPONENT16 = PixelInternalFormat
    DepthComponent16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DEPTH_COMPONENT24 = PixelInternalFormat
    DepthComponent24
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DEPTH_COMPONENT32 = PixelInternalFormat
    DepthComponent32
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE4 = PixelInternalFormat
    Luminance4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE8 = PixelInternalFormat
    Luminance8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE12 = PixelInternalFormat
    Luminance12
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE16 = PixelInternalFormat
    Luminance16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE4_ALPHA4 = PixelInternalFormat
    Luminance4Alpha4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE6_ALPHA2 = PixelInternalFormat
    Luminance6Alpha2
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE8_ALPHA8 = PixelInternalFormat
    Luminance8Alpha8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE12_ALPHA4 = PixelInternalFormat
    Luminance12Alpha4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE12_ALPHA12 = PixelInternalFormat
    Luminance12Alpha12
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE16_ALPHA16 = PixelInternalFormat
    Luminance16Alpha16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_INTENSITY = PixelInternalFormat
    Intensity
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_INTENSITY4 = PixelInternalFormat
    Intensity4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_INTENSITY8 = PixelInternalFormat
    Intensity8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_INTENSITY12 = PixelInternalFormat
    Intensity12
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_INTENSITY16 = PixelInternalFormat
    Intensity16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R3_G3_B2 = PixelInternalFormat
    R3G3B2
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB4 = PixelInternalFormat
    RGB4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB5 = PixelInternalFormat
    RGB5
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB8 = PixelInternalFormat
    RGB8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB10 = PixelInternalFormat
    RGB10
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB12 = PixelInternalFormat
    RGB12
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB16 = PixelInternalFormat
    RGB16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA2 = PixelInternalFormat
    RGBA2
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA4 = PixelInternalFormat
    RGBA4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB5_A1 = PixelInternalFormat
    RGB5A1
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA8 = PixelInternalFormat
    RGBA8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB10_A2 = PixelInternalFormat
    RGB10A2
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA12 = PixelInternalFormat
    RGBA12
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA16 = PixelInternalFormat
    RGBA16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SRGB8 = PixelInternalFormat
    SRGB8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SRGB8_ALPHA8 = PixelInternalFormat
    SRGB8Alpha8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R16F = PixelInternalFormat
    R16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RG16F = PixelInternalFormat
    RG16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB16F = PixelInternalFormat
    RGB16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA16F = PixelInternalFormat
    RGBA16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R32F = PixelInternalFormat
    R32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RG32F = PixelInternalFormat
    RG32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB32F = PixelInternalFormat
    RGB32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA32F = PixelInternalFormat
    RGBA32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R8I = PixelInternalFormat
    R8I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R8UI = PixelInternalFormat
    R8UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R16I = PixelInternalFormat
    R16I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R16UI = PixelInternalFormat
    R16UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R32I = PixelInternalFormat
    R32I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R32UI = PixelInternalFormat
    R32UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RG8I = PixelInternalFormat
    RG8I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RG8UI = PixelInternalFormat
    RG8UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RG16I = PixelInternalFormat
    RG16I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RG16UI = PixelInternalFormat
    RG16UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R32I = PixelInternalFormat
    RG32I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_R32UI = PixelInternalFormat
    RG32UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB8I = PixelInternalFormat
    RGB8I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB8UI = PixelInternalFormat
    RGB8UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB16I = PixelInternalFormat
    RGB16I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB16UI = PixelInternalFormat
    RGB16UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB32I = PixelInternalFormat
    RGB32I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB32UI = PixelInternalFormat
    RGB32UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA8I = PixelInternalFormat
    RGBA8I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA8UI = PixelInternalFormat
    RGBA8UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA16I = PixelInternalFormat
    RGBA16I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA16UI = PixelInternalFormat
    RGBA16UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA32I = PixelInternalFormat
    RGBA32I
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA32UI = PixelInternalFormat
    RGBA32UI
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SLUMINANCE8 = PixelInternalFormat
    SLuminance8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SLUMINANCE8_ALPHA8 = PixelInternalFormat
    SLuminance8Alpha8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_ALPHA = PixelInternalFormat
    CompressedAlpha
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_LUMINANCE = PixelInternalFormat
    CompressedLuminance
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_LUMINANCE_ALPHA = PixelInternalFormat
    CompressedLuminanceAlpha
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_INTENSITY = PixelInternalFormat
    CompressedIntensity
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RED = PixelInternalFormat
    CompressedRed
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RG = PixelInternalFormat
    CompressedRG
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RGB = PixelInternalFormat
    CompressedRGB
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RGBA = PixelInternalFormat
    CompressedRGBA
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_SRGB = PixelInternalFormat
    CompressedSRGB
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_SRGB_ALPHA = PixelInternalFormat
    CompressedSRGBAlpha
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_SLUMINANCE = PixelInternalFormat
    CompressedSLuminance
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_SLUMINANCE_ALPHA = PixelInternalFormat
    CompressedSLuminanceAlpha
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RED_RGTC1 = PixelInternalFormat
    CompressedRedRGTC1
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_SIGNED_RED_RGTC1 = PixelInternalFormat
    CompressedSignedRedRGTC1
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RG_RGTC2 = PixelInternalFormat
    CompressedRG_RGTC2
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_SIGNED_RG_RGTC2 = PixelInternalFormat
    CompressedSignedRG_RGTC2
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DEPTH_COMPONENT32F = PixelInternalFormat
    DepthComponent32f
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DEPTH32F_STENCIL8 = PixelInternalFormat
    Depth32fStencil8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB9_E5 = PixelInternalFormat
    RGB9E5
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_STENCIL_INDEX1 = PixelInternalFormat
    StencilIndex1
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_STENCIL_INDEX4 = PixelInternalFormat
    StencilIndex4
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_STENCIL_INDEX8 = PixelInternalFormat
    StencilIndex8
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_STENCIL_INDEX16 = PixelInternalFormat
    StencilIndex16
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB_S3TC = PixelInternalFormat
    RGBS3TC
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGB4_S3TC = PixelInternalFormat
    RGB4S3TC
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA_S3TC = PixelInternalFormat
    RGBAS3TC
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA4_S3TC = PixelInternalFormat
    RGBA4S3TC
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA_DXT5_S3TC = PixelInternalFormat
    RGBADXT5S3TC
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_RGBA4_DXT5_S3TC = PixelInternalFormat
    RGBA4DXT5S3TC
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = PixelInternalFormat
    CompressedRGBAS3TCDXT1
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = PixelInternalFormat
    CompressedRGBAS3TCDXT3
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = PixelInternalFormat
    CompressedRGBAS3TCDXT5
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_COMPRESSED_RGB_S3TC_DXT1_EXT = PixelInternalFormat
    CompressedRGBS3TCDXT1
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ALPHA32F_ARB = PixelInternalFormat
    Alpha32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_INTENSITY32F_ARB = PixelInternalFormat
    Intensity32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE32F_ARB = PixelInternalFormat
    Luminance32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE_ALPHA32F_ARB = PixelInternalFormat
    LuminanceAlpha32F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ALPHA16F_ARB = PixelInternalFormat
    Alpha16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_INTENSITY16F_ARB = PixelInternalFormat
    Intensity16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE16F_ARB = PixelInternalFormat
    Luminance16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_LUMINANCE_ALPHA16F_ARB = PixelInternalFormat
    LuminanceAlpha16F
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DEPTH24_STENCIL8_EXT = PixelInternalFormat
    Depth24Stencil8
       -- legacy values
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    1 = PixelInternalFormat
    Luminance'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    2 = PixelInternalFormat
    LuminanceAlpha'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    3 = PixelInternalFormat
    RGB'
       | GLenum
    y GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    4 = PixelInternalFormat
    RGBA'
       | Bool
    otherwise = String -> PixelInternalFormat
    forall a. HasCallStack => String -> a
    error (String
    "unmarshalPixelInternalFormat: illegal value " String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ GLint -> String
    forall a. Show a => a -> String
    show GLint
    x)
       where y :: GLenum
    y = GLint -> GLenum
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral GLint
    x

    -- Note: The following formats are still missing, it's a bit unclear how to
    -- handle these nicely. From the EXT_texture_sRGB spec:
    --
    --    Accepted by the <internalformat> parameter of TexImage2D, CopyTexImage2D,
    --    and CompressedTexImage2DARB and the <format> parameter of
    --    CompressedTexSubImage2DARB:
    --
    --       COMPRESSED_SRGB_S3TC_DXT1_EXT                  0x8C4C
    --       COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT            0x8C4D
    --       COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT            0x8C4E
    --       COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT            0x8C4F