Module: VIPS::Header
Instance Method Summary collapse
-
#band_fmt ⇒ Object
Get the band format of the image.
-
#bands ⇒ Numeric
Get the number of bands in the image.
-
#exif ⇒ String
Returns a binary string containing the raw exif header data.
-
#exif? ⇒ Boolean
Indicates whether the image has an exif header attached to it.
-
#get(name) ⇒ String
Return metadata item ‘name’ as a string.
-
#icc ⇒ String
Returns a binary string containing the raw icc header data.
-
#icc? ⇒ Boolean
Indicates whether the image has an icc header attached to it.
-
#n_elements ⇒ Numeric
Returns the number of elements in an image row, i.e.
-
#set(name, value) ⇒ Object
Set metadata item ‘name’ to value.
-
#sizeof_element ⇒ Numeric
Returns the size of a single image band item, in bytes.
-
#sizeof_line ⇒ Numeric
Returns the size of all pixels in the row of the image, uncompressed, in bytes.
-
#sizeof_pel ⇒ Numeric
Returns the size of a pixel in the image, in bytes.
-
#x_offset ⇒ Numeric
Get the x-offset of the image.
-
#x_res ⇒ Numeric
Get the x-resolution of the image.
-
#x_size ⇒ Numeric
Get the width in pixels of the image.
-
#y_offset ⇒ Numeric
Get the y-offset of the image.
-
#y_res ⇒ Numeric
Get the y-resolution of the image.
-
#y_size ⇒ Numeric
Get the height in pixels of the image.
Instance Method Details
#band_fmt ⇒ Object
Get the band format of the image.
108 109 110 111 112 113 114 115 116 117 |
# File 'ext/header.c', line 108
static VALUE
header_band_fmt(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return ID2SYM(header_band_fmt_to_id(im->BandFmt));
return Qnil;
}
|
#bands ⇒ Numeric
Get the number of bands in the image.
90 91 92 93 94 95 96 97 98 99 |
# File 'ext/header.c', line 90
static VALUE
header_bands(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(im->Bands);
return Qnil;
}
|
#exif ⇒ String
Returns a binary string containing the raw exif header data.
322 323 324 325 326 |
# File 'ext/header.c', line 322
static VALUE
header_exif(VALUE obj)
{
return header_meta_get(obj, IM_META_EXIF_NAME);
}
|
#exif? ⇒ Boolean
Indicates whether the image has an exif header attached to it.
335 336 337 338 339 |
# File 'ext/header.c', line 335
static VALUE
header_exif_p(VALUE obj)
{
return header_meta_p(obj, IM_META_EXIF_NAME);
}
|
#get(name) ⇒ String
Return metadata item ‘name’ as a string.
374 375 376 377 378 |
# File 'ext/header.c', line 374
static VALUE
header_get(VALUE obj, VALUE name)
{
return header_meta_get_string(obj, StringValuePtr(name));
}
|
#icc ⇒ String
Returns a binary string containing the raw icc header data.
348 349 350 351 352 |
# File 'ext/header.c', line 348
static VALUE
header_icc(VALUE obj)
{
return header_meta_get(obj, IM_META_ICC_NAME);
}
|
#icc? ⇒ Boolean
Indicates whether the image has an icc header attached to it.
361 362 363 364 365 |
# File 'ext/header.c', line 361
static VALUE
header_icc_p(VALUE obj)
{
return header_meta_p(obj, IM_META_ICC_NAME);
}
|
#n_elements ⇒ Numeric
Returns the number of elements in an image row, i.e. bands * x_size.
255 256 257 258 259 260 261 262 263 264 |
# File 'ext/header.c', line 255
static VALUE
header_n_elements(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(IM_IMAGE_N_ELEMENTS(im));
return Qnil;
}
|
#set(name, value) ⇒ Object
Set metadata item ‘name’ to value.
387 388 389 390 391 392 393 394 |
# File 'ext/header.c', line 387
static VALUE
header_set(VALUE obj, VALUE name, VALUE value)
{
header_meta_set_string(obj,
StringValuePtr(name), StringValuePtr(value));
return Qnil;
}
|
#sizeof_element ⇒ Numeric
Returns the size of a single image band item, in bytes.
200 201 202 203 204 205 206 207 208 209 |
# File 'ext/header.c', line 200
static VALUE
header_sizeof_element(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(IM_IMAGE_SIZEOF_ELEMENT(im));
return Qnil;
}
|
#sizeof_line ⇒ Numeric
Returns the size of all pixels in the row of the image, uncompressed, in bytes.
237 238 239 240 241 242 243 244 245 246 |
# File 'ext/header.c', line 237
static VALUE
header_sizeof_line(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(IM_IMAGE_SIZEOF_LINE(im));
return Qnil;
}
|
#sizeof_pel ⇒ Numeric
Returns the size of a pixel in the image, in bytes.
218 219 220 221 222 223 224 225 226 227 |
# File 'ext/header.c', line 218
static VALUE
header_sizeof_pel(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(IM_IMAGE_SIZEOF_PEL(im));
return Qnil;
}
|
#x_offset ⇒ Numeric
Get the x-offset of the image.
162 163 164 165 166 167 168 169 170 171 |
# File 'ext/header.c', line 162
static VALUE
header_x_offset(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(im->Xoffset);
return Qnil;
}
|
#x_res ⇒ Numeric
Get the x-resolution of the image.
126 127 128 129 130 131 132 133 134 135 |
# File 'ext/header.c', line 126
static VALUE
header_x_res(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return rb_float_new(im->Xres);
return Qnil;
}
|
#x_size ⇒ Numeric
Get the width in pixels of the image.
54 55 56 57 58 59 60 61 62 63 |
# File 'ext/header.c', line 54
static VALUE
header_x_size(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(im->Xsize);
return Qnil;
}
|
#y_offset ⇒ Numeric
Get the y-offset of the image.
180 181 182 183 184 185 186 187 188 189 |
# File 'ext/header.c', line 180
static VALUE
header_y_offset(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(im->Yoffset);
return Qnil;
}
|
#y_res ⇒ Numeric
Get the y-resolution of the image.
144 145 146 147 148 149 150 151 152 153 |
# File 'ext/header.c', line 144
static VALUE
header_y_res(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return rb_float_new(im->Yres);
return Qnil;
}
|
#y_size ⇒ Numeric
Get the height in pixels of the image.
72 73 74 75 76 77 78 79 80 81 |
# File 'ext/header.c', line 72
static VALUE
header_y_size(VALUE obj)
{
GetImg(obj, data, im);
if (im)
return INT2FIX(im->Ysize);
return Qnil;
}
|