Enable accepting file names with `-´ symbol .Modification getopt.c
[openjpeg.git] / OPJViewer / source / imagjp2.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:        imagjp2.h\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
34 \r
35 #ifndef _WX_IMAGJP2_H_\r
36 #define _WX_IMAGJP2_H_\r
37 \r
38 #include "wx/defs.h"\r
39 \r
40 //-----------------------------------------------------------------------------\r
41 // wxJP2Handler\r
42 //-----------------------------------------------------------------------------\r
43 \r
44 #if wxUSE_LIBOPENJPEG\r
45 \r
46 #include "wx/image.h"\r
47 #include "libopenjpeg/openjpeg.h"\r
48 \r
49 #define wxBITMAP_TYPE_JP2       48\r
50 \r
51 class WXDLLEXPORT wxJP2Handler: public wxImageHandler\r
52 {\r
53 public:\r
54     inline wxJP2Handler()\r
55     {\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
60 \r
61                 m_reducefactor = 0;\r
62                 m_qualitylayers = 0;\r
63                 m_components = 0;\r
64 #ifdef USE_JPWL\r
65                 m_enablejpwl = true;\r
66                 m_expcomps = JPWL_EXPECTED_COMPONENTS;\r
67                 m_maxtiles = JPWL_MAXIMUM_TILES;\r
68 #endif // USE_JPWL\r
69     }\r
70 \r
71                 // decoding engine parameters\r
72                 int m_reducefactor, m_qualitylayers, m_components;\r
73 #ifdef USE_JPWL\r
74                 bool m_enablejpwl;\r
75                 int m_expcomps, m_maxtiles;\r
76 #endif // USE_JPWL\r
77 \r
78 #if wxUSE_STREAMS\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
81 protected:\r
82     virtual bool DoCanRead( wxInputStream& stream );\r
83 #endif\r
84 \r
85 private:\r
86     DECLARE_DYNAMIC_CLASS(wxJP2Handler)\r
87 };\r
88 \r
89 #endif // wxUSE_LIBOPENJPEG\r
90 \r
91 #endif // _WX_IMAGJP2_H_\r
92 \r