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

Overview

Methods

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

Description

Methods

Public constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption); override;

This item has no description.

Public constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean); override;

This item has no description.

Public constructor Create(ABitmap: TBGRACustomBitmap; AAlpha: TAlphaChannelPaletteOption; AReductionColorCount: integer); override;

This item has no description.

Public constructor Create(APalette: TBGRACustomPalette; ASeparateAlphaChannel: boolean; AReductionColorCount: integer); override;

This item has no description.

Public destructor Destroy; override;

This item has no description.

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

This item has no description.

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

This item has no description.

Protected function GetPalette: TBGRACustomApproxPalette; override;

This item has no description.

Protected function GetReductionColorCount: integer; override;

This item has no description.

Protected function GetSourceColor(AIndex: integer): TBGRAPixel; override;

This item has no description.

Protected function GetSourceColorCount: Integer; override;

This item has no description.

Public procedure ApplyDitheringInplace(AAlgorithm: TDitheringAlgorithm; ABitmap: TBGRACustomBitmap; ABounds: TRect); override;

This item has no description.

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

This item has no description.

Protected procedure SetReductionColorCount(AValue: Integer); override;

This item has no description.