X-Git-Url: https://git.delphigl.com/?p=LazOpenGLCore.git;a=blobdiff_plain;f=doc%2FglBitmap.TglBitmapData.html;fp=doc%2FglBitmap.TglBitmapData.html;h=1e2306505b6ca9dcebc5c2205f1520dab36c0ccd;hp=0000000000000000000000000000000000000000;hb=c110c2d190cfdd632a622163d3edb7c9c90cf21a;hpb=fb955156e23a85973e7ee2f89954d90574982fef diff --git a/doc/glBitmap.TglBitmapData.html b/doc/glBitmap.TglBitmapData.html new file mode 100644 index 0000000..1e23065 --- /dev/null +++ b/doc/glBitmap.TglBitmapData.html @@ -0,0 +1,1539 @@ + + + +glBitmap: Class TglBitmapData + + + + + +
+

Class TglBitmapData

+ + +
DescriptionHierarchyFieldsMethodsProperties
+

Unit

+ +

Declaration

+

+type TglBitmapData = class(TObject)

+

Description

+

+class to store texture data in. used to load, save and manipulate data before assigned to texture object all operations on a data object can be done from a background thread

+

Hierarchy

+
  • TObject
  • +
  • TglBitmapData

Overview

+

Fields

+ + + + + + + + + + + + + + + + + + + + + + + + + +
PrivatefData: PByte;
PrivatefDimension: TglBitmapSize;
PrivatefFormat: TglBitmapFormat;
PrivatefFilename: String;
PrivatefScanlines: array of PByte;
PrivatefHasScanlines: Boolean;
+

Methods

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Privatefunction GetFormatDescriptor: TglBitmapFormatDescriptor;
Privatefunction GetWidth: Integer;
Privatefunction GetHeight: Integer;
Privatefunction GetScanlines(const aIndex: Integer): PByte;
Privateprocedure SetFormat(const aValue: TglBitmapFormat);
Privateprocedure PrepareResType(var aResource: String; var aResType: PChar);
Privateprocedure UpdateScanlines;
Privatefunction LoadPNG(const aStream: TStream): Boolean; virtual;
Privateprocedure SavePNG(const aStream: TStream); virtual;
Privatefunction LoadJPEG(const aStream: TStream): Boolean; virtual;
Privateprocedure SaveJPEG(const aStream: TStream); virtual;
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);
Publicfunction FlipHorz: Boolean; virtual;
Publicfunction FlipVert: Boolean; virtual;
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: TglBitmapData; const aFunc: TglBitmapFunction; aCreateTemp: Boolean; const aFormat: TglBitmapFormat; const aArgs: Pointer = nil): Boolean; overload;
Publicfunction ConvertTo(const aFormat: TglBitmapFormat): Boolean; virtual;
Publicfunction AssignToLazIntfImage(const aImage: TLazIntfImage): Boolean;
Publicfunction AssignFromLazIntfImage(const aImage: TLazIntfImage): Boolean;
Publicfunction AssignAlphaToLazIntfImage(const aImage: TLazIntfImage): Boolean;
Publicfunction AddAlphaFromLazIntfImage(const aImage: TLazIntfImage; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
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 AddAlphaFromDataObj(const aDataObj: TglBitmapData; aFunc: TglBitmapFunction; const aArgs: Pointer): 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;
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);
Publicprocedure SetData(const aData: PByte; const aFormat: TglBitmapFormat; const aWidth: Integer = -1; const aHeight: Integer = -1); virtual;
Publicfunction Clone: TglBitmapData;
Publicprocedure Invert(const aRed, aGreen, aBlue, aAlpha: Boolean);
Publicprocedure GenerateNormalMap(const aFunc: TglBitmapNormalMapFunc = nm3x3; const aScale: Single = 2; const aUseAlpha: Boolean = false);
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;
Publicconstructor Create(const aInstance: Cardinal; const aResource: String; const aResType: PChar = nil); overload;
Publicconstructor Create(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar); overload;
Publicdestructor Destroy; override;
+

Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Publicproperty Data: PByte read fData;
Publicproperty Dimension: TglBitmapSize read fDimension;
Publicproperty Filename: String read fFilename;
Publicproperty Width: Integer read GetWidth;
Publicproperty Height: Integer read GetHeight;
Publicproperty Format: TglBitmapFormat read fFormat write SetFormat;
Publicproperty Scanlines[constaIndex:Integer]: PByte read GetScanlines;
Publicproperty FormatDescriptor: TglBitmapFormatDescriptor read GetFormatDescriptor;
+

Description

+

Fields

+ + + + + + +
PrivatefData: PByte;
+

+texture data

+
+ + + + + + +
PrivatefDimension: TglBitmapSize;
+

+pixel size of the data

+
+ + + + + + +
PrivatefFormat: TglBitmapFormat;
+

+format the texture data is stored in

+
+ + + + + + +
PrivatefFilename: String;
+

+file the data was load from

+
+ + + + + + +
PrivatefScanlines: array of PByte;
+

+pointer to begin of each line

+
+ + + + + + +
PrivatefHasScanlines: Boolean;
+

+True if scanlines are initialized, False otherwise

+
+

Methods

+ + + + + + +
Privatefunction GetFormatDescriptor: TglBitmapFormatDescriptor;
Returns
+

the format descriptor suitable to the texture data format

+ + + + + + +
Privatefunction GetWidth: Integer;
Returns
+

the width of the texture data (in pixel) or -1 if no data is set

+ + + + + + +
Privatefunction GetHeight: Integer;
Returns
+

the height of the texture data (in pixel) or -1 if no data is set

+ + + + + + +
Privatefunction GetScanlines(const aIndex: Integer): PByte;
+

+get scanline at index aIndex

+
Returns
+

Pointer to start of line or Nil

+ + + + + + +
Privateprocedure 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

+
+ + + + + + +
Privateprocedure 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
+
+
+ + + + + + +
Privateprocedure UpdateScanlines;
+

+updates scanlines array

+
+ + + + + + +
Privatefunction LoadPNG(const aStream: TStream): Boolean; virtual;
+

+try to load a PNG from a stream

+
Parameters
+
+
aStream
+
stream to load PNG from
+
+
Returns
+

True on success, False otherwise

+ + + + + + +
Privateprocedure SavePNG(const aStream: TStream); virtual;
+

+save texture data as PNG to stream

+
Parameters
+
+
aStream
+
stream to save data to
+
+
+ + + + + + +
Privatefunction LoadJPEG(const aStream: TStream): Boolean; virtual;
+

+try to load a JPEG from a stream

+
Parameters
+
+
aStream
+
stream to load JPEG from
+
+
Returns
+

True on success, False otherwise

+ + + + + + +
Privateprocedure SaveJPEG(const aStream: TStream); virtual;
+

+save texture data as JPEG to stream

+
Parameters
+
+
aStream
+
stream to save data to
+
+
+ + + + + + +
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);
+

+save texture data as DDS to stream

+
Parameters
+
+
aStream
+
stream to save data to
+
+
+ + + + + + +
Publicfunction FlipHorz: Boolean; virtual;
+

+flip texture horizontal

+
Returns
+

True in success, False otherwise

+ + + + + + +
Publicfunction FlipVert: Boolean; virtual;
+

+flip texture vertical

+
Returns
+

True in success, False otherwise

+ + + + + + +
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: TglBitmapData; 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 AssignToLazIntfImage(const aImage: TLazIntfImage): Boolean;
+

+assign texture data to TLazIntfImage object

+
Parameters
+
+
aImage
+
TLazIntfImage to write data to
+
+
Returns
+

True on success, False otherwise

+ + + + + + +
Publicfunction AssignFromLazIntfImage(const aImage: TLazIntfImage): Boolean;
+

+assign texture data from TLazIntfImage object

+
Parameters
+
+
aImage
+
TLazIntfImage to read data from
+
+
Returns
+

True on success, False otherwise

+ + + + + + +
Publicfunction AssignAlphaToLazIntfImage(const aImage: TLazIntfImage): Boolean;
+

+assign alpha channel data to TLazIntfImage object

+
Parameters
+
+
aImage
+
TLazIntfImage to write data to
+
+
Returns
+

True on success, False otherwise

+ + + + + + +
Publicfunction AddAlphaFromLazIntfImage(const aImage: TLazIntfImage; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
+

+assign alpha channel data from TLazIntfImage object

+
Parameters
+
+
aImage
+
TLazIntfImage to read data from
+
aFunc
+
callback to use for converting
+
aArgs
+
user defined parameters (use at will)
+
+
Returns
+

True on success, 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
+
SetFormat 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 AddAlphaFromDataObj(const aDataObj: TglBitmapData; aFunc: TglBitmapFunction; const aArgs: Pointer): 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

+ + + + + + +
Publicfunction AddAlphaFromValue(const aAlpha: Byte): Boolean;
+

+add a constand alpha value to all pixels

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

True on success, False otherwise

+ + + + + + +
Publicfunction AddAlphaFromValueRange(const aAlpha: Cardinal): 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

+ + + + + + +
Publicfunction AddAlphaFromValueFloat(const aAlpha: Single): Boolean;
+

+add a constand alpha value to all pixels

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

True on success, False otherwise

+ + + + + + +
Publicfunction RemoveAlpha: Boolean; virtual;
+

+remove alpha channel

+
Returns
+

True on success, False otherwise

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

+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)
+
+
+ + + + + + +
Publicprocedure FillWithColorRange(const aRed, aGreen, aBlue: Cardinal; const aAlpha: Cardinal = $FFFFFFFF);
+

+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)
+
+
+ + + + + + +
Publicprocedure FillWithColorFloat(const aRed, aGreen, aBlue: Single; const aAlpha: Single = 1.0);
+

+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)
+
+
+ + + + + + +
Publicprocedure SetData(const 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
+
aFormat
+
format of the data stored at aData
+
aWidth
+
width of the texture data
+
aHeight
+
height of the texture data
+
+
+ + + + + + +
Publicfunction Clone: TglBitmapData;
+

+create a clone of the current object

+
Returns
+

clone of this object

+ + + + + + +
Publicprocedure Invert(const aRed, aGreen, aBlue, aAlpha: Boolean);
+

+invert color data (bitwise not)

+
Parameters
+
+
aRed
+
invert red channel
+
aGreen
+
invert green channel
+
aBlue
+
invert blue channel
+
aAlpha
+
invert alpha channel
+
+
+ + + + + + +
Publicprocedure GenerateNormalMap(const aFunc: TglBitmapNormalMapFunc = nm3x3; const aScale: Single = 2; const aUseAlpha: Boolean = false);
+

+create normal map from texture data

+
Parameters
+
+
aFunc
+
normal map function to generate normalmap with
+
aScale
+
scale of the normale stored in the normal map
+
aUseAlpha
+
generate normalmap from alpha channel data (if present)
+
+
+ + + + + + +
Publicconstructor Create; overload;
+

+constructor - creates a texutre data object

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

+constructor - creates a texture data object and loads it from a file

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

+constructor - creates a texture data object and loads it from a stream

+
Parameters
+
+
aStream
+
stream to load texture from
+
+
+ + + + + + +
Publicconstructor Create(const aSize: TglBitmapSize; const aFormat: TglBitmapFormat; aData: PByte = nil); overload;
+

+constructor - creates a texture data object with the given size, format and data

+
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 texture data object
+
+
+ + + + + + +
Publicconstructor Create(const aSize: TglBitmapSize; const aFormat: TglBitmapFormat; const aFunc: TglBitmapFunction; const aArgs: Pointer = nil); overload;
+

+constructor - creates a texture data object 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)
+
+
+ + + + + + +
Publicconstructor Create(const aInstance: Cardinal; const aResource: String; const aResType: PChar = nil); overload;
+

+constructor - creates a texture data object and loads it from a resource

+
Parameters
+
+
aInstance
+
resource handle
+
aResource
+
resource indentifier
+
aResType
+
resource type (if known)
+
+
+ + + + + + +
Publicconstructor Create(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar); overload;
+

+constructor - creates a texture data object and loads it from a resource

+
Parameters
+
+
aInstance
+
resource handle
+
aResourceID
+
resource ID
+
aResType
+
resource type (if known)
+
+
+ + + + + + +
Publicdestructor Destroy; override;
+

+destructor

+
+

Properties

+ + + + + + +
Publicproperty Data: PByte read fData;
+

+texture data (be carefull with this!)

+
+ + + + + + +
Publicproperty Dimension: TglBitmapSize read fDimension;
+

+size of the texture data (in pixel)

+
+ + + + + + +
Publicproperty Filename: String read fFilename;
+

+file the data was loaded from

+
+ + + + + + +
Publicproperty Width: Integer read GetWidth;
+

+width of the texture data (in pixel)

+
+ + + + + + +
Publicproperty Height: Integer read GetHeight;
+

+height of the texture data (in pixel)

+
+ + + + + + +
Publicproperty Format: TglBitmapFormat read fFormat write SetFormat;
+

+format the texture data is stored in

+
+ + + + + + +
Publicproperty Scanlines[constaIndex:Integer]: PByte read GetScanlines;
+

+pointer to begin of line at given index or Nil

+
+ + + + + + +
Publicproperty FormatDescriptor: TglBitmapFormatDescriptor read GetFormatDescriptor;
+

+descriptor object that describes the format of the stored data

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