C API

// enums

enum
{
    @102::CV_LOAD_IMAGE_UNCHANGED          =-1,
    @102::CV_LOAD_IMAGE_GRAYSCALE          =0,
    @102::CV_LOAD_IMAGE_COLOR              =1,
    @102::CV_LOAD_IMAGE_ANYDEPTH           =2,
    @102::CV_LOAD_IMAGE_ANYCOLOR           =4,
    @102::CV_LOAD_IMAGE_IGNORE_ORIENTATION =128,
};

enum
{
    @103::CV_IMWRITE_JPEG_QUALITY               =1,
    @103::CV_IMWRITE_JPEG_PROGRESSIVE           =2,
    @103::CV_IMWRITE_JPEG_OPTIMIZE              =3,
    @103::CV_IMWRITE_JPEG_RST_INTERVAL          =4,
    @103::CV_IMWRITE_JPEG_LUMA_QUALITY          =5,
    @103::CV_IMWRITE_JPEG_CHROMA_QUALITY        =6,
    @103::CV_IMWRITE_PNG_COMPRESSION            =16,
    @103::CV_IMWRITE_PNG_STRATEGY               =17,
    @103::CV_IMWRITE_PNG_BILEVEL                =18,
    @103::CV_IMWRITE_PNG_STRATEGY_DEFAULT       =0,
    @103::CV_IMWRITE_PNG_STRATEGY_FILTERED      =1,
    @103::CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY  =2,
    @103::CV_IMWRITE_PNG_STRATEGY_RLE           =3,
    @103::CV_IMWRITE_PNG_STRATEGY_FIXED         =4,
    @103::CV_IMWRITE_PXM_BINARY                 =32,
    @103::CV_IMWRITE_WEBP_QUALITY               =64,
    @103::CV_IMWRITE_PAM_TUPLETYPE              = 128,
    @103::CV_IMWRITE_PAM_FORMAT_NULL            = 0,
    @103::CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE   = 1,
    @103::CV_IMWRITE_PAM_FORMAT_GRAYSCALE       = 2,
    @103::CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3,
    @103::CV_IMWRITE_PAM_FORMAT_RGB             = 4,
    @103::CV_IMWRITE_PAM_FORMAT_RGB_ALPHA       = 5,
};

enum
{
    @104::CV_CVTIMG_FLIP    =1,
    @104::CV_CVTIMG_SWAP_RB =2,
};

// global functions

void
cvConvertImage(
    const CvArr* src,
    CvArr* dst,
    int flags = 0
    );

IplImage*
cvDecodeImage(
    const CvMat* buf,
    int iscolor = CV_LOAD_IMAGE_COLOR
    );

CvMat*
cvDecodeImageM(
    const CvMat* buf,
    int iscolor = CV_LOAD_IMAGE_COLOR
    );

CvMat*
cvEncodeImage(
    const char* ext,
    const CvArr* image,
    const int* params = 0
    );

int
cvHaveImageReader(const char* filename);

int
cvHaveImageWriter(const char* filename);

IplImage*
cvLoadImage(
    const char* filename,
    int iscolor = CV_LOAD_IMAGE_COLOR
    );

CvMat*
cvLoadImageM(
    const char* filename,
    int iscolor = CV_LOAD_IMAGE_COLOR
    );

int
cvSaveImage(
    const char* filename,
    const CvArr* image,
    const int* params = 0
    );

// macros

#define cvvConvertImage
#define cvvLoadImage(name)
#define cvvSaveImage