Sha256: f408e44de6a58933084bf43dd0cdf3156b0feea96977a86aa67d53f4eb928d80

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module GDAL
  # Info about GDAL data types (GDT symbols).
  class DataType
    # The size in bits.
    #
    # @param gdal_data_type [FFI::GDAL::GDAL::DataType]
    # @return [Fixnum]
    def self.size(gdal_data_type)
      FFI::GDAL::GDAL.GDALGetDataTypeSize(gdal_data_type)
    end

    # @param gdal_data_type [FFI::GDAL::GDAL::DataType]
    # @return [Fixnum]
    def self.complex?(gdal_data_type)
      FFI::GDAL::GDAL.GDALDataTypeIsComplex(gdal_data_type)
    end

    # @param gdal_data_type [FFI::GDAL::GDAL::DataType]
    # @return [String]
    def self.name(gdal_data_type)
      FFI::GDAL::GDAL.GDALGetDataTypeName(gdal_data_type)
    end

    # The data type's symbolic name.
    #
    # @param name [String]
    # @return [FFI::GDAL::GDAL::DataType]
    def self.by_name(name)
      FFI::GDAL::GDAL.GDALGetDataTypeByName(name.to_s)
    end

    # @param gdal_data_type1 [FFI::GDAL::GDAL::DataType]
    # @param gdal_data_type2 [FFI::GDAL::GDAL::DataType]
    # @return [FFI::GDAL::GDAL::DataType]
    def self.union(gdal_data_type1, gdal_data_type2)
      FFI::GDAL::GDAL.GDALDataTypeUnion(gdal_data_type1, gdal_data_type2)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta16 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta15 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta14 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta13 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta12 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta11 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta10 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta9 lib/gdal/data_type.rb
ffi-gdal-1.0.0.beta8 lib/gdal/data_type.rb