Class: LibRaw::RawObject

Inherits:
Object
  • Object
show all
Defined in:
ext/lib_raw/lib_raw.cpp

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'ext/lib_raw/lib_raw.cpp', line 200

VALUE rb_raw_object_initialize(VALUE self)
{
  LibRawNativeResource *p = ALLOC(LibRawNativeResource);
  p->libraw = NULL;

  try {
    p->libraw = new LibRaw(LIBRAW_OPTIONS_NONE);
  } catch (std::bad_alloc) {
    rb_raise(rb_eStandardError, "alloc error");
  }

  VALUE resource = Data_Wrap_Struct(CLASS_OF(self), 0, lib_raw_native_resource_delete, p);
  rb_iv_set(self, "lib_raw_native_resource", resource);

  apply_data(self, &p->libraw->imgdata);

  return self;
}

Instance Attribute Details

#idataObject (readonly)

#lensObject (readonly)

#otherObject (readonly)

#paramObject (readonly)

#sizeObject (readonly)

Instance Method Details

#dcraw_ppm_tiff_writer(filename) ⇒ Object



280
281
282
283
284
285
286
287
288
289
# File 'ext/lib_raw/lib_raw.cpp', line 280

VALUE rb_raw_object_dcraw_ppm_tiff_writer(VALUE self, VALUE filename)
{
  LibRaw *libraw = get_lib_raw(self);

  const char *name = RSTRING_PTR(filename);
  int ret = libraw->dcraw_ppm_tiff_writer(name);
  check_errors(ret);

  return Qtrue;
}

#dcraw_process(param) ⇒ Object



302
303
304
305
306
307
308
309
310
311
312
313
# File 'ext/lib_raw/lib_raw.cpp', line 302

VALUE rb_raw_object_dcraw_process(VALUE self, VALUE param)
{
  LibRaw *libraw = get_lib_raw(self);
  libraw_output_params_t *params = get_output_params(param);

  memmove(&libraw->imgdata.params, params, sizeof(libraw_output_params_t));

  int ret = libraw->dcraw_process();
  check_errors(ret);

  return Qtrue;
}

#dcraw_thumb_writer(filename) ⇒ Object



291
292
293
294
295
296
297
298
299
300
# File 'ext/lib_raw/lib_raw.cpp', line 291

VALUE rb_raw_object_dcraw_thumb_writer(VALUE self, VALUE filename)
{
  LibRaw *libraw = get_lib_raw(self);

  const char *name = RSTRING_PTR(filename);
  int ret = libraw->dcraw_thumb_writer(name);
  check_errors(ret);

  return Qtrue;
}

#open_buffer(buff) ⇒ Object



231
232
233
234
235
236
237
238
239
240
# File 'ext/lib_raw/lib_raw.cpp', line 231

VALUE rb_raw_object_open_buffer(VALUE self, VALUE buff)
{
  LibRaw *libraw = get_lib_raw(self);

  int ret = libraw->open_buffer(RSTRING_PTR(buff), RSTRING_LEN(buff));
  apply_rawobject(self);
  check_errors(ret);

  return Qtrue;
}

#open_file(filename) ⇒ Object



219
220
221
222
223
224
225
226
227
228
229
# File 'ext/lib_raw/lib_raw.cpp', line 219

VALUE rb_raw_object_open_file(VALUE self, VALUE filename)
{
  LibRaw *libraw = get_lib_raw(self);

  char *name = RSTRING_PTR(rb_obj_as_string(filename));
  int ret = libraw->open_file(name);
  apply_rawobject(self);
  check_errors(ret);

  return Qtrue;
}

#recycleObject



271
272
273
274
275
276
277
278
# File 'ext/lib_raw/lib_raw.cpp', line 271

VALUE rb_raw_object_recycle(VALUE self)
{
  LibRaw *libraw = get_lib_raw(self);

  libraw->recycle();

  return Qnil;
}

#recycle_datastreamObject



262
263
264
265
266
267
268
269
# File 'ext/lib_raw/lib_raw.cpp', line 262

VALUE rb_raw_object_recycle_datastream(VALUE self)
{
  LibRaw *libraw = get_lib_raw(self);

  libraw->recycle_datastream();

  return Qnil;
}

#unpackObject



242
243
244
245
246
247
248
249
250
# File 'ext/lib_raw/lib_raw.cpp', line 242

VALUE rb_raw_object_unpack(VALUE self)
{
  LibRaw *libraw = get_lib_raw(self);

  int ret = libraw->unpack();
  check_errors(ret);

  return Qtrue;
}

#unpack_thumbObject



252
253
254
255
256
257
258
259
260
# File 'ext/lib_raw/lib_raw.cpp', line 252

VALUE rb_raw_object_unpack_thumb(VALUE self)
{
  LibRaw *libraw = get_lib_raw(self);

  int ret = libraw->unpack_thumb();
  check_errors(ret);

  return Qtrue;
}