rfreeimage 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rfreeimage/rfi_main.c +26 -26
- data/lib/rfreeimage/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05d71b62d0c2ac693fd0eee63afddcb633fdf5a9
|
4
|
+
data.tar.gz: 437d56c3a25f98974331d2c52856e8072c1e50e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db7b86426f3642f5ea7cd6ec8f894c57649674a6137b60f7e44c981407020ad14c33a9ae4ab76bcd09ded57c022715ff8d772c4b55f3420f32158434b1f9786
|
7
|
+
data.tar.gz: 0e382c04c69f405939c9ff729b86ac181b3fd36e071a602599cc169f5b53daf76854dce9aa59d86f2cd944b0199bb8c78106d8b0b8f2af303960750d4cc4bb43
|
data/ext/rfreeimage/rfi_main.c
CHANGED
@@ -39,7 +39,7 @@ struct native_image {
|
|
39
39
|
FIBITMAP *handle;
|
40
40
|
};
|
41
41
|
|
42
|
-
void Image_free(struct native_image* img)
|
42
|
+
static void Image_free(struct native_image* img)
|
43
43
|
{
|
44
44
|
if(!img)
|
45
45
|
return;
|
@@ -48,7 +48,7 @@ void Image_free(struct native_image* img)
|
|
48
48
|
free(img);
|
49
49
|
}
|
50
50
|
|
51
|
-
VALUE Image_alloc(VALUE self)
|
51
|
+
static VALUE Image_alloc(VALUE self)
|
52
52
|
{
|
53
53
|
/* allocate */
|
54
54
|
struct native_image* img = malloc(sizeof(struct native_image));
|
@@ -172,7 +172,7 @@ rd_image_blob(VALUE clazz, VALUE blob, struct native_image *img, unsigned int bp
|
|
172
172
|
img->fif = in_fif;
|
173
173
|
}
|
174
174
|
|
175
|
-
VALUE Image_initialize(int argc, VALUE *argv, VALUE self)
|
175
|
+
static VALUE Image_initialize(int argc, VALUE *argv, VALUE self)
|
176
176
|
{
|
177
177
|
struct native_image* img;
|
178
178
|
/* unwrap */
|
@@ -200,7 +200,7 @@ VALUE Image_initialize(int argc, VALUE *argv, VALUE self)
|
|
200
200
|
#define RFI_CHECK_IMG(x) \
|
201
201
|
if (!img->handle) rb_raise(Class_RFIError, "Image pixels not loaded");
|
202
202
|
|
203
|
-
VALUE Image_save(VALUE self, VALUE file)
|
203
|
+
static VALUE Image_save(VALUE self, VALUE file)
|
204
204
|
{
|
205
205
|
char *filename;
|
206
206
|
struct native_image* img;
|
@@ -234,7 +234,7 @@ VALUE Image_save(VALUE self, VALUE file)
|
|
234
234
|
return Qnil;
|
235
235
|
}
|
236
236
|
|
237
|
-
VALUE Image_to_blob(VALUE self, VALUE type)
|
237
|
+
static VALUE Image_to_blob(VALUE self, VALUE type)
|
238
238
|
{
|
239
239
|
char *filetype;
|
240
240
|
struct native_image* img;
|
@@ -282,35 +282,35 @@ VALUE Image_to_blob(VALUE self, VALUE type)
|
|
282
282
|
|
283
283
|
|
284
284
|
|
285
|
-
VALUE Image_cols(VALUE self)
|
285
|
+
static VALUE Image_cols(VALUE self)
|
286
286
|
{
|
287
287
|
struct native_image* img;
|
288
288
|
Data_Get_Struct(self, struct native_image, img);
|
289
289
|
return INT2NUM(img->w);
|
290
290
|
}
|
291
291
|
|
292
|
-
VALUE Image_rows(VALUE self)
|
292
|
+
static VALUE Image_rows(VALUE self)
|
293
293
|
{
|
294
294
|
struct native_image* img;
|
295
295
|
Data_Get_Struct(self, struct native_image, img);
|
296
296
|
return INT2NUM(img->h);
|
297
297
|
}
|
298
298
|
|
299
|
-
VALUE Image_bpp(VALUE self)
|
299
|
+
static VALUE Image_bpp(VALUE self)
|
300
300
|
{
|
301
301
|
struct native_image* img;
|
302
302
|
Data_Get_Struct(self, struct native_image, img);
|
303
303
|
return INT2NUM(img->bpp);
|
304
304
|
}
|
305
305
|
|
306
|
-
VALUE Image_stride(VALUE self)
|
306
|
+
static VALUE Image_stride(VALUE self)
|
307
307
|
{
|
308
308
|
struct native_image* img;
|
309
309
|
Data_Get_Struct(self, struct native_image, img);
|
310
310
|
return INT2NUM(img->stride);
|
311
311
|
}
|
312
312
|
|
313
|
-
VALUE Image_format(VALUE self)
|
313
|
+
static VALUE Image_format(VALUE self)
|
314
314
|
{
|
315
315
|
struct native_image* img;
|
316
316
|
const char *p;
|
@@ -319,7 +319,7 @@ VALUE Image_format(VALUE self)
|
|
319
319
|
return rb_str_new(p, strlen(p));
|
320
320
|
}
|
321
321
|
|
322
|
-
VALUE Image_release(VALUE self)
|
322
|
+
static VALUE Image_release(VALUE self)
|
323
323
|
{
|
324
324
|
struct native_image* img;
|
325
325
|
Data_Get_Struct(self, struct native_image, img);
|
@@ -330,7 +330,7 @@ VALUE Image_release(VALUE self)
|
|
330
330
|
}
|
331
331
|
|
332
332
|
|
333
|
-
VALUE Image_read_bytes(VALUE self)
|
333
|
+
static VALUE Image_read_bytes(VALUE self)
|
334
334
|
{
|
335
335
|
struct native_image* img;
|
336
336
|
const char *p;
|
@@ -355,7 +355,7 @@ VALUE Image_read_bytes(VALUE self)
|
|
355
355
|
return v;
|
356
356
|
}
|
357
357
|
|
358
|
-
VALUE Image_buffer_addr(VALUE self)
|
358
|
+
static VALUE Image_buffer_addr(VALUE self)
|
359
359
|
{
|
360
360
|
struct native_image* img;
|
361
361
|
const char *p;
|
@@ -366,7 +366,7 @@ VALUE Image_buffer_addr(VALUE self)
|
|
366
366
|
return ULONG2NUM((uintptr_t)p);
|
367
367
|
}
|
368
368
|
|
369
|
-
VALUE Image_has_bytes(VALUE self)
|
369
|
+
static VALUE Image_has_bytes(VALUE self)
|
370
370
|
{
|
371
371
|
struct native_image* img;
|
372
372
|
Data_Get_Struct(self, struct native_image, img);
|
@@ -388,7 +388,7 @@ static inline VALUE rfi_get_image(FIBITMAP *nh)
|
|
388
388
|
return Data_Wrap_Struct(Class_Image, NULL, Image_free, new_img);
|
389
389
|
}
|
390
390
|
|
391
|
-
VALUE Image_to_bpp(VALUE self, VALUE _bpp)
|
391
|
+
static VALUE Image_to_bpp(VALUE self, VALUE _bpp)
|
392
392
|
{
|
393
393
|
struct native_image *img;
|
394
394
|
FIBITMAP *nh;
|
@@ -404,7 +404,7 @@ VALUE Image_to_bpp(VALUE self, VALUE _bpp)
|
|
404
404
|
return rfi_get_image(nh);
|
405
405
|
}
|
406
406
|
|
407
|
-
VALUE Image_rotate(VALUE self, VALUE _angle)
|
407
|
+
static VALUE Image_rotate(VALUE self, VALUE _angle)
|
408
408
|
{
|
409
409
|
struct native_image *img;
|
410
410
|
FIBITMAP *nh;
|
@@ -416,7 +416,7 @@ VALUE Image_rotate(VALUE self, VALUE _angle)
|
|
416
416
|
return rfi_get_image(nh);
|
417
417
|
}
|
418
418
|
|
419
|
-
VALUE Image_clone(VALUE self)
|
419
|
+
static VALUE Image_clone(VALUE self)
|
420
420
|
{
|
421
421
|
struct native_image *img;
|
422
422
|
FIBITMAP *nh;
|
@@ -427,7 +427,7 @@ VALUE Image_clone(VALUE self)
|
|
427
427
|
return rfi_get_image(nh);
|
428
428
|
}
|
429
429
|
|
430
|
-
VALUE Image_rescale(VALUE self, VALUE dst_width, VALUE dst_height, VALUE filter_type)
|
430
|
+
static VALUE Image_rescale(VALUE self, VALUE dst_width, VALUE dst_height, VALUE filter_type)
|
431
431
|
{
|
432
432
|
struct native_image *img;
|
433
433
|
FIBITMAP *nh;
|
@@ -447,7 +447,7 @@ VALUE Image_rescale(VALUE self, VALUE dst_width, VALUE dst_height, VALUE filter_
|
|
447
447
|
return rfi_get_image(nh);
|
448
448
|
}
|
449
449
|
|
450
|
-
VALUE Image_downscale(VALUE self, VALUE max_size) {
|
450
|
+
static VALUE Image_downscale(VALUE self, VALUE max_size) {
|
451
451
|
// down-sample resize
|
452
452
|
struct native_image *img;
|
453
453
|
FIBITMAP *nh;
|
@@ -501,7 +501,7 @@ VALUE Image_downscale(VALUE self, VALUE max_size) {
|
|
501
501
|
return rfi_get_image(nh);
|
502
502
|
}
|
503
503
|
|
504
|
-
VALUE Image_crop(VALUE self, VALUE _left, VALUE _top, VALUE _right, VALUE _bottom)
|
504
|
+
static VALUE Image_crop(VALUE self, VALUE _left, VALUE _top, VALUE _right, VALUE _bottom)
|
505
505
|
{
|
506
506
|
struct native_image *img;
|
507
507
|
FIBITMAP *nh;
|
@@ -526,7 +526,7 @@ VALUE Image_crop(VALUE self, VALUE _left, VALUE _top, VALUE _right, VALUE _botto
|
|
526
526
|
struct native_image* img; \
|
527
527
|
Data_Get_Struct(__v, struct native_image, img) \
|
528
528
|
|
529
|
-
VALUE Image_ping(VALUE self, VALUE file)
|
529
|
+
static VALUE Image_ping(VALUE self, VALUE file)
|
530
530
|
{
|
531
531
|
ALLOC_NEW_IMAGE(v, img);
|
532
532
|
|
@@ -538,7 +538,7 @@ VALUE Image_ping(VALUE self, VALUE file)
|
|
538
538
|
return v;
|
539
539
|
}
|
540
540
|
|
541
|
-
VALUE Image_from_blob(int argc, VALUE *argv, VALUE self)
|
541
|
+
static VALUE Image_from_blob(int argc, VALUE *argv, VALUE self)
|
542
542
|
{
|
543
543
|
ALLOC_NEW_IMAGE(v, img);
|
544
544
|
|
@@ -561,7 +561,7 @@ VALUE Image_from_blob(int argc, VALUE *argv, VALUE self)
|
|
561
561
|
return v;
|
562
562
|
}
|
563
563
|
|
564
|
-
VALUE Image_ping_blob(VALUE self, VALUE blob)
|
564
|
+
static VALUE Image_ping_blob(VALUE self, VALUE blob)
|
565
565
|
{
|
566
566
|
ALLOC_NEW_IMAGE(v, img);
|
567
567
|
|
@@ -573,7 +573,7 @@ VALUE Image_ping_blob(VALUE self, VALUE blob)
|
|
573
573
|
return v;
|
574
574
|
}
|
575
575
|
|
576
|
-
VALUE Image_from_bytes(VALUE self, VALUE bytes, VALUE width,
|
576
|
+
static VALUE Image_from_bytes(VALUE self, VALUE bytes, VALUE width,
|
577
577
|
VALUE height, VALUE stride, VALUE bpp)
|
578
578
|
{
|
579
579
|
long f_len;
|
@@ -617,7 +617,7 @@ VALUE Image_from_bytes(VALUE self, VALUE bytes, VALUE width,
|
|
617
617
|
}
|
618
618
|
|
619
619
|
/* draw */
|
620
|
-
VALUE Image_draw_point(VALUE self, VALUE _x, VALUE _y, VALUE color, VALUE _size)
|
620
|
+
static VALUE Image_draw_point(VALUE self, VALUE _x, VALUE _y, VALUE color, VALUE _size)
|
621
621
|
{
|
622
622
|
struct native_image* img;
|
623
623
|
int x = NUM2INT(_x);
|
@@ -640,7 +640,7 @@ VALUE Image_draw_point(VALUE self, VALUE _x, VALUE _y, VALUE color, VALUE _size)
|
|
640
640
|
return self;
|
641
641
|
}
|
642
642
|
|
643
|
-
VALUE Image_draw_rectangle(VALUE self, VALUE _x1, VALUE _y1,
|
643
|
+
static VALUE Image_draw_rectangle(VALUE self, VALUE _x1, VALUE _y1,
|
644
644
|
VALUE _x2, VALUE _y2,
|
645
645
|
VALUE color, VALUE _width)
|
646
646
|
{
|
data/lib/rfreeimage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfreeimage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuheng Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -924,7 +924,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
924
924
|
version: '0'
|
925
925
|
requirements: []
|
926
926
|
rubyforge_project:
|
927
|
-
rubygems_version: 2.4.
|
927
|
+
rubygems_version: 2.4.8
|
928
928
|
signing_key:
|
929
929
|
specification_version: 4
|
930
930
|
summary: Ruby extension for FreeImage library.
|