Unit BGRATransform

📄 Source code

Description

Affine and bitmap transformations

Uses

Overview

Structures

Name Description
Class TBGRAAffineBitmapTransform Scanners that applies an affine transform to a bitmap.
Class TBGRAAffineScannerTransform Scanner that transforms any other scanner.
Class TBGRABitmapScanner Simple scanner for a bitmap
Class TBGRAExtendedBorderScanner Scanner that restricts the source to a rectangular area and pad the rest.
Class TBGRAPerspectiveScannerTransform Scanner that performs a perspective transform (3D)
Class TBGRAQuadLinearScanner Scanner for a texture mapped to a quadrilateral shape
Class TBGRAScannerOffset Scanner that adds an offset
Class TBGRASphereDeformationScanner Scanners that distorts as a shere shape
Class TBGRATriangleLinearMapping Scanner that provides an optimized transformation for linear texture mapping on triangles
Class TBGRATwirlScanner Scanner that applies a twirl transformation.
Class TBGRAVerticalCylinderDeformationScanner Scanners that distorts as a cylinder shape
Class TPerspectiveTransform Computes a perspective transform (3D) of coordinates

Functions and Procedures

operator *(M: TAffineMatrix; V: TPointF): TPointF;
operator *(M: TAffineMatrix; A: array of TPointF): ArrayOfTPointF;
operator *(M: TAffineMatrix; ab: TAffineBox): TAffineBox;
operator *(M,N: TAffineMatrix): TAffineMatrix;
operator =(M,N: TAffineMatrix): boolean;
function AffineMatrix(m11,m12,m13,m21,m22,m23: single): TAffineMatrix; overload;
function AffineMatrix(AU,AV: TPointF; ATranslation: TPointF): TAffineMatrix; overload;
function AffineMatrixIdentity: TAffineMatrix;
function AffineMatrixInverse(M: TAffineMatrix): TAffineMatrix;
function AffineMatrixLinear(v1,v2: TPointF): TAffineMatrix; overload;
function AffineMatrixLinear(const AMatrix: TAffineMatrix): TAffineMatrix; overload;
function AffineMatrixRotationDeg(AngleCW: Single): TAffineMatrix;
function AffineMatrixRotationRad(AngleCCW: Single): TAffineMatrix;
function AffineMatrixScale(sx,sy: single): TAffineMatrix;
function AffineMatrixScaledRotation(ASourcePoint, ATargetPoint, AOrigin: TPointF): TAffineMatrix;
function AffineMatrixScaledRotation(ASourceVector, ATargetVector: TPointF): TAffineMatrix;
function AffineMatrixSkewXDeg(AngleCW: single): TAffineMatrix;
function AffineMatrixSkewXRad(AngleCCW: single): TAffineMatrix;
function AffineMatrixSkewYDeg(AngleCW: single): TAffineMatrix;
function AffineMatrixSkewYRad(AngleCCW: single): TAffineMatrix;
function AffineMatrixTranslation(OfsX,OfsY: Single): TAffineMatrix;
function IsAffineMatrixIdentity(M: TAffineMatrix): boolean;
function IsAffineMatrixInversible(M: TAffineMatrix): boolean;
function IsAffineMatrixOrthogonal(M: TAffineMatrix): boolean;
function IsAffineMatrixScale(M: TAffineMatrix): boolean;
function IsAffineMatrixScaledRotation(M: TAffineMatrix): boolean;
function IsAffineMatrixTranslation(M: TAffineMatrix): boolean;

Types

TAffineBox = BGRABitmapTypes.TAffineBox;
TAffineMatrix = BGRABitmapTypes.TAffineMatrix;

Description

Functions and Procedures

operator *(M: TAffineMatrix; V: TPointF): TPointF;

matrix multiplication by a vector (apply transformation to that vector)

operator *(M: TAffineMatrix; A: array of TPointF): ArrayOfTPointF;

This item has no description.

operator *(M: TAffineMatrix; ab: TAffineBox): TAffineBox;

This item has no description.

operator *(M,N: TAffineMatrix): TAffineMatrix;

matrix multiplication

operator =(M,N: TAffineMatrix): boolean;

This item has no description.

function AffineMatrix(m11,m12,m13,m21,m22,m23: single): TAffineMatrix; overload;

fill a matrix

function AffineMatrix(AU,AV: TPointF; ATranslation: TPointF): TAffineMatrix; overload;

This item has no description.

function AffineMatrixIdentity: TAffineMatrix;

define the identity matrix (that do nothing)

function AffineMatrixInverse(M: TAffineMatrix): TAffineMatrix;

compute inverse (check if inversible before)

function AffineMatrixLinear(v1,v2: TPointF): TAffineMatrix; overload;

define a linear matrix

function AffineMatrixLinear(const AMatrix: TAffineMatrix): TAffineMatrix; overload;

This item has no description.

function AffineMatrixRotationDeg(AngleCW: Single): TAffineMatrix;

Positive degrees are clockwise (assuming the y-axis is pointing down)

function AffineMatrixRotationRad(AngleCCW: Single): TAffineMatrix;

define a rotation matrix (positive radians are counter-clockwise) (assuming the y-axis is pointing down)

function AffineMatrixScale(sx,sy: single): TAffineMatrix;

define a scaling matrix

function AffineMatrixScaledRotation(ASourcePoint, ATargetPoint, AOrigin: TPointF): TAffineMatrix;

This item has no description.

function AffineMatrixScaledRotation(ASourceVector, ATargetVector: TPointF): TAffineMatrix;

This item has no description.

function AffineMatrixSkewXDeg(AngleCW: single): TAffineMatrix;

This item has no description.

function AffineMatrixSkewXRad(AngleCCW: single): TAffineMatrix;

This item has no description.

function AffineMatrixSkewYDeg(AngleCW: single): TAffineMatrix;

This item has no description.

function AffineMatrixSkewYRad(AngleCCW: single): TAffineMatrix;

This item has no description.

function AffineMatrixTranslation(OfsX,OfsY: Single): TAffineMatrix;

define a translation matrix

function IsAffineMatrixIdentity(M: TAffineMatrix): boolean;

check if the matrix is the identity

function IsAffineMatrixInversible(M: TAffineMatrix): boolean;

check if matrix is inversible

function IsAffineMatrixOrthogonal(M: TAffineMatrix): boolean;

This item has no description.

function IsAffineMatrixScale(M: TAffineMatrix): boolean;

check if the matrix is a scaling (including a projection i.e. with factor 0)

function IsAffineMatrixScaledRotation(M: TAffineMatrix): boolean;

This item has no description.

function IsAffineMatrixTranslation(M: TAffineMatrix): boolean;

check if the matrix is a translation (including the identity)

Types

TAffineBox = BGRABitmapTypes.TAffineBox;

Contains an affine base and information on the resulting box

TAffineMatrix = BGRABitmapTypes.TAffineMatrix;

Contains an affine matrix, i.e. a matrix to transform linearly and translate TPointF coordinates