2 Copyright © 1995-2011, 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 static LONG
pix_write(APTR pr_data
, OOP_Object
*bm
, OOP_Object
*gc
,
17 LONG x
, LONG y
, struct GfxBase
*GfxBase
);
19 /*****************************************************************************
23 AROS_LH3(LONG
, WritePixel
,
26 AROS_LHA(struct RastPort
*, rp
, A1
),
27 AROS_LHA(LONG
, x
, D0
),
28 AROS_LHA(LONG
, y
, D1
),
31 struct GfxBase
*, GfxBase
, 54, Graphics
)
34 Change pen number of a pixel at given coordinate.
35 The pixel is drawn with the primary (A) pen.
38 rp - destination RastPort
42 0: pixel could be written
43 -1: coordinate was outside rastport
54 This function takes layers into account. Some pixel that is
55 being read is not found on the display-bitmap but in some
56 clipped rectangle (cliprect) in a layer structure.
57 There is no support of anything else than bitplanes now.
61 29-10-95 digulla automatically created from
62 graphics_lib.fd and clib/graphics_protos.h
64 *****************************************************************************/
73 pix
= BM_PIXEL(rp
->BitMap
, (UBYTE
)rp
->FgPen
);
75 return do_pixel_func(rp
, x
, y
, pix_write
, (APTR
)pix
, TRUE
, GfxBase
);
81 static LONG
pix_write(APTR pr_data
, OOP_Object
*bm
, OOP_Object
*gc
,
82 LONG x
, LONG y
, struct GfxBase
*GfxBase
)
84 HIDD_BM_PutPixel(bm
, x
, y
, (IPTR
)pr_data
);