2 * Copyright (c) 2007, Digital Signal Processing Laboratory, Universit� degli studi di Perugia (UPG), Italy
\r
3 * All rights reserved.
\r
5 * Redistribution and use in source and binary forms, with or without
\r
6 * modification, are permitted provided that the following conditions
\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
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
26 /////////////////////////////////////////////////////////////////////////////
\r
27 // Name: imagalljpeg2000.h
\r
28 // Purpose: wxImage JPEG 2000 family file format handler
\r
29 // Author: G. Baruffa - based on imagjpeg.h, Vaclav Slavik
\r
30 // RCS-ID: $Id: imagalljpeg2000.h,v 0.0 2008/01/31 11:22:00 VZ Exp $
\r
31 // Copyright: (c) Giuseppe Baruffa
\r
32 // Licence: wxWindows licence
\r
33 /////////////////////////////////////////////////////////////////////////////
\r
35 #ifndef _WX_IMAGJPEG2000_H_
\r
36 #define _WX_IMAGJPEG2000_H_
\r
38 #include "wx/defs.h"
\r
40 //-----------------------------------------------------------------------------
\r
41 // wxJPEG2000Handler
\r
42 //-----------------------------------------------------------------------------
\r
44 #if wxUSE_LIBOPENJPEG
\r
46 #include "wx/image.h"
\r
47 #include "libopenjpeg/openjpeg.h"
\r
48 #include "codec/index.h"
\r
50 #define wxBITMAP_TYPE_JPEG2000 50
\r
52 class WXDLLEXPORT wxJPEG2000Handler: public wxImageHandler
\r
55 inline wxJPEG2000Handler()
\r
57 m_name = wxT("JPEG 2000 family file format");
\r
58 m_extension = wxT("mj2");
\r
59 m_type = wxBITMAP_TYPE_JPEG2000;
\r
60 m_mime = wxT("image/mj2");
\r
64 m_qualitylayers = 0;
\r
67 m_enablejpwl = true;
\r
68 m_expcomps = JPWL_EXPECTED_COMPONENTS;
\r
69 m_maxtiles = JPWL_MAXIMUM_TILES;
\r
73 m_subsampling = wxT("1,1");
\r
74 m_origin = wxT("0,0");
\r
75 m_rates = wxT("20,10,5");
\r
76 m_quality = wxT("30,35,40");
\r
77 m_enablequality = false;
\r
78 m_multicomp = false;
\r
79 m_irreversible = false;
\r
82 m_cbsize = wxT("32,32");
\r
83 m_prsize = wxT("[128,128],[128,128]");
\r
85 m_torigin = wxT("0,0");
\r
88 m_enablesop = false;
\r
89 m_enableeph = false;
\r
90 m_enablereset = false;
\r
91 m_enablesegmark = false;
\r
92 m_enablevsc = false;
\r
93 m_enablerestart = false;
\r
94 m_enableerterm = false;
\r
95 m_enablebypass = false;
\r
99 m_enableidx = false;
\r
100 m_index = wxT("index.txt");
\r
101 m_enablepoc = false;
\r
102 m_poc = wxT("T1=0,0,1,5,3,CPRL/T1=5,0,1,6,3,CPRL");
\r
103 m_enablecomm = true;
\r
105 #if defined __WXMSW__
\r
106 m_comment = wxT("Created by OPJViewer Win32 - OpenJPEG version ");
\r
107 #elif defined __WXGTK__
\r
108 m_comment = wxT("Created by OPJViewer Lin32 - OpenJPEG version ");
\r
110 m_comment = wxT("Created by OPJViewer - OpenJPEG version ");
\r
114 m_comment += wxString::Format(wxT("%s with JPWL"), (char *) opj_version());
\r
116 m_comment += wxString::Format(wxT("%s"), (char *) opj_version());
\r
121 // decoding engine parameters
\r
122 int m_reducefactor, m_qualitylayers, m_components, m_framenum;
\r
125 int m_expcomps, m_maxtiles;
\r
128 // encoding engine parameters
\r
129 wxString m_subsampling;
\r
132 wxString m_quality;
\r
133 bool m_enablequality;
\r
135 bool m_irreversible;
\r
141 wxString m_torigin;
\r
146 bool m_enablebypass;
\r
147 bool m_enableerterm;
\r
148 bool m_enablerestart;
\r
149 bool m_enablereset;
\r
150 bool m_enablesegmark;
\r
158 wxString m_comment;
\r
163 virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1);
\r
164 virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true);
\r
166 virtual bool DoCanRead(wxInputStream& stream);
\r
170 OPJ_PROG_ORDER give_progression(char progression[4]);
\r
171 DECLARE_DYNAMIC_CLASS(wxJPEG2000Handler)
\r
174 #endif // wxUSE_LIBOPENJPEG
\r
176 #endif // _WX_IMAGJPEG2000_H_
\r