re-organization of openjpeg directories hierarchy : step 1
[openjpeg.git] / applications / OPJViewer / source / imagmxf.h
1 /*\r
2  * Copyright (c) 2007, Digital Signal Processing Laboratory, Universit� degli studi di Perugia (UPG), Italy\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  * 1. Redistributions of source code must retain the above copyright\r
9  *    notice, this list of conditions and the following disclaimer.\r
10  * 2. Redistributions in binary form must reproduce the above copyright\r
11  *    notice, this list of conditions and the following disclaimer in the\r
12  *    documentation and/or other materials provided with the distribution.\r
13  *\r
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\r
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
18  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
24  * POSSIBILITY OF SUCH DAMAGE.\r
25  */\r
26 /////////////////////////////////////////////////////////////////////////////\r
27 // Name:        imagmxf.h\r
28 // Purpose:     wxImage MXF (Material eXchange Format) JPEG 2000 file format handler\r
29 // Author:      G. Baruffa - based on imagjpeg.h, Vaclav Slavik\r
30 // RCS-ID:      $Id: imagmj2.h,v 0.0 2007/11/19 17:00:00 VZ Exp $\r
31 // Copyright:   (c) Giuseppe Baruffa\r
32 // Licence:     wxWindows licence\r
33 /////////////////////////////////////////////////////////////////////////////\r
34 \r
35 #ifndef _WX_IMAGMXF_H_\r
36 #define _WX_IMAGMXF_H_\r
37 \r
38 #ifdef USE_MXF\r
39 \r
40 #include "wx/defs.h"\r
41 #include "wx/filename.h"\r
42 \r
43 //-----------------------------------------------------------------------------\r
44 // wxMXFHandler\r
45 //-----------------------------------------------------------------------------\r
46 \r
47 #if wxUSE_LIBOPENJPEG\r
48 \r
49 #include "wx/image.h"\r
50 #include "libopenjpeg/openjpeg.h"\r
51 \r
52 #define wxBITMAP_TYPE_MXF       51\r
53 \r
54 class WXDLLEXPORT wxMXFHandler: public wxImageHandler\r
55 {\r
56 public:\r
57     inline wxMXFHandler()\r
58     {\r
59         m_name = wxT("MXF JPEG 2000 file format");\r
60         m_extension = wxT("mxf");\r
61         m_type = wxBITMAP_TYPE_MXF;\r
62         m_mime = wxT("image/mxf");\r
63 \r
64                 m_reducefactor = 0;\r
65                 m_qualitylayers = 0;\r
66                 m_components = 0;\r
67                 m_filename = wxT("");\r
68 #ifdef USE_JPWL\r
69                 m_enablejpwl = true;\r
70                 m_expcomps = JPWL_EXPECTED_COMPONENTS;\r
71                 m_maxtiles = JPWL_MAXIMUM_TILES;\r
72 #endif // USE_JPWL\r
73     }\r
74 \r
75                 // decoding engine parameters\r
76                 int m_reducefactor, m_qualitylayers, m_components, m_framenum;\r
77                 wxFileName m_filename;\r
78 #ifdef USE_JPWL\r
79                 bool m_enablejpwl;\r
80                 int m_expcomps, m_maxtiles;\r
81 #endif // USE_JPWL\r
82 \r
83 #if wxUSE_STREAMS\r
84     virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );\r
85     virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );\r
86 protected:\r
87     virtual bool DoCanRead( wxInputStream& stream );\r
88 #endif\r
89 \r
90 private:\r
91     DECLARE_DYNAMIC_CLASS(wxMXFHandler)\r
92 };\r
93 \r
94 #endif // wxUSE_LIBOPENJPEG\r
95 \r
96 #endif // USE_MXF\r
97 \r
98 #endif // _WX_IMAGMXF_H_\r
99 \r