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

    module Graphics.Rendering.OpenGL.GL.PixelData (
       PixelData(..), withPixelData
    ) where

    import Foreign.Ptr
    import Graphics.Rendering.OpenGL.GL.DataType
    import Graphics.Rendering.OpenGL.GL.PixelFormat
    import Graphics.GL

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

    data PixelData a = PixelData PixelFormat DataType (Ptr a)
       deriving ( PixelData a -> PixelData a -> Bool
    (PixelData a -> PixelData a -> Bool)
    -> (PixelData a -> PixelData a -> Bool) -> Eq (PixelData a)
    forall a. PixelData a -> PixelData a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. PixelData a -> PixelData a -> Bool
    == :: PixelData a -> PixelData a -> Bool
    $c/= :: forall a. PixelData a -> PixelData a -> Bool
    /= :: PixelData a -> PixelData a -> Bool
    Eq, Eq (PixelData a)
    Eq (PixelData a) =>
    (PixelData a -> PixelData a -> Ordering)
    -> (PixelData a -> PixelData a -> Bool)
    -> (PixelData a -> PixelData a -> Bool)
    -> (PixelData a -> PixelData a -> Bool)
    -> (PixelData a -> PixelData a -> Bool)
    -> (PixelData a -> PixelData a -> PixelData a)
    -> (PixelData a -> PixelData a -> PixelData a)
    -> Ord (PixelData a)
    PixelData a -> PixelData a -> Bool
    PixelData a -> PixelData a -> Ordering
    PixelData a -> PixelData a -> PixelData a
    forall a. Eq (PixelData a)
    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
    forall a. PixelData a -> PixelData a -> Bool
    forall a. PixelData a -> PixelData a -> Ordering
    forall a. PixelData a -> PixelData a -> PixelData a
    $ccompare :: forall a. PixelData a -> PixelData a -> Ordering
    compare :: PixelData a -> PixelData a -> Ordering
    $c< :: forall a. PixelData a -> PixelData a -> Bool
    < :: PixelData a -> PixelData a -> Bool
    $c<= :: forall a. PixelData a -> PixelData a -> Bool
    <= :: PixelData a -> PixelData a -> Bool
    $c> :: forall a. PixelData a -> PixelData a -> Bool
    > :: PixelData a -> PixelData a -> Bool
    $c>= :: forall a. PixelData a -> PixelData a -> Bool
    >= :: PixelData a -> PixelData a -> Bool
    $cmax :: forall a. PixelData a -> PixelData a -> PixelData a
    max :: PixelData a -> PixelData a -> PixelData a
    $cmin :: forall a. PixelData a -> PixelData a -> PixelData a
    min :: PixelData a -> PixelData a -> PixelData a
    Ord, Int -> PixelData a -> ShowS
    [PixelData a] -> ShowS
    PixelData a -> String
    (Int -> PixelData a -> ShowS)
    -> (PixelData a -> String)
    -> ([PixelData a] -> ShowS)
    -> Show (PixelData a)
    forall a. Int -> PixelData a -> ShowS
    forall a. [PixelData a] -> ShowS
    forall a. PixelData a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Int -> PixelData a -> ShowS
    showsPrec :: Int -> PixelData a -> ShowS
    $cshow :: forall a. PixelData a -> String
    show :: PixelData a -> String
    $cshowList :: forall a. [PixelData a] -> ShowS
    showList :: [PixelData a] -> ShowS
    Show )

    withPixelData :: PixelData a -> (GLenum -> GLenum -> Ptr a -> b) -> b
    withPixelData :: forall a b. PixelData a -> (GLenum -> GLenum -> Ptr a -> b) -> b
    withPixelData (PixelData PixelFormat
    pixelFormat DataType
    dataType Ptr a
    ptr) GLenum -> GLenum -> Ptr a -> b
    f =
       GLenum -> GLenum -> Ptr a -> b
    f (PixelFormat -> GLenum
    marshalPixelFormat PixelFormat
    pixelFormat) (DataType -> GLenum
    marshalDataType DataType
    dataType) Ptr a
    ptr