#ifndef COLOURSPACE_H
#define COLOURSPACE_H

#include <cassert>
#ifndef NDEBUG
#include <iostream>
#endif
#include "colour_sensitivity.h"

namespace mimas {

/** @addtogroup imageIO
    @{ */
/** @defgroup colourspace Fast colourspace transformations
    Mimas provides several fast algorithms for converting from different
    YUV formats to RGBA- and grey-level images. There also is a transformation
    from RGBA to the YV12 format.

    The methods are used internally by the image-I/O classes.

    See <A HREF="http://www.fourcc.org/yuv.php">http://www.fourcc.org/yuv.php</A> and
    <A HREF="http://www.fourcc.org/fccyvrgb.php">http://www.fourcc.org/fccyvrgb.php</A>
    for more information on colourspaces.
    @see imageIO
    @author Bala Amavasai (bpa@amavasai.org)
    @author Jan Wedekind (jan@wedesoft.de)
    @date Fri Jan 10 15:53:56 UTC 2006
    @{ */
/** Colour conversion from RGB to RGBA.
    Adding A-byte to RGB.
    @param in Input RGB data (8 bit)
    @param width Width of input image
    @param height Height of input image
    @param out Pointer to store RGBA data in
    @author Jan Wedekind (jan@wedesoft.de)
    @date Fri Jan 10 11:40:53 UTC 2006 */
void rgb_to_rgba( const char *in, int width, int height, char *out );

/** Colour conversion from YV12 to RGBA.
    Colourspace transformation from YV12 to RGBA.
    @param in Input YV12 data (8 bit)
    @param width Width of input image
    @param height Height of input image
    @param out Pointer to store RGBA data in
    @author Jan Wedekind (jan@wedesoft.de)
    @date Fri Jan 10 11:40:53 UTC 2006 */
void yv12_to_rgba( const char *in, int width, int height, char *out );

/** Colour conversion from YUV420p to RGBA.
    Colourspace transformation from YUV420p to RGBA.
    @param in Input YUV420p data (8 bit)
    @param width Width of input image
    @param height Height of input image
    @param out Pointer to store RGBA data in
    @author Bala Amavasai (bpa@amavasai.org)
    @date Fri Jan 10 18:37:08 UTC 2006 */
void yuv420p_to_rgba( const char *in, int width, int height, char *out );

/** Colour conversion from RGBA to YV12.
    Colourspace transformation from RGBA to YV12.
    @param in Input RGBA data (8 bit)
    @param width Width of input image
    @param height Height of input image
    @param out Pointer to store YV12 data in
    @author Jan Wedekind (jan@wedesoft.de)
    @date Fri Jan 10 11:40:53 UTC 2006 */
void rgba_to_yv12( const char *in, int width, int height, char *out );

/** Colour conversion from UYVY to RGBA.
    Colourspace transformation from UYVY to RGBA.
    @param in Input UYVY data (8 bit)
    @param width Width of input image
    @param height Height of input image
    @param out Pointer to store RGBA data in
    @author Jan Wedekind (jan@wedesoft.de)
    @date Fri Jan 10 11:40:53 UTC 2006 */
void uyvy_to_rgba( const char *in, int width, int height, char *out );

/** Colour conversion from YUY2 to RGBA.
    Colourspace transformation from YUY2 to RGBA.
    @param in Input YUY2 data (8 bit)
    @param width Width of input image
    @param height Height of input image
    @param out Pointer to store RGBA data in
    @author Jan Wedekind (jan@wedesoft.de)
    @date Fri Jan 10 11:40:53 UTC 2006 */
void yuy2_to_rgba( const char *in, int width, int height, char *out );

///@}

///@}

};

#endif