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