2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Graphics function WritePixel()
9 #include <graphics/rastport.h>
10 #include <graphics/clip.h>
11 #include <proto/graphics.h>
13 #include "graphics_intern.h"
14 #include "gfxfuncsupport.h"
16 struct pix_render_data
21 static LONG
pix_write(APTR pr_data
, OOP_Object
*bm
, OOP_Object
*gc
,
22 LONG x
, LONG y
, struct GfxBase
*GfxBase
);
24 /*****************************************************************************
28 AROS_LH3(LONG
, WritePixel
,
31 AROS_LHA(struct RastPort
*, rp
, A1
),
32 AROS_LHA(LONG
, x
, D0
),
33 AROS_LHA(LONG
, y
, D1
),
36 struct GfxBase
*, GfxBase
, 54, Graphics
)
39 Change pen number of a pixel at given coordinate.
40 The pixel is drawn with the primary (A) pen.
43 rp - destination RastPort
47 0: pixel could be written
48 -1: coordinate was outside rastport
59 This function takes layers into account. Some pixel that is
60 being read is not found on the display-bitmap but in some
61 clipped rectangle (cliprect) in a layer structure.
62 There is no support of anything else than bitplanes now.
66 29-10-95 digulla automatically created from
67 graphics_lib.fd and clib/graphics_protos.h
69 *****************************************************************************/
73 struct pix_render_data prd
;
79 if(!OBTAIN_DRIVERDATA(rp
, GfxBase
))
82 prd
.pixel
= BM_PIXEL(rp
->BitMap
, (UBYTE
)rp
->FgPen
);
83 retval
= do_pixel_func(rp
, x
, y
, pix_write
, &prd
, TRUE
, GfxBase
);
85 RELEASE_DRIVERDATA(rp
, GfxBase
);
93 static LONG
pix_write(APTR pr_data
, OOP_Object
*bm
, OOP_Object
*gc
,
94 LONG x
, LONG y
, struct GfxBase
*GfxBase
)
96 struct pix_render_data
*prd
;
98 prd
= (struct pix_render_data
*)pr_data
;
100 HIDD_BM_PutPixel(bm
, x
, y
, prd
->pixel
);