my $color = $opts{'color'};
if (defined $color) {
- unless (ref $color &&
- (UNIVERSAL::isa($color, "Imager::Color")
- || UNIVERSAL::isa($color, "Imager::Color::Float"))) {
+ unless (_is_color_object($color)) {
$color = _color($color);
unless ($color) {
$self->{ERRSTR} = $Imager::ERRSTR;
else {
my $color = $opts{'color'};
if (defined $color) {
- unless (ref $color &&
- (UNIVERSAL::isa($color, "Imager::Color")
- || UNIVERSAL::isa($color, "Imager::Color::Float"))) {
+ unless (_is_color_object($color)) {
$color = _color($color);
unless ($color) {
$self->{ERRSTR} = $Imager::ERRSTR;
i_init_fonts(t1log=0)
int t1log
+bool
+_is_color_object(sv)
+ SV* sv
+ CODE:
+ SvGETMAGIC(sv);
+ RETVAL = SvOK(sv) && SvROK(sv) &&
+ (sv_derived_from(sv, "Imager::Color")
+ || sv_derived_from(sv, "Imager::Color::Float"));
+ OUTPUT:
+ RETVAL
+
#ifdef HAVE_LIBT1
void
palbox0100: 752.2 /s (0.001330 / iter)
palbox0500: 269.4 /s (0.003712 / iter)
palbox1000: 145.3 /s (0.006884 / iter)
+
+make _is_color_object xs
+
+box0010: 1359.4 /s (0.000736 / iter)
+box0010c: 3.4 /s (0.294118 / iter)
+box0010d: 635.6 /s (0.001573 / iter)
+box0100: 818.6 /s (0.001222 / iter)
+box0500: 294.3 /s (0.003398 / iter)
+box1000: 162.9 /s (0.006140 / iter)
+fbox0010: 1230.8 /s (0.000813 / iter)
+fbox0010c: 3.2 /s (0.313125 / iter)
+fbox0010d: 608.7 /s (0.001643 / iter)
+fbox0100: 158.5 /s (0.006308 / iter)
+fbox0500: 7.5 /s (0.134103 / iter)
+fbox1000: 1.9 /s (0.530000 / iter)
+fpalbox0010: 1328.8 /s (0.000753 / iter)
+fpalbox0100: 553.2 /s (0.001808 / iter)
+fpalbox0500: 43.5 /s (0.022974 / iter)
+fpalbox1000: 11.4 /s (0.087627 / iter)
+palbox0010: 1344.8 /s (0.000744 / iter)
+palbox0100: 783.0 /s (0.001277 / iter)
+palbox0500: 274.5 /s (0.003643 / iter)
+palbox1000: 147.9 /s (0.006761 / iter)