Method: Tiff::Tag#initialize

Defined in:
lib/tiff/tag.rb

#initialize(name, id, type, map = nil) ⇒ Tag

Creates a new tag.

  • name: A rubyish name for the tag. Displayed to users for exceptions.

  • id: The value for this tag as defined by ‘tiff.h`

  • type: The FFI type of the tag

  • map: A hash of ruby to FFI values (optional)

Examples:

width = Tag.new(:width, 256, :uint)
metric = Tag.new(:photometric, 262, :ushort, {
  min_is_white: 0,
  min_is_black: 1
})


33
34
35
36
37
38
# File 'lib/tiff/tag.rb', line 33

def initialize(name, id, type, map = nil)
  @name = name
  @id = id
  @type = type
  @map = map
end