Class: VIPS::Reader

Inherits:
Object
  • Object
show all
Includes:
Header
Defined in:
lib/vips/reader.rb,
ext/reader.c

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Header

#band_fmt, #bands, #exif, #exif?, #get, #icc, #icc?, #n_elements, #set, #sizeof_element, #sizeof_line, #sizeof_pel, #x_offset, #x_res, #x_size, #y_offset, #y_res, #y_size

Constructor Details

#initialize(path, options = {}) ⇒ Reader

Returns a new instance of Reader.



5
6
7
8
# File 'lib/vips/reader.rb', line 5

def initialize(path, options={})
  @path = path
  read_header path unless options[:skip_header]
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/vips/reader.rb', line 3

def path
  @path
end

Class Method Details

.read(path, options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/vips/reader.rb', line 10

def self.read(path, options={})
  options[:skip_header] = true
  reader = new path, options
  reader.read
end

.recognized?(path) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


53
54
55
56
57
58
59
60
61
62
# File 'ext/reader.c', line 53

static VALUE
reader_s_recognized_p(VALUE klass, VALUE path)
{
    VipsFormatClass *fmt_class = reader_get_fmt_class(klass);

    if (fmt_class && fmt_class->is_a && fmt_class->is_a(StringValuePtr(path)))
        return Qtrue;

    return Qfalse;
}

Instance Method Details

#readObject



16
17
18
# File 'lib/vips/reader.rb', line 16

def read
  read_internal @path
end