--- /dev/null
+/*M///////////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\r
+//\r
+// By downloading, copying, installing or using the software you agree to this license.\r
+// If you do not agree to this license, do not download, install,\r
+// copy or use the software.\r
+//\r
+//\r
+// License Agreement\r
+// For Open Source Computer Vision Library\r
+//\r
+// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\r
+// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\r
+// Third party copyrights are property of their respective owners.\r
+//\r
+// Redistribution and use in source and binary forms, with or without modification,\r
+// are permitted provided that the following conditions are met:\r
+//\r
+// * Redistribution's of source code must retain the above copyright notice,\r
+// this list of conditions and the following disclaimer.\r
+//\r
+// * Redistribution's in binary form must reproduce the above copyright notice,\r
+// this list of conditions and the following disclaimer in the documentation\r
+// and/or other materials provided with the distribution.\r
+//\r
+// * The name of the copyright holders may not be used to endorse or promote products\r
+// derived from this software without specific prior written permission.\r
+//\r
+// This software is provided by the copyright holders and contributors "as is" and\r
+// any express or implied warranties, including, but not limited to, the implied\r
+// warranties of merchantability and fitness for a particular purpose are disclaimed.\r
+// In no event shall the Intel Corporation or contributors be liable for any direct,\r
+// indirect, incidental, special, exemplary, or consequential damages\r
+// (including, but not limited to, procurement of substitute goods or services;\r
+// loss of use, data, or profits; or business interruption) however caused\r
+// and on any theory of liability, whether in contract, strict liability,\r
+// or tort (including negligence or otherwise) arising in any way out of\r
+// the use of this software, even if advised of the possibility of such damage.\r
+//\r
+//M*/\r
+\r
+#ifndef _GRFMT_EXR_H_\r
+#define _GRFMT_EXR_H_\r
+\r
+#ifdef HAVE_ILMIMF\r
+\r
+#include <ImfChromaticities.h>\r
+#include <ImfInputFile.h>\r
+#include <ImfChannelList.h>\r
+#include <ImathBox.h>\r
+#include "grfmt_base.h"\r
+\r
+namespace cv\r
+{\r
+\r
+using namespace Imf;\r
+using namespace Imath;\r
+\r
+/* libpng version only */\r
+\r
+class ExrDecoder : public BaseImageDecoder\r
+{\r
+public:\r
+\r
+ ExrDecoder();\r
+ ~ExrDecoder();\r
+\r
+ bool readData( Mat& img );\r
+ bool readHeader();\r
+ void close();\r
+\r
+ ImageDecoder newDecoder() const;\r
+\r
+protected:\r
+ void UpSample( uchar *data, int xstep, int ystep, int xsample, int ysample );\r
+ void UpSampleX( float *data, int xstep, int xsample );\r
+ void UpSampleY( uchar *data, int xstep, int ystep, int ysample );\r
+ void ChromaToBGR( float *data, int numlines, int step );\r
+ void RGBToGray( float *in, float *out );\r
+\r
+ InputFile *m_file;\r
+ PixelType m_type;\r
+ Box2i m_datawindow;\r
+ bool m_ischroma;\r
+ const Channel *m_red;\r
+ const Channel *m_green;\r
+ const Channel *m_blue;\r
+ Chromaticities m_chroma;\r
+};\r
+\r
+\r
+class ExrEncoder : public BaseImageEncoder\r
+{\r
+public:\r
+ ExrEncoder();\r
+ ~ExrEncoder();\r
+\r
+ bool isFormatSupported( int depth ) const;\r
+ bool write( const Mat& img, const Vector<int>& params );\r
+ ImageEncoder newEncoder() const;\r
+};\r
+\r
+}\r
+\r
+#endif\r
+\r
+#endif/*_GRFMT_EXR_H_*/\r