2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include "gfxfuncsupport.h"
12 struct rp8_render_data
16 HIDDT_PixelLUT
*pixlut
;
19 static ULONG
rp8_render(APTR rp8r_data
, LONG srcx
, LONG srcy
,
20 OOP_Object
*srcbm_obj
, OOP_Object
*gc
,
21 LONG x1
, LONG y1
, LONG x2
, LONG y2
,
22 struct GfxBase
*GfxBase
);
24 /*****************************************************************************
27 #include <clib/graphics_protos.h>
29 AROS_LH7(LONG
, ReadPixelArray8
,
32 AROS_LHA(struct RastPort
* , rp
, A0
),
33 AROS_LHA(LONG
, xstart
, D0
),
34 AROS_LHA(LONG
, ystart
, D1
),
35 AROS_LHA(LONG
, xstop
, D2
),
36 AROS_LHA(LONG
, ystop
, D3
),
37 AROS_LHA(UBYTE
* , array
, A2
),
38 AROS_LHA(struct RastPort
* , temprp
, A1
),
41 struct GfxBase
*, GfxBase
, 130, Graphics
)
44 Read the pen numbers of a rectangular area into an array.
48 xstart,ystart - starting point
49 xstop,ystop - stopping point
50 array - array where pens are stored. Allocate at least
51 (((width+15)>>4)<<4)*(ystop-ystart+1) bytes.
52 temprp - temporary RastPort; copy of rp with
54 - temprp->BitMap with Rows set to 1,
55 - temprp->BytesPerRow set to (((width+15)>>4)<<1),
56 and temporary memory allocated for
57 temprp->BitMap->Planes[])
60 The number of pixels read.
63 This function doesn't make sense on true-/hicolor rastports.
74 27-11-96 digulla automatically created from
75 graphics_lib.fd and clib/graphics_protos.h
77 *****************************************************************************/
81 struct rp8_render_data rp8rd
;
83 HIDDT_PixelLUT pixlut
;
86 EnterFunc(bug("ReadPixelArray8(%p, %d, %d, %d, %d)\n",
87 rp
, xstart
, ystart
, xstop
, ystop
));
94 if ((xstart
> xstop
) || (ystart
> ystop
)) return 0;
96 if (!OBTAIN_DRIVERDATA(rp
, GfxBase
))
99 #warning "ReadPixelArray8 on hi/truecolor screens or a LUT for it does not really make sense"
101 pixlut
.entries
= AROS_PALETTE_SIZE
;
102 pixlut
.pixels
= IS_HIDD_BM(rp
->BitMap
) ? HIDD_BM_PIXTAB(rp
->BitMap
) : NULL
;
105 rp8rd
.modulo
= ((xstop
- xstart
+ 1) + 15) & ~15;
106 rp8rd
.pixlut
= &pixlut
;
113 pixread
= do_render_func(rp
, NULL
, &rr
, rp8_render
, &rp8rd
, FALSE
, FALSE
, GfxBase
);
115 RELEASE_DRIVERDATA(rp
, GfxBase
);
117 ReturnInt("ReadPixelArray8", LONG
, pixread
);
121 } /* ReadPixelArray8 */
123 /****************************************************************************************/
125 static ULONG
rp8_render(APTR rp8r_data
, LONG srcx
, LONG srcy
,
126 OOP_Object
*srcbm_obj
, OOP_Object
*gc
,
127 LONG x1
, LONG y1
, LONG x2
, LONG y2
,
128 struct GfxBase
*GfxBase
)
130 struct rp8_render_data
*rp8rd
;
133 rp8rd
= (struct rp8_render_data
*)rp8r_data
;
136 height
= y2
- y1
+ 1;
138 HIDD_BM_GetImageLUT(srcbm_obj
139 , rp8rd
->array
+ CHUNKY8_COORD_TO_BYTEIDX(srcx
, srcy
, rp8rd
->modulo
)
146 return width
* height
;
149 /****************************************************************************************/