Class TBGRAReaderBMP

Unit

Declaration

type TBGRAReaderBMP = class(TBGRAImageReader)

Description

Reader for BMP format

Hierarchy

Overview

Fields

Protected BFH: TBitMapFileHeader;
Protected BFI: TBitMapInfoHeader;
Protected BlueMask: LongWord;
Protected BlueShift: shortint;
Protected FBGRAPalette: PBGRAPixel;
Protected FBuffer: packed of byte;
Protected FBufferPos: integer;
Protected FBufferSize: integer;
Protected FBufferStream: TStream;
Protected FHasAlphaValues: boolean;
Protected FMaskData: PByte;
Protected FMaskDataSize: integer;
Protected FOriginalHeight: Integer;
Protected FOutputHeight: integer;
Protected FPalette: PFPcolor;
Protected FPaletteEntrySize: integer;
Protected FTransparencyOption: TBMPTransparencyOption;
Protected GreenMask: LongWord;
Protected GreenShift: shortint;
Public Hotspot: TPoint;
Protected LineBuf: PByte;
Public MinifyHeight: integer;
Protected ReadSize: Integer;
Protected RedMask: LongWord;
Protected RedShift: shortint;
Public Subformat: TBitmapSubFormat;
Public WantedHeight: integer;

Methods

Public constructor Create; override;
Public destructor Destroy; override;
Public function GetBitmapDraft(AStream: TStream; AMaxWidth, AMaxHeight: integer; out AOriginalWidth,AOriginalHeight: integer): TBGRACustomBitmap; override;
Public function GetQuickInfo(AStream: TStream): TQuickImageInfo; override;
Protected function CountBits(Value : byte) : shortint;
Protected function ExpandColor(value : LongWord) : TFPColor;
Protected function ExpandColorBGRA(value : LongWord) : TBGRAPixel;
Protected function GetNextBufferByte: byte;
Protected function InternalCheck(Stream:TStream) : boolean; override;
Protected function ShiftCount(Mask : LongWord) : shortint;
Protected procedure CloseReadBuffer;
Protected procedure ExpandRLE4ScanLine(Row : Integer; Stream : TStream);
Protected procedure ExpandRLE8ScanLine(Row : Integer; Stream : TStream);
Protected procedure ImageVerticalLoop(Stream:TStream; Img:TFPCustomImage; ReadProc, SkipProc: TReadScanlineProc; WriteProc: TWriteScanlineProc; ProgressProc: TProgressProc; var ShouldContinue: boolean);
Protected procedure InitReadBuffer(AStream: TStream; ASize: integer);
Protected procedure InternalRead(Stream:TStream; Img:TFPCustomImage); override;
Protected procedure LoadMask(Stream:TStream; Img:TFPCustomImage; var ShouldContinue: boolean);
Protected procedure MainProgressProc(Percent: integer; var ShouldContinue: boolean);
Protected procedure MakeOpaque(Img: TFPCustomImage);
Protected procedure ReadMaskLine(Row : Integer; Stream : TStream); virtual;
Protected procedure ReadResolutionValues(Img: TFPCustomImage); virtual;
Protected procedure ReadScanLine(Row : Integer; Stream : TStream); virtual;
Protected procedure SetupRead(nPalette, nRowBits: Integer; Stream : TStream); virtual;
Protected procedure SkipMaskLine(Row : Integer; Stream : TStream); virtual;
Protected procedure SkipScanLine(Row : Integer; Stream : TStream); virtual;
Protected procedure WriteMaskLine(Row : Integer; Img : TFPCustomImage); virtual;
Protected procedure WriteScanLine(Row : Integer; Img : TFPCustomImage); virtual;
Protected procedure WriteScanLineBGRA(Row : Integer; Img : TFPCustomImage); virtual;

Properties

Public property OriginalHeight: integer read FOriginalHeight;
Public property OutputHeight: integer read FOutputHeight;
Public property TransparencyOption: TBMPTransparencyOption read FTransparencyOption write FTransparencyOption;

Description

Fields

Protected BFH: TBitMapFileHeader;

Size (in bytes) of 1 scanline.

Protected BFI: TBitMapInfoHeader;

The file header

Protected BlueMask: LongWord;

Buffer for 1 scanline. Can be Byte, Word, TColorRGB or TColorRGBA

Protected BlueShift: shortint;

Used if Compression=bi_bitfields

Protected FBGRAPalette: PBGRAPixel;

Buffer with Palette entries. (useless now)

Protected FBuffer: packed of byte;

This item has no description.

Protected FBufferPos: integer;

This item has no description.

Protected FBufferSize: integer;

This item has no description.

Protected FBufferStream: TStream;

This item has no description.

Protected FHasAlphaValues: boolean;

This item has no description.

Protected FMaskData: PByte;

This item has no description.

Protected FMaskDataSize: integer;

This item has no description.

Protected FOriginalHeight: Integer;

This item has no description.

Protected FOutputHeight: integer;

This item has no description.

Protected FPalette: PFPcolor;

4 for Windows, 3 for OS/2 1.x

Protected FPaletteEntrySize: integer;

The header as read from the stream.

Protected FTransparencyOption: TBMPTransparencyOption;

This item has no description.

Protected GreenMask: LongWord;

Buffer for 1 scanline. Can be Byte, Word, TColorRGB or TColorRGBA

Protected GreenShift: shortint;

Used if Compression=bi_bitfields

Public Hotspot: TPoint;

This item has no description.

Protected LineBuf: PByte;

This item has no description.

Public MinifyHeight: integer;

This item has no description.

Protected ReadSize: Integer;

Free (and nil) buffers.

Protected RedMask: LongWord;

Buffer for 1 scanline. Can be Byte, Word, TColorRGB or TColorRGBA

Protected RedShift: shortint;

Used if Compression=bi_bitfields

Public Subformat: TBitmapSubFormat;

This item has no description.

Public WantedHeight: integer;

This item has no description.

Methods

Public constructor Create; override;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function GetBitmapDraft(AStream: TStream; AMaxWidth, AMaxHeight: integer; out AOriginalWidth,AOriginalHeight: integer): TBGRACustomBitmap; override;

This item has no description. Showing description inherited from TBGRAImageReader.GetBitmapDraft.

Return a draft of the bitmap, the ratio may change compared to the original width and height (useful to make thumbnails)

Public function GetQuickInfo(AStream: TStream): TQuickImageInfo; override;

This item has no description. Showing description inherited from TBGRAImageReader.GetQuickInfo.

Return bitmap information (size, bit depth)

Protected function CountBits(Value : byte) : shortint;

This item has no description.

Protected function ExpandColor(value : LongWord) : TFPColor;

This item has no description.

Protected function ExpandColorBGRA(value : LongWord) : TBGRAPixel;

This item has no description.

Protected function GetNextBufferByte: byte;

This item has no description.

Protected function InternalCheck(Stream:TStream) : boolean; override;

This item has no description.

Protected function ShiftCount(Mask : LongWord) : shortint;

This item has no description.

Protected procedure CloseReadBuffer;

This item has no description.

Protected procedure ExpandRLE4ScanLine(Row : Integer; Stream : TStream);

This item has no description.

Protected procedure ExpandRLE8ScanLine(Row : Integer; Stream : TStream);

This item has no description.

Protected procedure ImageVerticalLoop(Stream:TStream; Img:TFPCustomImage; ReadProc, SkipProc: TReadScanlineProc; WriteProc: TWriteScanlineProc; ProgressProc: TProgressProc; var ShouldContinue: boolean);

This item has no description.

Protected procedure InitReadBuffer(AStream: TStream; ASize: integer);

This item has no description.

Protected procedure InternalRead(Stream:TStream; Img:TFPCustomImage); override;

required by TFPCustomImageReader

Protected procedure LoadMask(Stream:TStream; Img:TFPCustomImage; var ShouldContinue: boolean);

This item has no description.

Protected procedure MainProgressProc(Percent: integer; var ShouldContinue: boolean);

This item has no description.

Protected procedure MakeOpaque(Img: TFPCustomImage);

This item has no description.

Protected procedure ReadMaskLine(Row : Integer; Stream : TStream); virtual;

This item has no description.

Protected procedure ReadResolutionValues(Img: TFPCustomImage); virtual;

This item has no description.

Protected procedure ReadScanLine(Row : Integer; Stream : TStream); virtual;

This item has no description.

Protected procedure SetupRead(nPalette, nRowBits: Integer; Stream : TStream); virtual;

SetupRead will allocate the needed buffers, and read the colormap if needed.

Protected procedure SkipMaskLine(Row : Integer; Stream : TStream); virtual;

This item has no description.

Protected procedure SkipScanLine(Row : Integer; Stream : TStream); virtual;

This item has no description.

Protected procedure WriteMaskLine(Row : Integer; Img : TFPCustomImage); virtual;

This item has no description.

Protected procedure WriteScanLine(Row : Integer; Img : TFPCustomImage); virtual;

This item has no description.

Protected procedure WriteScanLineBGRA(Row : Integer; Img : TFPCustomImage); virtual;

This item has no description.

Properties

Public property OriginalHeight: integer read FOriginalHeight;

This item has no description.

Public property OutputHeight: integer read FOutputHeight;

This item has no description.

Public property TransparencyOption: TBMPTransparencyOption read FTransparencyOption write FTransparencyOption;

This item has no description.