Class TBGRAColorQuantizer
Unit
Declaration
type TBGRAColorQuantizer = class(TBGRACustomColorQuantizer)
Description
Implementation of color quantization.
Example saving an image into 8-bit PNG file:
uses BGRAColorQuantization, BGRABitmapTypes, BGRABitmap; var quant : TBGRAColorQuantizer; sourceBmp: TBGRABitmap; begin sourceBmp := TBGRABitmap.Create('picture_in_32_bits.bmp'); quant := TBGRAColorQuantizer.Create(sourceBmp, acFullChannelInPalette); // by default, reduces to 256 colors quant.SaveBitmapToFile(daFloydSteinberg, sourceBmp, 'picture_in_8_bits.png'); quant.Free; sourceBmp.Free; end;
Hierarchy
- TObject
- TBGRACustomColorQuantizer
- TBGRAColorQuantizer
Overview
Methods
constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption); override; |
|
constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean); override; |
|
constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption; AReductionColorCount: integer); override; |
|
constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean; AReductionColorCount: integer); override; |
|
destructor Destroy; override; |
|
function GetDitheredBitmap(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect): TBGRACustomBitmap; overload; override; |
|
function GetDitheredBitmapIndexedData(ABitDepth: integer; AByteOrder: TRawImageByteOrder; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; out AScanlineSize: PtrInt): Pointer; overload; override; |
|
function GetPalette: TBGRACustomApproxPalette; override; |
|
function GetReductionColorCount: integer; override; |
|
function GetSourceColor(AIndex: integer): TBGRAPixel; override; |
|
function GetSourceColorCount: Integer; override; |
|
procedure ApplyDitheringInplace(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect); override; |
|
procedure SaveBitmapToStream(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AStream: TStream; AFormat: TBGRAImageFormat); override; |
|
procedure SetReductionColorCount(AValue: Integer); override; |
Description
Methods
constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption); override; |
|
This item has no description. |
constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean); override; |
|
This item has no description. |
constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption; AReductionColorCount: integer); override; |
|
This item has no description. |
constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean; AReductionColorCount: integer); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
function GetDitheredBitmap(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect): TBGRACustomBitmap; overload; override; |
|
This item has no description. |
function GetDitheredBitmapIndexedData(ABitDepth: integer; AByteOrder: TRawImageByteOrder; AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; out AScanlineSize: PtrInt): Pointer; overload; override; |
|
This item has no description. |
function GetPalette: TBGRACustomApproxPalette; override; |
|
This item has no description. |
function GetReductionColorCount: integer; override; |
|
This item has no description. |
function GetSourceColor(AIndex: integer): TBGRAPixel; override; |
|
This item has no description. |
function GetSourceColorCount: Integer; override; |
|
This item has no description. |
procedure ApplyDitheringInplace(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect); override; |
|
This item has no description. |
procedure SaveBitmapToStream(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; AStream: TStream; AFormat: TBGRAImageFormat); override; |
|
This item has no description. |
procedure SetReductionColorCount(AValue: Integer); override; |
|
This item has no description. |