Renesas / opencv-lib

Dependents:   RZ_A2M_Mbed_samples

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers imgcodecs_c.h Source File

imgcodecs_c.h

00001 /*M///////////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
00004 //
00005 //  By downloading, copying, installing or using the software you agree to this license.
00006 //  If you do not agree to this license, do not download, install,
00007 //  copy or use the software.
00008 //
00009 //
00010 //                        Intel License Agreement
00011 //                For Open Source Computer Vision Library
00012 //
00013 // Copyright (C) 2000, Intel Corporation, all rights reserved.
00014 // Third party copyrights are property of their respective owners.
00015 //
00016 // Redistribution and use in source and binary forms, with or without modification,
00017 // are permitted provided that the following conditions are met:
00018 //
00019 //   * Redistribution's of source code must retain the above copyright notice,
00020 //     this list of conditions and the following disclaimer.
00021 //
00022 //   * Redistribution's in binary form must reproduce the above copyright notice,
00023 //     this list of conditions and the following disclaimer in the documentation
00024 //     and/or other materials provided with the distribution.
00025 //
00026 //   * The name of Intel Corporation may not be used to endorse or promote products
00027 //     derived from this software without specific prior written permission.
00028 //
00029 // This software is provided by the copyright holders and contributors "as is" and
00030 // any express or implied warranties, including, but not limited to, the implied
00031 // warranties of merchantability and fitness for a particular purpose are disclaimed.
00032 // In no event shall the Intel Corporation or contributors be liable for any direct,
00033 // indirect, incidental, special, exemplary, or consequential damages
00034 // (including, but not limited to, procurement of substitute goods or services;
00035 // loss of use, data, or profits; or business interruption) however caused
00036 // and on any theory of liability, whether in contract, strict liability,
00037 // or tort (including negligence or otherwise) arising in any way out of
00038 // the use of this software, even if advised of the possibility of such damage.
00039 //
00040 //M*/
00041 
00042 #ifndef OPENCV_IMGCODECS_H
00043 #define OPENCV_IMGCODECS_H
00044 
00045 #include "opencv2/core/core_c.h"
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif /* __cplusplus */
00050 
00051 /** @addtogroup imgcodecs_c
00052   @{
00053   */
00054 
00055 enum
00056 {
00057 /* 8bit, color or not */
00058     CV_LOAD_IMAGE_UNCHANGED  =-1,
00059 /* 8bit, gray */
00060     CV_LOAD_IMAGE_GRAYSCALE  =0,
00061 /* ?, color */
00062     CV_LOAD_IMAGE_COLOR      =1,
00063 /* any depth, ? */
00064     CV_LOAD_IMAGE_ANYDEPTH   =2,
00065 /* ?, any color */
00066     CV_LOAD_IMAGE_ANYCOLOR   =4,
00067 /* ?, no rotate */
00068     CV_LOAD_IMAGE_IGNORE_ORIENTATION  =128
00069 };
00070 
00071 /* load image from file
00072   iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED
00073   overrides the other flags
00074   using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED
00075   unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit
00076 */
00077 CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00078 CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00079 
00080 enum
00081 {
00082     CV_IMWRITE_JPEG_QUALITY =1,
00083     CV_IMWRITE_JPEG_PROGRESSIVE =2,
00084     CV_IMWRITE_JPEG_OPTIMIZE =3,
00085     CV_IMWRITE_JPEG_RST_INTERVAL =4,
00086     CV_IMWRITE_JPEG_LUMA_QUALITY =5,
00087     CV_IMWRITE_JPEG_CHROMA_QUALITY =6,
00088     CV_IMWRITE_PNG_COMPRESSION =16,
00089     CV_IMWRITE_PNG_STRATEGY =17,
00090     CV_IMWRITE_PNG_BILEVEL =18,
00091     CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,
00092     CV_IMWRITE_PNG_STRATEGY_FILTERED =1,
00093     CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,
00094     CV_IMWRITE_PNG_STRATEGY_RLE =3,
00095     CV_IMWRITE_PNG_STRATEGY_FIXED =4,
00096     CV_IMWRITE_PXM_BINARY =32,
00097     CV_IMWRITE_WEBP_QUALITY =64,
00098     CV_IMWRITE_PAM_TUPLETYPE = 128,
00099     CV_IMWRITE_PAM_FORMAT_NULL = 0,
00100     CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1,
00101     CV_IMWRITE_PAM_FORMAT_GRAYSCALE = 2,
00102     CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3,
00103     CV_IMWRITE_PAM_FORMAT_RGB = 4,
00104     CV_IMWRITE_PAM_FORMAT_RGB_ALPHA = 5,
00105 };
00106 
00107 
00108 
00109 /* save image to file */
00110 CVAPI(int) cvSaveImage( const char* filename, const CvArr* image,
00111                         const int* params CV_DEFAULT(0) );
00112 
00113 /* decode image stored in the buffer */
00114 CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00115 CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00116 
00117 /* encode image and store the result as a byte vector (single-row 8uC1 matrix) */
00118 CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image,
00119                              const int* params CV_DEFAULT(0) );
00120 
00121 enum
00122 {
00123     CV_CVTIMG_FLIP      =1,
00124     CV_CVTIMG_SWAP_RB   =2
00125 };
00126 
00127 /* utility function: convert one image to another with optional vertical flip */
00128 CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0));
00129 
00130 CVAPI(int) cvHaveImageReader(const char* filename);
00131 CVAPI(int) cvHaveImageWriter(const char* filename);
00132 
00133 
00134 /****************************************************************************************\
00135 *                              Obsolete functions/synonyms                               *
00136 \****************************************************************************************/
00137 
00138 #define cvvLoadImage(name) cvLoadImage((name),1)
00139 #define cvvSaveImage cvSaveImage
00140 #define cvvConvertImage cvConvertImage
00141 
00142 /** @} imgcodecs_c */
00143 
00144 #ifdef __cplusplus
00145 }
00146 #endif
00147 
00148 #endif // OPENCV_IMGCODECS_H