2 Copyright 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Function to convert pixels from one pixfmt into another
9 #include "graphics_intern.h"
10 #include <proto/graphics.h>
11 #include <proto/oop.h>
13 #include <aros/debug.h>
15 /*****************************************************************************
19 AROS_LH9(ULONG
, ConvertPixelsA
,
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
),
33 struct GfxBase
*, GfxBase
, 199, Graphics
)
36 Convert pixels in pixel buffer srcPixels from srcPixFmt to
37 dstPixFmt putting result into pixel buffer dstPixels.
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
47 0 on failure (bad pixfmts), 1 on success.
62 *****************************************************************************/
66 OOP_Object
*srcpf
, *dstpf
, *bm
;
72 if (!SDD(GfxBase
)->gfxhidd
) return 0;
73 bm
= SDD(GfxBase
)->bm_bak
;
75 bm
= SDD(GfxBase
)->framebuffer
;
79 srcpf
= HIDD_Gfx_GetPixFmt(SDD(GfxBase
)->gfxhidd
, srcPixFmt
);
80 dstpf
= HIDD_Gfx_GetPixFmt(SDD(GfxBase
)->gfxhidd
, dstPixFmt
);
84 D(bug("graphics.library/ConvertPixelsA(): Bad source (%d) or dest (%d) pixfmt!\n", srcPixFmt
, dstPixFmt
));
88 HIDD_BM_ConvertPixels(bm
, &src
, srcpf
, srcMod
,
96 } /* ConvertPixelsA */