1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

propagated fix for EXR from 2.3 branch to trunk

This commit is contained in:
Vadim Pisarevsky
2011-08-02 12:55:05 +00:00
parent f0b3cb1845
commit ce2f4c6a4d
4 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ public:
int width() const { return m_width; };
int height() const { return m_height; };
int type() const { return m_type; };
virtual int type() const { return m_type; };
virtual bool setSource( const string& filename );
virtual bool setSource( const Mat& buf );
+9
View File
@@ -96,6 +96,13 @@ void ExrDecoder::close()
}
}
int ExrDecoder::type() const
{
return CV_MAKETYPE((m_isfloat ? CV_32F : CV_32S), m_iscolor ? 3 : 1);
}
bool ExrDecoder::readHeader()
{
bool result = false;
@@ -174,7 +181,9 @@ bool ExrDecoder::readHeader()
bool ExrDecoder::readData( Mat& img )
{
m_native_depth = CV_MAT_DEPTH(type()) == img.depth();
bool color = img.channels() > 1;
uchar* data = img.data;
int step = img.step;
bool justcopy = m_native_depth;
+1
View File
@@ -66,6 +66,7 @@ public:
ExrDecoder();
~ExrDecoder();
int type() const;
bool readData( Mat& img );
bool readHeader();
void close();