Class: VIPS::Writer

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

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(*args) ⇒ Object

:nodoc:



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'ext/writer.c', line 5

static VALUE
writer_initialize(int argc, VALUE *argv, VALUE obj)
{
    VALUE image, opts;
	rb_scan_args(argc, argv, "11", &image, &opts);
    GetImg(image, data, im);
    GetImg(obj, data_new, im_new);

    img_add_dep(data_new, image);
    if (im_copy(im, im_new))
        vips_lib_error();

    return obj;
}

Instance Method Details

#exif=(exif_data) ⇒ Object

Sets the exif header of the writer to exif_data. This will be written only if the file format supports embedded exif data.



77
78
79
80
81
# File 'ext/writer.c', line 77

static VALUE
writer_exif_set(VALUE obj, VALUE str)
{
    return writer_meta_set(obj, IM_META_EXIF_NAME, str);
}

#icc=(icc_data) ⇒ Object

Sets the icc header of the writer to icc_data. This will be written only if the file format supports embedded icc data.



105
106
107
108
109
# File 'ext/writer.c', line 105

static VALUE
writer_icc_set(VALUE obj, VALUE str)
{
    return writer_meta_set(obj, IM_META_ICC_NAME, str);
}

#imageObject

Returns the image associated with self.



27
28
29
30
31
32
33
34
35
36
# File 'ext/writer.c', line 27

static VALUE
writer_image(VALUE obj)
{
    GetImg(obj, data, im);

    if(data->deps)
        return data->deps[0];

    return Qnil;
}

#remove_exifBoolean

Removes exif data associated with self.

Returns:

  • (Boolean)


90
91
92
93
94
# File 'ext/writer.c', line 90

static VALUE
writer_remove_exif(VALUE obj)
{
    return writer_meta_remove(obj, IM_META_EXIF_NAME);
}

#remove_iccBoolean

Removes icc data associated with self.

Returns:

  • (Boolean)


118
119
120
121
122
# File 'ext/writer.c', line 118

static VALUE
writer_remove_icc(VALUE obj)
{
    return writer_meta_remove(obj, IM_META_ICC_NAME);
}

#write(path) ⇒ Object



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

def write(path)
  write_internal path
end