Class TCastleImage
Unit
Declaration
type TCastleImage = class(TEncodedImage)
Description
An abstract class representing image as a simple array of pixels. RawPixels is a pointer to Width * Height * Depth of pixels.
What exactly is a "pixel" is undefined in this class. Each descendant of TCastleImage
defines it's own pixel encoding and interpretation. The only requirement is that all pixels have the same size (PixelSize). For example, for TRGBImage a "pixel" is a TVector3Byte type representing a (red, green, blue) color value.
When Depth > 1, the image is actually a 3D (not just 2D!) image. We call the particular 2D layers then "slices". Although some TCastleImage
methods (and functions in other units, like CastleGLImages) still operate only on the 1st "slice", that is the 2D image on Depth = 0 — be careful. But many methods correctly take the depth into consideration.
Pixels in RawPixels are ordered in slices, each slice is ordered in rows, in each row pixels are specified from left to right, rows are specified starting from lower row to upper. This means that you can think of RawPixels as
ˆ(packed array[0..Depth - 1, 0..Height - 1, 0..Width - 1] of TPixel)
Assuming the above definition, RawPixelsˆ[z, y, x] is color of pixel at position z, x, y.
Note that specifying rows from lower to upper follows an OpenGL standard, this makes using this unit with OpenGL straightforward.
Don't ever operate on RawPixels pointer directly — allocating, reallocating, freeing memory pointed to by RawPixels is handled inside this class. You must only worry to always free created TCastleImage
instances (like with any class).
Note that the only valid states of instances of this class are when (Width * Height * Depth > 0 and RawPixels <> nil) or (Width * Height * Depth = 0 and RawPixels = nil). Otherwise the fundamental assumption that RawPixels is a pointer to Width * Height * Depth pixels would be broken (as nil pointer cannot point to anything, and on the other side it's rather useless to have a pointer to 0 bytes (since you can never dereference it anyway) even if theoretically every PtrInt value can be treated as valid pointer to 0 bytes).
Note about coordinates:
All X, Y, Z coordinates of pixels are 0-based (X in range 0..Width-1, and Y in 0..Height-1, and Z in 0..Depth-1).
If documentation for some method does not specify otherwise, correctness of coordinates is *not* checked in method, which can lead to various errors at runtime if you will pass incorrect coordinates to given routine.
Hierarchy
- TObject
- TEncodedImage
- TCastleImage
Overview
Methods
procedure LerpSimpleCheckConditions(SecondImage: TCastleImage); |
|
procedure DrawFromCore(const Source: TCastleImage; const X, Y, SourceX, SourceY, SourceWidth, SourceHeight: Integer; const Mode: TDrawMode); virtual; |
|
function MakeResizedToFpImage(ResizeWidth, ResizeHeight: Cardinal; const Interpolation: TResizeInterpolation): TInternalCastleFpImage; |
|
function GetColors(const X, Y, Z: Integer): TCastleColor; virtual; |
|
procedure SetColors(const X, Y, Z: Integer; const C: TCastleColor); virtual; |
|
procedure AssignProperties(const Source: TCastleImage); virtual; |
|
constructor Create; overload; virtual; |
|
constructor Create(const AWidth, AHeight: Cardinal; const ADepth: Cardinal = 1); overload; |
|
procedure Empty; |
|
procedure SetSize( const AWidth, AHeight: Cardinal; const ADepth: Cardinal = 1); overload; |
|
procedure SetSize(const Source: TCastleImage); overload; |
|
class function PixelSize: Cardinal; virtual; abstract; |
|
function Size: Cardinal; override; |
|
function ImageSize: Cardinal; deprecated; |
|
class function ColorComponentsCount: Cardinal; virtual; abstract; |
|
function PixelPtr(const X, Y: Cardinal; const Z: Cardinal = 0): Pointer; |
|
function RowPtr(const Y: Cardinal; const Z: Cardinal = 0): Pointer; |
|
procedure InvertColors; virtual; |
|
procedure SetColorRGB(const X, Y: Integer; const v: TVector3); deprecated 'use Colors[X, Y, 0] to get or set colors'; |
|
function MakeCopy: TCastleImage; |
|
function CreateCopy: TEncodedImage; override; |
|
procedure Resize(ResizeWidth, ResizeHeight: Cardinal; const Interpolation: TResizeInterpolation = riBilinear); |
|
procedure Resize3x3(const ResizeWidth, ResizeHeight: Cardinal; var Corners: TVector4Integer; const Interpolation: TResizeInterpolationInternal); deprecated 'This method is seldom useful, and it is confused with TCastleImage.DrawFrom3x3 and TDrawableImage.Draw3x3 too often. Please report if you have a use-case when this method is useful, otherwise it may get removed from the engine one day.'; |
|
function MakeResized(ResizeWidth, ResizeHeight: Cardinal; const Interpolation: TResizeInterpolation = riBilinear): TCastleImage; |
|
procedure FlipHorizontal; |
|
procedure FlipVertical; override; |
|
function MakeRotated(Angle: Integer): TCastleImage; |
|
procedure Rotate(const Angle: Integer); |
|
function MakeTiled(TileX, TileY: Cardinal): TCastleImage; |
|
function MakeExtracted(X0, Y0, ExtractWidth, ExtractHeight: Cardinal): TCastleImage; |
|
procedure Clear(const Pixel: TVector4Byte); overload; virtual; |
|
procedure Clear(const Pixel: TCastleColor); overload; |
|
function IsClear(const Pixel: TVector4Byte): boolean; overload; virtual; |
|
procedure TransformRGB(const Matrix: TMatrix3); virtual; |
|
procedure ModulateRGB(const ColorModulator: TColorModulatorByteFunc); virtual; |
|
function MakeModulatedRGB( const ColorModulator: TColorModulatorByteFunc): TCastleImage; |
|
procedure Grayscale; |
|
procedure ConvertToChannelRGB(Channel: Integer); |
|
procedure StripToChannelRGB(Channel: Integer); |
|
function IsEqual(Image: TCastleImage): boolean; |
|
function ArePartsEqual( const SelfX0, SelfY0, SelfWidth, SelfHeight: Cardinal; Image: TCastleImage; const ImageX0, ImageY0, ImageWidth, ImageHeight: Cardinal): boolean; overload; |
|
function ArePartsEqual( Image: TCastleImage; const ImageX0, ImageY0, ImageWidth, ImageHeight: Cardinal): boolean; overload; |
|
function ArePartsEqual( const SelfX0, SelfY0, SelfWidth, SelfHeight: Cardinal; Image: TCastleImage): boolean; overload; |
|
procedure DrawFrom(const Source: TCastleImage; const X, Y: Integer; const Mode: TDrawMode = dmBlend); overload; |
|
procedure DrawFrom(const Source: TCastleImage; X, Y, SourceX, SourceY, SourceWidth, SourceHeight: Integer; const Mode: TDrawMode = dmBlend); overload; |
|
procedure DrawFrom(const Source: TCastleImage; const X, Y: Integer; const SourceRect: TRectangle; const Mode: TDrawMode = dmBlend); overload; |
|
procedure DrawTo(const Destination: TCastleImage; const X, Y: Integer; const Mode: TDrawMode = dmBlend); |
|
procedure DrawFrom3x3(const DestinationRect: TRectangle; const Source: TCastleImage; const SourceCorners: TVector4Integer; const DrawMode: TDrawMode; const Interpolation: TResizeInterpolation = riBilinear); |
|
procedure LerpWith(const Value: Single; SecondImage: TCastleImage); virtual; |
|
class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4; const AColors: TVector4Pointer); virtual; |
|
procedure Assign(const Source: TCastleImage); virtual; |
|
procedure SaveToPascalCode(const ImageName: string; var CodeInterface, CodeImplementation, CodeInitialization, CodeFinalization: string); |
|
procedure AlphaBleed(const ProgressTitle: string = ''); virtual; |
|
function MakeAlphaBleed(const ProgressTitle: string = ''): TCastleImage; virtual; |
|
procedure FillEllipse(const x, y: single; const aRadiusX, aRadiusY: single; const aColor: TCastleColor); virtual; |
|
procedure Ellipse(const x, y: single; const aRadiusX, aRadiusY: single; const aWidth: single; const aColor: TCastleColor); virtual; |
|
procedure FillRectangle(const x1, y1, x2, y2: single; const aColor: TCastleColor); virtual; |
|
procedure Rectangle(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); virtual; |
|
procedure Line(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); virtual; |
|
procedure FloodFill(const x, y: integer; const aColor: TCastleColor; const aThreshold: single = 0); |
Properties
property Colors [const X,Y,Z: Integer]: TCastleColor read GetColors write SetColors; |
Description
Methods
procedure LerpSimpleCheckConditions(SecondImage: TCastleImage); |
|
Check that both images have the same sizes and Second image class descends from First image class. If not, raise appropriate ELerpXxx exceptions. Some implementation of TRGBImage.LerpWith may require other checks (since LerpWith may be sometimes allowed between unequal classes), so this doesn't have to be used by all TRGBImage.LerpWith implementations (although it's comfortable for simple implementations). |
procedure DrawFromCore(const Source: TCastleImage; const X, Y, SourceX, SourceY, SourceWidth, SourceHeight: Integer; const Mode: TDrawMode); virtual; |
|
Like DrawFrom, but can assume that all coordinates and sizes are valid. Override this to add copying using some more sophisticated method than just memory copying (so also for handling mode other than dmBlend). |
function MakeResizedToFpImage(ResizeWidth, ResizeHeight: Cardinal; const Interpolation: TResizeInterpolation): TInternalCastleFpImage; |
|
This item has no description. |
function GetColors(const X, Y, Z: Integer): TCastleColor; virtual; |
|
This item has no description. |
procedure SetColors(const X, Y, Z: Integer; const C: TCastleColor); virtual; |
|
This item has no description. |
procedure AssignProperties(const Source: TCastleImage); virtual; |
|
Assign properties (other than Url, sizes and pixel contents). Used when creating a copy like MakeCopy, MakeRotated, MakeResized and so on. This is not used by Assign, so Assign implementation overrides must make sure to do the same thing (or call |
constructor Create; overload; virtual; |
|
Constructor without parameters creates image with Width = Height = Depth = 0 and RawPixels = nil, so IsEmpty will return |
constructor Create(const AWidth, AHeight: Cardinal; const ADepth: Cardinal = 1); overload; |
|
This item has no description. |
procedure Empty; |
|
This is equivalent to SetSize(0, 0, 0). It sets Width = Height = 0 and RawPixels = nil. |
procedure SetSize( const AWidth, AHeight: Cardinal; const ADepth: Cardinal = 1); overload; |
|
Change size (Width and Height and Depth). Previous pixel contents (RawPixels) are lost, and the contents of new pixels are undefined. Use other method, like Resize, if you want to change image size preserving it's contents. |
procedure SetSize(const Source: TCastleImage); overload; |
|
This item has no description. |
class function PixelSize: Cardinal; virtual; abstract; |
|
Size of TPixel in bytes for this TCastleImage descendant. |
function Size: Cardinal; override; |
|
Size of image contents in bytes. |
function ImageSize: Cardinal; deprecated; |
|
Warning: this symbol is deprecated.
Deprecated name for |
function RowPtr(const Y: Cardinal; const Z: Cardinal = 0): Pointer; |
|
Pointer to the first pixel in the Y row of the image. Same thing as PixelPtr but always with X = 0. Note that this function should be reintroduced in descendants to return the same value but typecasted to something better then Pointer, preferably something like ˆ(array of TPixel). |
procedure InvertColors; virtual; |
|
Inverts all colors (RGB or grayscale, but doesn't touch alpha channel). "Inverting" means changing color C in range [0..1] to 1-C, so black becomes white, white becomes black etc. For descendants implementors: Override it if necessary, otherwise the default implementation in this class will raise EInternalError. |
procedure SetColorRGB(const X, Y: Integer; const v: TVector3); deprecated 'use Colors[X, Y, 0] to get or set colors'; |
|
Warning: this symbol is deprecated: use Colors[X, Y, 0] to get or set colors This item has no description. |
function MakeCopy: TCastleImage; |
|
Create a new image object that has exactly the same class and the same data (size, pixels) as this image. (Design note: this function is *not* a constructor, because it's implemented in TCastleImage, but it always returns some descendant of TCastleImage.) |
function CreateCopy: TEncodedImage; override; |
|
Create a new image object that has exactly the same class and the same data (size, pixels) as this image. Equivalent to MakeCopy, but virtual and declared as returning TEncodedImage class. |
procedure Resize(ResizeWidth, ResizeHeight: Cardinal; const Interpolation: TResizeInterpolation = riBilinear); |
|
Change Width and Height and appropriately stretch image contents. If ResizeWidth or ResizeHeight is 0 then it means to take Width or Height, respectively. So e.g. using ResizeWidth = ResizeHeight = 0 is the same thing as using ResizeWidth = Width and ResizeHeight = Height and this is NOP. Remember that resizing may change RawPixels pointer, so all pointers that you aquired using functions like RawPixels, Pixels, PixelsArray, RowPtr, PixelPtr may be invalid after calling Resize. |
procedure Resize3x3(const ResizeWidth, ResizeHeight: Cardinal; var Corners: TVector4Integer; const Interpolation: TResizeInterpolationInternal); deprecated 'This method is seldom useful, and it is confused with TCastleImage.DrawFrom3x3 and TDrawableImage.Draw3x3 too often. Please report if you have a use-case when this method is useful, otherwise it may get removed from the engine one day.'; |
|
Warning: this symbol is deprecated: This method is seldom useful, and it is confused with TCastleImage.DrawFrom3x3 and TDrawableImage.Draw3x3 too often. Please report if you have a use-case when this method is useful, otherwise it may get removed from the engine one day. Change Width and Height and appropriately stretch image contents. This scales the image in almost the same way as standard Resize. However, this is aware of the image corners and edges, which is good if you plan to use this image with TDrawableImage.Draw3x3 drawing. The Corners parameter specifies the corners size, in the same clockwise order as for TDrawableImage.Draw3x3: top, right, bottom, left. The corners will be scaled (proportially to image scaling), and new Corners size returned. Additionally it makes sure that filtering (especially bilinear) does not "leak" colors from one image area to another. Effectively, the image is scaled like a 9 separate parts, and colors cannot bleed from one part to another. Both ResizeWidth, ResizeHeight parameters must be provided and non-zero. For now, only a subset of TResizeInterpolation values are supported by this method, namely the ones in TResizeInterpolationInternal. |
function MakeResized(ResizeWidth, ResizeHeight: Cardinal; const Interpolation: TResizeInterpolation = riBilinear): TCastleImage; |
|
Create a new TCastleImage instance with size ResizeWidth, ResizeHeight and pixels copied from the input and appropriately stretched. The exact class of the new instance is the same as our class. As with Resize method, when the parameter ResizeTo* is 0 it means to use current Width/Height. So e.g. using |
procedure FlipHorizontal; |
|
Mirror image horizotally (that is right edge is swapped with left edge). |
procedure FlipVertical; override; |
|
Mirror image vertically. |
function MakeRotated(Angle: Integer): TCastleImage; |
|
Make rotated version of the image. See Rotate for description of parameters. |
function MakeTiled(TileX, TileY: Cardinal): TCastleImage; |
|
Create a new instance with the same class, and size TileX * Width and TileY * Height and contents being our contents duplicated (tiled). Must be TileX, TileY > 0. |
function MakeExtracted(X0, Y0, ExtractWidth, ExtractHeight: Cardinal): TCastleImage; |
|
Extract rectangular area of this image. X0 and Y0 are start position (lower-left corner), ExtractWidth, ExtractHeight specify size of area. This checks parameters for correctness – if start position is not correct or ExtractWidth/Height are too large then exception EImagePosOutOfRange is raised. |
procedure Clear(const Pixel: TVector4Byte); overload; virtual; |
|
Set all image pixels to the same color. |
procedure Clear(const Pixel: TCastleColor); overload; |
|
This item has no description. |
function IsClear(const Pixel: TVector4Byte): boolean; overload; virtual; |
|
Check do all image pixels have the same color. |
procedure TransformRGB(const Matrix: TMatrix3); virtual; |
|
Multiply each RGB color by a matrix. This is a useful routine for many various conversions of image colors. Every pixel's RGB color is multiplied by given Matrix, i.e. PixelRGBColor := Matrix * PixelRGBColor. If some value in some channel will be < 0, it will be set to 0. And if it will be > High(Byte), it will be set to High(Byte). Examples: when Matrix = TMatrix3.Identity, this is NOOP. Matrix = ((2, 0, 0), (0, 1, 0), (0, 0, 1)) red channel is made lighter. Matrix = ((0, 0, 1), (0, 1, 0), (1, 0, 0)) swaps red and blue channel. Matrix = ((0.33, 0.33, 0.33), (0.33, 0.33, 0.33), (0.33, 0.33, 0.33)) is a simple conversion to grayscale (actually incorrect, even if often visually acceptable; actually instead of 0.33 one has to use GrayscaleFloat/ByteValues, this is already implemented in ImageTransformColorsVar function) Note: it's often more optimal to hard-code necessary color transformations as TColorModulatorFunc and use ModulateRGB. This function is only implemented for images that represent Pixel as RGB values, for now this means TRGBImage and TRGBAlphaImage. In case of TRGBAlphaImage (or any other class that represents colors as RGB + something more) alpha channel (i.e. "something more") is ignored (i.e. left without any modification). In this class this simply raises EInternalError to say 'not implemented'. This also means that you must not call inherited in descendants when overriding this method. |
procedure ModulateRGB(const ColorModulator: TColorModulatorByteFunc); virtual; |
|
Process each pixel by given function. If ColorModulator = nil then this procedure does nothing. Else, every RGB color value of an image will be transformed using ColorModulator. Like TransformRGB: This function is only implemented for images that represent Pixel as RGB values, for now this means TRGBImage and TRGBAlphaImage. In case of TRGBAlphaImage (or any other class that represents colors as RGB + something more) alpha channel (i.e. "something more") is ignored (i.e. left without any modification). In this class this simply raises EInternalError to say 'not implemented'. This also means that you must not call inherited in descendants when overriding this method. |
function MakeModulatedRGB( const ColorModulator: TColorModulatorByteFunc): TCastleImage; |
|
Just like ModulateRGB, but this returns new image, not changing initial image. This means that if ColorModulator = nil this is equivalent to CreateCopy. Implemented if and only if ModulateRGB is implemented. |
procedure Grayscale; |
|
Convert image colors to grayscale. Implemented if and only if ModulateRGB is implemented. When image has alpha channel, alpha channel value (or just anything beyond 3 rgb components) is ignored (not modified). This changes color to grayscale, but format of memory storage is the same. For example, for TRGBImage, they are still kept in RGB format (just Red = Green = Blue). If you want to convert to true Grayscale format, you should use TRGBImage.ToGrayscale that will create new TGrayscaleImage instance. |
procedure ConvertToChannelRGB(Channel: Integer); |
|
Convert every image color using Color*Convert function from CastleVectors. "Channel" parameter determines which Color*Convert function to use (Red, Green or Blue), must be 0, 1 or 2. Implemented if and only if ModulateRGB is implemented. |
procedure StripToChannelRGB(Channel: Integer); |
|
Converts every image color using Color*Strip function from CastleVectors. "Channel" parameter determines which Color*Strip function to use (Red, Green or Blue), must be 0, 1 or 2. Implemented if and only if ModulateRGB is implemented. |
function IsEqual(Image: TCastleImage): boolean; |
|
Check if given Image has the same class, the same sizes (Width, Height) and contains exactly the same pixel values. |
function ArePartsEqual( const SelfX0, SelfY0, SelfWidth, SelfHeight: Cardinal; Image: TCastleImage; const ImageX0, ImageY0, ImageWidth, ImageHeight: Cardinal): boolean; overload; |
|
This is like IsEqual, but is compares only given parts of the images. Note that it's your responsibility to make sure that given areas are really within the sizes of Self or Image. Overloaded version without SelfXxx parameters compares whole Self to given part of Image. Analogously, version without ImageXxx parameters compares whole Image to part of Self. |
function ArePartsEqual( Image: TCastleImage; const ImageX0, ImageY0, ImageWidth, ImageHeight: Cardinal): boolean; overload; |
|
This item has no description. |
function ArePartsEqual( const SelfX0, SelfY0, SelfWidth, SelfHeight: Cardinal; Image: TCastleImage): boolean; overload; |
|
This item has no description. |
procedure DrawFrom(const Source: TCastleImage; const X, Y: Integer; const Mode: TDrawMode = dmBlend); overload; |
|
Draw one image part on another image. X, Y is the lower-left position on the destination image where we draw. Optional SourceX, SourceY, SourceWidth, SourceHeight specify to use only a part of the source image (without them, we take whole source image). The pixel on source image (SourceX, SourceY) will be drawn on destination image on (X, Y). The coordinates and sizes are carefully checked, so that we do not try to take some pixels outside of the source or destination image. Warning: It is not efficient to use this drawing method. This drawing is performed on CPU and cannot be fast. If possible, use instead TDrawableImage.DrawFrom, that performs image-on-image drawing using GPU, or just draw TDrawableImage straight to the screen by TDrawableImage.Draw. See examples/images_videos/draw_images_on_gpu.lpr for an example of TDrawableImage.DrawFrom. Using this method makes most sense in image manipulation tools, or during the loading / preparation stage of your game, not during actual game. Note for descendants implementors: The default implementation of this function in TCastleImage can only directly copy the pixels, regardless of what information they have. This makes it very fast, but not suitable if the source image has some alpha channel and you want to apply it over a destination image with blending (adding scaled source to a destination color), and not suitable when Mode is <> dmBlend. Descendants with alpha channel should override DrawFromCore to handle drawing with blending (for dmBlend), all descendants should override DrawFromCore to handle drawing with Mode <> dmBlend.
Exceptions raised
|
procedure DrawFrom(const Source: TCastleImage; X, Y, SourceX, SourceY, SourceWidth, SourceHeight: Integer; const Mode: TDrawMode = dmBlend); overload; |
|
This item has no description. |
procedure DrawFrom(const Source: TCastleImage; const X, Y: Integer; const SourceRect: TRectangle; const Mode: TDrawMode = dmBlend); overload; |
|
This item has no description. |
procedure DrawTo(const Destination: TCastleImage; const X, Y: Integer; const Mode: TDrawMode = dmBlend); |
|
This item has no description. |
procedure DrawFrom3x3(const DestinationRect: TRectangle; const Source: TCastleImage; const SourceCorners: TVector4Integer; const DrawMode: TDrawMode; const Interpolation: TResizeInterpolation = riBilinear); |
|
Draw the Source image on this image, dividing the source image into 3x3 parts for corners, sides, and inside. The source image is divided into 3 * 3 = 9 parts:
The size of corners is specified in the SourceCorners parameter, in the order: top, right, bottom, left. (It's the same order as e.g. CSS margins.) Warning: It is not efficient to use this drawing method. This drawing is performed on CPU and cannot be fast. If possible, use instead TDrawableImage, and either draw it to the screen by TDrawableImage.Draw3x3, or draw it to another TDrawableImage by combining TDrawableImage.Draw3x3 with TDrawableImage.RenderToImageBegin. Using this method makes most sense in image manipulation tools, or during the loading / preparation stage of your game, not during actual game. |
procedure LerpWith(const Value: Single; SecondImage: TCastleImage); virtual; |
|
Makes linear interpolation of colors from this image and the SecondImage. Intuitively, every pixel in new image is set to (1 - Value) * Self[pixel] + Value * SecondImage[pixel]
Both images need to have the exact same size. If they are not, EImageLerpDifferentSizes is raised. Not all TCastleImage combinations are allowed. Every subclass is required to override this to at least handle Lerp between itself. That is, TRGBImage.Lerp has to handle Lerp with other TRGBImage, TRGBAlphaImage.Lerp has to handle Lerp with other TRGBAlphaImage etc. Other combinations may be permitted, if useful and implemented. EImageLerpInvalidClasses is raised if given class combinations are not allowed. In this class, this simply always raises EImageLerpInvalidClasses.
Exceptions raised
|
class procedure MixColors(const OutputColor: Pointer; const Weights: TVector4; const AColors: TVector4Pointer); virtual; |
|
Mix 4 colors, with 4 weights, into a resulting color. All 4 Colors and OutputColor must be pointers to a pixel of current image class, that is they must point to PixelSize bytes of memory. Exceptions raised
|
procedure Assign(const Source: TCastleImage); virtual; |
|
Copy size and contents from Source. This sets our size (Width, Height and Depth) to match Source image, and copies pixels from the Source image, converting them as closely as possible. For example, converting RGBA to RGB will strip alpha channel, but copy RGB values. When implementing descendants: the base implementation of this method in TCastleImage handles only the case when Image class equals our own class. And raises EImageAssignmentError in other cases. Override this method if you want to actually handle some conversions when assignning. Exceptions raised
|
procedure SaveToPascalCode(const ImageName: string; var CodeInterface, CodeImplementation, CodeInitialization, CodeFinalization: string); |
|
Append code to embed this image inside Pascal source code. |
function MakeAlphaBleed(const ProgressTitle: string = ''): TCastleImage; virtual; |
|
This item has no description. |
procedure FillEllipse(const x, y: single; const aRadiusX, aRadiusY: single; const aColor: TCastleColor); virtual; |
|
Draw simple geometric shapes like circles, rectangles, lines, etc. |
procedure Ellipse(const x, y: single; const aRadiusX, aRadiusY: single; const aWidth: single; const aColor: TCastleColor); virtual; |
|
This item has no description. |
procedure FillRectangle(const x1, y1, x2, y2: single; const aColor: TCastleColor); virtual; |
|
This item has no description. |
procedure Rectangle(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); virtual; |
|
This item has no description. |
procedure Line(const x1, y1, x2, y2: single; const aWidth: single; const aColor: TCastleColor); virtual; |
|
This item has no description. |
procedure FloodFill(const x, y: integer; const aColor: TCastleColor; const aThreshold: single = 0); |
|
This item has no description. |
Properties
property Colors [const X,Y,Z: Integer]: TCastleColor read GetColors write SetColors; |
|
Get or set the color of the pixel. In case of descendants without alpha, we may drop this information. In case of grayscale descendants, when getting or setting we convert the color to/from grayscale as necessary. This means that setting RGB color on a grayscale image may lose information – we will convert your color to grayscale. Caller is responsible for checking the correctness of given X, Y, Z coordinates. For speed, we may not check them inside (so nasty memory errors will occur in case of invalid coordinates). |
Generated by PasDoc 0.16.0-snapshot.