rasdaman API
tiff.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 */
45 #ifndef _R_CONV_TIFF_HH_
46 #define _R_CONV_TIFF_HH_
47 
48 #include "conversion/convertor.hh"
49 
50 
51 
52 //@ManMemo: Module {\bf conversion}
53 
54 /*@Doc:
55  TIFF convertor class.
56 
57  Supported parameters are
58 
59  \begin{tabular}{lcl}
60  {\tt comptype} && string && compression type (see below)\\
61  {\tt quality} && int && quality parameter (JPEG)\\
62  {\tt bpp} && int && override number of bits per p (if not set in the tiff)\\
63  {\tt bps} && int && override number of bits per s (if not set in the tiff)\\
64  {\tt depth} && int && override number of colors in the mdd\\
65  \end{tabular}
66 
67  The compression type defaults to lzw, but it may be one of the
68  following (but not all types may be supported by the version of
69  the TIFF library; note also that some compression types are only
70  valid for specific colour depths):
71 
72  \begin{tabular}{ll}
73  {\tt none}\\
74  {\tt ccittrle}\\
75  {\tt ccittfax3}\\
76  {\tt ccittfax4}\\
77  {\tt lzw}\\
78  {\tt ojpeg}\\
79  {\tt jpeg}\\
80  {\tt next}\\
81  {\tt ccittrlew}\\
82  {\tt packbits}\\
83  {\tt thunderscan}\\
84  {\tt pixarfilm}\\
85  {\tt pixarlog}\\
86  {\tt deflate}\\
87  {\tt dcs}\\
88  {\tt jbig}\\
89  {\tt sgilog} && Not Linux\\
90  {\tt sgilog24} && Not Linux\\
91  {\tt it8ctpad} && Not Linux\\
92  {\tt it8lw} && Not Linux\\
93  {\tt it8mp} && Not Linux\\
94  {\tt it8bl} && Not Linux\\
95  \end{tabular}
96 
97  For more information refer to the TIFFlib manual pages.
98  */
99 
100 class r_Conv_TIFF : public r_Convert_Memory
101 {
102 public:
104  r_Conv_TIFF( const char *src, const r_Minterval &interv, const r_Type *tp ) throw(r_Error);
106  r_Conv_TIFF( const char *src, const r_Minterval &interv, int type ) throw(r_Error);
108  ~r_Conv_TIFF( void );
109 
111  virtual r_convDesc &convertTo( const char *options=NULL) throw(r_Error);
113  virtual r_convDesc &convertFrom( const char *options=NULL ) throw(r_Error);
115  virtual r_Convertor *clone( void ) const;
117  virtual const char *get_name( void ) const;
118  virtual r_Data_Format get_data_format( void ) const;
119 
121  static int get_compression_from_name(const char* strComp);
122 
124  static int get_resunit_from_name(const char* strComp);
125 
126 private:
128  void initTIFF( void );
130  char *compType;
131  int quality;
132  int override_bpp;
133  int override_bps;
134  int override_depth;
135  char *sampleType;
137  static const convert_string_t compNames[];
139  static const convert_string_t resunitNames[];
141  static const int defaultRPS;
143  static const char dummyFileFmt[];
144 
146  static const unsigned int TIFF_DEFAULT_QUALITY;
147 
148 };
149 
150 #endif
static int get_compression_from_name(const char *strComp)
translate string compression type to libtiff compression type
static int get_resunit_from_name(const char *strComp)
translate string resolution unit type to libtiff resolution unit type
virtual r_convDesc & convertTo(const char *options=NULL)
convert to TIFF
Definition: type.hh:56
Definition: tiff.hh:100
~r_Conv_TIFF(void)
destructor
virtual r_Data_Format get_data_format(void) const
virtual const char * get_name(void) const
identification
r_Conv_TIFF(const char *src, const r_Minterval &interv, const r_Type *tp)
constructor using an r_Type object
virtual r_convDesc & convertFrom(const char *options=NULL)
convert from TIFF
virtual r_Convertor * clone(void) const
cloning