home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_progs
/
prog_c
/
suplib.lzh
/
SUPLIB
/
DOC
/
BITMAP.DOC
< prev
next >
Wrap
Text File
|
1991-08-16
|
4KB
|
107 lines
BITMAP.DOC
(SUP32.LIB and DRES.LIBRARY)
MakeBitMap MakeBitMap
BOOL MakeBitMap(bm, depth, width, height, memflags)
BM *bm; D0 D1.B D2.W D3.W A0
char depth;
short width;
short height;
ulong memflags; /* used to allocate the planes */
Warning: If called from C you must pass all arguments as longs.
This call fills in the uninitialized BitMap structure by first
calling InitBitMap() and then allocating <depth> planes of
<width>x<height> each (the width is increased to the nearest word
boundry, modulo 16 bits).
The bitmap's planes are allocated using the memflags specified.
Normally one specifies: MEMF_CHIP|MEMF_PUBLIC|MEMF_CLEAR. You
must specify MEMF_CHIP if you wish to use graphics.library calls
on the bitmap or attach the bitmap to a rastport or use it in a
NewScreen or NewWindow structure.
RESULTS: 0 on failure, 1 on success. This call will failure if
insufficient memory exists to allocate all the planeptr's. In the
case of failure, any planeptr's already allocated will be freed and
their corrosponding array entries set to NULL.
FreeBitMap FreeBitMap
(void) FreeBitMap(bm)
BM *bm; D0
This call frees the memory associated with the PlanePtr[]s of a bitmap.
The PlanePtr[]s are freed and their array entries set to NULL. Any
PlanePtr[]s that were already NULL are ignored. PlanePtr[] entries are
scanned up to the bm->Depth and not beyond.
MakeRastPortBitMap MakeRastPortBitMap
BOOL MakeRastPortBitMap(rp, bm, depth, width, height, tmprassize, numai)
D0 D1 D2 D3 D4 D5 A0
RP *rp; pointer to UnInitialized RastPort structure
BM *bm; pointer to UnInitialized BitMap structure
long depth; depth of bitmap
long width; width in pixels (rounded to nearest word)
long height; height in pixels
long tmprassize; # bytes to allocate for rastport temporary raster
long numai; number of vectors for area info.
This call simply calls MakeBitMap() and if successful MakeRastPort().
If MakeRastPort() fails FreeBitMap() will be called before returning.
Thus, this is an all-or-nothing call. Note that you provide the
RastPort and BitMap structures.
The bitmap will be filled in according to specifications from CHIP_MEM.
The rastport will be filled in according to specifications and setup
with a temporary raster:
tmprassize == -1 Allocate a TmpRas structure and temporary
raster the size of one plane of the bitmap.
0 Do not allocate a TmpRas structure or raster
N Allocate a TmpRas structure and temporary
raster of size N bytes
numai == 0 Do not allocate an AreaInfo structure or vectors
N Allocate an AreaInfo and buffer space for N
vectors (5 bytes per vector).
RESULTS: 0 on failure, 1 on success. If successful the rastport
and bitmap will have been allocated and initialized with
the bitmap attached to the rastport. Beyond the defaults
for InitRastPort(), the APen will be set to 1 and the
DrMd to JAM2.
This is an all or nothing function. On failure, anything
already allocated is freed and their pointers set to NULL.
FreeRastPortBitMap FreeRastPortBitMap
(void) FreeRastPortBitMap(rp)
RP *rp; D0
This call frees the memory associated with the rastport and its
bitmap (if any). This call is a NOP if rp == NULL.
If a TmpRas exists the memory associated with the raster and the TmpRas
structure is freed. If an AreaInfo exists the memory associated with
the vector table and the AreaInfo structure is freed. TmpRas and
AreaInfo are set to NULL. If a BitMap exists the memory associated with
the BitMap's PlanePtr[]s is freed. PlanePtr[] entries are set to NULL.
The BitMap and RastPort structures themselves are not freed.
This call is equivalent to calling FreeRastPort() and then FreeBitMap().