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
28 // Purpose: wxImage JPEG 2000 file format handler
\r
29 // Author: G. Baruffa - based on imagjpeg.h, Vaclav Slavik
\r
30 // RCS-ID: $Id: imagjp2.h,v 0.0 2007/02/08 23:45:00 VZ Exp $
\r
31 // Copyright: (c) Giuseppe Baruffa
\r
32 // Licence: wxWindows licence
\r
33 /////////////////////////////////////////////////////////////////////////////
\r
35 #ifndef _WX_IMAGJP2_H_
\r
36 #define _WX_IMAGJP2_H_
\r
38 #include "wx/defs.h"
\r
40 //-----------------------------------------------------------------------------
\r
42 //-----------------------------------------------------------------------------
\r
44 #if wxUSE_LIBOPENJPEG
\r
46 #include "wx/image.h"
\r
47 #include "libopenjpeg/openjpeg.h"
\r
49 #define wxBITMAP_TYPE_JP2 48
\r
51 class WXDLLEXPORT wxJP2Handler: public wxImageHandler
\r
54 inline wxJP2Handler()
\r
56 m_name = wxT("JPEG 2000 file format");
\r
57 m_extension = wxT("jp2");
\r
58 m_type = wxBITMAP_TYPE_JP2;
\r
59 m_mime = wxT("image/jp2");
\r
62 m_qualitylayers = 0;
\r
65 m_enablejpwl = true;
\r
66 m_expcomps = JPWL_EXPECTED_COMPONENTS;
\r
67 m_maxtiles = JPWL_MAXIMUM_TILES;
\r
71 // decoding engine parameters
\r
72 int m_reducefactor, m_qualitylayers, m_components;
\r
75 int m_expcomps, m_maxtiles;
\r
79 virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
\r
80 virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
\r
82 virtual bool DoCanRead( wxInputStream& stream );
\r
86 DECLARE_DYNAMIC_CLASS(wxJP2Handler)
\r
89 #endif // wxUSE_LIBOPENJPEG
\r
91 #endif // _WX_IMAGJP2_H_
\r