Sha256: df07a25588ebbdc96fd54461525419a849fbf609b8b4e73e1aba15affc28263c

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module GDAL
  module Transformers
    class GeolocationTransformer
      # @return [FFI::Function]
      def self.function
        FFI::GDAL::Alg::GeoLocTransform
      end

      # @return [FFI::Pointer] C pointer to the C geolocation transformer.
      attr_reader :c_pointer

      # @param base_dataset [GDAL::Dataset]
      # @param geolocation_info [Array<String>]
      # @param reversed [Boolean]
      def intialize(base_dataset, geolocation_info, reversed = false)
        base_dataset_ptr = GDAL._pointer(GDAL::Dataset, base_dataset)
        geolocation_info_ptr = GDAL._string_array_to_pointer(geolocation_info)

        @c_pointer = FFI::GDAL::Alg.CreateGeoLocTransformer(
          base_dataset_ptr,
          geolocation_info_ptr,
          reversed
        )
      end

      def destroy!
        return unless @c_pointer

        FFI::GDAL::Alg.GDALDestroyGeoLocTransformer(@c_pointer)
        @c_pointer = nil
      end

      # @return [FFI::Function]
      def function
        self.class.function
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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