r4493@vps: verhaegs | 2007-04-19 14:44:00 -0400
[AROS.git] / rom / graphics / setrgbconversionfunctiona.c
blobf34c9f40dcafed92b8a7a52b9be14eebd6972ea9
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Function to replace pixel conversion routine
6 Lang: english
7 */
9 #include "graphics_intern.h"
10 #include <proto/graphics.h>
11 #include <proto/oop.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH4(APTR, SetRGBConversionFunctionA,
19 /* SYNOPSIS */
20 AROS_LHA(ULONG, srcPixFmt, D0),
21 AROS_LHA(ULONG, dstPixFmt, D1),
22 AROS_LHA(APTR, function, A0),
23 AROS_LHA(struct TagItem *, tags, A1),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 198, Graphics)
28 /* FUNCTION
29 Replace RGB pixel conversion routine used for converting from
30 srcPixFmt to dstPixFmt.
32 INPUTS
33 srcPixFmt, dstPixFmt - One of the truecolor vHidd_StdPixFmt_#?
34 function - function of type HIDDT_RGBConversionFunction
35 tags - none defined yet
37 RESULT
38 Previous conversion routine or (APTR)-1 on failure (bad value
39 for srcPixFmt and/or dstPixFmt)
41 NOTES
42 The conversion function must return 1 if it did the conversion,
43 or 0 if for whatever reason it did not do it or want to do it.
44 Then the fallback pixel conversion routine will be used.
46 EXAMPLE
47 See AROS/test/patchrgbconv.c
49 BUGS
51 SEE ALSO
52 <hidd/graphics.h>
54 INTERNALS
56 HISTORY
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
61 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
63 (void)tags;
65 return (APTR)HIDD_BM_SetRGBConversionFunction(SDD(GfxBase)->framebuffer,
66 (HIDDT_StdPixFmt)srcPixFmt,
67 (HIDDT_StdPixFmt)dstPixFmt,
68 (HIDDT_RGBConversionFunction)function);
70 AROS_LIBFUNC_EXIT
72 } /* SetRGBConversionFunctionA */