Class: GDAL::DataType
- Inherits:
-
Object
- Object
- GDAL::DataType
- Defined in:
- lib/gdal/data_type.rb
Overview
Info about GDAL data types (GDT symbols).
Class Method Summary collapse
-
.by_name(name) ⇒ FFI::GDAL::GDAL::DataType
The data type’s symbolic name.
- .complex?(gdal_data_type) ⇒ Integer
- .name(gdal_data_type) ⇒ String
-
.size(gdal_data_type) ⇒ Integer
The size in bits.
-
.union(gdal_data_type1, gdal_data_type2) ⇒ FFI::GDAL::GDAL::DataType
Return the smallest data type that can fully express both input data types.
Class Method Details
.by_name(name) ⇒ FFI::GDAL::GDAL::DataType
The data type’s symbolic name.
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
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
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.
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.
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 |