fix legacy constants
This commit is contained in:
@@ -637,7 +637,7 @@ bool ExrEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
|
||||
for( size_t i = 0; i < params.size(); i += 2 )
|
||||
{
|
||||
if( params[i] == CV_IMWRITE_EXR_TYPE )
|
||||
if( params[i] == IMWRITE_EXR_TYPE )
|
||||
{
|
||||
switch( params[i+1] )
|
||||
{
|
||||
|
||||
@@ -643,23 +643,23 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
|
||||
for( size_t i = 0; i < params.size(); i += 2 )
|
||||
{
|
||||
if( params[i] == CV_IMWRITE_JPEG_QUALITY )
|
||||
if( params[i] == IMWRITE_JPEG_QUALITY )
|
||||
{
|
||||
quality = params[i+1];
|
||||
quality = MIN(MAX(quality, 0), 100);
|
||||
}
|
||||
|
||||
if( params[i] == CV_IMWRITE_JPEG_PROGRESSIVE )
|
||||
if( params[i] == IMWRITE_JPEG_PROGRESSIVE )
|
||||
{
|
||||
progressive = params[i+1];
|
||||
}
|
||||
|
||||
if( params[i] == CV_IMWRITE_JPEG_OPTIMIZE )
|
||||
if( params[i] == IMWRITE_JPEG_OPTIMIZE )
|
||||
{
|
||||
optimize = params[i+1];
|
||||
}
|
||||
|
||||
if( params[i] == CV_IMWRITE_JPEG_LUMA_QUALITY )
|
||||
if( params[i] == IMWRITE_JPEG_LUMA_QUALITY )
|
||||
{
|
||||
if (params[i+1] >= 0)
|
||||
{
|
||||
@@ -674,7 +674,7 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
}
|
||||
}
|
||||
|
||||
if( params[i] == CV_IMWRITE_JPEG_CHROMA_QUALITY )
|
||||
if( params[i] == IMWRITE_JPEG_CHROMA_QUALITY )
|
||||
{
|
||||
if (params[i+1] >= 0)
|
||||
{
|
||||
@@ -682,7 +682,7 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
}
|
||||
}
|
||||
|
||||
if( params[i] == CV_IMWRITE_JPEG_RST_INTERVAL )
|
||||
if( params[i] == IMWRITE_JPEG_RST_INTERVAL )
|
||||
{
|
||||
rst_interval = params[i+1];
|
||||
rst_interval = MIN(MAX(rst_interval, 0), 65535L);
|
||||
|
||||
@@ -111,12 +111,12 @@ static bool rgb_convert (void *src, void *target, int width, int target_channels
|
||||
int target_depth);
|
||||
|
||||
const static struct pam_format formats[] = {
|
||||
{CV_IMWRITE_PAM_FORMAT_NULL, "", NULL, {0, 0, 0, 0} },
|
||||
{CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE, "BLACKANDWHITE", NULL, {0, 0, 0, 0} },
|
||||
{CV_IMWRITE_PAM_FORMAT_GRAYSCALE, "GRAYSCALE", NULL, {0, 0, 0, 0} },
|
||||
{CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA, "GRAYSCALE_ALPHA", NULL, {0, 0, 0, 0} },
|
||||
{CV_IMWRITE_PAM_FORMAT_RGB, "RGB", rgb_convert, {0, 1, 2, 0} },
|
||||
{CV_IMWRITE_PAM_FORMAT_RGB_ALPHA, "RGB_ALPHA", NULL, {0, 1, 2, 0} },
|
||||
{IMWRITE_PAM_FORMAT_NULL, "", NULL, {0, 0, 0, 0} },
|
||||
{IMWRITE_PAM_FORMAT_BLACKANDWHITE, "BLACKANDWHITE", NULL, {0, 0, 0, 0} },
|
||||
{IMWRITE_PAM_FORMAT_GRAYSCALE, "GRAYSCALE", NULL, {0, 0, 0, 0} },
|
||||
{IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA, "GRAYSCALE_ALPHA", NULL, {0, 0, 0, 0} },
|
||||
{IMWRITE_PAM_FORMAT_RGB, "RGB", rgb_convert, {0, 1, 2, 0} },
|
||||
{IMWRITE_PAM_FORMAT_RGB_ALPHA, "RGB_ALPHA", NULL, {0, 1, 2, 0} },
|
||||
};
|
||||
#define PAM_FORMATS_NO (sizeof (fields) / sizeof ((fields)[0]))
|
||||
|
||||
@@ -341,7 +341,7 @@ PAMDecoder::PAMDecoder()
|
||||
m_offset = -1;
|
||||
m_buf_supported = true;
|
||||
bit_mode = false;
|
||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_NULL;
|
||||
selected_fmt = IMWRITE_PAM_FORMAT_NULL;
|
||||
m_maxval = 0;
|
||||
m_channels = 0;
|
||||
m_sampledepth = 0;
|
||||
@@ -462,14 +462,14 @@ bool PAMDecoder::readHeader()
|
||||
|
||||
if (flds_endhdr && flds_height && flds_width && flds_depth && flds_maxval)
|
||||
{
|
||||
if (selected_fmt == CV_IMWRITE_PAM_FORMAT_NULL)
|
||||
if (selected_fmt == IMWRITE_PAM_FORMAT_NULL)
|
||||
{
|
||||
if (m_channels == 1 && m_maxval == 1)
|
||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE;
|
||||
selected_fmt = IMWRITE_PAM_FORMAT_BLACKANDWHITE;
|
||||
else if (m_channels == 1 && m_maxval < 256)
|
||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_GRAYSCALE;
|
||||
selected_fmt = IMWRITE_PAM_FORMAT_GRAYSCALE;
|
||||
else if (m_channels == 3 && m_maxval < 256)
|
||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_RGB;
|
||||
selected_fmt = IMWRITE_PAM_FORMAT_RGB;
|
||||
}
|
||||
m_type = CV_MAKETYPE(m_sampledepth, m_channels);
|
||||
m_offset = m_strm.getPos();
|
||||
@@ -512,7 +512,7 @@ bool PAMDecoder::readData(Mat& img)
|
||||
if( m_offset < 0 || !m_strm.isOpened())
|
||||
return false;
|
||||
|
||||
if (selected_fmt != CV_IMWRITE_PAM_FORMAT_NULL)
|
||||
if (selected_fmt != IMWRITE_PAM_FORMAT_NULL)
|
||||
fmt = &formats[selected_fmt];
|
||||
else {
|
||||
/* default layout handling */
|
||||
@@ -662,8 +662,8 @@ bool PAMEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
|
||||
/* parse save file type */
|
||||
for( size_t i = 0; i < params.size(); i += 2 )
|
||||
if( params[i] == CV_IMWRITE_PAM_TUPLETYPE ) {
|
||||
if ( params[i+1] > CV_IMWRITE_PAM_FORMAT_NULL &&
|
||||
if( params[i] == IMWRITE_PAM_TUPLETYPE ) {
|
||||
if ( params[i+1] > IMWRITE_PAM_FORMAT_NULL &&
|
||||
params[i+1] < (int) PAM_FORMATS_NO)
|
||||
fmt = &formats[params[i+1]];
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ bool WebPEncoder::write(const Mat& img, const std::vector<int>& params)
|
||||
|
||||
if (params.size() > 1)
|
||||
{
|
||||
if (params[0] == CV_IMWRITE_WEBP_QUALITY)
|
||||
if (params[0] == IMWRITE_WEBP_QUALITY)
|
||||
{
|
||||
comp_lossless = false;
|
||||
quality = static_cast<float>(params[1]);
|
||||
|
||||
@@ -562,7 +562,7 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats, int star
|
||||
if ((flags & IMREAD_ANYDEPTH) == 0)
|
||||
type = CV_MAKETYPE(CV_8U, CV_MAT_CN(type));
|
||||
|
||||
if ((flags & CV_LOAD_IMAGE_COLOR) != 0 ||
|
||||
if ((flags & IMREAD_COLOR) != 0 ||
|
||||
((flags & IMREAD_ANYCOLOR) != 0 && CV_MAT_CN(type) > 1))
|
||||
type = CV_MAKETYPE(CV_MAT_DEPTH(type), 3);
|
||||
else
|
||||
|
||||
@@ -43,11 +43,8 @@
|
||||
#define __IMGCODECS_H_
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/imgcodecs/legacy/constants_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/private.hpp"
|
||||
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
Reference in New Issue
Block a user