2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
10 #include <proto/graphics.h>
11 #include <proto/oop.h>
13 #include "graphics_intern.h"
14 #include "gfxfuncsupport.h"
15 #include "graphics_driver.h"
17 /****************************************************************************************/
19 struct bltmask_render_data
21 struct render_special_info rsi
;
23 OOP_Object
*srcbm_obj
;
27 static ULONG
bltmask_render(APTR bltmask_rd
, WORD srcx
, WORD srcy
,
28 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
29 struct Rectangle
*rect
, struct GfxBase
*GfxBase
)
31 struct bltmask_render_data
*brd
= bltmask_rd
;
32 WORD width
= rect
->MaxX
- rect
->MinX
+ 1;
33 WORD height
= rect
->MaxY
- rect
->MinY
+ 1;
37 gfxhidd
= SelectDriverObject(brd
->srcbm
, dstbm_obj
, GfxBase
);
38 ok
= HIDD_Gfx_CopyBoxMasked(gfxhidd
, brd
->srcbm_obj
, srcx
, srcy
, dstbm_obj
, rect
->MinX
, rect
->MinY
, width
, height
, brd
->mask
, dst_gc
);
40 return ok
? width
* height
: 0;
43 /*****************************************************************************
46 #include <clib/graphics_protos.h>
48 AROS_LH10(void, BltMaskBitMapRastPort
,
51 AROS_LHA(struct BitMap
*, srcBitMap
, A0
),
52 AROS_LHA(WORD
, xSrc
, D0
),
53 AROS_LHA(WORD
, ySrc
, D1
),
54 AROS_LHA(struct RastPort
*, destRP
, A1
),
55 AROS_LHA(WORD
, xDest
, D2
),
56 AROS_LHA(WORD
, yDest
, D3
),
57 AROS_LHA(WORD
, xSize
, D4
),
58 AROS_LHA(WORD
, ySize
, D5
),
59 AROS_LHA(ULONG
, minterm
, D6
),
60 AROS_LHA(PLANEPTR
, bltMask
, A2
),
63 struct GfxBase
*, GfxBase
, 106, Graphics
)
66 Copies a part of a bitmap to another bitmap with using a mask.
69 srcBitMap - Copy from this bitmap.
70 xSrc, ySrc - This is the upper left corner of the area to copy.
71 destRP - Destination RastPort.
72 xDest, yDest - Upper left corner where to place the copy
73 xSize, ySize - The size of the area to copy
74 minterm - How to copy. See BltBitMap() for an explanation.
75 bltMask - The mask bitplane must be of the same size as the source bitmap.
98 27-11-96 digulla automatically created from
99 graphics_lib.fd and clib/graphics_protos.h
101 *****************************************************************************/
105 struct bltmask_render_data brd
;
110 EnterFunc(bug("BltMaskBitMapRastPort(%p (%d*%d), %d*%d, %p, %d*%d, %d*%d, %02x, %p)\n",
111 srcBitMap
, srcBitMap
->BytesPerRow
, srcBitMap
->Rows
, xSrc
, ySrc
,
112 destRP
, xDest
, yDest
, xSize
, ySize
, minterm
, bltMask
));
119 if ((xSize
< 1) || (ySize
< 1)) return;
121 brd
.srcbm_obj
= OBTAIN_HIDD_BM(srcBitMap
);
122 if (NULL
== brd
.srcbm_obj
)
127 brd
.srcbm
= srcBitMap
;
130 gc
= GetDriverData(destRP
, GfxBase
);
131 GC_DRMD(gc
) = MINTERM_TO_GCDRMD(minterm
);
135 rr
.MaxX
= xDest
+ xSize
- 1;
136 rr
.MaxY
= yDest
+ ySize
- 1;
141 do_render_with_gc(destRP
, &src
, &rr
, bltmask_render
, &brd
, gc
, TRUE
, TRUE
, GfxBase
);
143 RELEASE_HIDD_BM(brd
.srcbm_obj
, srcBitMap
);
144 ReturnVoid("BltBitMapRastPort");
148 } /* BltMaskBitMapRastPort */