Unit BGRABlend

Classes, Interfaces, Objects and Records
Types
Constants
Variables

Description

Pixel blending functions for 32-bit BGRA/RGBA.

Pixel functions take a destination adress as parameter and draw pixels at this address with different blending modes. These functions are used by many functions/classes in BGRABitmap library.

Uses

Overview

Functions and Procedures

procedure AddPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure AlphaFillInline(dest: PBGRAPixel; alpha: byte; Count: integer); inline;
function ApplyOpacity(opacity1,opacity2: byte): byte; inline;
procedure BGRAAlphaBrush(out ABrush: TUniversalBrush; AAlpha: Word);
procedure BGRAEraseBrush(out ABrush: TUniversalBrush; AAlpha: Word);
procedure BGRAFillClearTypeMask(dest: TBGRACustomBitmap; x,y: integer; xThird: integer; mask: TBGRACustomBitmap; color: TBGRAPixel; texture: IBGRAScanner; RGBOrder: boolean);
procedure BGRAFillClearTypeMaskPtr(dest: TBGRACustomBitmap; x,y: integer; xThird: integer; maskData: PByte; maskPixelSize: Int32or64; maskRowSize: Int32or64; maskWidth,maskHeight: integer; color: TBGRAPixel; texture: IBGRAScanner; RGBOrder: boolean);
procedure BGRAFillClearTypeRGBMask(dest: TBGRACustomBitmap; x, y: integer; mask: TBGRACustomBitmap; color: TBGRAPixel; texture: IBGRAScanner; KeepRGBOrder: boolean);
procedure BGRAMaskBrush(out ABrush: TUniversalBrush; AScanner: IBGRAScanner; AOffsetX: integer = 0; AOffsetY: integer = 0);
procedure BGRAScannerBrush(out ABrush: TUniversalBrush; AScanner: IBGRAScanner; ADrawMode: TDrawMode = dmDrawWithTransparency; AOffsetX: integer = 0; AOffsetY: integer = 0);
procedure BGRASolidBrushIndirect(out ABrush: TUniversalBrush; AColor: Pointer; ADrawMode: TDrawMode = dmDrawWithTransparency);
procedure BlendMaskPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure BlendPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; blendOp: TBlendOperation; Count: integer; excludeChannels: TChannels = []);
procedure BlendPixelsOver(pdest: PBGRAPixel; psrc: PBGRAPixel; blendOp: TBlendOperation; Count: integer; opacity: byte; linearBlend: boolean = false; excludeChannels: TChannels = []);
procedure BlendXorPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure ClearTypeDrawPixel(pdest: PBGRAPixel; Cr, Cg, Cb: byte; Color: TBGRAPixel); inline;
procedure ColorBurnPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure ColorDodgePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure CopyPixelsWithOpacity(dest,src: PBGRAPixel; opacity: byte; Count: integer); inline;
procedure CorrectedColorInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure CorrectedHueInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure CorrectedLightnessInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure CorrectedSaturationInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure DarkenPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure DifferencePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure DividePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure DrawExpandedPixelInlineNoAlphaCheck(dest: PBGRAPixel; const ec: TExpandedPixel; calpha: byte); inline; overload;
procedure DrawExpandedPixelInlineWithAlphaCheck(dest: PBGRAPixel; const ec: TExpandedPixel); inline; overload;
procedure DrawExpandedPixelsInline(dest: PBGRAPixel; ec: TExpandedPixel; Count: integer); inline; overload;
procedure DrawPixelInlineDiff(dest: PBGRAPixel; c, compare: TBGRAPixel; maxDiff: byte); inline;
procedure DrawPixelInlineExpandedOrNotWithAlphaCheck(dest: PBGRAPixel; const ec: TExpandedPixel; c: TBGRAPixel); inline; overload;
procedure DrawPixelInlineNoAlphaCheck(dest: PBGRAPixel; const c: TBGRAPixel); inline; overload;
procedure DrawPixelInlineWithAlphaCheck(dest: PBGRAPixel; c: TBGRAPixel; appliedOpacity: byte); inline; overload;
procedure DrawPixelInlineWithAlphaCheck(dest: PBGRAPixel; const c: TBGRAPixel); inline; overload;
procedure DrawPixelsInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline; overload;
procedure DrawPixelsInlineDiff(dest: PBGRAPixel; c: TBGRAPixel; Count: integer; compare: TBGRAPixel; maxDiff: byte); inline;
procedure DrawPixelsInlineExpandedOrNot(dest: PBGRAPixel; ec: TExpandedPixel; c: TBGRAPixel; Count: integer); inline; overload;
procedure ErasePixelInline(dest: PBGRAPixel; alpha: byte); inline;
procedure ExclusionPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure FastBlendPixelInline(dest: PBGRAPixel; const c: TBGRAPixel); inline; overload;
procedure FastBlendPixelInline(dest: PBGRAPixel; c: TBGRAPixel; appliedOpacity: byte); inline; overload;
procedure FastBlendPixelsInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline;
function FastRoundDiv255(value: LongWord): LongWord; inline;
procedure FillInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline;
procedure GlowPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure HardLightPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure InterpolateBilinear(pUpLeft,pUpRight,pDownLeft,pDownRight: PBGRAPixel; iFactX,iFactY: Integer; ADest: PBGRAPixel);
procedure InterpolateBilinearMask(pUpLeft,pUpRight,pDownLeft,pDownRight: PByteMask; iFactX,iFactY: Integer; ADest: PByteMask);
procedure LightenPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearAddPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearColorInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearDifferencePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearExclusionPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearHueInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearLightnessInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearMultiplyPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearMultiplySaturationInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearNegationPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearOverlayPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearSaturationInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearSubtractInversePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure LinearSubtractPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure NegationPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure NiceGlowPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure NonLinearReflectPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure OverlayPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure PutPixels(pdest: PBGRAPixel; psource: PBGRAPixel; copycount: integer; mode: TDrawMode; AOpacity:byte);
procedure ReflectPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure ScannerPutPixels(scan: IBGRAScanner; pdest: PBGRAPixel; count: integer; mode: TDrawMode);
procedure ScreenPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure SoftLightPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure SubtractInversePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure SubtractPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure SvgSoftLightPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;
procedure XorInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline;
procedure XorPixels(pdest, psrc: PBGRAPixel; count: integer);

Description

Functions and Procedures

procedure AddPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure AlphaFillInline(dest: PBGRAPixel; alpha: byte; Count: integer); inline;

Set alpha value for a series of pixels

function ApplyOpacity(opacity1,opacity2: byte): byte; inline;

This item has no description.

procedure BGRAAlphaBrush(out ABrush: TUniversalBrush; AAlpha: Word);

This item has no description.

procedure BGRAEraseBrush(out ABrush: TUniversalBrush; AAlpha: Word);

This item has no description.

procedure BGRAFillClearTypeMask(dest: TBGRACustomBitmap; x,y: integer; xThird: integer; mask: TBGRACustomBitmap; color: TBGRAPixel; texture: IBGRAScanner; RGBOrder: boolean);

This item has no description.

procedure BGRAFillClearTypeMaskPtr(dest: TBGRACustomBitmap; x,y: integer; xThird: integer; maskData: PByte; maskPixelSize: Int32or64; maskRowSize: Int32or64; maskWidth,maskHeight: integer; color: TBGRAPixel; texture: IBGRAScanner; RGBOrder: boolean);

This item has no description.

procedure BGRAFillClearTypeRGBMask(dest: TBGRACustomBitmap; x, y: integer; mask: TBGRACustomBitmap; color: TBGRAPixel; texture: IBGRAScanner; KeepRGBOrder: boolean);

This item has no description.

procedure BGRAMaskBrush(out ABrush: TUniversalBrush; AScanner: IBGRAScanner; AOffsetX: integer = 0; AOffsetY: integer = 0);

This item has no description.

procedure BGRAScannerBrush(out ABrush: TUniversalBrush; AScanner: IBGRAScanner; ADrawMode: TDrawMode = dmDrawWithTransparency; AOffsetX: integer = 0; AOffsetY: integer = 0);

This item has no description.

procedure BGRASolidBrushIndirect(out ABrush: TUniversalBrush; AColor: Pointer; ADrawMode: TDrawMode = dmDrawWithTransparency);

Brush providers

procedure BlendMaskPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure BlendPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; blendOp: TBlendOperation; Count: integer; excludeChannels: TChannels = []);

Perform advanced blending operation

procedure BlendPixelsOver(pdest: PBGRAPixel; psrc: PBGRAPixel; blendOp: TBlendOperation; Count: integer; opacity: byte; linearBlend: boolean = false; excludeChannels: TChannels = []);

Perform blending operation and merge over destination

procedure BlendXorPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure ClearTypeDrawPixel(pdest: PBGRAPixel; Cr, Cg, Cb: byte; Color: TBGRAPixel); inline;

This item has no description.

procedure ColorBurnPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure ColorDodgePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure CopyPixelsWithOpacity(dest,src: PBGRAPixel; opacity: byte; Count: integer); inline;

This item has no description.

procedure CorrectedColorInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure CorrectedHueInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure CorrectedLightnessInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure CorrectedSaturationInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure DarkenPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure DifferencePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure DividePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure DrawExpandedPixelInlineNoAlphaCheck(dest: PBGRAPixel; const ec: TExpandedPixel; calpha: byte); inline; overload;

This item has no description.

procedure DrawExpandedPixelInlineWithAlphaCheck(dest: PBGRAPixel; const ec: TExpandedPixel); inline; overload;

This item has no description.

procedure DrawExpandedPixelsInline(dest: PBGRAPixel; ec: TExpandedPixel; Count: integer); inline; overload;

This item has no description.

procedure DrawPixelInlineDiff(dest: PBGRAPixel; c, compare: TBGRAPixel; maxDiff: byte); inline;

Draw a pixel to the extent the current pixel is close enough to compare value. It should not be called on pixels that have not been checked to be close enough

procedure DrawPixelInlineExpandedOrNotWithAlphaCheck(dest: PBGRAPixel; const ec: TExpandedPixel; c: TBGRAPixel); inline; overload;

This item has no description.

procedure DrawPixelInlineNoAlphaCheck(dest: PBGRAPixel; const c: TBGRAPixel); inline; overload;

alpha in 'c' parameter

procedure DrawPixelInlineWithAlphaCheck(dest: PBGRAPixel; c: TBGRAPixel; appliedOpacity: byte); inline; overload;

This item has no description.

procedure DrawPixelInlineWithAlphaCheck(dest: PBGRAPixel; const c: TBGRAPixel); inline; overload;

Draw one pixel with alpha blending

procedure DrawPixelsInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline; overload;

This item has no description.

procedure DrawPixelsInlineDiff(dest: PBGRAPixel; c: TBGRAPixel; Count: integer; compare: TBGRAPixel; maxDiff: byte); inline;

Draw a series of pixel to the extent the current pixel is close enough to compare value

procedure DrawPixelsInlineExpandedOrNot(dest: PBGRAPixel; ec: TExpandedPixel; c: TBGRAPixel; Count: integer); inline; overload;

This item has no description.

procedure ErasePixelInline(dest: PBGRAPixel; alpha: byte); inline;

Erase a series of pixels, i.e. decrease alpha value

procedure ExclusionPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure FastBlendPixelInline(dest: PBGRAPixel; const c: TBGRAPixel); inline; overload;

Draw one pixel with linear alpha blending

procedure FastBlendPixelInline(dest: PBGRAPixel; c: TBGRAPixel; appliedOpacity: byte); inline; overload;

This item has no description.

procedure FastBlendPixelsInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline;

Draw a series of pixels with linear alpha blending

function FastRoundDiv255(value: LongWord): LongWord; inline;

This item has no description.

procedure FillInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline;

Replace a series of pixels

procedure GlowPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure HardLightPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure InterpolateBilinear(pUpLeft,pUpRight,pDownLeft,pDownRight: PBGRAPixel; iFactX,iFactY: Integer; ADest: PBGRAPixel);

This item has no description.

procedure InterpolateBilinearMask(pUpLeft,pUpRight,pDownLeft,pDownRight: PByteMask; iFactX,iFactY: Integer; ADest: PByteMask);

This item has no description.

procedure LightenPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearAddPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearColorInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearDifferencePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearExclusionPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearHueInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearLightnessInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearMultiplyPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

layer blend modes

procedure LinearMultiplySaturationInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearNegationPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearOverlayPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearSaturationInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearSubtractInversePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure LinearSubtractPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure NegationPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure NiceGlowPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure NonLinearReflectPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure OverlayPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure PutPixels(pdest: PBGRAPixel; psource: PBGRAPixel; copycount: integer; mode: TDrawMode; AOpacity:byte);

Draw a series of pixels with alpha blending

procedure ReflectPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure ScannerPutPixels(scan: IBGRAScanner; pdest: PBGRAPixel; count: integer; mode: TDrawMode);

Blend pixels with scanner content

procedure ScreenPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure SoftLightPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure SubtractInversePixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure SubtractPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure SvgSoftLightPixelInline(dest: PBGRAPixel; c: TBGRAPixel); inline;

This item has no description.

procedure XorInline(dest: PBGRAPixel; c: TBGRAPixel; Count: integer); inline;

Xor a series of pixels

procedure XorPixels(pdest, psrc: PBGRAPixel; count: integer);

This item has no description.