Unit 'agraphics' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#aros]

BltBitMap

Move a rectangular region of bits in a BitMap.

Declaration

Source position: agraphics.pas line 2047

function BltBitMap(

  const SrcBitMap: PBitMap;

  xSrc: LongInt;

  ySrc: LongInt;

  DestBitMap: PBitMap;

  xDest: LongInt;

  yDest: LongInt;

  xSize: LongInt;

  ySize: LongInt;

  MinTerm: LongWord;

  Mask: LongWord;

  TempA: PByte

):LongInt;

Arguments

SrcBitMap

  

Copy from this bitmap. as a special case, if a plane pointer in the SrcBitMap is nil, it acts as a pointer to a plane of all zeros, and if the plane pointer is $ffffffff, it acts as a pointer to a plane of all ones.

xSrc

  

Top Left corner of the Source rectangle

ySrc

  

Valid range is positive signed integer such that the raster word's offset 0..(32767-Size)

DestBitMap

  

Copy to this bitmap. May be the same as srcBitMap.

xDest

  

the x and y coordinates of the upper left corner of the destination for the rectangle.

yDest

  

Valid range is as for Src.

xSize

  

The size of the rectangle to be moved.

ySize

  

Valid range is (X: 1..976; Y: 1..1023 such that final raster word's offset is 0..32767)

MinTerm

  

See description

Mask

  

the write mask to apply to this operation. Bits set indicate the corresponding planes (if not greater than the minimum plane count) are to participate in the operation. Typically this is set to $ff.

TempA

  

If the copy overlaps exactly to the left or right (i.e. the scan line addresses overlap), and TempA is non-zero, it points to enough chip accessible memory to hold a line of A source for the blit (ie CHIP RAM). BltBitMap will allocate (and free) the needed TempA if none is provided and one is needed. Blit overlap is determined from the relation of the first non-masked planes in the source and destination bit maps.

Function result

The number of planes actually involved in the blit.

Description

Perform non-destructive blits to move a rectangle from one area in a BitMap to another area, which can be on a different BitMap. This blit is assumed to be friendly: no error conditions (e.g. a rectangle outside the BitMap bounds) are tested or reported.

If a special hardware is available, this function will use it.

MinTerm:

How to copy. Most useful values are 0x00C0 for a vanilla copy, 0x0030 to invert the source and then copy or 0x0050 to ignore the source and just invert the destination. If you want to calculate other values, then you must know that channel A is set, if you are inside the rectangle, channel B is the source and channel C is the destination of the rectangle.

Bit ABC
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111

So 0x00C0 means: D is set if one is inside the rectangle (A is set) and B (the source) is set and cleared otherwise.

To fill the rectangle, you would want to set D when A is set, so the value is 0x00F0.

See also

ClipBlit

  

Calls BltBitMap() after accounting for windows

BltBitMapRastPort

  

Blit from source bitmap to destination rastport.


Documentation generated on: 2021-07-30