Sha256: de6bd299a116ee1d21f865244aa16a2083a2aed9eaf8efb58d25984c3e02e489

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta7 lib/gdal/transformers/base_general_image_projection_transformer.rb
ffi-gdal-1.0.0.beta6 lib/gdal/transformers/base_general_image_projection_transformer.rb