some fixes to accented characters
[tangerine.git] / rom / graphics / convertpixelsa.c
blob7f1fcb036751f23f5d5c551fbc105621d4ae99c9
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, *bm;
67 APTR src = srcPixels;
68 APTR dst = dstPixels;
70 (void)tags;
72 if (!SDD(GfxBase)->gfxhidd) return 0;
73 bm = SDD(GfxBase)->bm_bak;
74 if (!bm)
75 bm = SDD(GfxBase)->framebuffer;
76 if (!bm)
77 return 0;
79 srcpf = HIDD_Gfx_GetPixFmt(SDD(GfxBase)->gfxhidd, srcPixFmt);
80 dstpf = HIDD_Gfx_GetPixFmt(SDD(GfxBase)->gfxhidd, dstPixFmt);
82 if (!srcpf || !dstpf)
84 D(bug("graphics.library/ConvertPixelsA(): Bad source (%d) or dest (%d) pixfmt!\n", srcPixFmt, dstPixFmt));
85 return 0;
88 HIDD_BM_ConvertPixels(bm, &src, srcpf, srcMod,
89 &dst, dstpf, dstMod,
90 width, height, NULL);
92 return 1;
94 AROS_LIBFUNC_EXIT
96 } /* ConvertPixelsA */