Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TGrayscaleImage
Unit
CastleImages
Declaration
type TGrayscaleImage = class(TCastleImage)
Description
Grayscale image. Color is a simple Byte value.
Hierarchy
Overview
Methods
 |
procedure DrawFromCore(Source: TCastleImage; X, Y, SourceX, SourceY, SourceWidth, SourceHeight: Integer; const Mode: TDrawMode); override; |
 |
function GetColors(const X, Y, Z: Integer): TCastleColor; override; |
 |
procedure SetColors(const X, Y, Z: Integer; const C: TCastleColor); override; |
 |
class function PixelSize: Cardinal; override; |
 |
class function ColorComponentsCount: Cardinal; override; |
 |
function PixelPtr(const X, Y: Cardinal; const Z: Cardinal = 0): PByte; |
 |
function RowPtr(const Y: Cardinal; const Z: Cardinal = 0): PByteArray; |
 |
procedure InvertColors; override; |
 |
procedure Clear(const Pixel: TVector4Byte); override; |
 |
function IsClear(const Pixel: TVector4Byte): boolean; override; |
 |
procedure Clear(const Pixel: Byte); reintroduce; |
 |
function IsClear(const Pixel: Byte): boolean; reintroduce; |
 |
procedure HalfColors; |
 |
function ToGrayscaleAlphaImage: TGrayscaleAlphaImage; |
 |
procedure LerpWith(const Value: Single; SecondImage: TCastleImage); override; |
 |
class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4; const AColors: TVector4Pointer); override; |
 |
function AlphaChannel( const AlphaTolerance: Byte): TAlphaChannel; override; |
 |
procedure Assign(const Source: TCastleImage); override; |
 |
procedure FillEllipse(const x, y: single; const aRadiusX, aRadiusY: single; const aColor: TCastleColor); override; |
 |
procedure Ellipse(const x, y: single; const aRadiusX, aRadiusY: single; const aWidth: single; const aColor: TCastleColor); override; |
 |
procedure FillRectangle(const x1, y1, x2, y2: single; const aColor: TCastleColor); override; |
 |
procedure Rectangle(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); override; |
 |
procedure Line(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); override; |
Properties
Description
Methods
 |
procedure DrawFromCore(Source: TCastleImage; X, Y, SourceX, SourceY, SourceWidth, SourceHeight: Integer; const Mode: TDrawMode); override; |
|
 |
function GetColors(const X, Y, Z: Integer): TCastleColor; override; |
|
 |
procedure SetColors(const X, Y, Z: Integer; const C: TCastleColor); override; |
|
 |
class function PixelSize: Cardinal; override; |
|
 |
class function ColorComponentsCount: Cardinal; override; |
|
 |
function PixelPtr(const X, Y: Cardinal; const Z: Cardinal = 0): PByte; |
|
 |
function RowPtr(const Y: Cardinal; const Z: Cardinal = 0): PByteArray; |
|
 |
procedure InvertColors; override; |
|
 |
function IsClear(const Pixel: TVector4Byte): boolean; override; |
|
 |
procedure Clear(const Pixel: Byte); reintroduce; |
|
 |
function IsClear(const Pixel: Byte): boolean; reintroduce; |
|
 |
procedure HalfColors; |
Every pixels value is halved (divided by 2). This is done by simple bitshift, so you can be sure that all components are < 2ˆ7 after this.
|
 |
function ToGrayscaleAlphaImage: TGrayscaleAlphaImage; |
Add an alpha channel. The newly created alpha channel will have constant opaque alpha, except in the special case of TGrayscaleImage.TreatAsAlpha = True (where the contents will be copied to alpha, and intensity set to white).
|
 |
procedure LerpWith(const Value: Single; SecondImage: TCastleImage); override; |
|
 |
class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4; const AColors: TVector4Pointer); override; |
|
 |
function AlphaChannel( const AlphaTolerance: Byte): TAlphaChannel; override; |
|
 |
procedure FillEllipse(const x, y: single; const aRadiusX, aRadiusY: single; const aColor: TCastleColor); override; |
|
 |
procedure Ellipse(const x, y: single; const aRadiusX, aRadiusY: single; const aWidth: single; const aColor: TCastleColor); override; |
|
 |
procedure FillRectangle(const x1, y1, x2, y2: single; const aColor: TCastleColor); override; |
|
 |
procedure Rectangle(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); override; |
|
 |
procedure Line(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); override; |
|
Properties
 |
property Pixels: PByte read GetPixels; |
Pointer to pixels . Same as RawPixels, only typecasted to PByte.
|
 |
property GrayscalePixels: PByte read GetPixels; deprecated 'use Pixels'; |
Warning: this symbol is deprecated: use Pixels |
 |
property TreatAsAlpha: boolean
read FTreatAsAlpha write FTreatAsAlpha; |
Should we treat grayscale image as pure alpha channel (without any color information) when using this as a texture.
This property is meaningful only for a small subset of operations.
When creating OpenGL texture from this image. If True , then the grayscale pixel data will be loaded as alpha channel contents (GL_ALPHA texture for OpenGL, it modifies only the fragments alpha value, it doesn't have any "color" in the normal sense). It is also the only way for TGrayscaleImage to return AlphaChannel <> acNone.
When using DrawFrom / DrawTo methods. If True , this image is drawn like an RGBA image, with constant RGB color ColorWhenTreatedAsAlpha, and alpha channel taken from contents of this image.
|
 |
property ColorWhenTreatedAsAlpha: TVector3Byte
read FColorWhenTreatedAsAlpha write FColorWhenTreatedAsAlpha; |
|
Generated by PasDoc 0.15.0.
|