Minor fixes to comments.
[AROS.git] / rom / graphics / writepixel.c
blobb6527c32e9ae0deac64c809a397b68b246d79a83
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$ $Log
5 Desc: Graphics function WritePixel()
6 Lang: english
7 */
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 WORD x, WORD y, struct GfxBase *GfxBase);
19 /*****************************************************************************
21 NAME */
23 AROS_LH3(LONG, WritePixel,
25 /* SYNOPSIS */
26 AROS_LHA(struct RastPort *, rp, A1),
27 AROS_LHA(WORD , x, D0),
28 AROS_LHA(WORD , y, D1),
30 /* LOCATION */
31 struct GfxBase *, GfxBase, 54, Graphics)
33 /* FUNCTION
34 Change pen number of a pixel at given coordinate.
35 The pixel is drawn with the primary (A) pen.
37 INPUTS
38 rp - destination RastPort
39 x,y - coordinate
41 RESULT
42 0: pixel could be written
43 -1: coordinate was outside rastport
45 NOTES
47 EXAMPLE
49 BUGS
51 SEE ALSO
53 INTERNALS
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.
58 (No chunky pixels)
60 HISTORY
61 29-10-95 digulla automatically created from
62 graphics_lib.fd and clib/graphics_protos.h
64 *****************************************************************************/
66 AROS_LIBFUNC_INIT
68 IPTR pix;
70 FIX_GFXCOORD(x);
71 FIX_GFXCOORD(y);
73 pix = BM_PIXEL(rp->BitMap, (UBYTE)rp->FgPen);
75 return do_pixel_func(rp, x, y, pix_write, (APTR)pix, TRUE, GfxBase);
77 AROS_LIBFUNC_EXIT
78 } /* WritePixel */
81 static LONG pix_write(APTR pr_data, OOP_Object *bm, OOP_Object *gc,
82 WORD x, WORD y, struct GfxBase *GfxBase)
84 HIDD_BM_PutPixel(bm, x, y, (IPTR)pr_data);
86 return 0;