MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

lti_utils.h
Go to the documentation of this file.
1 /* $Id$ */
2 /* //////////////////////////////////////////////////////////////////////////
3 // //
4 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
5 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
6 // prohibited. Access to and use of this code is permitted only under //
7 // license from LizardTech, Inc. Portions of the code are protected by //
8 // US and foreign patents and other filings. All Rights Reserved. //
9 // //
11 /* PUBLIC */
12
13 #ifndef LTI_UTILS_H
14 #define LTI_UTILS_H
15
16
17 // lt_lib_mrsid_core
18 #include "lti_types.h"
19
20 LT_BEGIN_NAMESPACE(LizardTech)
21 #define LTI_DEFAULT_MAG_SNAP_THRESHOLD 0.41503749927884381
22
31 class LTIUtils
32 {
33 public:
44 static lt_uint8 getMinNumSamplesPerPixel(LTIColorSpace colorspace);
45
46 #if 1 //JAH deprecate
47
53 static LTIColorSpace getColorSpaceWithoutAlpha(LTIColorSpace colorspace);
54
61 static bool hasAlphaBand(LTIColorSpace colorspace);
62 #endif
63
72 static lt_uint8 getNumBytes(LTIDataType datatype);
73
83 static bool isSigned(LTIDataType datatype);
84
94 static bool isIntegral(LTIDataType datatype);
95 static bool isFloatingPoint(LTIDataType datatype);
96
97 static double getMinValue(LTIDataType datatype);
98 static double getMaxValue(LTIDataType datatype);
99
100 static bool needsSwapping(LTIDataType datatype, LTIEndian byteOrder);
101
106
118 static void convertWindowLevelToMinMax(double window, double level,
119 double& drmin, double& drmax);
120
135 static void convertMinMaxToWindowLevel(double drmin, double drmax,
136 double& window, double& level);
143
157 static lt_int32 magToLevel(double mag);
158
169 static double levelToMag(lt_int32 level);
170
179 static double snapToOctave(double mag, double threshold = LTI_DEFAULT_MAG_SNAP_THRESHOLD);
180
191 static double snapToOctave(double mag, const LTIImageStage &imageStage, double threshold = LTI_DEFAULT_MAG_SNAP_THRESHOLD);
192
193 static bool isOctave(double mag);
194
195
204 static lt_uint8 getNumLevelsForIcon(lt_uint32 width,
205 lt_uint32 height,
206 lt_uint32 iconsize);
207
216 static double getMagForIcon(lt_uint32 width,
217 lt_uint32 height,
218 lt_uint32 iconsize);
219
220 static double getMaxMag(lt_uint32 width, lt_uint32 height);
221
235 static LT_STATUS getDimsAtMag(lt_uint32 width, lt_uint32 height,
236 double mag,
237 lt_uint32 &scaledWidth, lt_uint32 &scaledHeight);
238
257 static void getVersionInfo(lt_uint32& major,
258 lt_uint32& minor,
259 lt_uint32& revision,
260 lt_uint32& build,
261 const char*& branch);
262
272 static const char* getVersionString();
273
274 private:
275 // nope
276 LTIUtils();
277 LTIUtils(const LTIUtils&);
278 };
279
280
281 LT_END_NAMESPACE(LizardTech)
282
283 #endif // LTI_UTILS_H

LizardTech