Sha256: 2e785e869f9bfef612f91f7a5b47d01875087fab015eb590c4eccbbd901dd2c0

Contents?: true

Size: 919 Bytes

Versions: 2

Compression:

Stored size: 919 Bytes

Contents

require_relative 'color_entry_mixins/extensions'

module GDAL
  class ColorEntry
    include ColorEntryMixins::Extensions

    # @return [FFI::GDAL::ColorEntry]
    attr_reader :c_struct

    # @param color_entry [FFI::GDAL::ColorEntry]
    def initialize(color_entry = nil)
      @c_struct = color_entry || FFI::GDAL::ColorEntry.new
    end

    # @return [FFI::MemoryPointer] Pointer to the C struct.
    def c_pointer
      @c_struct.pointer
    end

    def color1
      @c_struct[:c1]
    end

    def color1=(new_color)
      @c_struct[:c1] = new_color
    end

    def color2
      @c_struct[:c2]
    end

    def color2=(new_color)
      @c_struct[:c2] = new_color
    end

    def color3
      @c_struct[:c3]
    end

    def color3=(new_color)
      @c_struct[:c3] = new_color
    end

    def color4
      @c_struct[:c4]
    end

    def color4=(new_color)
      @c_struct[:c4] = new_color
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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