Class TglBitmapFormatDescriptor

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TglBitmapFormatDescriptor = class(TObject)

Description

describes the properties of a given texture data format

Hierarchy

  • TObject
  • TglBitmapFormatDescriptor

Overview

Fields

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

Methods

Private function GetHasRed: Boolean;
Private function GetHasGreen: Boolean;
Private function GetHasBlue: Boolean;
Private function GetHasAlpha: Boolean;
Private function GetHasColor: Boolean;
Private function GetIsGrayscale: Boolean;
Protected procedure SetValues; virtual;
Protected procedure CalcValues;
Public function GetSize(const aSize: TglBitmapSize): Integer; overload; virtual;
Public function GetSize(const aWidth, aHeight: Integer): Integer; overload; virtual;
Public constructor Create;
Public class function GetByFormat(const aInternalFormat: GLenum): TglBitmapFormatDescriptor;

Properties

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

Description

Fields

Private fBytesPerPixel: Single;

number of bytes for each pixel

Private fChannelCount: Integer;

number of color channels

Private fMask: TglBitmapRec4ul;

bitmask for each color channel

Private fRange: TglBitmapRec4ui;

maximal value of each color channel

Protected fFormat: TglBitmapFormat;

format this descriptor belongs to

Protected fWithAlpha: TglBitmapFormat;

suitable format with alpha channel

Protected fWithoutAlpha: TglBitmapFormat;

suitable format without alpha channel

Protected fOpenGLFormat: TglBitmapFormat;

suitable format that is supported by OpenGL

Protected fRGBInverted: TglBitmapFormat;

suitable format with inverted RGB channels

Protected fUncompressed: TglBitmapFormat;

suitable format with uncompressed data

Protected fBitsPerPixel: Integer;

number of bits per pixel

Protected fIsCompressed: Boolean;

True if the format is compressed, False otherwise

Protected fPrecision: TglBitmapRec4ub;

number of bits for each color channel

Protected fShift: TglBitmapRec4ub;

bit offset for each color channel

Protected fglFormat: GLenum;

OpenGL format enum (e.g. GL_RGB)

Protected fglInternalFormat: GLenum;

OpenGL internal format enum (e.g. GL_RGB8)

Protected fglDataFormat: GLenum;

OpenGL data format enum (e.g. GL_UNSIGNED_BYTE)

Methods

Private function GetHasRed: Boolean;
 
Returns

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

Private function GetHasGreen: Boolean;
 
Returns

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

Private function GetHasBlue: Boolean;
 
Returns

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

Private function GetHasAlpha: Boolean;
 
Returns

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

Private function GetHasColor: Boolean;
 
Returns

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

Private function GetIsGrayscale: Boolean;
 
Returns

True if the format is a grayscale format, False otherwise

Protected procedure SetValues; virtual;

set values for this format descriptor

Protected procedure CalcValues;

calculate cached values

Public function GetSize(const aSize: TglBitmapSize): Integer; overload; virtual;
 
Public function GetSize(const aWidth, aHeight: Integer): Integer; overload; virtual;
 
Public constructor Create;

constructor

Public 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

Public property Format: TglBitmapFormat read fFormat;

format this descriptor belongs to

Public property ChannelCount: Integer read fChannelCount;

number of color channels

Public property IsCompressed: Boolean read fIsCompressed;

True if the format is compressed, False otherwise

Public property BitsPerPixel: Integer read fBitsPerPixel;

number of bytes per pixel

Public property BytesPerPixel: Single read fBytesPerPixel;

number of bits per pixel

Public property Precision: TglBitmapRec4ub read fPrecision;

number of bits for each color channel

Public property Shift: TglBitmapRec4ub read fShift;

bit offset for each color channel

Public property Range: TglBitmapRec4ui read fRange;

maximal value of each color channel

Public property Mask: TglBitmapRec4ul read fMask;

bitmask for each color channel

Public property RGBInverted: TglBitmapFormat read fRGBInverted;

suitable format with inverted RGB channels

Public property WithAlpha: TglBitmapFormat read fWithAlpha;

suitable format with alpha channel

Public property WithoutAlpha: TglBitmapFormat read fWithAlpha;

suitable format without alpha channel

Public property OpenGLFormat: TglBitmapFormat read fOpenGLFormat;

suitable format that is supported by OpenGL

Public property Uncompressed: TglBitmapFormat read fUncompressed;

suitable format with uncompressed data

Public property glFormat: GLenum read fglFormat;

OpenGL format enum (e.g. GL_RGB)

Public property glInternalFormat: GLenum read fglInternalFormat;

OpenGL internal format enum (e.g. GL_RGB8)

Public property glDataFormat: GLenum read fglDataFormat;

OpenGL data format enum (e.g. GL_UNSIGNED_BYTE)

Public property HasRed: Boolean read GetHasRed;

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

Public property HasGreen: Boolean read GetHasGreen;

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

Public property HasBlue: Boolean read GetHasBlue;

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

Public property HasAlpha: Boolean read GetHasAlpha;

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

Public property HasColor: Boolean read GetHasColor;

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

Public property IsGrayscale: Boolean read GetIsGrayscale;

True if the format is a grayscale format, False otherwise


Generated by PasDoc 0.13.0 on 2014-12-24 04:27:09