Class: VIPS::Reader
- Inherits:
-
Object
- Object
- VIPS::Reader
- Includes:
- Header
- Defined in:
- lib/vips/reader.rb,
ext/reader.c
Direct Known Subclasses
AnalyzeReader, CSVReader, EXRReader, JPEGReader, MagickReader, PNGReader, PPMReader, RAWReader, TIFFReader, VIPSReader
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
-
.recognized?(path) ⇒ Boolean
:nodoc:.
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ Reader
constructor
A new instance of Reader.
- #read ⇒ Object
-
#x_size ⇒ Object
support these two for compat with older ruby-vips.
- #y_size ⇒ Object
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, #y_offset, #y_res
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, ={}) @path = path @_im = nil end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/vips/reader.rb', line 3 def path @path end |
Class Method Details
.recognized?(path) ⇒ Boolean
:nodoc:
26 27 28 29 30 31 32 33 34 35 |
# File 'ext/reader.c', line 26
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
#read ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/vips/reader.rb', line 10 def read # in case the sub-class has not read it if not @_im @_im = read_internal @path, 0 end @_im end |
#x_size ⇒ Object
support these two for compat with older ruby-vips
19 20 21 |
# File 'lib/vips/reader.rb', line 19 def x_size @_im.x_size end |
#y_size ⇒ Object
23 24 25 |
# File 'lib/vips/reader.rb', line 23 def y_size @_im.y_size end |