diff options
author | Christian A. Weber <chris@gna.ch> | 1992-05-12 22:26:12 +0000 |
---|---|---|
committer | Christian A. Weber <chris@gna.ch> | 1992-05-12 22:26:12 +0000 |
commit | 36c824864c02f0a3f62c8a1d365d1670835c8c96 (patch) | |
tree | f3f433e4af522925d4c91f56865d38efaf83a456 /Source/SaveBitMap.S | |
download | iff-library-36c824864c02f0a3f62c8a1d365d1670835c8c96.tar.gz iff-library-36c824864c02f0a3f62c8a1d365d1670835c8c96.tar.bz2 iff-library-36c824864c02f0a3f62c8a1d365d1670835c8c96.zip |
Initial revision
Diffstat (limited to 'Source/SaveBitMap.S')
-rw-r--r-- | Source/SaveBitMap.S | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/Source/SaveBitMap.S b/Source/SaveBitMap.S new file mode 100644 index 0000000..15607c3 --- /dev/null +++ b/Source/SaveBitMap.S @@ -0,0 +1,82 @@ +** +** $Id: $ +** $Revision: $ +** +** $Filename: SaveBitMap.S $ +** $Author: Christian A. Weber $ +** $Release: 19.1 $ +** $Date: 92/05/11 21:11:27 $ +** +** iff.library/IFFLib_SaveBitMap +** +** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2, +** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART +** OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, OR TRANSMITTED +** IN ANY FORM OR BY ANY MEANS, WITHOUT THE PRIOR WRITTEN PER- +** MISSION OF THE AUTHOR. USE AT YOUR OWN RISK. +** + + + IDNT IFFLib_SaveBitMap + SECTION text,CODE + + INCLUDE "IFFLib.i" + + XREF SaveClipFunc + XDEF SaveBitMapFunc + + +******* iff.library/IFFLib_SaveBitMap *************************************** +* +* NAME +* IFFLib_SaveBitMap -- save the planes of a BitMap as an IFF-file +* +* SYNOPSIS +* result = IFFLib_SaveBitMap( filename, bitmap, colortable, flags ) +* D0 A0 A1 A2 D0 +* +* BOOL IFFLib_SaveBitMap(char *, struct BitMap *, UWORD *, ULONG ) +* +* FUNCTION +* Save the planes of a BitMap as an IFF-file, optionally with a +* colortable. The IFF file will contain the following chunks: +* +* FORM - The IFF header, with the type ILBM +* BMHD - The BitMap Header structre +* CMAP - The color map, this chunk is omitted if colortable is zero +* CAMG - The Amiga ViewModes word, contains the special ViewModes +* information (HAM, LACE, HIRES ...) +* BODY - The (crunched or uncompressed) picture +* +* INPUTS +* filename - Name of the IFF file to create +* bitmap - Pointer to the BitMap holding your picture +* colortable - Pointer to an Amiga ColorTable structure or zero +* (if colortable = 0, no CMAP chunk will be generated). +* flags - Bit 0: 1 = Use the "CmpByteRun1" compression algorythm, +* 0 = Save the file uncompressed +* Bit 7: 1 = This is a HAM (Hold and modify) picture +* 0 = This is a normal or Extra-Halfbrite picture +* +* RESULT +* Non-zero if successful, 0 if error, Call IFFLib_IFFError() to know +* more about the reason of the failure +* +* NOTE +* This routine needs 620 bytes of stack space +* +* SEE ALSO +* SaveClip +* +***************************************************************************** + +SaveBitMapFunc: movem.l d2-d4,-(SP) + moveq #0,d1 ; X-Offset : 0 + moveq #0,d2 ; Y-Offset : 0 + move.w bm_BytesPerRow(a1),d3 ; Breite : maximal + move.w bm_Rows(a1),d4 ; Höhe : maximal + bsr SaveClipFunc ; als Ausschnitt speichern + movem.l (SP)+,d2-d4 + rts + + END |