Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TRGBImage
Unit
CastleImages
Declaration
type TRGBImage = class(TCastleImage)
Description
Image with pixel represented as a TVector3Byte (red, green, blue).
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): PVector3Byte; |
 |
function RowPtr(const Y: Cardinal; const Z: Cardinal = 0): PVector3ByteArray; |
 |
procedure InvertColors; override; |
 |
procedure Clear(const Pixel: TVector4Byte); override; |
 |
function IsClear(const Pixel: TVector4Byte): boolean; override; |
 |
procedure TransformRGB(const Matrix: TMatrix3); override; |
 |
procedure ModulateRGB(const ColorModulator: TColorModulatorByteFunc); override; |
 |
function ToRGBAlphaImage: TRGBAlphaImage; |
 |
function ToRGBFloat: TRGBFloatImage; |
 |
function ToGrayscale: TGrayscaleImage; |
 |
procedure HorizontalLine(const x1, x2, y: Integer; const Color: TVector3Byte); overload; |
 |
procedure HorizontalLine(const x1, x2, y: Integer; const Color: TCastleColor); overload; |
 |
procedure VerticalLine(const x, y1, y2: Integer; const Color: TVector3Byte); overload; |
 |
procedure VerticalLine(const x, y1, y2: Integer; const Color: TCastleColor); overload; |
 |
constructor CreateCombined(const MapImage: TRGBImage; var ReplaceWhiteImage, ReplaceBlackImage: TRGBImage); |
 |
procedure LerpWith(const Value: Single; SecondImage: TCastleImage); override; |
 |
class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4; const AColors: TVector4Pointer); 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): PVector3Byte; |
|
 |
procedure InvertColors; override; |
|
 |
function IsClear(const Pixel: TVector4Byte): boolean; override; |
|
 |
procedure TransformRGB(const Matrix: TMatrix3); override; |
|
 |
function ToRGBAlphaImage: TRGBAlphaImage; |
Create a new TRGBAlphaImage instance with RGB contents copied from this image, and alpha fully opaque.
|
 |
function ToRGBFloat: TRGBFloatImage; |
Convert image to an TRGBFloatImage format.
Although float format offers superior precision compared to 8bit RGB, there is a slight chance of some unnoticeable loss of information in such conversion, since floating-point values are involved in calculation.
But generally this conversion is relatively safe (contrary to conversion float -> 8-bit RGB, which must be lossy).
But still you should note that doing such conversion has little sense since float format is useful only when you have colors that can't be expressed as simple 8-bit RGB. But by using this conversion you initially fill float image with data that does not have precision beyond standard 0..255 discreet range for each RGB component...
|
 |
procedure HorizontalLine(const x1, x2, y: Integer; const Color: TVector3Byte); overload; |
Draw horizontal line. Must be y1 <= y2, else it is NOOP.
|
 |
procedure HorizontalLine(const x1, x2, y: Integer; const Color: TCastleColor); overload; |
|
 |
procedure VerticalLine(const x, y1, y2: Integer; const Color: TVector3Byte); overload; |
Draw vertical line. Must be x1 <= x2, else it is NOOP.
|
 |
procedure VerticalLine(const x, y1, y2: Integer; const Color: TCastleColor); overload; |
|
 |
constructor CreateCombined(const MapImage: TRGBImage; var ReplaceWhiteImage, ReplaceBlackImage: TRGBImage); |
Create image by merging two images according to a (third) mask image. This is a very special constructor. It creates image with the same size as MapImage. It also resizes ReplaceWhiteImage, ReplaceBlackImage to the size of MapImage.
Then it inits color of each pixel of our image with combined colors of two pixels on the same coordinates from ReplaceWhiteImage, ReplaceBlackImage, something like
Pixel[x, y] := ReplaceWhiteImage[x, y] * S +
ReplaceBlackImage[x, y] * (S-1);
where S = average of red, gree, blue of color MapImage[x, y].
This means that final image will look like ReplaceWhiteImage in the areas where MapImage is white, and it will look like ReplaceBlackImage in the areas where MapImage is black.
|
 |
procedure LerpWith(const Value: Single; SecondImage: TCastleImage); override; |
|
 |
class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4; const AColors: TVector4Pointer); 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 RGBPixels: PVector3Byte read GetPixels; deprecated 'use Pixels'; |
Warning: this symbol is deprecated: use Pixels |
Generated by PasDoc 0.15.0.
|