OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | List of all members
ossimGdalType Class Reference

#include <ossimGdalType.h>

Public Member Functions

ossimScalarType toOssim (GDALDataType gdalType) const
 
GDALDataType toGdal (ossimScalarType) const
 

Detailed Description

Definition at line 13 of file ossimGdalType.h.

Member Function Documentation

◆ toGdal()

GDALDataType ossimGdalType::toGdal ( ossimScalarType  ossimType) const

Definition at line 56 of file ossimGdalType.cpp.

References OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_USHORT11, and OSSIM_USHORT16.

57 {
58  switch(ossimType)
59  {
60  case OSSIM_UCHAR:
61  {
62  return GDT_Byte;
63  }
64  case OSSIM_USHORT11:
65  case OSSIM_USHORT16:
66  {
67  return GDT_UInt16;
68  }
69  case OSSIM_SSHORT16:
70  {
71  return GDT_Int16;
72  break;
73  }
74  case OSSIM_FLOAT:
76  {
77  return GDT_Float32;
78  }
79  case OSSIM_DOUBLE:
81  {
82  return GDT_Float64;
83  }
85  {
86  break;
87  }
88  default:
89  break;
90  }
91 
92  return GDT_Unknown;
93 }
32 bit normalized floating point
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
32 bit floating point
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
8 bit unsigned iteger

◆ toOssim()

ossimScalarType ossimGdalType::toOssim ( GDALDataType  gdalType) const

Definition at line 14 of file ossimGdalType.cpp.

References OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SSHORT16, OSSIM_UCHAR, and OSSIM_USHORT16.

15 {
16  switch(gdalType)
17  {
18  case GDT_Byte:
19  {
20  return OSSIM_UCHAR;
21  }
22  case GDT_UInt16:
23  {
24  return OSSIM_USHORT16;
25  }
26  case GDT_Int16:
27  {
28  return OSSIM_SSHORT16;
29  }
30  case GDT_Int32:
31  {
32  ossim_int32 sizeType = GDALGetDataTypeSize(gdalType)/8;
33  if(sizeType == 2)
34  {
35  return OSSIM_SSHORT16;
36  }
37  break;
38  }
39  case GDT_Float32:
40  {
41  return OSSIM_FLOAT;
42  break;
43  }
44  case GDT_Float64:
45  {
46  return OSSIM_DOUBLE;
47  break;
48  }
49  default:
50  break;
51  }
52 
53  return OSSIM_SCALAR_UNKNOWN;
54 }
32 bit floating point
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
8 bit unsigned iteger
int ossim_int32

The documentation for this class was generated from the following files: