Class TBGRATwirlScanner

Unit

Declaration

type TBGRATwirlScanner = class(TBGRACustomScanner)

Description

Scanner that applies a twirl transformation.

Note : this scanner handles integer coordinates only, so any further transformation applied after this one may not render correctly.

Example drawing a radial gradient transformed with a twirl:

tbgratwirlscanner

var image: TBGRABitmap;
    grad: TBGRAGradientScanner;
    affine: TBGRAAffineScannerTransform;
    twirl: TBGRATwirlScanner;
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);

  twirl := TBGRATwirlScanner.Create(affine,Point(ClientWidth div 2, ClientHeight div 2),100);
  image.Fill(twirl);
  twirl.Free;

  affine.free;
  grad.free;

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

Hierarchy

Overview

Fields

Protected FCenter: TPoint;
Protected FExponent: Single;
Protected FRadius: Single;
Protected FScanAtFunc: TScanAtFunction;
Protected FScanner: IBGRAScanner;
Protected FTurn: Single;

Methods

Public constructor Create(AScanner: IBGRAScanner; ACenter: TPoint; ARadius: single; ATurn: single = 1; AExponent: single = 3);
Public function ScanAt(X, Y: Single): TBGRAPixel; override;

Properties

Public property Center: TPoint read FCenter;
Public property Exponent: Single read FExponent;
Public property Radius: Single read FRadius;

Description

Fields

Protected FCenter: TPoint;

This item has no description.

Protected FExponent: Single;

This item has no description.

Protected FRadius: Single;

This item has no description.

Protected FScanAtFunc: TScanAtFunction;

This item has no description.

Protected FScanner: IBGRAScanner;

This item has no description.

Protected FTurn: Single;

This item has no description.

Methods

Public constructor Create(AScanner: IBGRAScanner; ACenter: TPoint; ARadius: single; ATurn: single = 1; AExponent: single = 3);

This item has no description.

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

This item has no description.

Properties

Public property Center: TPoint read FCenter;

This item has no description.

Public property Exponent: Single read FExponent;

This item has no description.

Public property Radius: Single read FRadius;

This item has no description.