PageRenderTime 55ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h

https://gitlab.com/geekshabeka/opencv
C Header | 117 lines | 48 code | 14 blank | 55 comment | 0 complexity | 6e6082a90a73e41ef6c7b0c5fc1f8c33 MD5 | raw file
  1. /*M///////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
  4. //
  5. // By downloading, copying, installing or using the software you agree to this license.
  6. // If you do not agree to this license, do not download, install,
  7. // copy or use the software.
  8. //
  9. //
  10. // Intel License Agreement
  11. // For Open Source Computer Vision Library
  12. //
  13. // Copyright (C) 2000, Intel Corporation, all rights reserved.
  14. // Third party copyrights are property of their respective owners.
  15. //
  16. // Redistribution and use in source and binary forms, with or without modification,
  17. // are permitted provided that the following conditions are met:
  18. //
  19. // * Redistribution's of source code must retain the above copyright notice,
  20. // this list of conditions and the following disclaimer.
  21. //
  22. // * Redistribution's in binary form must reproduce the above copyright notice,
  23. // this list of conditions and the following disclaimer in the documentation
  24. // and/or other materials provided with the distribution.
  25. //
  26. // * The name of Intel Corporation may not be used to endorse or promote products
  27. // derived from this software without specific prior written permission.
  28. //
  29. // This software is provided by the copyright holders and contributors "as is" and
  30. // any express or implied warranties, including, but not limited to, the implied
  31. // warranties of merchantability and fitness for a particular purpose are disclaimed.
  32. // In no event shall the Intel Corporation or contributors be liable for any direct,
  33. // indirect, incidental, special, exemplary, or consequential damages
  34. // (including, but not limited to, procurement of substitute goods or services;
  35. // loss of use, data, or profits; or business interruption) however caused
  36. // and on any theory of liability, whether in contract, strict liability,
  37. // or tort (including negligence or otherwise) arising in any way out of
  38. // the use of this software, even if advised of the possibility of such damage.
  39. //
  40. //M*/
  41. #ifndef __OPENCV_IMGCODECS_H__
  42. #define __OPENCV_IMGCODECS_H__
  43. #include "opencv2/core/core_c.h"
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif /* __cplusplus */
  47. enum
  48. {
  49. /* 8bit, color or not */
  50. CV_LOAD_IMAGE_UNCHANGED =-1,
  51. /* 8bit, gray */
  52. CV_LOAD_IMAGE_GRAYSCALE =0,
  53. /* ?, color */
  54. CV_LOAD_IMAGE_COLOR =1,
  55. /* any depth, ? */
  56. CV_LOAD_IMAGE_ANYDEPTH =2,
  57. /* ?, any color */
  58. CV_LOAD_IMAGE_ANYCOLOR =4
  59. };
  60. /* load image from file
  61. iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED
  62. overrides the other flags
  63. using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED
  64. unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit
  65. */
  66. CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
  67. CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
  68. enum
  69. {
  70. CV_IMWRITE_JPEG_QUALITY =1,
  71. CV_IMWRITE_JPEG_PROGRESSIVE =2,
  72. CV_IMWRITE_JPEG_OPTIMIZE =3,
  73. CV_IMWRITE_PNG_COMPRESSION =16,
  74. CV_IMWRITE_PNG_STRATEGY =17,
  75. CV_IMWRITE_PNG_BILEVEL =18,
  76. CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,
  77. CV_IMWRITE_PNG_STRATEGY_FILTERED =1,
  78. CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,
  79. CV_IMWRITE_PNG_STRATEGY_RLE =3,
  80. CV_IMWRITE_PNG_STRATEGY_FIXED =4,
  81. CV_IMWRITE_PXM_BINARY =32,
  82. CV_IMWRITE_WEBP_QUALITY =64
  83. };
  84. /* save image to file */
  85. CVAPI(int) cvSaveImage( const char* filename, const CvArr* image,
  86. const int* params CV_DEFAULT(0) );
  87. /* decode image stored in the buffer */
  88. CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
  89. CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
  90. /* encode image and store the result as a byte vector (single-row 8uC1 matrix) */
  91. CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image,
  92. const int* params CV_DEFAULT(0) );
  93. enum
  94. {
  95. CV_CVTIMG_FLIP =1,
  96. CV_CVTIMG_SWAP_RB =2
  97. };
  98. /* utility function: convert one image to another with optional vertical flip */
  99. CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0));
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif // __OPENCV_IMGCODECS_H__