/*
    Copyright (C) 2013-2017, The AROS Development Team. All rights reserved.
*/

#include <exec/types.h>
#include <hidd/gfx.h>

#include "colorconv/rgbconv_macros.h"
#include "colorconv/rgbconv_rgbswap.h"

#define UNUSED(a,b) static ULONG __attribute__((unused)) convert_ ## a ## _ ## b ## _generic \
    (APTR srcPixels, ULONG srcMod, HIDDT_StdPixFmt srcPixFmt, \
    APTR dstPixels, ULONG dstMod, HIDDT_StdPixFmt dstPixFmt, \
    UWORD width, UWORD height);

UNUSED(RGB16,RGB15)    UNUSED(RGB16,BGR16)    UNUSED(RGB16,BGR15)    /* -- */
UNUSED(RGB16,BGRA32)   UNUSED(RGB16,RGBA32)   UNUSED(RGB16,ABGR32)   UNUSED(RGB16,RGB24)
UNUSED(RGB16,BGR24)    UNUSED(RGB16,RGB16OE)  UNUSED(RGB16,RGB15OE)  UNUSED(RGB16,BGR16OE)
UNUSED(RGB16,BGR15OE)  UNUSED(RGB16,XRGB32)   UNUSED(RGB16,BGRX32)   UNUSED(RGB16,RGBX32)
UNUSED(RGB16,XBGR32)

UNUSED(BGRA32,RGB16)   UNUSED(BGRA32,BGR16)   UNUSED(BGRA32,RGB15)   UNUSED(BGRA32,BGR15)
/* -- */               UNUSED(BGRA32,RGBA32)  UNUSED(BGRA32,ABGR32)  UNUSED(BGRA32,RGB24)
UNUSED(BGRA32,BGR24)   UNUSED(BGRA32,RGB16OE) UNUSED(BGRA32,BGR16OE) UNUSED(BGRA32,RGB15OE)
UNUSED(BGRA32,BGR15OE) UNUSED(BGRA32,XRGB32)  UNUSED(BGRA32,BGRX32)  UNUSED(BGRA32,RGBX32)
UNUSED(BGRA32,XBGR32)

/* -- */               UNUSED(ARGB32,BGR16)   UNUSED(ARGB32,RGB15)   UNUSED(ARGB32,BGR15)
/* -- */               UNUSED(ARGB32,RGBA32)  UNUSED(ARGB32,ABGR32)  UNUSED(ARGB32,RGB24)
UNUSED(ARGB32,BGR24)   UNUSED(ARGB32,RGB16OE) UNUSED(ARGB32,BGR16OE) UNUSED(ARGB32,RGB15OE)
UNUSED(ARGB32,BGR15OE) UNUSED(ARGB32,XRGB32)  UNUSED(ARGB32,BGRX32)  UNUSED(ARGB32,RGBX32)
UNUSED(ARGB32,XBGR32)

#include "colorconv/rgbconv_argb32.h"
#include "colorconv/rgbconv_bgra32.h"
#include "colorconv/rgbconv_rgb16.h"

#define SCCF(SRCPIXFMT, DSTPIXFMT) \
    rgbconvertfuncs[FMT_##SRCPIXFMT - FIRST_RGB_STDPIXFMT][FMT_##DSTPIXFMT - FIRST_RGB_STDPIXFMT] = convert_##SRCPIXFMT##_##DSTPIXFMT##_generic;

void SetRGBConversionFunctions(HIDDT_RGBConversionFunction rgbconvertfuncs[NUM_RGB_STDPIXFMT][NUM_RGB_STDPIXFMT])
{
    /* Include only those conversions to save ROM space */

    SCCF(ARGB32,RGB16 )
    SCCF(ARGB32,BGRA32)
    SCCF(BGRA32,ARGB32)
    SCCF(RGB16 ,ARGB32)
}
