2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
11 #include "graphics_intern.h"
12 #include "gfxfuncsupport.h"
14 /****************************************************************************************/
17 struct rp8_render_data
21 HIDDT_PixelLUT
*pixlut
;
24 static ULONG
rp8_render(APTR rp8r_data
, WORD srcx
, WORD srcy
,
25 OOP_Object
*srcbm_obj
, OOP_Object
*gc
,
26 struct Rectangle
*rect
, struct GfxBase
*GfxBase
)
28 struct rp8_render_data
*rp8rd
= rp8r_data
;
29 WORD width
= rect
->MaxX
- rect
->MinX
+ 1;
30 WORD height
= rect
->MaxY
- rect
->MinY
+ 1;
32 HIDD_BM_GetImageLUT(srcbm_obj
, rp8rd
->array
+ CHUNKY8_COORD_TO_BYTEIDX(srcx
, srcy
, rp8rd
->modulo
), rp8rd
->modulo
,
33 rect
->MinX
, rect
->MinY
, width
, height
, rp8rd
->pixlut
);
35 return width
* height
;
38 /*****************************************************************************
41 #include <clib/graphics_protos.h>
43 AROS_LH7(LONG
, ReadPixelArray8
,
46 AROS_LHA(struct RastPort
* , rp
, A0
),
47 AROS_LHA(WORD
, xstart
, D0
),
48 AROS_LHA(WORD
, ystart
, D1
),
49 AROS_LHA(WORD
, xstop
, D2
),
50 AROS_LHA(WORD
, ystop
, D3
),
51 AROS_LHA(UBYTE
* , array
, A2
),
52 AROS_LHA(struct RastPort
* , temprp
, A1
),
55 struct GfxBase
*, GfxBase
, 130, Graphics
)
58 Read the pen numbers of a rectangular area into an array.
62 xstart,ystart - starting point
63 xstop,ystop - stopping point
64 array - array where pens are stored. Allocate at least
65 (((width+15)>>4)<<4)*(ystop-ystart+1) bytes.
66 temprp - temporary RastPort; copy of rp with
68 - temprp->BitMap with Rows set to 1,
69 - temprp->BytesPerRow set to (((width+15)>>4)<<1),
70 and temporary memory allocated for
71 temprp->BitMap->Planes[])
74 The number of pixels read.
77 This function doesn't make sense on true-/hicolor rastports.
88 27-11-96 digulla automatically created from
89 graphics_lib.fd and clib/graphics_protos.h
91 *****************************************************************************/
95 struct rp8_render_data rp8rd
;
97 HIDDT_PixelLUT pixlut
;
100 EnterFunc(bug("ReadPixelArray8(%p, %d, %d, %d, %d)\n",
101 rp
, xstart
, ystart
, xstop
, ystop
));
103 FIX_GFXCOORD(xstart
);
104 FIX_GFXCOORD(ystart
);
108 if ((xstart
> xstop
) || (ystart
> ystop
)) return 0;
110 /* FIXME: ReadPixelArray8 on hi/truecolor screens or
111 * a LUT for it does not really make sense
114 pixlut
.entries
= AROS_PALETTE_SIZE
;
115 pixlut
.pixels
= IS_HIDD_BM(rp
->BitMap
) ? HIDD_BM_PIXTAB(rp
->BitMap
) : NULL
;
118 rp8rd
.modulo
= ((xstop
- xstart
+ 1) + 15) & ~15;
119 rp8rd
.pixlut
= &pixlut
;
126 pixread
= do_render_func(rp
, NULL
, &rr
, rp8_render
, &rp8rd
, FALSE
, FALSE
, GfxBase
);
128 ReturnInt("ReadPixelArray8", LONG
, pixread
);
132 } /* ReadPixelArray8 */