OpenCV 4.5.3(日本語機械翻訳)
imgcodecs.hpp
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 // License Agreement
11 // For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15 // Third party copyrights are property of their respective owners.
16 //
17 // Redistribution and use in source and binary forms, with or without modification,
18 // are permitted provided that the following conditions are met:
19 //
20 // * Redistribution's of source code must retain the above copyright notice,
21 // this list of conditions and the following disclaimer.
22 //
23 // * Redistribution's in binary form must reproduce the above copyright notice,
24 // this list of conditions and the following disclaimer in the documentation
25 // and/or other materials provided with the distribution.
26 //
27 // * The name of the copyright holders may not be used to endorse or promote products
28 // derived from this software without specific prior written permission.
29 //
30 // This software is provided by the copyright holders and contributors "as is" and
31 // any express or implied warranties, including, but not limited to, the implied
32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
33 // In no event shall the Intel Corporation or contributors be liable for any direct,
34 // indirect, incidental, special, exemplary, or consequential damages
35 // (including, but not limited to, procurement of substitute goods or services;
36 // loss of use, data, or profits; or business interruption) however caused
37 // and on any theory of liability, whether in contract, strict liability,
38 // or tort (including negligence or otherwise) arising in any way out of
39 // the use of this software, even if advised of the possibility of such damage.
40 //
41 //M*/
42
43 #ifndef OPENCV_IMGCODECS_HPP
44 #define OPENCV_IMGCODECS_HPP
45
46 #include "opencv2/core.hpp"
47
59 namespace cv
60{
61
64
67
83 };
84
97 IMWRITE_EXR_TYPE = (3 << 4) + 0, /* 48 */
98 IMWRITE_EXR_COMPRESSION = (3 << 4) + 1, /* 49 */
106 };
107
109 /*IMWRITE_EXR_TYPE_UNIT = 0, //!< not supported */
112 };
113
125 };
126
128
141 };
142
145 IMWRITE_PAM_FORMAT_NULL = 0,
146 IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1,
147 IMWRITE_PAM_FORMAT_GRAYSCALE = 2,
148 IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3,
149 IMWRITE_PAM_FORMAT_RGB = 4,
150 IMWRITE_PAM_FORMAT_RGB_ALPHA = 5,
151 };
152
154
206 CV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR );
207
216 CV_EXPORTS_W bool imreadmulti(const String& filename, CV_OUT std::vector<Mat>& mats, int flags = IMREAD_ANYCOLOR);
217
228 CV_EXPORTS_W bool imreadmulti(const String& filename, CV_OUT std::vector<Mat>& mats, int start, int count, int flags = IMREAD_ANYCOLOR);
229
236 CV_EXPORTS_W size_t imcount(const String& filename, int flags = IMREAD_ANYCOLOR);
237
267 CV_EXPORTS_W bool imwrite( const String& filename, InputArray img,
268 const std::vector<int>& params = std::vector<int>());
269
271CV_WRAP static inline
272 bool imwritemulti(const String& filename, InputArrayOfArrays img,
273 const std::vector<int>& params = std::vector<int>())
274{
275 return imwrite(filename, img, params);
276}
277
289 CV_EXPORTS_W Mat imdecode( InputArray buf, int flags );
290
297 CV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst);
298
309 CV_EXPORTS_W bool imencode( const String& ext, InputArray img,
310 CV_OUT std::vector<uchar>& buf,
311 const std::vector<int>& params = std::vector<int>());
312
317 CV_EXPORTS_W bool haveImageReader( const String& filename );
318
323 CV_EXPORTS_W bool haveImageWriter( const String& filename );
324
325
327
328} // cv
329
330 #endif //OPENCV_IMGCODECS_HPP
n-dimensional dense array class
Definition: mat.hpp:802
ImwriteFlags
Imwrite flags
Definition: imgcodecs.hpp:86
ImwriteEXRTypeFlags
Definition: imgcodecs.hpp:108
ImwritePAMFlags
Imwrite PAM specific tupletype flags used to define the 'TUPETYPE' field of a PAM file.
Definition: imgcodecs.hpp:144
ImreadModes
Imread flags
Definition: imgcodecs.hpp:69
ImwriteEXRCompressionFlags
Definition: imgcodecs.hpp:114
ImwritePNGFlags
Imwrite PNG specific flags used to tune the compression algorithm.
Definition: imgcodecs.hpp:135
@ IMWRITE_JPEG_RST_INTERVAL
JPEG restart interval, 0 - 65535, default is 0 - no restart.
Definition: imgcodecs.hpp:90
@ IMWRITE_JPEG_PROGRESSIVE
Enable JPEG features, 0 or 1, default is False.
Definition: imgcodecs.hpp:88
@ IMWRITE_EXR_COMPRESSION
override EXR storage type (FLOAT (FP32) is default)
Definition: imgcodecs.hpp:98
@ IMWRITE_TIFF_XDPI
For TIFF, use to specify the X direction DPI
Definition: imgcodecs.hpp:102
@ IMWRITE_JPEG_LUMA_QUALITY
Separate luma quality level, 0 - 100, default is 0 - don't use.
Definition: imgcodecs.hpp:91
@ IMWRITE_PXM_BINARY
For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1.
Definition: imgcodecs.hpp:96
@ IMWRITE_TIFF_YDPI
For TIFF, use to specify the Y direction DPI
Definition: imgcodecs.hpp:103
@ IMWRITE_WEBP_QUALITY
override EXR compression type (ZIP_COMPRESSION = 3 is default)
Definition: imgcodecs.hpp:99
@ IMWRITE_PNG_BILEVEL
Binary level PNG, 0 or 1, default is 0.
Definition: imgcodecs.hpp:95
@ IMWRITE_JPEG_QUALITY
For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95.
Definition: imgcodecs.hpp:87
@ IMWRITE_JPEG2000_COMPRESSION_X1000
For JPEG2000, use to specify the target compression rate (multiplied by 1000). The value can be from ...
Definition: imgcodecs.hpp:105
@ IMWRITE_PNG_STRATEGY
One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_RLE.
Definition: imgcodecs.hpp:94
@ IMWRITE_JPEG_CHROMA_QUALITY
Separate chroma quality level, 0 - 100, default is 0 - don't use.
Definition: imgcodecs.hpp:92
@ IMWRITE_TIFF_RESUNIT
For TIFF, use to specify which DPI resolution unit to set; see libtiff documentation for valid values
Definition: imgcodecs.hpp:101
@ IMWRITE_PAM_TUPLETYPE
For PAM, sets the TUPLETYPE field to the corresponding string value that is defined for the format
Definition: imgcodecs.hpp:100
@ IMWRITE_PNG_COMPRESSION
For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer ...
Definition: imgcodecs.hpp:93
@ IMWRITE_TIFF_COMPRESSION
For TIFF, use to specify the image compression scheme. See libtiff for integer constants correspondin...
Definition: imgcodecs.hpp:104
@ IMWRITE_JPEG_OPTIMIZE
Enable JPEG features, 0 or 1, default is False.
Definition: imgcodecs.hpp:89
@ IMWRITE_EXR_TYPE_HALF
store as HALF (FP16)
Definition: imgcodecs.hpp:110
@ IMWRITE_EXR_TYPE_FLOAT
store as FP32 (default)
Definition: imgcodecs.hpp:111
@ IMREAD_ANYDEPTH
If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it t...
Definition: imgcodecs.hpp:73
@ IMREAD_LOAD_GDAL
If set, use the gdal driver for loading the image.
Definition: imgcodecs.hpp:75
@ IMREAD_IGNORE_ORIENTATION
If set, do not rotate the image according to EXIF's orientation flag.
Definition: imgcodecs.hpp:82
@ IMREAD_REDUCED_COLOR_2
If set, always convert image to the 3 channel BGR color image and the image size reduced 1/2.
Definition: imgcodecs.hpp:77
@ IMREAD_REDUCED_GRAYSCALE_2
If set, always convert image to the single channel grayscale image and the image size reduced 1/2.
Definition: imgcodecs.hpp:76
@ IMREAD_REDUCED_GRAYSCALE_4
If set, always convert image to the single channel grayscale image and the image size reduced 1/4.
Definition: imgcodecs.hpp:78
@ IMREAD_REDUCED_GRAYSCALE_8
If set, always convert image to the single channel grayscale image and the image size reduced 1/8.
Definition: imgcodecs.hpp:80
@ IMREAD_ANYCOLOR
If set, the image is read in any possible color format.
Definition: imgcodecs.hpp:74
@ IMREAD_REDUCED_COLOR_8
If set, always convert image to the 3 channel BGR color image and the image size reduced 1/8.
Definition: imgcodecs.hpp:81
@ IMREAD_REDUCED_COLOR_4
If set, always convert image to the 3 channel BGR color image and the image size reduced 1/4.
Definition: imgcodecs.hpp:79
@ IMREAD_GRAYSCALE
If set, always convert image to the single channel grayscale image (codec internal conversion).
Definition: imgcodecs.hpp:71
@ IMREAD_UNCHANGED
If set, return the loaded image as is (with alpha channel, otherwise it gets cropped)....
Definition: imgcodecs.hpp:70
@ IMREAD_COLOR
If set, always convert image to the 3 channel BGR color image.
Definition: imgcodecs.hpp:72
@ IMWRITE_EXR_COMPRESSION_NO
no compression
Definition: imgcodecs.hpp:115
@ IMWRITE_EXR_COMPRESSION_ZIPS
zlib compression, one scan line at a time
Definition: imgcodecs.hpp:117
@ IMWRITE_EXR_COMPRESSION_PXR24
lossy 24-bit float compression
Definition: imgcodecs.hpp:120
@ IMWRITE_EXR_COMPRESSION_PIZ
piz-based wavelet compression
Definition: imgcodecs.hpp:119
@ IMWRITE_EXR_COMPRESSION_ZIP
zlib compression, in blocks of 16 scan lines
Definition: imgcodecs.hpp:118
@ IMWRITE_EXR_COMPRESSION_B44
lossy 4-by-4 pixel block compression, fixed compression rate
Definition: imgcodecs.hpp:121
@ IMWRITE_EXR_COMPRESSION_DWAB
lossy DCT based compression, in blocks of 256 scanlines. More efficient space wise and faster to deco...
Definition: imgcodecs.hpp:124
@ IMWRITE_EXR_COMPRESSION_B44A
lossy 4-by-4 pixel block compression, flat fields are compressed more
Definition: imgcodecs.hpp:122
@ IMWRITE_EXR_COMPRESSION_RLE
run length encoding
Definition: imgcodecs.hpp:116
@ IMWRITE_EXR_COMPRESSION_DWAA
lossy DCT based compression, in blocks of 32 scanlines. More efficient for partial buffer access....
Definition: imgcodecs.hpp:123
@ IMWRITE_PNG_STRATEGY_FILTERED
Use this value for data produced by a filter (or predictor).Filtered data consists mostly of small va...
Definition: imgcodecs.hpp:137
@ IMWRITE_PNG_STRATEGY_FIXED
Using this value prevents the use of dynamic Huffman codes, allowing for a simpler decoder for specia...
Definition: imgcodecs.hpp:140
@ IMWRITE_PNG_STRATEGY_DEFAULT
Use this value for normal data.
Definition: imgcodecs.hpp:136
@ IMWRITE_PNG_STRATEGY_RLE
Use this value to limit match distances to one (run-length encoding).
Definition: imgcodecs.hpp:139
@ IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY
Use this value to force Huffman encoding only (no string match).
Definition: imgcodecs.hpp:138
CV_EXPORTS_W size_t imcount(const String &filename, int flags=IMREAD_ANYCOLOR)
Returns the number of images inside the give file
CV_EXPORTS_W bool imencode(const String &ext, InputArray img, CV_OUT std::vector< uchar > &buf, const std::vector< int > &params=std::vector< int >())
Encodes an image into a memory buffer.
CV_EXPORTS_W bool haveImageReader(const String &filename)
Returns true if the specified image can be decoded by OpenCV
CV_EXPORTS_W bool imwrite(const String &filename, InputArray img, const std::vector< int > &params=std::vector< int >())
Saves an image to a specified file.
CV_EXPORTS_W Mat imdecode(InputArray buf, int flags)
Reads an image from a buffer in memory.
CV_EXPORTS_W bool imreadmulti(const String &filename, CV_OUT std::vector< Mat > &mats, int flags=IMREAD_ANYCOLOR)
Loads a multi-page image from a file.
CV_EXPORTS_W Mat imread(const String &filename, int flags=IMREAD_COLOR)
Loads an image from a file.
CV_EXPORTS_W bool haveImageWriter(const String &filename)
Returns true if an image with the specified filename can be encoded by OpenCV
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75