rasdaman complete source
rviewIO.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
23 
42 #ifndef _RVIEW_IO_H_
43 #define _RVIEW_IO_H_
44 
45 
46 #ifdef __GNUG__
47 #pragma interface
48 #endif
49 
50 
51 
52 #include "rasodmg/ref.hh"
53 #include "rasodmg/marray.hh"
54 #include "rasodmg/gmarray.hh"
55 
56 #include "rviewUtils.hh"
57 
58 
59 
60 // Return status
61 enum rviewIoStates
62 {
63  RVIEW_IO_OK,
64  RVIEW_IO_NOTFOUND,
65  RVIEW_IO_MEMORY,
66  RVIEW_IO_UNSUPP,
67  RVIEW_IO_FORMAT
68 };
69 
70 
71 // pixmap conversion functions
72 class wxPixmap;
73 
74 // parameter parser
75 class r_Parse_Params;
76 
77 
78 class rviewIO
79 {
80 public:
81 
82  rviewIO(void);
83  ~rviewIO(void);
84 
85  static void terminate(void);
86 
87  static int isTIFF(const char *filename);
88  static int loadTIFF(const char *filename, r_Ref<r_GMarray> &mddPtr, const char *params=NULL);
89  static int saveTIFF(const char *filename, r_Ref<r_GMarray> &mddPtr, const char *params=NULL);
90  static int PixmapToTIFF(wxPixmap *pixmap, const char *filename, const char *params=NULL);
91  static int isVFF(const char *filename);
92  static int loadVFF(const char *filename, r_Ref<r_GMarray> &mddPtr, const char *params=NULL);
93  static int saveVFF(const char *filename, r_Ref<r_GMarray> &mddPtr, const char *params=NULL);
94 
95 
96 private:
97 
98  static void ensureParams(void);
99  static void processParams(const char *params);
100 
101  static r_Parse_Params *dfltParams;
102  static char *tiffCompStr;
103  static int tiffCompression;
104 
105  static const char *getExtension(const char *filename);
106 
107  // tiff compression keywords
108  static const char param_KeyTiffComp[];
109  static const char param_TiffCompNone[];
110  static const char param_TiffCompPack[];
111  static const char param_TiffCompLZW[];
112  static const char param_TiffCompZLib[];
113  static const char param_TiffCompJPEG[];
114 
115  // TIFF formats
116  static const char structure_format_mono[];
117  static const char structure_format_grey[];
118  static const char structure_format_rgb[];
119 
120  // VFF formats
121  static const char structure_format_cube8[];
122  static const char structure_format_cube16[];
123  static const char structure_format_cube32[];
124 };
125 
126 #endif