Class TPHXImage

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TPHXImage = class(TObject)

Description

The image is a container for a texture and supports patterns and tags

Hierarchy

  • TObject
  • TPHXImage

Overview

Fields

Protected PatternBuffer: array of TPHXPatternBuffer;

Methods

Protected procedure DrawPattern(const Pattern: TPHXPatternBuffer; const Position: TVector3f; const Color: TColor4f); overload;
Protected procedure DrawPattern(const Pattern: TPHXPatternBuffer; const Position: TVector3f; const Scale: TVector2f; const Color: TColor4f); overload;
Protected procedure DrawPattern(const Pattern: TPHXPatternBuffer; const Transform: TMatrix4; const Color: TColor4f); overload;
Public constructor Create(ADevice: TPHXDevice; ACanvas: TPHXCanvas);
Public constructor CreateEx(ATexture: TPHXTexture);
Public destructor Destroy; override;
Public procedure LoadImage(const FileName: String); overload;
Public procedure LoadImage(const FileName: String; Stream: TStream); overload;
Public procedure LoadFromFile(const FileName: String);
Public procedure LoadFromStream(Stream: TStream);
Public procedure SaveToFile(const FileName: String);
Public procedure SaveToStream(Stream: TStream);
Public procedure Initialize;
Public procedure Draw(const X, Y: Single); overload;
Public procedure Draw(const X, Y: Single; const PatternIndex: Integer); overload;
Public procedure Draw(const X, Y: Single; const PatternName: String); overload;
Public procedure Draw(const X, Y: Single; const Color : TColor4f); overload;
Public procedure Draw(const X, Y: Single; const Color : TColor4f; const PatternIndex: Integer); overload;
Public procedure Draw(const X, Y: Single; const Color : TColor4f; const PatternName: String); overload;
Public procedure DrawRotate(const X,Y : Single; const Angle: Single); overload;
Public procedure DrawRotate(const X,Y : Single; const Angle: Single; const PatternIndex: Cardinal); overload;
Public procedure DrawRotate(const X,Y : Single; const Angle: Single; const PatternName: String); overload;
Public procedure DrawTransform(const Transform: TMatrix4); overload;
Public procedure DrawTransform(const Transform: TMatrix4; const PatternIndex: Integer); overload;
Public procedure DrawTransform(const Transform: TMatrix4; const PatternName: String); overload;
Public procedure DrawTransform(const Transform: TMatrix4; const Color: TColor4f); overload;
Public procedure DrawTransform(const Transform: TMatrix4; const Color: TColor4f; const PatternIndex: Integer); overload;
Public procedure DrawTransform(const Transform: TMatrix4; const Color: TColor4f; const PatternName: String); overload;
Public procedure TileDraw(const X, Y: Single; const NumX, NumY: Integer); overload;
Public procedure TileDraw(const X, Y: Single; const NumX, NumY: Integer; const PatternIndex: Integer); overload;
Public procedure TileDraw(const X, Y: Single; const NumX, NumY: Integer; const PatternName: String); overload;
Public procedure StrechDraw(const X, Y: Single; const W, H: Integer); overload;
Public procedure StrechDraw(const X, Y: Single; const W, H: Integer; const PatternIndex: Integer); overload;
Public procedure StrechDraw(const X, Y: Single; const W, H: Integer; const PatternName: String); overload;
Public procedure DrawAdd(const X, Y: Single; const Alpha: Single); overload;
Public procedure DrawAdd(const X, Y: Single; const Alpha: Single; const PatternIndex: Integer); overload;
Public procedure DrawAdd(const X, Y: Single; const Alpha: Single; const PatternName: String); overload;
Public procedure DrawAlpha(const X, Y: Single; const Alpha: Single); overload;
Public procedure DrawAlpha(const X, Y: Single; const Alpha: Single; const PatternIndex: Integer); overload;
Public procedure DrawAlpha(const X, Y: Single; const Alpha: Single; const PatternName: String); overload;
Public procedure DrawBlend(const X, Y: Single; const Color: TColor4f; const Blend: TPHXBlendMode); overload;
Public procedure DrawBlend(const X, Y: Single; const Color: TColor4f; const Blend: TPHXBlendMode; const PatternIndex: Integer); overload;
Public procedure DrawBlend(const X, Y: Single; const Color: TColor4f; const Blend: TPHXBlendMode; const PatternName: String); overload;
Public procedure DrawArea(const X, Y: Integer; const Area: TRecti); overload;
Public procedure DrawArea(const Rect: TRectf; const Area: TRecti); overload;
Public procedure ChangePivot(const PatternIndex: Integer; const Pivot: TVector2i);

Properties

Public property Device: TPHXDevice read FDevice;
Public property Canvas: TPHXCanvas read FCanvas;
Public property Name: String read FName write FName;
Public property Author: String read FAuthor write FAuthor;
Public property Version: String read FVersion write FVersion;
Public property Comment: String read FComment write FComment;
Public property Width : Integer read FWidth write FWidth;
Public property Height : Integer read FHeight write FHeight;
Public property Patterns: TPHXPatternList read FPatterns;
Public property Tags: TPHXTagList read FTags;
Public property Texture: TPHXTexture read FTexture;

Description

Fields

Protected PatternBuffer: array of TPHXPatternBuffer;

Buffer for pattern texture coordinates and verticies

Methods

Protected procedure DrawPattern(const Pattern: TPHXPatternBuffer; const Position: TVector3f; const Color: TColor4f); overload;

Helper functions for rendering patterns

Protected procedure DrawPattern(const Pattern: TPHXPatternBuffer; const Position: TVector3f; const Scale: TVector2f; const Color: TColor4f); overload;

Helper functions for rendering patterns

Protected procedure DrawPattern(const Pattern: TPHXPatternBuffer; const Transform: TMatrix4; const Color: TColor4f); overload;

Helper functions for rendering patterns

Public constructor Create(ADevice: TPHXDevice; ACanvas: TPHXCanvas);

Creates a new image for the specified device

Public constructor CreateEx(ATexture: TPHXTexture);

Creates a new image with a predefined texture

Public destructor Destroy; override;

Destroys the image

Public procedure LoadImage(const FileName: String); overload;

Load a image from a file.

Public procedure LoadImage(const FileName: String; Stream: TStream); overload;

Load the image from a stream.

Public procedure LoadFromFile(const FileName: String);

Load the image froma file

Public procedure LoadFromStream(Stream: TStream);

Load the image from stream

Public procedure SaveToFile(const FileName: String);

Save the image to a file

Public procedure SaveToStream(Stream: TStream);

Save the image to a stream

Public procedure Initialize;

Initializes the image, must be called before any rendering

Public procedure Draw(const X, Y: Single); overload;

Draw the image at a specified location.

Public procedure Draw(const X, Y: Single; const PatternIndex: Integer); overload;

Draw a pattern at a specified location.

Public procedure Draw(const X, Y: Single; const PatternName: String); overload;

Draw a pattern at a specified location.

Public procedure Draw(const X, Y: Single; const Color : TColor4f); overload;

Draw the image at the specified location with the specified color.

Public procedure Draw(const X, Y: Single; const Color : TColor4f; const PatternIndex: Integer); overload;

Draw a pattern at the specified location with the specified color.

Public procedure Draw(const X, Y: Single; const Color : TColor4f; const PatternName: String); overload;

Draw a pattern at the specified location with the specified color.

Public procedure DrawRotate(const X,Y : Single; const Angle: Single); overload;

Draw the image rotated.

Public procedure DrawRotate(const X,Y : Single; const Angle: Single; const PatternIndex: Cardinal); overload;

Draw a pattern rotated.

Public procedure DrawRotate(const X,Y : Single; const Angle: Single; const PatternName: String); overload;

Draw a pattern rotated.

Public procedure DrawTransform(const Transform: TMatrix4); overload;

Draw the image using a specifed transformation matrix

Public procedure DrawTransform(const Transform: TMatrix4; const PatternIndex: Integer); overload;

Draw a pattern using a specifed transformation matrix

Public procedure DrawTransform(const Transform: TMatrix4; const PatternName: String); overload;

Draw a pattern using a specifed transformation matrix

Public procedure DrawTransform(const Transform: TMatrix4; const Color: TColor4f); overload;

Draw the image using a specifed transformation matrix and color

Public procedure DrawTransform(const Transform: TMatrix4; const Color: TColor4f; const PatternIndex: Integer); overload;

Draw a pattern using a specifed transformation matrix and color

Public procedure DrawTransform(const Transform: TMatrix4; const Color: TColor4f; const PatternName: String); overload;

Draw a pattern using a specifed transformation matrix and color

Public procedure TileDraw(const X, Y: Single; const NumX, NumY: Integer); overload;

Draws the image tiled with NumX and NumY repeats.

Public procedure TileDraw(const X, Y: Single; const NumX, NumY: Integer; const PatternIndex: Integer); overload;

Draws a pattern tiled with NumX and NumY repeats.

Public procedure TileDraw(const X, Y: Single; const NumX, NumY: Integer; const PatternName: String); overload;

Draws a pattern tiled with NumX and NumY repeats.

Public procedure StrechDraw(const X, Y: Single; const W, H: Integer); overload;

Draws the image streched to fill the supplied rectangle.

Public procedure StrechDraw(const X, Y: Single; const W, H: Integer; const PatternIndex: Integer); overload;

Draws a pattern streched to fill the supplied rectangle.

Public procedure StrechDraw(const X, Y: Single; const W, H: Integer; const PatternName: String); overload;

Draws a pattern streched to fill the supplied rectangle.

Public procedure DrawAdd(const X, Y: Single; const Alpha: Single); overload;

Draw the image at the specified location with additive blending

Public procedure DrawAdd(const X, Y: Single; const Alpha: Single; const PatternIndex: Integer); overload;

Draw a pattern at the specified location with additive blending

Public procedure DrawAdd(const X, Y: Single; const Alpha: Single; const PatternName: String); overload;

Draw a pattern at the specified location with additive blending

Public procedure DrawAlpha(const X, Y: Single; const Alpha: Single); overload;

Draw the image at the specified location with the specified alpha.

Public procedure DrawAlpha(const X, Y: Single; const Alpha: Single; const PatternIndex: Integer); overload;

Draw a pattern at the specified location with the specified alpha.

Public procedure DrawAlpha(const X, Y: Single; const Alpha: Single; const PatternName: String); overload;

Draw a pattern at the specified location with additive blending

Public procedure DrawBlend(const X, Y: Single; const Color: TColor4f; const Blend: TPHXBlendMode); overload;

Draw the image at the specified location with custom blending

Public procedure DrawBlend(const X, Y: Single; const Color: TColor4f; const Blend: TPHXBlendMode; const PatternIndex: Integer); overload;

Draw a pattern at the specified location with custom blending

Public procedure DrawBlend(const X, Y: Single; const Color: TColor4f; const Blend: TPHXBlendMode; const PatternName: String); overload;

Draw a pattern at the specified location with custom blending

Public procedure DrawArea(const X, Y: Integer; const Area: TRecti); overload;

Draws a selected area of the image. The area is the texture coordinates in pixels to draw

Public procedure DrawArea(const Rect: TRectf; const Area: TRecti); overload;

Draws a selected area of the image. The area is the texture coordinates in pixels to draw

Public procedure ChangePivot(const PatternIndex: Integer; const Pivot: TVector2i);

Draw the image using a wave function procedure DrawWaveHorz(const Rect: TRecti; const WaveFunct: TWaveFunc; const Time: Single; const Detail: Integer); overload; procedure DrawWaveHorz(const Rect: TRecti; const WaveFunct: TWaveFunc; const Time: Single; const Detail: Integer; const PatternIndex: Integer); overload; procedure DrawWaveVert(const Rect: TRecti; const WaveFunct: TWaveFunc; const Time: Single; const Detail: Integer); Change the pivot position of a pattern

Properties

Public property Device: TPHXDevice read FDevice;

The owning device

Public property Canvas: TPHXCanvas read FCanvas;

The canvas that is rendered to

Public property Name: String read FName write FName;

The name of the image, used to search for textures in the imagelist.

Public property Author: String read FAuthor write FAuthor;

Author of the image

Public property Version: String read FVersion write FVersion;

Version of the image

Public property Comment: String read FComment write FComment;

Comment of the image

Public property Width : Integer read FWidth write FWidth;

The width of the image.

Public property Height : Integer read FHeight write FHeight;

The height of the image.

Public property Patterns: TPHXPatternList read FPatterns;

The patterns in the image

Public property Tags: TPHXTagList read FTags;

The tags in the image

Public property Texture: TPHXTexture read FTexture;

The internal texture


Generated by PasDoc 0.13.0 on 2013-08-26 11:02:38