Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains data types that describe the data formats of images.
- isRenderTargettable :: ImageFormat -> Bool
- isCompressed :: ImageFormat -> Bool
- isColorFormat :: ImageFormat -> Bool
- hasDepthComponent :: ImageFormat -> Bool
- hasStencilComponent :: ImageFormat -> Bool
- isSRGBFormat :: ImageFormat -> Bool
- data ImageFormat
- = R8
- | R8I
- | R8UI
- | R16
- | R16I
- | R16UI
- | R16F
- | R32F
- | R32I
- | R32UI
- | RG8
- | RG8I
- | RG8UI
- | RG16
- | RG16I
- | RG16UI
- | RG16F
- | RG32F
- | RG32I
- | RG32UI
- | R11F_G11F_B10F
- | RGBA32F
- | RGBA32I
- | RGBA32UI
- | RGBA16
- | RGBA16F
- | RGBA16I
- | RGBA16UI
- | RGBA8
- | RGBA8UI
- | SRGB8_ALPHA8
- | RGB10_A2
- | RGB32F
- | RGB32I
- | RGB32UI
- | RGB16F
- | RGB16I
- | RGB16UI
- | RGB16
- | RGB8
- | RGB8I
- | RGB8UI
- | SRGB8
- | RGB9_E5
- | COMPRESSED_RG_RGTC2
- | COMPRESSED_SIGNED_RG_RGTC2
- | COMPRESSED_RED_RGTC1
- | COMPRESSED_SIGNED_RED_RGTC1
- | COMPRESSED_RGB_S3TC_DXT1
- | COMPRESSED_RGBA_S3TC_DXT1
- | COMPRESSED_RGBA_S3TC_DXT3
- | COMPRESSED_RGBA_S3TC_DXT5
- | COMPRESSED_SRGB_S3TC_DXT1
- | COMPRESSED_SRGB_ALPHA_S3TC_DXT1
- | COMPRESSED_SRGB_ALPHA_S3TC_DXT3
- | COMPRESSED_SRGB_ALPHA_S3TC_DXT5
- | DEPTH_COMPONENT32
- | DEPTH_COMPONENT32F
- | DEPTH_COMPONENT24
- | DEPTH_COMPONENT16
- | DEPTH32F_STENCIL8
- | DEPTH24_STENCIL8
- toConstantIF :: ImageFormat -> GLenum
- data SpecificationType
- toConstantST :: SpecificationType -> GLenum
- sizeOfSpecificationType :: SpecificationType -> Int
- class SpecificationTypeable a where
- toSpecificationType :: a -> SpecificationType
Documentation
isRenderTargettable :: ImageFormat -> Bool Source
Given a format, returns True
if that format can be rendered to. That is,
if it can be one of the targets in a framebuffer.
This is conservative. Sometimes you may be able to render anyway; however this is not guaranteed by the OpenGL specification.
isCompressed :: ImageFormat -> Bool Source
Returns true if the given format is a compressed format.
isColorFormat :: ImageFormat -> Bool Source
Returns true if the given format is a color format.
hasDepthComponent :: ImageFormat -> Bool Source
Returns true if the given format has a depth component.
hasStencilComponent :: ImageFormat -> Bool Source
Returns true if the given format has a stencil component.
isSRGBFormat :: ImageFormat -> Bool Source
Returns true if the given format uses the sRGB color space.
If the format is not a color format, returns False
.
data ImageFormat Source
All the various internal formats.
This list corresponds to the OpenGL specification of 3.3, required texture formats (+ S3TC compressed formats). Check the OpenGL specification for explanations on how these formats work.
toConstantIF :: ImageFormat -> GLenum Source
data SpecificationType Source
Specification formats.
These formats specify the type of the data passed from Haskell to GPU.
sizeOfSpecificationType :: SpecificationType -> Int Source
Given a specification format, returns the number of bytes one element uses.
class SpecificationTypeable a where Source
Class that turns Haskell types into SpecificationType
.
:: a | Used to pass the type; not evaluated. |
-> SpecificationType |
Returns the corresponding SpecificationType
for a Haskell type.