Class: VideoFile::Thumbnailer
- Inherits:
-
Data
- Object
- Data
- VideoFile::Thumbnailer
- Defined in:
- lib/video_file.rb,
ext/video_file_ext/ext.c
Instance Method Summary collapse
-
#file ⇒ VideoFile::File
The file associated with this thumbnailer.
-
#get(position, accurate: false, filter: false) ⇒ String
Obtain a thumbnail at the given position.
- #initialze(file, width, count = 1) ⇒ Object constructor
Constructor Details
#initialze(file, width, count = 1) ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'ext/video_file_ext/ext.c', line 136
VALUE thumbnailer_m_initialize(int argc, VALUE* argv, VALUE self)
{
VALUE file = Qnil;
VALUE width = Qnil;
VALUE count = Qnil;
rb_scan_args(argc, argv, "21", &file, &width, &count);
Check_TypedStruct(file, &file_type);
Thumbnailer *thumbnailer;
VfFile *file_;
TypedData_Get_Struct(self, Thumbnailer, &thumbnailer_type, thumbnailer);
TypedData_Get_Struct(file, VfFile, &file_type, file_);
int width_ = FIX2INT(width);
unsigned n_ = count == Qnil ? 1 : FIX2UINT(count);
if(!vf_thumbnailer_init(&thumbnailer->thumbnailer, file_, width_, n_)) {
rb_raise(eError, "%s", thumbnailer->thumbnailer.last_error_str);
}
return self;
}
|
Instance Method Details
#file ⇒ VideoFile::File
Returns the file associated with this thumbnailer.
159 160 161 162 163 |
# File 'ext/video_file_ext/ext.c', line 159
VALUE thumbnailer_m_file(VALUE self) {
Thumbnailer *thumbnailer;
TypedData_Get_Struct(self, Thumbnailer, &thumbnailer_type, thumbnailer);
return thumbnailer->file;
}
|
#get(position, accurate: false, filter: false) ⇒ String
Obtain a thumbnail at the given position
12 13 14 |
# File 'lib/video_file.rb', line 12 def get(position, accurate: false, filter: false) get__(position, accurate, filter) end |