X-Git-Url: https://git.delphigl.com/?p=glBitmap.git;a=blobdiff_plain;f=doc%2FglBitmap.TglBitmap.html;h=cf098b36ef8fd75ff43556fac4621cb4786533a1;hp=7f53bf58cd1b5c693b6bc359cbb4e9a86c3b71eb;hb=c110c2d190cfdd632a622163d3edb7c9c90cf21a;hpb=fb955156e23a85973e7ee2f89954d90574982fef diff --git a/doc/glBitmap.TglBitmap.html b/doc/glBitmap.TglBitmap.html index 7f53bf5..cf098b3 100644 --- a/doc/glBitmap.TglBitmap.html +++ b/doc/glBitmap.TglBitmap.html @@ -21,7 +21,7 @@ type TglBitmap = class(TObject)

Description

-base class for all glBitmap classes. used to manage OpenGL texture objects and to load, save and manipulate texture data

+base class for all glBitmap classes. used to manage OpenGL texture objects all operations on a bitmap object must be done from the render thread

Hierarchy

Overview

@@ -37,75 +37,51 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t Protected -fAnisotropic: Integer; - - -Protected fDeleteTextureOnFree: Boolean; - -Protected -fFreeDataOnDestroy: Boolean; - - -Protected -fFreeDataAfterGenTexture: Boolean; - - -Protected -fData: PByte; - - -Protected -fBorderColor: array[0..3] of Single; - - -Protected -fDimension: TglBitmapSize; - Protected -fMipMap: TglBitmapMipMap; +fFilterMin: GLenum; Protected -fFormat: TglBitmapFormat; +fFilterMag: GLenum; Protected -fPixelSize: Integer; +fWrapS: GLenum; Protected -fRowSize: Integer; +fWrapT: GLenum; Protected -fFilterMin: GLenum; +fWrapR: GLenum; Protected -fFilterMag: GLenum; +fAnisotropic: Integer; Protected -fWrapS: GLenum; +fBorderColor: array[0..3] of Single; Protected -fWrapT: GLenum; +fSwizzle: array[0..3] of GLenum; Protected -fWrapR: GLenum; +fDimension: TglBitmapSize; Protected -fSwizzle: array[0..3] of GLenum; +fMipMap: TglBitmapMipMap; Protected -fFilename: String; +fCustomData: Pointer; Protected @@ -115,48 +91,28 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t Protected fCustomNameW: WideString; - -Protected -fCustomData: Pointer; -

Methods

- - - - - - - - - + - - - - - - - - - + - + @@ -164,14 +120,6 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t - - - - - - - - @@ -195,22 +143,6 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t - - - - - - - - - - - - - - - - @@ -220,126 +152,6 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -360,63 +172,15 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
Privatefunction GetFormatDesc: TglBitmapFormatDescriptor;
Protected function GetWidth: Integer; virtual;
Protectedfunction GetHeight: Integer; virtual;
Protectedfunction GetFileWidth: Integer; virtual;function GetHeight: Integer; virtual;
Protectedfunction GetFileHeight: Integer; virtual;
Protected procedure SetCustomData(const aValue: Pointer);
Protectedprocedure SetCustomName(const aValue: String);
Protectedprocedure SetCustomNameW(const aValue: WideString);procedure SetCustomName(const aValue: String);
Protectedprocedure SetFreeDataOnDestroy(const aValue: Boolean);procedure SetCustomNameW(const aValue: WideString);
Protected
Protectedprocedure SetFormat(const aValue: TglBitmapFormat);
Protectedprocedure SetFreeDataAfterGenTexture(const aValue: Boolean);
Protected procedure SetID(const aValue: Cardinal);
procedure SetupParameters();
Protectedprocedure SetDataPointer(var aData: PByte; const aFormat: TglBitmapFormat; const aWidth: Integer = -1; const aHeight: Integer = -1); virtual;
Protectedprocedure GenTexture(const aTestTextureSize: Boolean = true); virtual; abstract;
Protectedfunction FlipHorz: Boolean; virtual;
Protectedfunction FlipVert: Boolean; virtual;
Public procedure AfterConstruction; override;
Publicprocedure PrepareResType(var aResource: String; var aResType: PChar);
Publicprocedure LoadFromFile(const aFilename: String);
Publicprocedure LoadFromStream(const aStream: TStream); virtual;
Publicprocedure LoadFromFunc(const aSize: TglBitmapSize; const aFunc: TglBitmapFunction; const aFormat: TglBitmapFormat; const aArgs: Pointer = nil);
Publicprocedure LoadFromResource(const aInstance: Cardinal; aResource: String; aResType: PChar = nil);
Publicprocedure LoadFromResourceID(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar);
Publicprocedure SaveToFile(const aFilename: String; const aFileType: TglBitmapFileType);
Publicprocedure SaveToStream(const aStream: TStream; const aFileType: TglBitmapFileType); virtual;
Publicfunction Convert(const aFunc: TglBitmapFunction; const aCreateTemp: Boolean; const aArgs: Pointer = nil): Boolean; overload;
Publicfunction Convert(const aSource: TglBitmap; const aFunc: TglBitmapFunction; aCreateTemp: Boolean; const aFormat: TglBitmapFormat; const aArgs: Pointer = nil): Boolean; overload;
Publicfunction ConvertTo(const aFormat: TglBitmapFormat): Boolean; virtual;
Publicfunction AddAlphaFromResource(const aInstance: Cardinal; aResource: String; aResType: PChar = nil; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
Publicfunction AddAlphaFromResourceID(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
Publicfunction AddAlphaFromFunc(const aFunc: TglBitmapFunction; const aArgs: Pointer = nil): Boolean; virtual;
Publicfunction AddAlphaFromFile(const aFileName: String; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
Publicfunction AddAlphaFromStream(const aStream: TStream; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
Publicfunction AddAlphaFromGlBitmap(const aBitmap: TglBitmap; aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
Publicfunction AddAlphaFromColorKey(const aRed, aGreen, aBlue: Byte; const aDeviation: Byte = 0): Boolean;
Publicfunction AddAlphaFromColorKeyRange(const aRed, aGreen, aBlue: Cardinal; const aDeviation: Cardinal = 0): Boolean;
Publicfunction AddAlphaFromColorKeyFloat(const aRed, aGreen, aBlue: Single; const aDeviation: Single = 0): Boolean;
Publicfunction AddAlphaFromValue(const aAlpha: Byte): Boolean;
Publicfunction AddAlphaFromValueRange(const aAlpha: Cardinal): Boolean;
Publicfunction AddAlphaFromValueFloat(const aAlpha: Single): Boolean;
Publicfunction RemoveAlpha: Boolean; virtual;
Publicfunction Clone: TglBitmap;
Publicprocedure Invert(const aUseRGB: Boolean = true; const aUseAlpha: Boolean = false);
Publicprocedure FreeData;
Publicprocedure FillWithColor(const aRed, aGreen, aBlue: Byte; const aAlpha: Byte = 255);
Publicprocedure FillWithColorRange(const aRed, aGreen, aBlue: Cardinal; const aAlpha: Cardinal = $FFFFFFFF);
Publicprocedure FillWithColorFloat(const aRed, aGreen, aBlue: Single; const aAlpha: Single = 1.0);
Public procedure SetFilter(const aMin, aMag: GLenum);
Publicconstructor Create; overload;
Publicconstructor Create(const aFileName: String); overload;
Publicconstructor Create(const aStream: TStream); overload;
Publicconstructor Create(const aSize: TglBitmapSize; const aFormat: TglBitmapFormat; aData: PByte = nil); overload;
Publicconstructor Create(const aSize: TglBitmapSize; const aFormat: TglBitmapFormat; const aFunc: TglBitmapFunction; const aArgs: Pointer = nil); overload;procedure UploadData(const aDataObj: TglBitmapData; const aCheckSize: Boolean = true); virtual;
Publicconstructor Create(const aInstance: Cardinal; const aResource: String; const aResType: PChar = nil); overload;constructor Create; overload;
Publicconstructor Create(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar); overload;
Privatefunction LoadRAW(const aStream: TStream): Boolean;
Privateprocedure SaveRAW(const aStream: TStream);
Privatefunction LoadBMP(const aStream: TStream): Boolean;
Privateprocedure SaveBMP(const aStream: TStream);
Privatefunction LoadTGA(const aStream: TStream): Boolean;
Privateprocedure SaveTGA(const aStream: TStream);
Privatefunction LoadDDS(const aStream: TStream): Boolean;
Privateprocedure SaveDDS(const aStream: TStream);constructor Create(const aData: TglBitmapData); overload;

Properties

@@ -430,24 +194,16 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t property Height: Integer read GetHeight; -Protected -property FileWidth: Integer read GetFileWidth; - - -Protected -property FileHeight: Integer read GetFileHeight; - - Public -property ID: Cardinal read fID write SetID; +property ID: Cardinal read fID write SetID; Public -property Target: Cardinal read fTarget write SetTarget; +property Target: Cardinal read fTarget write SetTarget; Public -property Format: TglBitmapFormat read fFormat write SetFormat; +property DeleteTextureOnFree: Boolean read fDeleteTextureOnFree write SetDeleteTextureOnFree; Public @@ -459,44 +215,20 @@ base class for all glBitmap classes. used to manage OpenGL texture objects and t Public -property FormatDesc: TglBitmapFormatDescriptor read GetFormatDesc; - - -Public -property Filename: String read fFilename; - - -Public -property CustomName: String read fCustomName write SetCustomName; - - -Public -property CustomNameW: WideString read fCustomNameW write SetCustomNameW; - - -Public property CustomData: Pointer read fCustomData write SetCustomData; Public -property DeleteTextureOnFree: Boolean read fDeleteTextureOnFree write SetDeleteTextureOnFree; +property CustomName: String read fCustomName write SetCustomName; Public -property FreeDataOnDestroy: Boolean read fFreeDataOnDestroy write SetFreeDataOnDestroy; +property CustomNameW: WideString read fCustomNameW write SetCustomNameW; Public -property FreeDataAfterGenTexture: Boolean read fFreeDataAfterGenTexture write SetFreeDataAfterGenTexture; - - -Public property Dimension: TglBitmapSize read fDimension; - -Public -property Data: PByte read fData; -

Description

Fields

@@ -523,181 +255,121 @@ texture target (e.g. GL_TEXTURE_2D)

- +
ProtectedfAnisotropic: Integer;fDeleteTextureOnFree: Boolean;

-anisotropic level

+delete OpenGL texture object when this object is destroyed

- +
ProtectedfDeleteTextureOnFree: Boolean;fFilterMin: GLenum;

-delete OpenGL texture object when this object is destroyed

+min filter to apply to the texture

- +
ProtectedfFreeDataOnDestroy: Boolean;fFilterMag: GLenum;

-free stored data when this object is destroyed

+mag filter to apply to the texture

- +
ProtectedfFreeDataAfterGenTexture: Boolean;fWrapS: GLenum;

-free stored data after data was uploaded to video card

+texture wrapping for x axis

- +
ProtectedfData: PByte;fWrapT: GLenum;

-data of this texture

+texture wrapping for y axis

- +
ProtectedfBorderColor: array[0..3] of Single;fWrapR: GLenum;

-color of the texture border

+texture wrapping for z axis

- +
ProtectedfDimension: TglBitmapSize;fAnisotropic: Integer;

-size of this texture

+anisotropic level

- +
ProtectedfMipMap: TglBitmapMipMap;fBorderColor: array[0..3] of Single;

-mipmap type

+color of the texture border

- +
ProtectedfFormat: TglBitmapFormat;fSwizzle: array[0..3] of GLenum;

-format the texture data is stored in

+color channel swizzle

- +
ProtectedfPixelSize: Integer;fDimension: TglBitmapSize;

-size of one pixel (in byte)

+size of this texture

- - - -
ProtectedfRowSize: Integer;
-

-size of one pixel row (in byte)

-
- - - - - - -
ProtectedfFilterMin: GLenum;
-

-min filter to apply to the texture

-
- - - - - - -
ProtectedfFilterMag: GLenum;
-

-mag filter to apply to the texture

-
- - - - - - -
ProtectedfWrapS: GLenum;
-

-texture wrapping for x axis

-
- - - - - - -
ProtectedfWrapT: GLenum;
-

-texture wrapping for y axis

-
- - - - - - -
ProtectedfWrapR: GLenum;
-

-texture wrapping for z axis

-
- - - - +
ProtectedfSwizzle: array[0..3] of GLenum;fMipMap: TglBitmapMipMap;

-color channel swizzle

+mipmap type

- +
ProtectedfFilename: String;fCustomData: Pointer;

-filename the texture was load from

+user defined data

@@ -720,28 +392,9 @@ user defined name

user defined name

- - - - - - -
ProtectedfCustomData: Pointer;
-

-user defined data

-

Methods

- - - - -
Privatefunction GetFormatDesc: TglBitmapFormatDescriptor;
Returns
-

format descriptor that describes the format of the stored data

- - @@ -761,24 +414,6 @@ user defined data

Protected function GetWidth: Integer; virtual;
- - - -
Protectedfunction GetFileWidth: Integer; virtual;
Returns
-

the width of the texture or 1 if the width is zero

- - - - - - -
Protectedfunction GetFileHeight: Integer; virtual;
Returns
-

the height of the texture or 1 if the height is zero

- - -
Protected procedure SetCustomData(const aValue: Pointer);
@@ -798,742 +433,102 @@ set a new value for fCustomName

- - - - -
Protectedprocedure SetCustomNameW(const aValue: WideString);
-

-set a new value for fCustomNameW

-
- - - - - - -
Protectedprocedure SetFreeDataOnDestroy(const aValue: Boolean);
-

-set new value for fFreeDataOnDestroy

-
- - - - - - -
Protectedprocedure SetDeleteTextureOnFree(const aValue: Boolean);
-

-set new value for fDeleteTextureOnFree

-
- - - - - - -
Protectedprocedure SetFormat(const aValue: TglBitmapFormat);
-

-set new value for the data format. only possible if new format has the same pixel size. if you want to convert the texture data, see ConvertTo function

-
- - - - - - -
Protectedprocedure SetFreeDataAfterGenTexture(const aValue: Boolean);
-

-set new value for fFreeDataAfterGenTexture

-
- - - - - - -
Protectedprocedure SetID(const aValue: Cardinal);
-

-set name of OpenGL texture object

-
- - - - - - -
Protectedprocedure SetMipMap(const aValue: TglBitmapMipMap);
-

-set new value for fMipMap

-
- - - - - - -
Protectedprocedure SetTarget(const aValue: Cardinal);
-

-set new value for target

-
- - - - - - -
Protectedprocedure SetAnisotropic(const aValue: Integer);
-

-set new value for fAnisotrophic

-
- - - - - - -
Protectedprocedure CreateID;
-

-create OpenGL texture object (delete exisiting object if exists)

-
- - - - - - -
Protectedprocedure SetupParameters();
-

-setup texture parameters

-
- - - - - - -
Protectedprocedure SetDataPointer(var aData: PByte; const aFormat: TglBitmapFormat; const aWidth: Integer = -1; const aHeight: Integer = -1); virtual;
-

-set data pointer of texture data

-
Parameters
-
-
aData
-
pointer to new texture data (be carefull, aData could be freed by this function)
-
aFormat
-
format of the data stored at aData
-
aWidth
-
width of the texture data
-
aHeight
-
height of the texture data
-
-
- - - - - - -
Protectedprocedure GenTexture(const aTestTextureSize: Boolean = true); virtual; abstract;
-

-generate texture (upload texture data to video card)

-
Parameters
-
-
aTestTextureSize
-
test texture size before uploading and raise exception if something is wrong
-
-
- - - - - - -
Protectedfunction FlipHorz: Boolean; virtual;
-

-flip texture horizontal

-
Returns
-

True in success, False otherwise

- - - - - - -
Protectedfunction FlipVert: Boolean; virtual;
-

-flip texture vertical

-
Returns
-

True in success, False otherwise

- - - - - - -
Publicprocedure AfterConstruction; override;
-

-this method is called after the constructor and sets the default values of this object

-
- - - - - - -
Publicprocedure BeforeDestruction; override;
-

-this method is called before the destructor and does some cleanup

-
- - - - - - -
Publicprocedure PrepareResType(var aResource: String; var aResType: PChar);
-

-splits a resource identifier into the resource and it's type

-
Parameters
-
-
aResource
-
resource identifier to split and store name in
-
aResType
-
type of the resource
-
-
- - - - - - -
Publicprocedure LoadFromFile(const aFilename: String);
-

-load a texture from a file

-
Parameters
-
-
aFilename
-
file to load texuture from
-
-
- - - - - - -
Publicprocedure LoadFromStream(const aStream: TStream); virtual;
-

-load a texture from a stream

-
Parameters
-
-
aStream
-
stream to load texture from
-
-
- - - - - - -
Publicprocedure LoadFromFunc(const aSize: TglBitmapSize; const aFunc: TglBitmapFunction; const aFormat: TglBitmapFormat; const aArgs: Pointer = nil);
-

-use a function to generate texture data

-
Parameters
-
-
aSize
-
size of the texture
-
aFunc
-
callback to use for generation
-
aFormat
-
format of the texture data
-
aArgs
-
user defined paramaters (use at will)
-
-
- - - - - - -
Publicprocedure LoadFromResource(const aInstance: Cardinal; aResource: String; aResType: PChar = nil);
-

-load a texture from a resource

-
Parameters
-
-
aInstance
-
resource handle
-
aResource
-
resource indentifier
-
aResType
-
resource type (if known)
-
-
- - - - - - -
Publicprocedure LoadFromResourceID(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar);
-

-load a texture from a resource id

-
Parameters
-
-
aInstance
-
resource handle
-
aResource
-
resource ID
-
aResType
-
resource type
-
-
- - - - - - -
Publicprocedure SaveToFile(const aFilename: String; const aFileType: TglBitmapFileType);
-

-save texture data to a file

-
Parameters
-
-
aFilename
-
filename to store texture in
-
aFileType
-
file type to store data into
-
-
- - - - - - -
Publicprocedure SaveToStream(const aStream: TStream; const aFileType: TglBitmapFileType); virtual;
-

-save texture data to a stream

-
Parameters
-
-
aFilename
-
filename to store texture in
-
aFileType
-
file type to store data into
-
-
- - - - - - -
Publicfunction Convert(const aFunc: TglBitmapFunction; const aCreateTemp: Boolean; const aArgs: Pointer = nil): Boolean; overload;
-

-convert texture data using a user defined callback

-
Parameters
-
-
aFunc
-
callback to use for converting
-
aCreateTemp
-
create a temporary buffer to use for converting
-
aArgs
-
user defined paramters (use at will)
-
-
Returns
-

True if converting was successful, False otherwise

- - - - - - -
Publicfunction Convert(const aSource: TglBitmap; const aFunc: TglBitmapFunction; aCreateTemp: Boolean; const aFormat: TglBitmapFormat; const aArgs: Pointer = nil): Boolean; overload;
-

-convert texture data using a user defined callback

-
Parameters
-
-
aSource
-
glBitmap to read data from
-
aFunc
-
callback to use for converting
-
aCreateTemp
-
create a temporary buffer to use for converting
-
aFormat
-
format of the new data
-
aArgs
-
user defined paramters (use at will)
-
-
Returns
-

True if converting was successful, False otherwise

- - - - - - -
Publicfunction ConvertTo(const aFormat: TglBitmapFormat): Boolean; virtual;
-

-convert texture data using a specific format

-
Parameters
-
-
aFormat
-
new format of texture data
-
-
Returns
-

True if converting was successful, False otherwise

- - - - - - -
Publicfunction AddAlphaFromResource(const aInstance: Cardinal; aResource: String; aResType: PChar = nil; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
-

-load alpha channel data from resource

-
Parameters
-
-
aInstance
-
resource handle
-
aResource
-
resource ID
-
aResType
-
resource type
-
aFunc
-
callback to use for converting
-
aArgs
-
user defined parameters (use at will)
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromResourceID(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
-

-load alpha channel data from resource ID

-
Parameters
-
-
aInstance
-
resource handle
-
aResourceID
-
resource ID
-
aResType
-
resource type
-
aFunc
-
callback to use for converting
-
aArgs
-
user defined parameters (use at will)
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromFunc(const aFunc: TglBitmapFunction; const aArgs: Pointer = nil): Boolean; virtual;
-

-add alpha channel data from function

-
Parameters
-
-
aFunc
-
callback to get data from
-
aArgs
-
user defined parameters (use at will)
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromFile(const aFileName: String; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
-

-add alpha channel data from file (macro for: new glBitmap, LoadFromFile, AddAlphaFromGlBitmap)

-
Parameters
-
-
aFilename
-
file to load alpha channel data from
-
aFunc
-
callback to use for converting
-
aArgs
-
user defined parameters (use at will)
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromStream(const aStream: TStream; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
-

-add alpha channel data from stream (macro for: new glBitmap, LoadFromStream, AddAlphaFromGlBitmap)

-
Parameters
-
-
aStream
-
stream to load alpha channel data from
-
aFunc
-
callback to use for converting
-
aArgs
-
user defined parameters (use at will)
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromGlBitmap(const aBitmap: TglBitmap; aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
-

-add alpha channel data from existing glBitmap object

-
Parameters
-
-
aBitmap
-
TglBitmap to copy alpha channel data from
-
aFunc
-
callback to use for converting
-
aArgs
-
user defined parameters (use at will)
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromColorKey(const aRed, aGreen, aBlue: Byte; const aDeviation: Byte = 0): Boolean;
-

-add alpha to pixel if the pixels color is greter than the given color value

-
Parameters
-
-
aRed
-
red threshold (0-255)
-
aGreen
-
green threshold (0-255)
-
aBlue
-
blue threshold (0-255)
-
aDeviatation
-
accepted deviatation (0-255)
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromColorKeyRange(const aRed, aGreen, aBlue: Cardinal; const aDeviation: Cardinal = 0): Boolean;
-

-add alpha to pixel if the pixels color is greter than the given color value

-
Parameters
-
-
aRed
-
red threshold (0-Range.r)
-
aGreen
-
green threshold (0-Range.g)
-
aBlue
-
blue threshold (0-Range.b)
-
aDeviatation
-
accepted deviatation (0-max(Range.rgb))
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Publicfunction AddAlphaFromColorKeyFloat(const aRed, aGreen, aBlue: Single; const aDeviation: Single = 0): Boolean;
-

-add alpha to pixel if the pixels color is greter than the given color value

-
Parameters
-
-
aRed
-
red threshold (0.0-1.0)
-
aGreen
-
green threshold (0.0-1.0)
-
aBlue
-
blue threshold (0.0-1.0)
-
aDeviatation
-
accepted deviatation (0.0-1.0)
-
-
Returns
-

True on success, False otherwise

- - - - + + +set a new value for fCustomNameW

+
Publicfunction AddAlphaFromValue(const aAlpha: Byte): Boolean;Protectedprocedure SetCustomNameW(const aValue: WideString);

-add a constand alpha value to all pixels

-
Parameters
-
-
aAlpha
-
alpha value to add (0-255)
-
-
Returns
-

True on success, False otherwise

- - + + +set new value for fDeleteTextureOnFree

+
Publicfunction AddAlphaFromValueRange(const aAlpha: Cardinal): Boolean;Protectedprocedure SetDeleteTextureOnFree(const aValue: Boolean);

-add a constand alpha value to all pixels

-
Parameters
-
-
aAlpha
-
alpha value to add (0-max(Range.rgb))
-
-
Returns
-

True on success, False otherwise

- - + + +set name of OpenGL texture object

+
Publicfunction AddAlphaFromValueFloat(const aAlpha: Single): Boolean;Protectedprocedure SetID(const aValue: Cardinal);

-add a constand alpha value to all pixels

-
Parameters
-
-
aAlpha
-
alpha value to add (0.0-1.0)
-
-
Returns
-

True on success, False otherwise

- - + + +set new value for fMipMap

+
Publicfunction RemoveAlpha: Boolean; virtual;Protectedprocedure SetMipMap(const aValue: TglBitmapMipMap);

-remove alpha channel

-
Returns
-

True on success, False otherwise

- - + + +set new value for target

+
Publicfunction Clone: TglBitmap;Protectedprocedure SetTarget(const aValue: Cardinal);

-create a clone of the current object

-
Returns
-

clone of this object

- - + +
Publicprocedure Invert(const aUseRGB: Boolean = true; const aUseAlpha: Boolean = false);Protectedprocedure SetAnisotropic(const aValue: Integer);

-invert color data (xor)

-
Parameters
-
-
aUseRGB
-
xor each color channel
-
aUseAlpha
-
xor alpha channel
-
+set new value for fAnisotrophic

- - + +
Publicprocedure FreeData;Protectedprocedure CreateID;

-free texture stored data

+create OpenGL texture object (delete exisiting object if exists)

- - + +
Publicprocedure FillWithColor(const aRed, aGreen, aBlue: Byte; const aAlpha: Byte = 255);Protectedprocedure SetupParameters();

-fill complete texture with one color

-
Parameters
-
-
aRed
-
red color for border (0-255)
-
aGreen
-
green color for border (0-255)
-
aBlue
-
blue color for border (0-255)
-
aAlpha
-
alpha color for border (0-255)
-
+setup texture parameters

- +
Publicprocedure FillWithColorRange(const aRed, aGreen, aBlue: Cardinal; const aAlpha: Cardinal = $FFFFFFFF);procedure AfterConstruction; override;

-fill complete texture with one color

-
Parameters
-
-
aRed
-
red color for border (0-Range.r)
-
aGreen
-
green color for border (0-Range.g)
-
aBlue
-
blue color for border (0-Range.b)
-
aAlpha
-
alpha color for border (0-Range.a)
-
+this method is called after the constructor and sets the default values of this object

- +
Publicprocedure FillWithColorFloat(const aRed, aGreen, aBlue: Single; const aAlpha: Single = 1.0);procedure BeforeDestruction; override;

-fill complete texture with one color

-
Parameters
-
-
aRed
-
red color for border (0.0-1.0)
-
aGreen
-
green color for border (0.0-1.0)
-
aBlue
-
blue color for border (0.0-1.0)
-
aAlpha
-
alpha color for border (0.0-1.0)
-
+this method is called before the destructor and does some cleanup

@@ -1626,243 +621,38 @@ bind texture

- - - -
Publicconstructor Create; overload;
-

-constructor - created an empty texture

-
- - - - - - -
Publicconstructor Create(const aFileName: String); overload;
-

-constructor - creates a texture and load it from a file

-
Parameters
-
-
aFilename
-
file to load texture from
-
-
- - - - - - -
Publicconstructor Create(const aStream: TStream); overload;
-

-constructor - creates a texture and load it from a stream

-
Parameters
-
-
aStream
-
stream to load texture from
-
-
- - - - + -
Publicconstructor Create(const aSize: TglBitmapSize; const aFormat: TglBitmapFormat; aData: PByte = nil); overload;procedure UploadData(const aDataObj: TglBitmapData; const aCheckSize: Boolean = true); virtual;

-constructor - creates a texture with the given size, format and data you can control this by setting DeleteTextureOnFree, FreeDataOnDestroy and FreeDataAfterGenTexture

+upload texture data from given data object to video card

Parameters
-
aSize
-
size of the texture
-
aFormat
-
format of the given data
aData
-
texture data - be carefull: the data will now be managed by the glBitmap object,
-
-
- - - - - -
Publicconstructor Create(const aSize: TglBitmapSize; const aFormat: TglBitmapFormat; const aFunc: TglBitmapFunction; const aArgs: Pointer = nil); overload;
-

-constructor - creates a texture with the given size and format and uses the given callback to create the data

-
Parameters
-
-
aSize
-
size of the texture
-
aFormat
-
format of the given data
-
aFunc
-
callback to use for generating the data
-
aArgs
-
user defined parameters (use at will)
+
texture data object that contains the actual data
+
aCheckSize
+
check size before upload and throw exception if something is wrong
- +
Publicconstructor Create(const aInstance: Cardinal; const aResource: String; const aResType: PChar = nil); overload;constructor Create; overload;

-constructor - creates a texture and loads it from a resource

-
Parameters
-
-
aInstance
-
resource handle
-
aResource
-
resource indentifier
-
aResType
-
resource type (if known)
-
+constructor - creates an empty texture

- - - -
Publicconstructor Create(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar); overload;
-

-constructor - creates a texture and loads it from a resource

-
Parameters
-
-
aInstance
-
resource handle
-
aResourceID
-
resource ID
-
aResType
-
resource type (if known)
-
-
- - - - - - -
Privatefunction LoadRAW(const aStream: TStream): Boolean;
-

-try to load a RAW image from a stream

-
Parameters
-
-
aStream
-
stream to load RAW image from
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Privateprocedure SaveRAW(const aStream: TStream);
-

-save texture data as RAW image to stream

-
Parameters
-
-
aStream
-
stream to save data to
-
-
- - - - - - -
Privatefunction LoadBMP(const aStream: TStream): Boolean;
-

-try to load a BMP from a stream

-
Parameters
-
-
aStream
-
stream to load BMP from
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Privateprocedure SaveBMP(const aStream: TStream);
-

-save texture data as BMP to stream

-
Parameters
-
-
aStream
-
stream to save data to
-
-
- - - - - - -
Privatefunction LoadTGA(const aStream: TStream): Boolean;
-

-try to load a TGA from a stream

-
Parameters
-
-
aStream
-
stream to load TGA from
-
-
Returns
-

True on success, False otherwise

- - - - - - -
Privateprocedure SaveTGA(const aStream: TStream);
-

-save texture data as TGA to stream

-
Parameters
-
-
aStream
-
stream to save data to
-
-
- - - - - - -
Privatefunction LoadDDS(const aStream: TStream): Boolean;
-

-try to load a DDS from a stream

-
Parameters
-
-
aStream
-
stream to load DDS from
-
-
Returns
-

True on success, False otherwise

- - - - +
Privateprocedure SaveDDS(const aStream: TStream);constructor Create(const aData: TglBitmapData); overload;

-save texture data as DDS to stream

-
Parameters
-
-
aStream
-
stream to save data to
-
+constructor - creates an texture object and uploads the given data

Properties

@@ -1888,28 +678,8 @@ the actual height of the texture

- - - - -
Protectedproperty FileWidth: Integer read GetFileWidth;
-

-the width of the texture or 1 if the width is zero

-
- - - - - - -
Protectedproperty FileHeight: Integer read GetFileHeight;
-

-the height of the texture or 1 if the height is zero

-
- - - +
Publicproperty ID: Cardinal read fID write SetID;property ID: Cardinal read fID write SetID;

@@ -1919,7 +689,7 @@ name of the OpenGL texture object

- +
Publicproperty Target: Cardinal read fTarget write SetTarget;property Target: Cardinal read fTarget write SetTarget;

@@ -1929,11 +699,11 @@ texture target (e.g. GL_TEXTURE_2D)

- +
Publicproperty Format: TglBitmapFormat read fFormat write SetFormat;property DeleteTextureOnFree: Boolean read fDeleteTextureOnFree write SetDeleteTextureOnFree;

-format the texture data is stored in

+delete texture object when this object is destroyed

@@ -1959,21 +729,11 @@ anisotropic level

- - - -
Publicproperty FormatDesc: TglBitmapFormatDescriptor read GetFormatDesc;
-

-format descriptor that describes the format of the stored data

-
- - - - +
Publicproperty Filename: String read fFilename;property CustomData: Pointer read fCustomData write SetCustomData;

-filename the texture was load from

+user defined data (use at will)

@@ -1999,46 +759,6 @@ user defined name (as WideString; use at will)

- - - -
Publicproperty CustomData: Pointer read fCustomData write SetCustomData;
-

-user defined data (use at will)

-
- - - - - - -
Publicproperty DeleteTextureOnFree: Boolean read fDeleteTextureOnFree write SetDeleteTextureOnFree;
-

-delete texture object when this object is destroyed

-
- - - - - - -
Publicproperty FreeDataOnDestroy: Boolean read fFreeDataOnDestroy write SetFreeDataOnDestroy;
-

-free stored data when this object is destroyed

-
- - - - - - -
Publicproperty FreeDataAfterGenTexture: Boolean read fFreeDataAfterGenTexture write SetFreeDataAfterGenTexture;
-

-free stored data after it is uplaoded to video card

-
- - -
Public property Dimension: TglBitmapSize read fDimension;
@@ -2046,16 +766,6 @@ free stored data after it is uplaoded to video card

size of the texture

- - - - - - -
Publicproperty Data: PByte read fData;
-

-texture data (or Nil if unset)

-
-
Generated by PasDoc 0.13.0 on 2014-12-21 15:05:48 +
Generated by PasDoc 0.13.0 on 2014-12-24 04:27:09