/*---------------------------------------------------------------------------*/
/* video_format_conversion.h                                                 */
/* copyright (c) innovaphone 2020                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

class IVideoFormatConversion {
public:
    static void RGB24ToYUY2(unsigned char* dest, int destStride, const unsigned char* src, int srcStride, int width, int height, bool flip);
    static void RGB32ToYUY2(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void NV12ToYUY2(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void NV12ToRGB32(unsigned char* dest, int destStride, const unsigned char* src, int srcStride, int width, int height, bool flip);
    static void I420ToYUY2(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void YV12ToYUY2(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);

    static void RGB24ToYUV(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void RGB32ToYUV(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void ARGBToYUV(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void RGBAToYUV(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void NV12ToYUV(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void YUY2ToYUV(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);
    static void YUY2ToRGB32(unsigned char* dest, int destStride, const unsigned char* src, int srcStride, int width, int height, bool flip);
    static void YV12ToYUV(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);

    static void YUVToRGB32(unsigned char * dest, int destStride, const unsigned char * src, int srcStride, int width, int height, bool flip);

    static void TransformImage_RGB24(unsigned char* pDest, int lDestStride, const unsigned char * pSrc, int lSrcStride, int dwWidthInPixels, int dwHeightInPixels, bool flip);
    static void TransformImage_RGB32(unsigned char* pDest, int lDestStride, const unsigned char * pSrc, int lSrcStride, int dwWidthInPixels, int dwHeightInPixels, bool flip);

    static void ScaleRGB24ToYUV(unsigned char* dest, int destStride, int destWidth, int destHeight, const unsigned char* src, int srcStride, int width, int height);
    static void ScaleRGB32ToYUV(unsigned char* dest, int destStride, int destWidth, int destHeight, const unsigned char* src, int srcStride, int width, int height);
    static void ScaleYUY2ToYUV(unsigned char* dest, int destStride, int destWidth, int destHeight, const unsigned char* src, int srcStride, int width, int height);
};

class IVideoScaleSample {
public:
    static void ScaleRGB24(unsigned char* dst, int dstStride, int dstWidth, int dstHeight, const unsigned char* src, int srcStride, int srcWidth, int srcHeight);
    static void ScaleYUY2(unsigned char* dst, int dstStride, int dstWidth, int dstHeight, const unsigned char* src, int srcStride, int srcWidth, int srcHeight);
    static void ScaleNV12(unsigned char* dst, int dstStride, int dstWidth, int dstHeight, const unsigned char* src, int srcStride, int srcWidth, int srcHeight);
    static void ScaleI420(unsigned char* dst, int dstStride, int dstWidth, int dstHeight, const unsigned char* src, int srcStride, int srcWidth, int srcHeight);
    static void ScaleYV12(unsigned char* dst, int dstStride, int dstWidth, int dstHeight, const unsigned char* src, int srcStride, int srcWidth, int srcHeight);
    static void ScaleYUV(unsigned char* dst, int dstStride, int dstWidth, int dstHeight, const unsigned char* src, int srcStride, int srcWidth, int srcHeight);
};
