added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / rom / graphics / convertpixelsa.c
blob229819e170dece46e2cacd3d1d21a65eeca455f8
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Function to convert pixels from one pixfmt into another
6 Lang: english
7 */
9 #include "graphics_intern.h"
10 #include <proto/graphics.h>
11 #include <proto/oop.h>
13 #include <aros/debug.h>
15 /*****************************************************************************
17 NAME */
19 AROS_LH9(ULONG, ConvertPixelsA,
21 /* SYNOPSIS */
22 AROS_LHA(APTR, srcPixels, A0),
23 AROS_LHA(ULONG, srcMod, D0),
24 AROS_LHA(ULONG, srcPixFmt, D1),
25 AROS_LHA(APTR, dstPixels, A1),
26 AROS_LHA(ULONG, dstMod, D2),
27 AROS_LHA(ULONG, dstPixFmt, D3),
28 AROS_LHA(ULONG, width, D4),
29 AROS_LHA(ULONG, height, D5),
30 AROS_LHA(struct TagItem *, tags, A2),
32 /* LOCATION */
33 struct GfxBase *, GfxBase, 199, Graphics)
35 /* FUNCTION
36 Convert pixels in pixel buffer srcPixels from srcPixFmt to
37 dstPixFmt putting result into pixel buffer dstPixels.
39 INPUTS
40 srcPixels, dstPixels - Pointer to source/dest pixel buffer
41 srcPixFmt, dstPixFmt - One of the truecolor vHidd_StdPixFmt_#?
42 srcMod, dstMod - Modulo for src/dest pixel buffer
43 width, height - size of area to convert
44 tags - none defined yet
46 RESULT
47 0 on failure (bad pixfmts), 1 on success.
49 NOTES
51 EXAMPLE
53 BUGS
55 SEE ALSO
56 <hidd/graphics.h>
58 INTERNALS
60 HISTORY
62 *****************************************************************************/
64 AROS_LIBFUNC_INIT
66 OOP_Object *srcpf, *dstpf;
67 APTR src = srcPixels;
68 APTR dst = dstPixels;
70 (void)tags;
72 if (!SDD(GfxBase)->gfxhidd) return 0;
74 srcpf = HIDD_Gfx_GetPixFmt(SDD(GfxBase)->gfxhidd, srcPixFmt);
75 dstpf = HIDD_Gfx_GetPixFmt(SDD(GfxBase)->gfxhidd, dstPixFmt);
77 if (!srcpf || !dstpf)
79 D(bug("graphics.library/ConvertPixelsA(): Bad source (%d) or dest (%d) pixfmt!\n", srcPixFmt, dstPixFmt));
80 return 0;
83 HIDD_BM_ConvertPixels(SDD(GfxBase)->framebuffer, &src, srcpf, srcMod,
84 &dst, dstpf, dstMod,
85 width, height, NULL);
87 return 1;
89 AROS_LIBFUNC_EXIT
91 } /* ConvertPixelsA */