Class TBGRACustomColorQuantizer

Unit

Declaration

type TBGRACustomColorQuantizer = class(TObject)

Description

Abstract class for color quantization.

Quantization is the process by which each color is reduced to an index into a palette. Surrounding pixels can affect the approximate color, an effect called dithering.

Hierarchy

Overview

Methods

Public constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption); overload; virtual; abstract;
Public constructor Create(AColors: array of TBGRAPixel; ASeparateAlphaChannel: boolean); overload;
Public constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean); overload; virtual; abstract;
Public constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption; AReductionColorCount: integer); overload; virtual; abstract;
Public constructor Create(AColors: array of TBGRAPixel; ASeparateAlphaChannel: boolean; AReductionColorCount: integer); overload;
Public constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean; AReductionColorCount: integer); overload; virtual; abstract;
Public function GetDitheredBitmap(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect): TBGRACustomBitmap; overload; virtual; abstract;
Public function GetDitheredBitmap(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap): TBGRACustomBitmap; overload;
Public function GetDitheredBitmapIndexedData(ABitDepth: integer; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap): Pointer; overload;
Public function GetDitheredBitmapIndexedData(ABitDepth: integer; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; out AScanlineSize: PtrInt): Pointer; overload;
Public function GetDitheredBitmapIndexedData(ABitDepth: integer; AByteOrder: TRawImageByteOrder; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; out AScanlineSize: PtrInt): Pointer; overload; virtual; abstract;
Protected function GetDominantColor: TBGRAPixel; virtual;
Protected function GetPalette: TBGRACustomApproxPalette; virtual; abstract;
Protected function GetReductionColorCount: integer; virtual; abstract;
Protected function GetSourceColor(AIndex: integer): TBGRAPixel; virtual; abstract;
Protected function GetSourceColorCount: Integer; virtual; abstract;
Public procedure ApplyDitheringInplace(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect); overload; virtual; abstract;
Public procedure ApplyDitheringInplace(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap); overload;
Public procedure SaveBitmapToFile(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AFilenameUTF8: string); overload;
Public procedure SaveBitmapToFile(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AFilenameUTF8: string; AFormat: TBGRAImageFormat); overload;
Public procedure SaveBitmapToStream(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AStream: TStream; AFormat: TBGRAImageFormat); virtual; abstract;
Protected procedure SetReductionColorCount(AValue: Integer); virtual; abstract;

Properties

Public property DominantColor: TBGRAPixel read GetDominantColor;
Public property ReducedPalette: TBGRACustomApproxPalette read GetPalette;
Public property ReductionColorCount: Integer read GetReductionColorCount write SetReductionColorCount;
Public property SourceColor[AIndex: integer]: TBGRAPixel read GetSourceColor;
Public property SourceColorCount: Integer read GetSourceColorCount;

Description

Methods

Public constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption); overload; virtual; abstract;

This item has no description.

Public constructor Create(AColors: array of TBGRAPixel; ASeparateAlphaChannel: boolean); overload;

This item has no description.

Public constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean); overload; virtual; abstract;

This item has no description.

Public constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption; AReductionColorCount: integer); overload; virtual; abstract;

This item has no description.

Public constructor Create(AColors: array of TBGRAPixel; ASeparateAlphaChannel: boolean; AReductionColorCount: integer); overload;

This item has no description.

Public constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean; AReductionColorCount: integer); overload; virtual; abstract;

This item has no description.

Public function GetDitheredBitmap(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect): TBGRACustomBitmap; overload; virtual; abstract;

This item has no description.

Public function GetDitheredBitmap(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap): TBGRACustomBitmap; overload;

This item has no description.

Public function GetDitheredBitmapIndexedData(ABitDepth: integer; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap): Pointer; overload;

This item has no description.

Public function GetDitheredBitmapIndexedData(ABitDepth: integer; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; out AScanlineSize: PtrInt): Pointer; overload;

This item has no description.

Public function GetDitheredBitmapIndexedData(ABitDepth: integer; AByteOrder: TRawImageByteOrder; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; out AScanlineSize: PtrInt): Pointer; overload; virtual; abstract;

This item has no description.

Protected function GetDominantColor: TBGRAPixel; virtual;

This item has no description.

Protected function GetPalette: TBGRACustomApproxPalette; virtual; abstract;

This item has no description.

Protected function GetReductionColorCount: integer; virtual; abstract;

This item has no description.

Protected function GetSourceColor(AIndex: integer): TBGRAPixel; virtual; abstract;

This item has no description.

Protected function GetSourceColorCount: Integer; virtual; abstract;

This item has no description.

Public procedure ApplyDitheringInplace(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect); overload; virtual; abstract;

This item has no description.

Public procedure ApplyDitheringInplace(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap); overload;

This item has no description.

Public procedure SaveBitmapToFile(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AFilenameUTF8: string); overload;

This item has no description.

Public procedure SaveBitmapToFile(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AFilenameUTF8: string; AFormat: TBGRAImageFormat); overload;

This item has no description.

Public procedure SaveBitmapToStream(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AStream: TStream; AFormat: TBGRAImageFormat); virtual; abstract;

This item has no description.

Protected procedure SetReductionColorCount(AValue: Integer); virtual; abstract;

This item has no description.

Properties

Public property DominantColor: TBGRAPixel read GetDominantColor;

This item has no description.

Public property ReducedPalette: TBGRACustomApproxPalette read GetPalette;

This item has no description.

Public property ReductionColorCount: Integer read GetReductionColorCount write SetReductionColorCount;

This item has no description.

Public property SourceColor[AIndex: integer]: TBGRAPixel read GetSourceColor;

This item has no description.

Public property SourceColorCount: Integer read GetSourceColorCount;

This item has no description.