Castle Game Engine: CastleImages: Class TGrayscaleImage

# Class TGrayscaleImage
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleImages ## Declaration `type TGrayscaleImage = class(TCastleImage)` ## Description Grayscale image. Color is a simple Byte value. ## Hierarchy TObject TEncodedImage TCastleImage TGrayscaleImage ## Overview ### Methods
| `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 Clear(const Pixel: Byte); reintroduce;`
| `function IsClear(const Pixel: Byte): boolean; reintroduce;`
| `procedure HalfColors;`
| `function ToGrayscaleAlphaImage_AlphaConst(Alpha: byte): TGrayscaleAlphaImage;`
| `procedure LerpWith(const Value: Single; SecondImage: TCastleImage); override;`
| `class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4Single; const Colors: TVector4Pointer); override;`
### Properties
| `property GrayscalePixels: PByte read GetGrayscalePixels;`
## Description ### Methods
| `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 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_AlphaConst(Alpha: byte): TGrayscaleAlphaImage;`
Create new TGrayscaleAlphaImage with grayscale channel copied from this object, and alpha channel filled with constant Alpha value.
| `procedure LerpWith(const Value: Single; SecondImage: TCastleImage); override;`
| `class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4Single; const Colors: TVector4Pointer); override;`
### Properties
| `property GrayscalePixels: PByte read GetGrayscalePixels;`
This is the same pointer as RawPixels, only typecasted to PByte
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:13