Class: GDAL::DataType

Inherits:
Object
  • Object
show all
Defined in:
lib/gdal/data_type.rb

Overview

Info about GDAL data types (GDT symbols).

Class Method Summary collapse

Class Method Details

.by_name(name) ⇒ FFI::GDAL::GDAL::DataType

The data type’s symbolic name.

Parameters:

Returns:



35
36
37
# File 'lib/gdal/data_type.rb', line 35

def self.by_name(name)
  FFI::GDAL::GDAL.GDALGetDataTypeByName(name.to_s)
end

.complex?(gdal_data_type) ⇒ Integer

Parameters:

Returns:



16
17
18
# File 'lib/gdal/data_type.rb', line 16

def self.complex?(gdal_data_type)
  FFI::GDAL::GDAL.GDALDataTypeIsComplex(gdal_data_type)
end

.name(gdal_data_type) ⇒ String

Parameters:

Returns:



22
23
24
25
26
27
28
29
# File 'lib/gdal/data_type.rb', line 22

def self.name(gdal_data_type)
  # The returned strings are static strings and should not be modified or
  # freed by the application.
  name, ptr = FFI::GDAL::GDAL.GDALGetDataTypeName(gdal_data_type)
  ptr.autorelease = false

  name
end

.size(gdal_data_type) ⇒ Integer

The size in bits.

Parameters:

Returns:



10
11
12
# File 'lib/gdal/data_type.rb', line 10

def self.size(gdal_data_type)
  FFI::GDAL::GDAL.GDALGetDataTypeSize(gdal_data_type)
end

.union(gdal_data_type1, gdal_data_type2) ⇒ FFI::GDAL::GDAL::DataType

Return the smallest data type that can fully express both input data types.

Parameters:

Returns:



44
45
46
# File 'lib/gdal/data_type.rb', line 44

def self.union(gdal_data_type1, gdal_data_type2)
  FFI::GDAL::GDAL.GDALDataTypeUnion(gdal_data_type1, gdal_data_type2)
end