HDR formats support and HDR making. Code only.

This commit is contained in:
Fedor Morozov
2013-06-23 14:19:09 +04:00
parent eff6dccb3b
commit 7469c935f3
12 changed files with 1378 additions and 4 deletions

View File

@@ -47,6 +47,7 @@
#include "grfmts.hpp"
#undef min
#undef max
#include <iostream>
/****************************************************************************************\
* Image Codecs *
@@ -60,6 +61,8 @@ struct ImageCodecInitializer
{
decoders.push_back( new BmpDecoder );
encoders.push_back( new BmpEncoder );
decoders.push_back( new HdrDecoder );
encoders.push_back( new HdrEncoder );
#ifdef HAVE_JPEG
decoders.push_back( new JpegDecoder );
encoders.push_back( new JpegEncoder );
@@ -203,7 +206,6 @@ imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 )
decoder->setSource(filename);
if( !decoder->readHeader() )
return 0;
CvSize size;
size.width = decoder->width();
size.height = decoder->height();
@@ -271,7 +273,6 @@ static bool imwrite_( const String& filename, const Mat& image,
ImageEncoder encoder = findEncoder( filename );
if( encoder.empty() )
CV_Error( CV_StsError, "could not find a writer for the specified extension" );
if( !encoder->isFormatSupported(image.depth()) )
{
CV_Assert( encoder->isFormatSupported(CV_8U) );