Class TGrayscaleImage
Unit
Declaration
type TGrayscaleImage = class(TCastleImage)
Description
Grayscale image. Color is a simple Byte value.
Hierarchy
- TObject
- TEncodedImage
- TCastleImage
- TGrayscaleImage
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; |
|
constructor Create; overload; 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; overload; |
|
function IsClear(const Pixel: Byte): boolean; reintroduce; overload; |
|
procedure HalfColors; |
|
function ToGrayscaleAlphaImage: TGrayscaleAlphaImage; deprecated 'create TGrayscaleAlphaImage and use TGrayscaleAlphaImage.Assign'; |
|
function ToFpImage: TInternalCastleFpImage; override; |
|
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
property Pixels: PByte read GetPixels; |
|
property GrayscalePixels: PByte read GetPixels; deprecated 'use Pixels'; |
|
property PixelsArray: PByteArray read GetPixelsArray; |
|
property TreatAsAlpha: boolean
read FTreatAsAlpha write FTreatAsAlpha default false; |
|
property ColorWhenTreatedAsAlpha: TVector3Byte
read FColorWhenTreatedAsAlpha write SetColorWhenTreatedAsAlpha; |
|
property GrayscaleColorWhenTreatedAsAlpha: Byte
read FGrayscaleColorWhenTreatedAsAlpha; |
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; |
|
constructor Create; overload; 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; overload; |
|
function IsClear(const Pixel: Byte): boolean; reintroduce; overload; |
|
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; deprecated 'create TGrayscaleAlphaImage and use TGrayscaleAlphaImage.Assign'; |
|
Warning: this symbol is deprecated: create TGrayscaleAlphaImage and use TGrayscaleAlphaImage.Assign Add alpha channel. If TreatAsAlpha = If TreatAsAlpha = |
function ToFpImage: TInternalCastleFpImage; override; |
|
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
property Pixels: PByte read GetPixels; |
|
Pointer to |
property GrayscalePixels: PByte read GetPixels; deprecated 'use Pixels'; |
|
Warning: this symbol is deprecated: use Pixels |
property PixelsArray: PByteArray read GetPixelsArray; |
|
Pointer to pixels. Same as RawPixels, only typecasted to PByteArray. |
property TreatAsAlpha: boolean
read FTreatAsAlpha write FTreatAsAlpha default false; |
|
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.
|
property ColorWhenTreatedAsAlpha: TVector3Byte
read FColorWhenTreatedAsAlpha write SetColorWhenTreatedAsAlpha; |
|
Used for drawing/assigning when TreatAsAlpha is |
property GrayscaleColorWhenTreatedAsAlpha: Byte
read FGrayscaleColorWhenTreatedAsAlpha; |
|
Automatically derived from ColorWhenTreatedAsAlpha by averaging RGB components to calculate grayscale intensity. By default 255. |
Generated by PasDoc 0.16.0.