Class TBGRAAffineBitmapTransform

Unit

Declaration

type TBGRAAffineBitmapTransform = class(TBGRAAffineScannerTransform)

Description

Scanners that applies an affine transform to a bitmap.

It is usedful if you don't want the bitmap to repeats itself, or want to specify the resample filter, or want to fit easily the bitmap on axes.

Example filling with a rotated image:

tbgraffinebitmaptransform

uses BGRABitmap, BGRABitmapTypes, BGRATransform;

procedure TForm1.PaintImage;
var image: TBGRABitmap;
    tex: TBGRABitmap;
    affine: TBGRAAffineBitmapTransform;

begin
  //black background
  image := TBGRABitmap.Create(ClientWidth,ClientHeight, BGRABlack );

  tex:= TBGRABitmap.Create('image.png'); //load a bitmap

  //create a rotation of 45°
  affine := TBGRAAffineBitmapTransform.Create(tex,True);
  affine.RotateDeg(45);

  //use this transformation as parameter instead of tex
  image.FillPolyAntialias( [PointF(110,10), PointF(250,10), PointF(350,160), PointF(10,160)], affine);

  affine.Free;
  tex.Free;

  image.Draw(Canvas,0,0,True); //draw on the screen
  image.free;
end;

Hierarchy

Overview

Fields

Protected FBitmap: TBGRACustomBitmap;
Protected FBuffer: PBGRAPixel;
Protected FBufferSize: Int32or64;
Protected FIncludeEdges: boolean;
Protected FRepeatImageX: boolean;
Protected FRepeatImageY: boolean;
Protected FResampleFilter: TResampleFilter;

Methods

Public constructor Create(ABitmap: TBGRACustomBitmap; ARepeatImageX: Boolean; ARepeatImageY: Boolean; AResampleFilter: TResampleFilter = rfLinear; AIncludeEdges: boolean = false); overload;
Public constructor Create(ABitmap: TBGRACustomBitmap; ARepeatImage: Boolean= false; AResampleFilter: TResampleFilter = rfLinear; AIncludeEdges: boolean = false); overload;
Public destructor Destroy; override;
Public function InternalScanCurrentPixel: TBGRAPixel; override;
Public function IsScanPutPixelsDefined: boolean; override;
Public procedure Fit(Origin, HAxis, VAxis: TPointF); override;
Public procedure ScanPutPixels(pdest: PBGRAPixel; count: integer; mode: TDrawMode); override;
Protected procedure Init(ABitmap: TBGRACustomBitmap; ARepeatImageX: Boolean= false; ARepeatImageY: Boolean= false; AResampleFilter: TResampleFilter = rfLinear; AIncludeEdges: boolean = false);

Description

Fields

Protected FBitmap: TBGRACustomBitmap;

This item has no description.

Protected FBuffer: PBGRAPixel;

This item has no description.

Protected FBufferSize: Int32or64;

This item has no description.

Protected FIncludeEdges: boolean;

This item has no description.

Protected FRepeatImageX: boolean;

This item has no description.

Protected FRepeatImageY: boolean;

This item has no description.

Protected FResampleFilter: TResampleFilter;

This item has no description.

Methods

Public constructor Create(ABitmap: TBGRACustomBitmap; ARepeatImageX: Boolean; ARepeatImageY: Boolean; AResampleFilter: TResampleFilter = rfLinear; AIncludeEdges: boolean = false); overload;

This item has no description.

Public constructor Create(ABitmap: TBGRACustomBitmap; ARepeatImage: Boolean= false; AResampleFilter: TResampleFilter = rfLinear; AIncludeEdges: boolean = false); overload;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function InternalScanCurrentPixel: TBGRAPixel; override;

This item has no description.

Public function IsScanPutPixelsDefined: boolean; override;

This item has no description.

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

This item has no description.

Public procedure ScanPutPixels(pdest: PBGRAPixel; count: integer; mode: TDrawMode); override;

This item has no description.

Protected procedure Init(ABitmap: TBGRACustomBitmap; ARepeatImageX: Boolean= false; ARepeatImageY: Boolean= false; AResampleFilter: TResampleFilter = rfLinear; AIncludeEdges: boolean = false);

This item has no description.