# Class TglBitmapFormatDescriptor

Description | Hierarchy | Fields | Methods | Properties

## Unit

glBitmap

## Declaration

`type TglBitmapFormatDescriptor = class(TObject)`

## Description

describes the properties of a given texture data format

## Hierarchy

- TObject
- TglBitmapFormatDescriptor

## Overview

### Fields

| `fBytesPerPixel: Single;`
| `fChannelCount: Integer;`
| `fMask: TglBitmapRec4ul;`
| `fRange: TglBitmapRec4ui;`
| `fFormat: TglBitmapFormat;`
| `fWithAlpha: TglBitmapFormat;`
| `fWithoutAlpha: TglBitmapFormat;`
| `fOpenGLFormat: TglBitmapFormat;`
| `fRGBInverted: TglBitmapFormat;`
| `fUncompressed: TglBitmapFormat;`
| `fBitsPerPixel: Integer;`
| `fIsCompressed: Boolean;`
| `fPrecision: TglBitmapRec4ub;`
| `fShift: TglBitmapRec4ub;`
| `fglFormat: GLenum;`
| `fglInternalFormat: GLenum;`
| `fglDataFormat: GLenum;`

### Methods

| `function GetHasRed: Boolean;`
| `function GetHasGreen: Boolean;`
| `function GetHasBlue: Boolean;`
| `function GetHasAlpha: Boolean;`
| `function GetHasColor: Boolean;`
| `function GetIsGrayscale: Boolean;`
| `procedure SetValues; virtual;`
| `procedure CalcValues;`
| `constructor Create;`
| `class function GetByFormat(const aInternalFormat: GLenum): TglBitmapFormatDescriptor;`

### Properties

| `property Format: TglBitmapFormat read fFormat;`
| `property ChannelCount: Integer read fChannelCount;`
| `property IsCompressed: Boolean read fIsCompressed;`
| `property BitsPerPixel: Integer read fBitsPerPixel;`
| `property BytesPerPixel: Single read fBytesPerPixel;`
| `property Precision: TglBitmapRec4ub read fPrecision;`
| `property Shift: TglBitmapRec4ub read fShift;`
| `property Range: TglBitmapRec4ui read fRange;`
| `property Mask: TglBitmapRec4ul read fMask;`
| `property RGBInverted: TglBitmapFormat read fRGBInverted;`
| `property WithAlpha: TglBitmapFormat read fWithAlpha;`
| `property WithoutAlpha: TglBitmapFormat read fWithAlpha;`
| `property OpenGLFormat: TglBitmapFormat read fOpenGLFormat;`
| `property Uncompressed: TglBitmapFormat read fUncompressed;`
| `property glFormat: GLenum read fglFormat;`
| `property glInternalFormat: GLenum read fglInternalFormat;`
| `property glDataFormat: GLenum read fglDataFormat;`
| `property HasRed: Boolean read GetHasRed;`
| `property HasGreen: Boolean read GetHasGreen;`
| `property HasBlue: Boolean read GetHasBlue;`
| `property HasAlpha: Boolean read GetHasAlpha;`
| `property HasColor: Boolean read GetHasColor;`
| `property IsGrayscale: Boolean read GetIsGrayscale;`

## Description

### Fields

| `fBytesPerPixel: Single;`
number of bytes for each pixel

| `fChannelCount: Integer;`
number of color channels

| `fMask: TglBitmapRec4ul;`
bitmask for each color channel

| `fRange: TglBitmapRec4ui;`
maximal value of each color channel

| `fFormat: TglBitmapFormat;`
format this descriptor belongs to

| `fWithAlpha: TglBitmapFormat;`
suitable format with alpha channel

| `fWithoutAlpha: TglBitmapFormat;`
suitable format without alpha channel

| `fOpenGLFormat: TglBitmapFormat;`
suitable format that is supported by OpenGL

| `fRGBInverted: TglBitmapFormat;`
suitable format with inverted RGB channels

| `fUncompressed: TglBitmapFormat;`
suitable format with uncompressed data

| `fBitsPerPixel: Integer;`
number of bits per pixel

| `fIsCompressed: Boolean;`
`True` if the format is compressed, `False` otherwise

| `fPrecision: TglBitmapRec4ub;`
number of bits for each color channel

| `fShift: TglBitmapRec4ub;`
bit offset for each color channel

| `fglFormat: GLenum;`
OpenGL format enum (e.g. GL_RGB)

| `fglInternalFormat: GLenum;`
OpenGL internal format enum (e.g. GL_RGB8)

| `fglDataFormat: GLenum;`
OpenGL data format enum (e.g. GL_UNSIGNED_BYTE)

### Methods

| `function GetHasRed: Boolean;`

###### Returns

`True` if the format has a red color channel, `False` otherwise

| `function GetHasGreen: Boolean;`

###### Returns

`True` if the format has a green color channel, `False` otherwise

| `function GetHasBlue: Boolean;`

###### Returns

`True` if the format has a blue color channel, `False` otherwise

| `function GetHasAlpha: Boolean;`

###### Returns

`True` if the format has a alpha color channel, `False` otherwise

| `function GetHasColor: Boolean;`

###### Returns

`True` if the format has any color color channel, `False` otherwise

| `function GetIsGrayscale: Boolean;`

###### Returns

`True` if the format is a grayscale format, `False` otherwise

| `procedure SetValues; virtual;`
set values for this format descriptor

| `procedure CalcValues;`
calculate cached values

| `constructor Create;`
constructor

| `class function GetByFormat(const aInternalFormat: GLenum): TglBitmapFormatDescriptor;`

get the format descriptor by a given OpenGL internal format

###### Parameters

aInternalFormat
  OpenGL internal format to get format descriptor for

###### Returns

suitable format descriptor or tfEmpty-Descriptor

### Properties

| `property Format: TglBitmapFormat read fFormat;`
format this descriptor belongs to

| `property ChannelCount: Integer read fChannelCount;`
number of color channels

| `property IsCompressed: Boolean read fIsCompressed;`
`True` if the format is compressed, `False` otherwise

| `property BitsPerPixel: Integer read fBitsPerPixel;`
number of bytes per pixel

| `property BytesPerPixel: Single read fBytesPerPixel;`
number of bits per pixel

| `property Precision: TglBitmapRec4ub read fPrecision;`
number of bits for each color channel

| `property Shift: TglBitmapRec4ub read fShift;`
bit offset for each color channel

| `property Range: TglBitmapRec4ui read fRange;`
maximal value of each color channel

| `property Mask: TglBitmapRec4ul read fMask;`
bitmask for each color channel

| `property RGBInverted: TglBitmapFormat read fRGBInverted;`
suitable format with inverted RGB channels

| `property WithAlpha: TglBitmapFormat read fWithAlpha;`
suitable format with alpha channel

| `property WithoutAlpha: TglBitmapFormat read fWithAlpha;`
suitable format without alpha channel

| `property OpenGLFormat: TglBitmapFormat read fOpenGLFormat;`
suitable format that is supported by OpenGL

| `property Uncompressed: TglBitmapFormat read fUncompressed;`
suitable format with uncompressed data

| `property glFormat: GLenum read fglFormat;`
OpenGL format enum (e.g. GL_RGB)

| `property glInternalFormat: GLenum read fglInternalFormat;`
OpenGL internal format enum (e.g. GL_RGB8)

| `property glDataFormat: GLenum read fglDataFormat;`
OpenGL data format enum (e.g. GL_UNSIGNED_BYTE)

| `property HasRed: Boolean read GetHasRed;`
`True` if the format has a red color channel, `False` otherwise

| `property HasGreen: Boolean read GetHasGreen;`
`True` if the format has a green color channel, `False` otherwise

| `property HasBlue: Boolean read GetHasBlue;`
`True` if the format has a blue color channel, `False` otherwise

| `property HasAlpha: Boolean read GetHasAlpha;`
`True` if the format has a alpha color channel, `False` otherwise

| `property HasColor: Boolean read GetHasColor;`
`True` if the format has any color color channel, `False` otherwise

| `property IsGrayscale: Boolean read GetIsGrayscale;`
`True` if the format is a grayscale format, `False` otherwise

Generated by PasDoc 0.13.0 on 2014-12-21 15:05:48