Update to 2.0.0 tree from current Fremantle build
[opencv] / src / highgui / grfmt_jpeg.h
diff --git a/src/highgui/grfmt_jpeg.h b/src/highgui/grfmt_jpeg.h
new file mode 100644 (file)
index 0000000..7a7e569
--- /dev/null
@@ -0,0 +1,90 @@
+/*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_JPEG_H_\r
+#define _GRFMT_JPEG_H_\r
+\r
+#include "grfmt_base.h"\r
+#include "bitstrm.h"\r
+\r
+#ifdef HAVE_JPEG\r
+\r
+// IJG-based Jpeg codec\r
+\r
+namespace cv\r
+{\r
+\r
+class JpegDecoder : public BaseImageDecoder\r
+{\r
+public:\r
+\r
+    JpegDecoder();\r
+    virtual ~JpegDecoder();\r
+\r
+    bool  readData( Mat& img );\r
+    bool  readHeader();\r
+    void  close();\r
+\r
+    ImageDecoder newDecoder() const;\r
+\r
+protected:\r
+\r
+    FILE* m_f;\r
+    void* m_state;\r
+};\r
+\r
+\r
+class JpegEncoder : public BaseImageEncoder\r
+{\r
+public:\r
+    JpegEncoder();\r
+    virtual ~JpegEncoder();\r
+\r
+    bool  write( const Mat& img, const vector<int>& params );\r
+    ImageEncoder newEncoder() const;\r
+};\r
+\r
+}\r
+\r
+#endif\r
+\r
+#endif/*_GRFMT_JPEG_H_*/\r