Sha256: db308313825cbb29886a879f84d573feca9f16ab8b90a73592e2c838de9dfa18

Contents?: true

Size: 534 Bytes

Versions: 3

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

module GDAL
  class Dataset
    module InternalFunctions
      # Makes a pointer of +band_numbers+.
      #
      # @param band_numbers [Array<Integer>]
      # @return [Array<FFI::MemoryPointer, Integer>]
      def self.band_numbers_args(band_numbers)
        band_count = band_numbers&.size || 0
        ptr = FFI::MemoryPointer.new(:int, band_count)

        ptr.write_array_of_int(band_numbers) if band_numbers

        ptr.autorelease = false

        [ptr, band_count]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ffi-gdal-1.1.0 lib/gdal/dataset/internal_functions.rb
ffi-gdal-1.0.4 lib/gdal/dataset/internal_functions.rb
ffi-gdal-1.0.3 lib/gdal/dataset/internal_functions.rb