rmagick 4.2.5 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/Dockerfile +14 -0
- data/.devcontainer/ImageMagick6/devcontainer.json +11 -0
- data/.devcontainer/devcontainer.json +11 -0
- data/.devcontainer/setup-repo.sh +10 -0
- data/.devcontainer/setup-user.sh +45 -0
- data/.editorconfig +1 -1
- data/.github/workflows/ci.yml +90 -9
- data/.gitignore +4 -0
- data/.rubocop_todo.yml +16 -9
- data/.yardopts +1 -1
- data/CHANGELOG.md +141 -0
- data/Gemfile +20 -0
- data/README.md +12 -17
- data/Rakefile +63 -80
- data/before_install_linux.sh +4 -4
- data/before_install_osx.sh +7 -6
- data/ext/RMagick/extconf.rb +113 -52
- data/ext/RMagick/{rmagick.c → rmagick.cpp} +19 -22
- data/ext/RMagick/rmagick.h +88 -59
- data/ext/RMagick/rmagick_gvl.h +224 -0
- data/ext/RMagick/{rmdraw.c → rmdraw.cpp} +170 -159
- data/ext/RMagick/{rmenum.c → rmenum.cpp} +69 -50
- data/ext/RMagick/{rmfill.c → rmfill.cpp} +85 -24
- data/ext/RMagick/{rmilist.c → rmilist.cpp} +191 -93
- data/ext/RMagick/{rmimage.c → rmimage.cpp} +1544 -989
- data/ext/RMagick/{rminfo.c → rminfo.cpp} +140 -152
- data/ext/RMagick/{rmkinfo.c → rmkinfo.cpp} +46 -34
- data/ext/RMagick/rmmain.cpp +1923 -0
- data/ext/RMagick/{rmmontage.c → rmmontage.cpp} +50 -29
- data/ext/RMagick/{rmpixel.c → rmpixel.cpp} +108 -83
- data/ext/RMagick/{rmstruct.c → rmstruct.cpp} +6 -6
- data/ext/RMagick/{rmutil.c → rmutil.cpp} +62 -161
- data/lib/rmagick/version.rb +3 -1
- data/lib/rmagick.rb +2 -0
- data/lib/rmagick_internal.rb +76 -110
- data/lib/rvg/embellishable.rb +6 -2
- data/lib/rvg/misc.rb +7 -7
- data/lib/rvg/rvg.rb +2 -0
- data/lib/rvg/stretchable.rb +2 -2
- data/lib/rvg/transformable.rb +1 -1
- data/rmagick.gemspec +6 -17
- data/sig/rmagick/_draw_common_methods.rbs +64 -0
- data/sig/rmagick/_image_common_methods.rbs +389 -0
- data/sig/rmagick/draw.rbs +38 -0
- data/sig/rmagick/draw_attribute.rbs +28 -0
- data/sig/rmagick/enum.rbs +814 -0
- data/sig/rmagick/error.rbs +11 -0
- data/sig/rmagick/fill.rbs +21 -0
- data/sig/rmagick/geometry.rbs +14 -0
- data/sig/rmagick/image.rbs +194 -0
- data/sig/rmagick/image_list.rbs +181 -0
- data/sig/rmagick/iptc.rbs +101 -0
- data/sig/rmagick/kernel_info.rbs +12 -0
- data/sig/rmagick/optional_method_arguments.rbs +10 -0
- data/sig/rmagick/pixel.rbs +46 -0
- data/sig/rmagick/struct.rbs +90 -0
- data/sig/rmagick.rbs +43 -0
- data/sig/rvg/clippath.rbs +34 -0
- data/sig/rvg/container.rbs +78 -0
- data/sig/rvg/deep_equal.rbs +48 -0
- data/sig/rvg/describable.rbs +30 -0
- data/sig/rvg/embellishable.rbs +226 -0
- data/sig/rvg/misc.rbs +145 -0
- data/sig/rvg/paint.rbs +55 -0
- data/sig/rvg/pathdata.rbs +77 -0
- data/sig/rvg/rvg.rbs +125 -0
- data/sig/rvg/stretchable.rbs +56 -0
- data/sig/rvg/stylable.rbs +66 -0
- data/sig/rvg/text.rbs +118 -0
- data/sig/rvg/transformable.rbs +59 -0
- data/sig/rvg/units.rbs +33 -0
- metadata +63 -128
- data/.codeclimate.yml +0 -63
- data/deprecated/RMagick.rb +0 -6
- data/ext/RMagick/rmmain.c +0 -1951
@@ -5,8 +5,8 @@
|
|
5
5
|
*
|
6
6
|
* Changes since Nov. 2009 copyright © by Benjamin Thomas and Omer Bar-or
|
7
7
|
*
|
8
|
-
* @file rmagick.
|
9
|
-
* @version $Id: rmagick.
|
8
|
+
* @file rmagick.cpp
|
9
|
+
* @version $Id: rmagick.cpp,v 1.4 2009/12/20 02:33:32 baror Exp $
|
10
10
|
* @author Tim Hunter
|
11
11
|
******************************************************************************/
|
12
12
|
|
@@ -14,8 +14,6 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
static VALUE rm_yield_handle_exception(VALUE, VALUE) ATTRIBUTE_NORETURN;
|
18
|
-
|
19
17
|
static VALUE
|
20
18
|
rm_yield_body(VALUE object)
|
21
19
|
{
|
@@ -42,7 +40,7 @@ rm_yield_handle_exception(VALUE allocated_area, VALUE exc)
|
|
42
40
|
*
|
43
41
|
*/
|
44
42
|
VALUE
|
45
|
-
Magick_colors(VALUE
|
43
|
+
Magick_colors(VALUE klass)
|
46
44
|
{
|
47
45
|
const ColorInfo **color_info_list;
|
48
46
|
size_t number_colors, x;
|
@@ -60,10 +58,10 @@ Magick_colors(VALUE class)
|
|
60
58
|
{
|
61
59
|
for (x = 0; x < number_colors; x++)
|
62
60
|
{
|
63
|
-
rb_rescue(rm_yield_body, Import_ColorInfo(color_info_list[x]), rm_yield_handle_exception, (VALUE)color_info_list);
|
61
|
+
rb_rescue(RESCUE_FUNC(rm_yield_body), Import_ColorInfo(color_info_list[x]), RESCUE_EXCEPTION_HANDLER_FUNC(rm_yield_handle_exception), (VALUE)color_info_list);
|
64
62
|
}
|
65
63
|
magick_free((void *)color_info_list);
|
66
|
-
return
|
64
|
+
return klass;
|
67
65
|
}
|
68
66
|
else
|
69
67
|
{
|
@@ -93,7 +91,7 @@ Magick_colors(VALUE class)
|
|
93
91
|
*
|
94
92
|
*/
|
95
93
|
VALUE
|
96
|
-
Magick_fonts(VALUE
|
94
|
+
Magick_fonts(VALUE klass)
|
97
95
|
{
|
98
96
|
const TypeInfo **type_info;
|
99
97
|
size_t number_types, x;
|
@@ -109,10 +107,10 @@ Magick_fonts(VALUE class)
|
|
109
107
|
{
|
110
108
|
for (x = 0; x < number_types; x++)
|
111
109
|
{
|
112
|
-
rb_rescue(rm_yield_body, Import_TypeInfo((const TypeInfo *)type_info[x]), rm_yield_handle_exception, (VALUE)type_info);
|
110
|
+
rb_rescue(RESCUE_FUNC(rm_yield_body), Import_TypeInfo((const TypeInfo *)type_info[x]), RESCUE_EXCEPTION_HANDLER_FUNC(rm_yield_handle_exception), (VALUE)type_info);
|
113
111
|
}
|
114
112
|
magick_free((void *)type_info);
|
115
|
-
return
|
113
|
+
return klass;
|
116
114
|
}
|
117
115
|
else
|
118
116
|
{
|
@@ -170,7 +168,7 @@ MagickInfo_to_format(const MagickInfo *magick_info)
|
|
170
168
|
* @return [Hash] the formats hash.
|
171
169
|
*/
|
172
170
|
VALUE
|
173
|
-
Magick_init_formats(VALUE
|
171
|
+
Magick_init_formats(VALUE klass ATTRIBUTE_UNUSED)
|
174
172
|
{
|
175
173
|
const MagickInfo **magick_info;
|
176
174
|
size_t number_formats, x;
|
@@ -210,11 +208,11 @@ Magick_init_formats(VALUE class ATTRIBUTE_UNUSED)
|
|
210
208
|
* Set resource limits.
|
211
209
|
* @param resource [String, Symbol] the type of resource
|
212
210
|
* @param limit [Numeric] the new limit number
|
213
|
-
*
|
211
|
+
*
|
214
212
|
* @return [Numeric] the old limit.
|
215
213
|
*/
|
216
214
|
VALUE
|
217
|
-
Magick_limit_resource(int argc, VALUE *argv, VALUE
|
215
|
+
Magick_limit_resource(int argc, VALUE *argv, VALUE klass)
|
218
216
|
{
|
219
217
|
VALUE resource, limit;
|
220
218
|
ResourceType res = UndefinedResource;
|
@@ -227,7 +225,7 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
227
225
|
switch (TYPE(resource))
|
228
226
|
{
|
229
227
|
case T_NIL:
|
230
|
-
return
|
228
|
+
return klass;
|
231
229
|
|
232
230
|
case T_SYMBOL:
|
233
231
|
id = (ID)SYM2ID(resource);
|
@@ -265,7 +263,7 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
265
263
|
str = StringValueCStr(resource);
|
266
264
|
if (*str == '\0')
|
267
265
|
{
|
268
|
-
return
|
266
|
+
return klass;
|
269
267
|
}
|
270
268
|
else if (rm_strcasecmp("area", str) == 0)
|
271
269
|
{
|
@@ -321,12 +319,12 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
|
|
321
319
|
* @param threshold [Numeric] the number of megabytes to set.
|
322
320
|
*/
|
323
321
|
VALUE
|
324
|
-
Magick_set_cache_threshold(VALUE
|
322
|
+
Magick_set_cache_threshold(VALUE klass, VALUE threshold)
|
325
323
|
{
|
326
324
|
unsigned long thrshld = NUM2ULONG(threshold);
|
327
325
|
SetMagickResourceLimit(MemoryResource, (MagickSizeType)thrshld);
|
328
326
|
SetMagickResourceLimit(MapResource, (MagickSizeType)(2*thrshld));
|
329
|
-
return
|
327
|
+
return klass;
|
330
328
|
}
|
331
329
|
|
332
330
|
|
@@ -354,7 +352,7 @@ Magick_set_cache_threshold(VALUE class, VALUE threshold)
|
|
354
352
|
* @param args [String] the mask of log event.
|
355
353
|
*/
|
356
354
|
VALUE
|
357
|
-
Magick_set_log_event_mask(int argc, VALUE *argv, VALUE
|
355
|
+
Magick_set_log_event_mask(int argc, VALUE *argv, VALUE klass)
|
358
356
|
{
|
359
357
|
int x;
|
360
358
|
|
@@ -366,7 +364,7 @@ Magick_set_log_event_mask(int argc, VALUE *argv, VALUE class)
|
|
366
364
|
{
|
367
365
|
SetLogEventMask(StringValueCStr(argv[x]));
|
368
366
|
}
|
369
|
-
return
|
367
|
+
return klass;
|
370
368
|
}
|
371
369
|
|
372
370
|
/**
|
@@ -388,9 +386,8 @@ Magick_set_log_event_mask(int argc, VALUE *argv, VALUE class)
|
|
388
386
|
* @param format [String] the format to set.
|
389
387
|
*/
|
390
388
|
VALUE
|
391
|
-
Magick_set_log_format(VALUE
|
389
|
+
Magick_set_log_format(VALUE klass, VALUE format)
|
392
390
|
{
|
393
391
|
SetLogFormat(StringValueCStr(format));
|
394
|
-
return
|
392
|
+
return klass;
|
395
393
|
}
|
396
|
-
|
data/ext/RMagick/rmagick.h
CHANGED
@@ -16,14 +16,21 @@
|
|
16
16
|
//! Suppress warnings about deprecated functions on Windows
|
17
17
|
#define _CRT_SECURE_NO_DEPRECATE 1
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
#include
|
22
|
-
|
23
|
-
|
24
|
-
#include <
|
25
|
-
#include
|
26
|
-
#include
|
19
|
+
// ruby.h contains a C++ template, which cannot be included in extern "C".
|
20
|
+
// Therefore, it includes the header in advance.
|
21
|
+
#include "ruby/defines.h"
|
22
|
+
|
23
|
+
extern "C" {
|
24
|
+
#include <assert.h>
|
25
|
+
#include <stdio.h>
|
26
|
+
#include <ctype.h>
|
27
|
+
#include <stdlib.h>
|
28
|
+
#include <math.h>
|
29
|
+
#include <sys/types.h>
|
30
|
+
#include "ruby.h"
|
31
|
+
#include "ruby/io.h"
|
32
|
+
#include "rmagick_gvl.h"
|
33
|
+
}
|
27
34
|
|
28
35
|
#if defined(__MINGW32__)
|
29
36
|
// Ruby defines wrong format specifiers for MinGW. So this defines original macro in here.
|
@@ -44,10 +51,6 @@
|
|
44
51
|
#endif
|
45
52
|
|
46
53
|
#if defined(__GNUC__)
|
47
|
-
#pragma GCC diagnostic push
|
48
|
-
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
|
49
|
-
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
|
50
|
-
|
51
54
|
#if __GNUC__ > 6
|
52
55
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
53
56
|
#endif
|
@@ -61,6 +64,11 @@
|
|
61
64
|
#undef PACKAGE_TARNAME
|
62
65
|
#undef WORDS_BIGENDIAN
|
63
66
|
|
67
|
+
#ifndef HAVE_RB_EXT_RACTOR_SAFE
|
68
|
+
#undef RUBY_TYPED_FROZEN_SHAREABLE
|
69
|
+
#define RUBY_TYPED_FROZEN_SHAREABLE 0
|
70
|
+
#endif
|
71
|
+
|
64
72
|
#include "extconf.h"
|
65
73
|
|
66
74
|
#if defined(IMAGEMAGICK_7)
|
@@ -90,8 +98,8 @@
|
|
90
98
|
|
91
99
|
//! Trace new image creation in bang methods
|
92
100
|
#define UPDATE_DATA_PTR(_obj_, _new_) \
|
93
|
-
do {
|
94
|
-
|
101
|
+
do { \
|
102
|
+
DATA_PTR(_obj_) = (void *)(_new_); \
|
95
103
|
} while(0)
|
96
104
|
|
97
105
|
|
@@ -310,7 +318,7 @@ typedef enum _QuantumExpressionOperator
|
|
310
318
|
|
311
319
|
|
312
320
|
/** This implements the "omitted storage class model" for external variables.
|
313
|
-
* (Ref: Harbison & Steele.) The rmmain.
|
321
|
+
* (Ref: Harbison & Steele.) The rmmain.cpp file defines MAIN, which causes
|
314
322
|
* the single defining declarations to be generated. No other source files
|
315
323
|
* define MAIN and therefore generate referencing declarations.
|
316
324
|
*/
|
@@ -325,6 +333,7 @@ typedef enum _QuantumExpressionOperator
|
|
325
333
|
* RMagick Module and Class VALUEs
|
326
334
|
*/
|
327
335
|
EXTERN VALUE Module_Magick;
|
336
|
+
EXTERN VALUE Module_DrawAttribute;
|
328
337
|
EXTERN VALUE Class_ImageList;
|
329
338
|
EXTERN VALUE Class_Info;
|
330
339
|
EXTERN VALUE Class_KernelInfo;
|
@@ -396,7 +405,6 @@ EXTERN VALUE Class_KernelInfoType;
|
|
396
405
|
/**
|
397
406
|
* Commonly-used IDs
|
398
407
|
*/
|
399
|
-
EXTERN ID rm_ID_trace_proc; /**< "@trace_proc" */
|
400
408
|
EXTERN ID rm_ID_call; /**< "call" */
|
401
409
|
EXTERN ID rm_ID_changed; /**< "changed" */
|
402
410
|
EXTERN ID rm_ID_cur_image; /**< "cur_image" */
|
@@ -411,7 +419,13 @@ EXTERN ID rm_ID_push; /**< "push" */
|
|
411
419
|
EXTERN ID rm_ID_values; /**< "values" */
|
412
420
|
EXTERN ID rm_ID_width; /**< "width" */
|
413
421
|
|
414
|
-
|
422
|
+
extern const rb_data_type_t rm_enum_data_type;
|
423
|
+
extern const rb_data_type_t rm_info_data_type;
|
424
|
+
extern const rb_data_type_t rm_image_data_type;
|
425
|
+
extern const rb_data_type_t rm_draw_data_type;
|
426
|
+
extern const rb_data_type_t rm_pixel_data_type;
|
427
|
+
extern const rb_data_type_t rm_montage_data_type;
|
428
|
+
extern const rb_data_type_t rm_kernel_info_data_type;
|
415
429
|
|
416
430
|
#if !defined(min)
|
417
431
|
#define min(a, b) ((a)<(b)?(a):(b)) /**< min of two values */
|
@@ -431,7 +445,7 @@ EXTERN unsigned long long rm_main_thread_id;
|
|
431
445
|
Define simple attribute accessor methods (boolean, int, string, and double types)
|
432
446
|
*/
|
433
447
|
#define C_boolean_to_R_boolean(attr) (attr) ? Qtrue : Qfalse /**< C boolean -> Ruby boolean */
|
434
|
-
#define R_boolean_to_C_boolean(attr) RTEST(attr) /**< C boolean <- Ruby boolean */
|
448
|
+
#define R_boolean_to_C_boolean(attr) (MagickBooleanType)RTEST(attr) /**< C boolean <- Ruby boolean */
|
435
449
|
#define C_int_to_R_int(attr) INT2FIX(attr) /**< C int -> Ruby int */
|
436
450
|
#define R_int_to_C_int(attr) NUM2INT(attr) /**< C int <- Ruby int */
|
437
451
|
#define C_long_to_R_long(attr) LONG2NUM(attr) /**< C long -> Ruby long */
|
@@ -443,47 +457,47 @@ EXTERN unsigned long long rm_main_thread_id;
|
|
443
457
|
#define R_dbl_to_C_dbl(attr) NUM2DBL(attr) /**< C double <- Ruby double */
|
444
458
|
|
445
459
|
//! define attribute reader
|
446
|
-
#define
|
460
|
+
#define IMPLEMENT_TYPED_ATTR_READER(klass, attr, type, data_type) \
|
447
461
|
{\
|
448
|
-
|
462
|
+
klass *ptr;\
|
449
463
|
if (rb_obj_is_kind_of(self, Class_Image) == Qtrue) {\
|
450
464
|
rm_check_destroyed(self); \
|
451
465
|
}\
|
452
|
-
|
466
|
+
TypedData_Get_Struct(self, klass, data_type, ptr);\
|
453
467
|
return C_##type##_to_R_##type(ptr->attr);\
|
454
468
|
}
|
455
469
|
|
456
470
|
//! define attribute reader when attribute name is different from the field name
|
457
|
-
#define
|
471
|
+
#define IMPLEMENT_TYPED_ATTR_READERF(klass, attr, field, type, data_type) \
|
458
472
|
{\
|
459
|
-
|
473
|
+
klass *ptr;\
|
460
474
|
rm_check_destroyed(self); \
|
461
|
-
|
475
|
+
TypedData_Get_Struct(self, klass, data_type, ptr);\
|
462
476
|
return C_##type##_to_R_##type(ptr->field);\
|
463
477
|
}
|
464
478
|
|
465
479
|
//! define attribute writer
|
466
|
-
#define
|
480
|
+
#define IMPLEMENT_TYPED_ATTR_WRITER(klass, attr, type, data_type) \
|
467
481
|
{\
|
468
|
-
|
482
|
+
klass *ptr;\
|
469
483
|
if (rb_obj_is_kind_of(self, Class_Image) == Qtrue) {\
|
470
484
|
rm_check_destroyed(self); \
|
471
485
|
}\
|
472
486
|
rb_check_frozen(self);\
|
473
|
-
|
487
|
+
TypedData_Get_Struct(self, klass, data_type, ptr);\
|
474
488
|
ptr->attr = R_##type##_to_C_##type(val);\
|
475
489
|
return val;\
|
476
490
|
}
|
477
491
|
|
478
492
|
//! define attribute writer when attribute name is different from the field name
|
479
|
-
#define
|
493
|
+
#define IMPLEMENT_TYPED_ATTR_WRITERF(klass, attr, field, type, data_type) \
|
480
494
|
{\
|
481
|
-
|
495
|
+
klass *ptr;\
|
482
496
|
if (rb_obj_is_kind_of(self, Class_Image) == Qtrue) {\
|
483
497
|
rm_check_destroyed(self); \
|
484
498
|
}\
|
485
499
|
rb_check_frozen(self);\
|
486
|
-
|
500
|
+
TypedData_Get_Struct(self, klass, data_type, ptr);\
|
487
501
|
ptr->field = R_##type##_to_C_##type(val);\
|
488
502
|
return self;\
|
489
503
|
}
|
@@ -493,15 +507,15 @@ EXTERN unsigned long long rm_main_thread_id;
|
|
493
507
|
* Declare attribute accessors
|
494
508
|
*/
|
495
509
|
//! declare attribute reader
|
496
|
-
#define ATTR_READER(
|
497
|
-
extern VALUE
|
510
|
+
#define ATTR_READER(klass, attr) \
|
511
|
+
extern VALUE klass##_##attr(VALUE);
|
498
512
|
//! declare attribute writer
|
499
|
-
#define ATTR_WRITER(
|
500
|
-
extern VALUE
|
513
|
+
#define ATTR_WRITER(klass, attr) \
|
514
|
+
extern VALUE klass##_##attr##_eq(VALUE, VALUE);
|
501
515
|
//! declare attribute accessor
|
502
|
-
#define ATTR_ACCESSOR(
|
503
|
-
ATTR_READER(
|
504
|
-
ATTR_WRITER(
|
516
|
+
#define ATTR_ACCESSOR(klass, attr) \
|
517
|
+
ATTR_READER(klass, attr)\
|
518
|
+
ATTR_WRITER(klass, attr)
|
505
519
|
|
506
520
|
|
507
521
|
//! Define a Magick module constant
|
@@ -513,7 +527,6 @@ EXTERN unsigned long long rm_main_thread_id;
|
|
513
527
|
#define DEF_CONSTV(constant, val) rb_define_const(Module_Magick, #constant, UINT2NUM(val))
|
514
528
|
#endif
|
515
529
|
|
516
|
-
|
517
530
|
//! Convert a Ruby enum constant back to a C enum member.
|
518
531
|
#define VALUE_TO_ENUM(value, e, type) \
|
519
532
|
do {\
|
@@ -521,7 +534,7 @@ EXTERN unsigned long long rm_main_thread_id;
|
|
521
534
|
if (CLASS_OF(value) != Class_##type)\
|
522
535
|
rb_raise(rb_eTypeError, "wrong enumeration type - expected %s, got %s", \
|
523
536
|
rb_class2name(Class_##type), rb_class2name(CLASS_OF(value)));\
|
524
|
-
|
537
|
+
TypedData_Get_Struct(value, MagickEnum, &rm_enum_data_type, magick_enum);\
|
525
538
|
e = (type)(magick_enum->val);\
|
526
539
|
} while(0)
|
527
540
|
|
@@ -534,11 +547,13 @@ EXTERN unsigned long long rm_main_thread_id;
|
|
534
547
|
// the same source file.
|
535
548
|
|
536
549
|
|
537
|
-
|
550
|
+
extern "C" {
|
551
|
+
|
552
|
+
// rmmain.cpp
|
538
553
|
extern void Init_RMagick2(void);
|
539
554
|
|
540
555
|
|
541
|
-
// rmagick.
|
556
|
+
// rmagick.cpp
|
542
557
|
extern VALUE Magick_colors(VALUE);
|
543
558
|
extern VALUE Magick_fonts(VALUE);
|
544
559
|
extern VALUE Magick_init_formats(VALUE);
|
@@ -547,7 +562,7 @@ extern VALUE Magick_set_cache_threshold(VALUE, VALUE);
|
|
547
562
|
extern VALUE Magick_set_log_event_mask(int, VALUE *, VALUE);
|
548
563
|
extern VALUE Magick_set_log_format(VALUE, VALUE);
|
549
564
|
|
550
|
-
// rmdraw.
|
565
|
+
// rmdraw.cpp
|
551
566
|
ATTR_WRITER(Draw, affine)
|
552
567
|
ATTR_WRITER(Draw, align)
|
553
568
|
ATTR_WRITER(Draw, border_color)
|
@@ -598,7 +613,7 @@ ATTR_WRITER(PolaroidOptions, shadow_color);
|
|
598
613
|
ATTR_WRITER(PolaroidOptions, border_color);
|
599
614
|
|
600
615
|
|
601
|
-
// rmmontage.
|
616
|
+
// rmmontage.cpp
|
602
617
|
ATTR_WRITER(Montage, background_color)
|
603
618
|
ATTR_WRITER(Montage, border_color)
|
604
619
|
ATTR_WRITER(Montage, border_width)
|
@@ -621,7 +636,7 @@ extern VALUE Montage_alloc(VALUE);
|
|
621
636
|
extern VALUE rm_montage_new(void);
|
622
637
|
|
623
638
|
|
624
|
-
// rmilist.
|
639
|
+
// rmilist.cpp
|
625
640
|
extern VALUE ImageList_animate(int, VALUE *, VALUE);
|
626
641
|
extern VALUE ImageList_append(VALUE, VALUE);
|
627
642
|
extern VALUE ImageList_average(VALUE);
|
@@ -643,7 +658,7 @@ extern VALUE ImageList_write(VALUE, VALUE);
|
|
643
658
|
extern VALUE rm_imagelist_from_images(Image *);
|
644
659
|
|
645
660
|
|
646
|
-
// rminfo.
|
661
|
+
// rminfo.cpp
|
647
662
|
ATTR_ACCESSOR(Info, antialias)
|
648
663
|
ATTR_ACCESSOR(Info, attenuate)
|
649
664
|
ATTR_ACCESSOR(Info, authenticate)
|
@@ -705,7 +720,7 @@ extern VALUE rm_info_new(void);
|
|
705
720
|
extern DisposeType rm_dispose_to_enum(const char *);
|
706
721
|
extern GravityType rm_gravity_to_enum(const char *);
|
707
722
|
|
708
|
-
// rmkinfo.
|
723
|
+
// rmkinfo.cpp
|
709
724
|
|
710
725
|
extern VALUE KernelInfo_alloc(VALUE);
|
711
726
|
|
@@ -718,7 +733,7 @@ extern VALUE KernelInfo_clone(VALUE);
|
|
718
733
|
extern VALUE KernelInfo_builtin(VALUE, VALUE, VALUE);
|
719
734
|
|
720
735
|
|
721
|
-
// rmimage.
|
736
|
+
// rmimage.cpp
|
722
737
|
ATTR_ACCESSOR(Image, background_color)
|
723
738
|
ATTR_READER(Image, base_columns)
|
724
739
|
ATTR_READER(Image, base_filename)
|
@@ -1019,10 +1034,9 @@ extern VALUE Image_write(VALUE, VALUE);
|
|
1019
1034
|
|
1020
1035
|
extern VALUE rm_image_new(Image *);
|
1021
1036
|
extern void rm_image_destroy(void *);
|
1022
|
-
extern void rm_trace_creation(Image *);
|
1023
1037
|
|
1024
1038
|
|
1025
|
-
// rmfill.
|
1039
|
+
// rmfill.cpp
|
1026
1040
|
extern VALUE GradientFill_alloc(VALUE);
|
1027
1041
|
extern VALUE GradientFill_initialize(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
|
1028
1042
|
extern VALUE GradientFill_fill(VALUE, VALUE);
|
@@ -1032,7 +1046,7 @@ extern VALUE TextureFill_initialize(VALUE, VALUE);
|
|
1032
1046
|
extern VALUE TextureFill_fill(VALUE, VALUE);
|
1033
1047
|
|
1034
1048
|
|
1035
|
-
// rmpixel.
|
1049
|
+
// rmpixel.cpp
|
1036
1050
|
|
1037
1051
|
|
1038
1052
|
ATTR_ACCESSOR(Pixel, red)
|
@@ -1043,7 +1057,6 @@ ATTR_ACCESSOR(Pixel, cyan)
|
|
1043
1057
|
ATTR_ACCESSOR(Pixel, magenta)
|
1044
1058
|
ATTR_ACCESSOR(Pixel, yellow)
|
1045
1059
|
ATTR_ACCESSOR(Pixel, black)
|
1046
|
-
extern void destroy_Pixel(Pixel *);
|
1047
1060
|
extern VALUE Pixel_alloc(VALUE);
|
1048
1061
|
extern VALUE Pixel_case_eq(VALUE, VALUE);
|
1049
1062
|
extern VALUE Pixel_clone(VALUE);
|
@@ -1064,7 +1077,7 @@ extern VALUE Pixel_to_hsla(VALUE);
|
|
1064
1077
|
extern VALUE Pixel_to_s(VALUE);
|
1065
1078
|
|
1066
1079
|
|
1067
|
-
// rmenum.
|
1080
|
+
// rmenum.cpp
|
1068
1081
|
extern VALUE Enum_alloc(VALUE);
|
1069
1082
|
extern VALUE Enum_initialize(VALUE, VALUE, VALUE);
|
1070
1083
|
extern VALUE Enum_to_s(VALUE);
|
@@ -1073,7 +1086,7 @@ extern VALUE Enum_spaceship(VALUE, VALUE);
|
|
1073
1086
|
extern VALUE Enum_bitwise_or(VALUE, VALUE);
|
1074
1087
|
extern VALUE Enum_case_eq(VALUE, VALUE);
|
1075
1088
|
extern VALUE Enum_type_initialize(VALUE, VALUE, VALUE);
|
1076
|
-
extern VALUE Enum_find(VALUE
|
1089
|
+
extern VALUE Enum_find(VALUE, int);
|
1077
1090
|
extern VALUE Enum_type_each(VALUE);
|
1078
1091
|
extern VALUE rm_enum_new(VALUE, VALUE, VALUE);
|
1079
1092
|
extern VALUE ClassType_find(ClassType);
|
@@ -1100,7 +1113,7 @@ extern const char *StyleType_name(StyleType);
|
|
1100
1113
|
extern VALUE VirtualPixelMethod_find(VirtualPixelMethod);
|
1101
1114
|
|
1102
1115
|
|
1103
|
-
// rmstruct.
|
1116
|
+
// rmstruct.cpp
|
1104
1117
|
extern VALUE ChromaticityInfo_to_s(VALUE);
|
1105
1118
|
extern VALUE ChromaticityInfo_new(ChromaticityInfo *);
|
1106
1119
|
extern void Color_to_PixelColor(PixelColor *, VALUE);
|
@@ -1135,7 +1148,7 @@ extern void Export_TypeInfo(TypeInfo *, VALUE);
|
|
1135
1148
|
extern VALUE Import_TypeMetric(TypeMetric *);
|
1136
1149
|
|
1137
1150
|
|
1138
|
-
// rmutil.
|
1151
|
+
// rmutil.cpp
|
1139
1152
|
extern VALUE ImageMagickError_initialize(int, VALUE *, VALUE);
|
1140
1153
|
extern void *magick_malloc(const size_t);
|
1141
1154
|
extern void *magick_safe_malloc(const size_t, const size_t);
|
@@ -1156,12 +1169,13 @@ extern void rm_check_ary_len(VALUE, long);
|
|
1156
1169
|
extern VALUE rm_check_ary_type(VALUE ary);
|
1157
1170
|
extern Image *rm_check_destroyed(VALUE);
|
1158
1171
|
extern Image *rm_check_frozen(VALUE);
|
1159
|
-
extern char *rm_str2cstr(VALUE,
|
1172
|
+
extern char *rm_str2cstr(VALUE, size_t *);
|
1160
1173
|
extern int rm_check_num2dbl(VALUE);
|
1161
1174
|
extern double rm_fuzz_to_dbl(VALUE);
|
1162
1175
|
extern Quantum rm_app2quantum(VALUE);
|
1163
1176
|
extern double rm_percentage(VALUE, double);
|
1164
|
-
extern double
|
1177
|
+
extern double rm_percentage2(VALUE, double, bool);
|
1178
|
+
extern double rm_str_to_pct(VALUE, bool);
|
1165
1179
|
extern VALUE rm_define_enum_type(const char *);
|
1166
1180
|
extern void rm_write_temp_image(Image *, char *, size_t);
|
1167
1181
|
extern void rm_delete_temp_image(char *);
|
@@ -1193,7 +1207,6 @@ typedef enum
|
|
1193
1207
|
extern void rm_check_exception(ExceptionInfo *, Image *, ErrorRetention);
|
1194
1208
|
extern void rm_ensure_result(Image *);
|
1195
1209
|
extern Image *rm_clone_image(Image *);
|
1196
|
-
extern MagickBooleanType rm_progress_monitor(const char *, const MagickOffsetType, const MagickSizeType, void *);
|
1197
1210
|
extern VALUE rm_exif_by_entry(Image *);
|
1198
1211
|
extern VALUE rm_exif_by_number(Image *);
|
1199
1212
|
extern void rm_get_optional_arguments(VALUE);
|
@@ -1202,10 +1215,26 @@ extern void rm_error_handler(const ExceptionType, const char *, const char *);
|
|
1202
1215
|
extern void rm_warning_handler(const ExceptionType, const char *, const char *);
|
1203
1216
|
extern MagickBooleanType rm_should_raise_exception(ExceptionInfo *, const ExceptionRetention);
|
1204
1217
|
extern void rm_raise_exception(ExceptionInfo *);
|
1205
|
-
extern
|
1218
|
+
extern VALUE rm_io_path(VALUE);
|
1206
1219
|
#if defined(IMAGEMAGICK_6)
|
1207
1220
|
extern void rm_check_image_exception(Image *, ErrorRetention);
|
1208
1221
|
#endif
|
1209
1222
|
|
1223
|
+
#if !defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_9_0)
|
1224
|
+
/* UnityAddKernelInfo() was private function until IM 6.9 */
|
1225
|
+
MagickExport void UnityAddKernelInfo(KernelInfo *kernel, const double scale);
|
1226
|
+
/* ScaleKernelInfo() was private function until IM 6.9 */
|
1227
|
+
MagickExport void ScaleKernelInfo(KernelInfo *kernel, const double scaling_factor, const GeometryFlags normalize_flags);
|
1210
1228
|
#endif
|
1211
1229
|
|
1230
|
+
#if (RUBY_VERSION_MAJOR == 2 && RUBY_VERSION_MINOR < 7)
|
1231
|
+
#define RESCUE_FUNC(func) (VALUE (*)(ANYARGS))(func)
|
1232
|
+
#define RESCUE_EXCEPTION_HANDLER_FUNC(func) (VALUE (*)(ANYARGS))(func)
|
1233
|
+
#else
|
1234
|
+
#define RESCUE_FUNC(func) (VALUE(*)(VALUE))(func)
|
1235
|
+
#define RESCUE_EXCEPTION_HANDLER_FUNC(func) (VALUE(*)(VALUE, VALUE))(func)
|
1236
|
+
#endif
|
1237
|
+
|
1238
|
+
} // extern "C"
|
1239
|
+
|
1240
|
+
#endif
|