Class TBGRAAffineScannerTransform

Unit

Declaration

type TBGRAAffineScannerTransform = class(TBGRACustomScanner)

Description

Scanner that transforms any other scanner. To use it, create this object with a scanner as parameter, call transformation procedures, and finally, use the newly created object as a scanner.

You can transform a gradient or a bitmap. See TBGRAAffineBitmapTransform for bitmap specific transformation.

Example drawing an oblique radial gradient:

tbgraaffinescannertransform

uses BGRAGradientScanner, BGRATransform;

procedure TForm1.FormPaint(Sender: TObject);
var image: TBGRABitmap;
    grad: TBGRAGradientScanner;
    affine: TBGRAAffineScannerTransform;
begin
  image := TBGRABitmap.Create(ClientWidth,ClientHeight, BGRABlack );

  grad := TBGRAGradientScanner.Create(BGRA(0,0,255),BGRAWhite,gtRadial,PointF(0,0),PointF(1,0),True,True);

  affine := TBGRAAffineScannerTransform.Create(grad);
  affine.Scale(150,80);
  affine.RotateDeg(-30);
  affine.Translate(ClientWidth/2, ClientHeight/2);

  image.Fill(affine);

  affine.free;
  grad.free;

  image.Draw(Canvas,0,0,True);
  image.free;
end;

Hierarchy

Overview

Fields

Protected FCur: TPointF;
Protected FEmptyMatrix: Boolean;
Protected FMatrix: TAffineMatrix;
Protected FScanAtFunc: TScanAtFunction;
Protected FScanner: IBGRAScanner;
Public GlobalOpacity: Byte;

Methods

Public constructor Create(AScanner: IBGRAScanner);
Public function GetScanCustomColorspace: TColorspaceAny; override;
Public function ScanAt(X, Y: Single): TBGRAPixel; override;
Public function ScanNextPixel: TBGRAPixel; override;
Protected function GetViewMatrix: TAffineMatrix;
Protected function InternalScanCurrentPixel: TBGRAPixel; virtual;
Public procedure Fit(Origin,HAxis,VAxis: TPointF); virtual;
Public procedure Invert;
Public procedure MultiplyBy(AMatrix: TAffineMatrix);
Public procedure Reset;
Public procedure RotateDeg(AngleCW: Single);
Public procedure RotateRad(AngleCCW: Single);
Public procedure Scale(factor: single); overload;
Public procedure Scale(sx,sy: single); overload;
Public procedure ScanMoveTo(X, Y: Integer); override;
Public procedure ScanMoveToF(X, Y: single); inline;
Public procedure ScanSkipPixels(ACount: integer); override;
Public procedure Translate(OfsX,OfsY: Single);
Protected procedure SetMatrix(AMatrix: TAffineMatrix);
Protected procedure SetViewMatrix(AValue: TAffineMatrix);

Properties

Public property Matrix: TAffineMatrix read FMatrix write SetMatrix;
Public property ViewMatrix: TAffineMatrix read GetViewMatrix write SetViewMatrix;

Description

Fields

Protected FCur: TPointF;

This item has no description.

Protected FEmptyMatrix: Boolean;

This item has no description.

Protected FMatrix: TAffineMatrix;

This item has no description.

Protected FScanAtFunc: TScanAtFunction;

This item has no description.

Protected FScanner: IBGRAScanner;

This item has no description.

Public GlobalOpacity: Byte;

This item has no description.

Methods

Public constructor Create(AScanner: IBGRAScanner);

This item has no description.

Public function GetScanCustomColorspace: TColorspaceAny; override;

This item has no description.

Public function ScanAt(X, Y: Single): TBGRAPixel; override;

This item has no description.

Public function ScanNextPixel: TBGRAPixel; override;

This item has no description.

Protected function GetViewMatrix: TAffineMatrix;

This item has no description.

Protected function InternalScanCurrentPixel: TBGRAPixel; virtual;

This item has no description.

Public procedure Fit(Origin,HAxis,VAxis: TPointF); virtual;

This item has no description.

Public procedure Invert;

This item has no description.

Public procedure MultiplyBy(AMatrix: TAffineMatrix);

This item has no description.

Public procedure Reset;

This item has no description.

Public procedure RotateDeg(AngleCW: Single);

This item has no description.

Public procedure RotateRad(AngleCCW: Single);

This item has no description.

Public procedure Scale(factor: single); overload;

This item has no description.

Public procedure Scale(sx,sy: single); overload;

This item has no description.

Public procedure ScanMoveTo(X, Y: Integer); override;

This item has no description.

Public procedure ScanMoveToF(X, Y: single); inline;

This item has no description.

Public procedure ScanSkipPixels(ACount: integer); override;

This item has no description.

Public procedure Translate(OfsX,OfsY: Single);

This item has no description.

Protected procedure SetMatrix(AMatrix: TAffineMatrix);

This item has no description.

Protected procedure SetViewMatrix(AValue: TAffineMatrix);

This item has no description.

Properties

Public property Matrix: TAffineMatrix read FMatrix write SetMatrix;

This item has no description.

Public property ViewMatrix: TAffineMatrix read GetViewMatrix write SetViewMatrix;

This item has no description.