Sha256: 1400fdb28ff9bb727909a632ce9fa31c36d6e412628a55d32ef5939400b02989

Contents?: true

Size: 1.23 KB

Versions: 9

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

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

      attr_reader :c_pointer

      def destroy!
        return unless @c_pointer

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

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

      # Normally the destination geotransform is extracted from the destination
      # file by the transformer and stored in internal private info. However,
      # sometimes it is inconvenient to have an output file handle with
      # appropriate geotransform information when creating the transformation.
      # For these cases, this function can be used to apply the destination
      # geotransform.
      #
      # @param [FFI::Pointer, GDAL::GeoTransform] geo_transform
      def destination_geo_transform=(geo_transform)
        geo_transform_ptr = GDAL._pointer(GDAL::GeoTransform, geo_transform)

        FFI::GDAL::Alg.GDALSetGenImgProjTransformerDstGeoTransform(
          @c_pointer, geo_transform_ptr
        )
      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/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta15 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta14 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta13 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta12 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta11 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta10 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta9 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta8 lib/gdal/transformers/base_general_image_projection_transformer.rb