Class TImage

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TImage = class(TReferenceCounted)

Description

Interface for software image data.
Image loaders create these images from files. TVideoDrivers convert these images into their (hardware) textures.

Hierarchy

Overview

Methods

Public class function GetBitsPerPixelFromFormat(Format: TColorFormat): LongWord; inline;
Public function GetPixel(X, Y: LongWord): TARGBColor; inline;
Public class function IsRenderTargetOnlyFormat(Format: TColorFormat): Boolean; inline;
Public function Lock: Pointer; inline;
Public procedure CopyTo(Target: TImage; const Position: TPoint); overload; inline;
Public procedure CopyTo(Target: TImage); overload; inline;
Public procedure CopyTo(Target: TImage; const Position: TPoint; const SourceRect, ClipRect: TRect); overload; inline;
Public procedure CopyTo(Target: TImage; const Position: TPoint; const SourceRect: TRect); overload; inline;
Public procedure CopyToScaling(Target: TImage); overload; inline;
Public procedure CopyToScaling(Target: Pointer; Width, Height: LongWord; ColorFormat: TColorFormat = cfA8R8G8B8; Pitch: LongWord = 0); overload; inline;
Public procedure CopyToScalingBoxFilter(Target: TImage; Bias: LongInt = 0; Blend: BOolean = False); inline;
Public procedure CopyToWithAlpha(Target: TImage; const Position: TPoint; const SourceRect: TRect; Color: TARGBColor); overload; inline;
Public procedure CopyToWithAlpha(Target: TImage; const Position: TPoint; const SourceRect: TRect; Color: TARGBColor; const ClipRect: TRect); overload; inline;
Public procedure Fill(Color: TARGBColor); inline;
Public procedure SetPixel(X, Y: LongWord; Color: TARGBColor; Blend: Boolean = False); inline;
Public procedure Unlock; inline;

Properties

Public property AlphaMask: LongWord read GetAlphaMask;
Public property BitsPerPixel: LongWord read GetBitsPerPixel;
Public property BlueMask: LongWord read GetBlueMask;
Public property BytesPerPixel: LongWord read GetBytesPerPixel;
Public property ColorFormat: TColorFormat read GetColorFormat;
Public property GreenMask: LongWord read GetGreenMask;
Public property ImageDataBytes: LongWord read GetImageDataSizeInBytes;
Public property ImageDataPixels: LongWord read GetImageDataSizeInPixels;
Public property Pitch: LongWord read GetPitch;
Public property RedMask: LongWord read GetRedMask;
Public property Size: TSize read GetDimension;

Description

Methods

Public class function GetBitsPerPixelFromFormat(Format: TColorFormat): LongWord; inline;

Gets the number of Bits per Pixel of a given color format.

Public function GetPixel(X, Y: LongWord): TARGBColor; inline;
 
Public class function IsRenderTargetOnlyFormat(Format: TColorFormat): Boolean; inline;

Test if a color format is only viable for RenderTarget textures.
Since we don't have support for e.g. floating point image formats one should test if the color format can be used for arbitrary usage, or if it is restricted to RTTs.

Public function Lock: Pointer; inline;

Lock function. Use this to get a pointer to the image data.
After you don't need the pointer anymore, you must call unlock().

Returns

Pointer to the image data. What type of data is pointed to depends on the color format of the image. For example if the color format is cfA8R8G8B8, it is of LongWord. Be sure to call unlock() after you don't need the pointer any more.

Public procedure CopyTo(Target: TImage; const Position: TPoint); overload; inline;

Copies the image to another one.
Overloaded for default parameters.

Parameters
Target
The image to copy to.
Position
The position this image will be inserted at.
Public procedure CopyTo(Target: TImage); overload; inline;

Copies the image to another one.
Overloaded for default parameters.

Parameters
Target
The image to copy to.
Public procedure CopyTo(Target: TImage; const Position: TPoint; const SourceRect, ClipRect: TRect); overload; inline;

Copies a part of the image to another one.

Parameters
Target
The image to copy to.
Position
The position this image will be inserted at.
SourceRect
The part of this image to copy.
ClipRect
The rectangle in the target image which the copied image will be clipped against.
Public procedure CopyTo(Target: TImage; const Position: TPoint; const SourceRect: TRect); overload; inline;

Copies a part of the image to another one.
Overloaded for default parameters.

Parameters
Target
The image to copy to.
Position
The position this image will be inserted at.
SourceRect
The part of this image to copy.
Public procedure CopyToScaling(Target: TImage); overload; inline;

Copies the image to another one, scaling it to fit.
Overloaded for default parameters.

Parameters
Target
The image to copy to.
Public procedure CopyToScaling(Target: Pointer; Width, Height: LongWord; ColorFormat: TColorFormat = cfA8R8G8B8; Pitch: LongWord = 0); overload; inline;

Copies the image to raw memory, scaling it to fit.

Parameters
Target
The memory to copy to.
Width
Undocumented, probably the target image width.
Height
Undocumented, probably the target image height.
Pitch
Undocumented.
Public procedure CopyToScalingBoxFilter(Target: TImage; Bias: LongInt = 0; Blend: BOolean = False); inline;

Copies the image to another one, scaling it to fit, applying a box filter.

Parameters
Target
The image to copy to.
Bias
Undocumented.
Blend
Undocumented.
Public procedure CopyToWithAlpha(Target: TImage; const Position: TPoint; const SourceRect: TRect; Color: TARGBColor); overload; inline;

Copies a part of the image to another one using the alpha mask.
Overloaded for default parameters.

Parameters
Target
The image to copy to.
Position
The position this image will be inserted at.
SourceRect
The part of this image to copy.
Color
Undocumented.
Public procedure CopyToWithAlpha(Target: TImage; const Position: TPoint; const SourceRect: TRect; Color: TARGBColor; const ClipRect: TRect); overload; inline;

Copies a part of the image to another one using the alpha mask.

Parameters
Target
The image to copy to.
Position
The position this image will be inserted at.
SourceRect
The part of this image to copy.
Color
Undocumented.
ClipRect
The rectangle in the target image which the copied image will be clipped against.
Public procedure Fill(Color: TARGBColor); inline;

Fills the image with a single color.

Parameters
Color
The color to fill with.
Public procedure SetPixel(X, Y: LongWord; Color: TARGBColor; Blend: Boolean = False); inline;

Sets a single pixel.

Parameters
X
The pixel's X coordinate.
Y
The pixel's Y coordinate.
Color
The new color.
Blend
Undocumented.
Public procedure Unlock; inline;

Unlock function.
Should be called after the pointer received by lock() is not needed anymore.

Properties

Public property AlphaMask: LongWord read GetAlphaMask;

The image's alpha channel mask.

Public property BitsPerPixel: LongWord read GetBitsPerPixel;

The number of bits representing a single pixel.

Public property BlueMask: LongWord read GetBlueMask;

The image's blue channel mask.

Public property BytesPerPixel: LongWord read GetBytesPerPixel;

Like BitsPerPixel, but returns the size in bytes.

Public property ColorFormat: TColorFormat read GetColorFormat;

The image's color format.

Public property GreenMask: LongWord read GetGreenMask;

The image's green channel mask.

Public property ImageDataBytes: LongWord read GetImageDataSizeInBytes;

The raw image data's size in bytes.

Public property ImageDataPixels: LongWord read GetImageDataSizeInPixels;

The image data size in pixels.

Public property Pitch: LongWord read GetPitch;
 
Public property RedMask: LongWord read GetRedMask;
 
Public property Size: TSize read GetDimension;

The image's width and height in pixels.


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22