Class: Magick::Image::PolaroidOptions
- Inherits:
-
Object
- Object
- Magick::Image::PolaroidOptions
- Defined in:
- ext/RMagick/rmmain.cpp
Instance Method Summary collapse
-
#align=(align) ⇒ Magick::AlignType
Set the text alignment from an AlignType.
-
#border_color=(border) ⇒ Magick::Pixel, String
Set the border color.
-
#decorate=(decorate) ⇒ Magick::DecorationType
Set text decorate from an DecorationType.
-
#density=(density) ⇒ String
Set density.
-
#encoding=(encoding) ⇒ String
Set text encoding.
-
#fill=(fill) ⇒ Magick::Pixel, String
Set fill color.
-
#fill_pattern=(pattern) ⇒ Magick::Image
Accept an image as a fill pattern.
-
#font=(font) ⇒ String
Set the font name.
-
#font_family=(family) ⇒ String
Set the font family name.
-
#font_stretch=(stretch) ⇒ Magick::StretchType
Set the stretch as spacing between text characters.
-
#font_style=(style) ⇒ Magick::StyleType
Set font style.
-
#font_weight=(weight) ⇒ Magick::WeightType, Numeric
Set font weight.
-
#gravity=(grav) ⇒ Magick::GravityType
Set gravity to draw text.
-
#initialize {|self| ... } ⇒ Magick::Image::PolaroidOptions
constructor
Initialize a PolaroidOptions object.
-
#pointsize=(pointsize) ⇒ Float
Set point size to draw text.
-
#shadow_color=(shadow) ⇒ Magick::Pixel, String
Set the shadow color attribute.
-
#stroke=(stroke) ⇒ Magick::Pixel, String
Set stroke.
-
#stroke_pattern=(pattern) ⇒ Magick::Image
Accept an image as a stroke pattern.
-
#stroke_width=(stroke_width) ⇒ Float
Set stroke width.
-
#text_antialias=(text_antialias) ⇒ Boolean
Set whether to enable text antialias.
-
#undercolor=(undercolor) ⇒ Magick::Pixel, String
Set undercolor.
Constructor Details
#initialize {|self| ... } ⇒ Magick::Image::PolaroidOptions
Initialize a PolaroidOptions object.
1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 |
# File 'ext/RMagick/rmdraw.cpp', line 1470
VALUE
PolaroidOptions_initialize(VALUE self)
{
Draw *draw;
ExceptionInfo *exception;
// Default shadow color
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
exception = AcquireExceptionInfo();
QueryColorCompliance("gray75", AllCompliance, &draw->shadow_color, exception);
CHECK_EXCEPTION();
QueryColorCompliance("#dfdfdf", AllCompliance, &draw->info->border_color, exception);
CHECK_EXCEPTION();
DestroyExceptionInfo(exception);
if (rb_block_given_p())
{
rb_yield(self);
}
return self;
}
|
Instance Method Details
#align=(align) ⇒ Magick::AlignType
Set the text alignment from an AlignType.
79 80 81 82 83 84 85 86 87 88 |
# File 'ext/RMagick/rmdraw.cpp', line 79
VALUE
Draw_align_eq(VALUE self, VALUE align)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
VALUE_TO_ENUM(align, draw->info->align, AlignType);
return align;
}
|
#border_color=(border) ⇒ Magick::Pixel, String
Set the border color.
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 |
# File 'ext/RMagick/rmdraw.cpp', line 1533
VALUE
PolaroidOptions_border_color_eq(VALUE self, VALUE border)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
Color_to_PixelColor(&draw->info->border_color, border);
return border;
}
|
#decorate=(decorate) ⇒ Magick::DecorationType
Set text decorate from an DecorationType.
97 98 99 100 101 102 103 104 105 106 |
# File 'ext/RMagick/rmdraw.cpp', line 97
VALUE
Draw_decorate_eq(VALUE self, VALUE decorate)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
VALUE_TO_ENUM(decorate, draw->info->decorate, DecorationType);
return decorate;
}
|
#density=(density) ⇒ String
Set density.
115 116 117 118 119 120 121 122 123 124 125 |
# File 'ext/RMagick/rmdraw.cpp', line 115
VALUE
Draw_density_eq(VALUE self, VALUE density)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
magick_clone_string(&draw->info->density, StringValueCStr(density));
return density;
}
|
#encoding=(encoding) ⇒ String
Set text encoding.
134 135 136 137 138 139 140 141 142 143 144 |
# File 'ext/RMagick/rmdraw.cpp', line 134
VALUE
Draw_encoding_eq(VALUE self, VALUE encoding)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
magick_clone_string(&draw->info->encoding, StringValueCStr(encoding));
return encoding;
}
|
#fill=(fill) ⇒ Magick::Pixel, String
Set fill color.
153 154 155 156 157 158 159 160 161 162 |
# File 'ext/RMagick/rmdraw.cpp', line 153
VALUE
Draw_fill_eq(VALUE self, VALUE fill)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
Color_to_PixelColor(&draw->info->fill, fill);
return fill;
}
|
#fill_pattern=(pattern) ⇒ Magick::Image
Accept an image as a fill pattern.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'ext/RMagick/rmdraw.cpp', line 174
VALUE
Draw_fill_pattern_eq(VALUE self, VALUE pattern)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
if (draw->info->fill_pattern != NULL)
{
// Do not trace destruction
DestroyImage(draw->info->fill_pattern);
draw->info->fill_pattern = NULL;
}
if (!NIL_P(pattern))
{
Image *image;
pattern = rm_cur_image(pattern);
image = rm_check_destroyed(pattern);
// Do not trace creation
draw->info->fill_pattern = rm_clone_image(image);
}
return pattern;
}
|
#font=(font) ⇒ String
Set the font name.
209 210 211 212 213 214 215 216 217 218 219 |
# File 'ext/RMagick/rmdraw.cpp', line 209
VALUE
Draw_font_eq(VALUE self, VALUE font)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
magick_clone_string(&draw->info->font, StringValueCStr(font));
return font;
}
|
#font_family=(family) ⇒ String
Set the font family name.
228 229 230 231 232 233 234 235 236 237 238 |
# File 'ext/RMagick/rmdraw.cpp', line 228
VALUE
Draw_font_family_eq(VALUE self, VALUE family)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
magick_clone_string(&draw->info->family, StringValueCStr(family));
return family;
}
|
#font_stretch=(stretch) ⇒ Magick::StretchType
Set the stretch as spacing between text characters.
247 248 249 250 251 252 253 254 255 256 |
# File 'ext/RMagick/rmdraw.cpp', line 247
VALUE
Draw_font_stretch_eq(VALUE self, VALUE stretch)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
VALUE_TO_ENUM(stretch, draw->info->stretch, StretchType);
return stretch;
}
|
#font_style=(style) ⇒ Magick::StyleType
Set font style.
265 266 267 268 269 270 271 272 273 274 |
# File 'ext/RMagick/rmdraw.cpp', line 265
VALUE
Draw_font_style_eq(VALUE self, VALUE style)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
VALUE_TO_ENUM(style, draw->info->style, StyleType);
return style;
}
|
#font_weight=(weight) ⇒ Magick::WeightType, Numeric
The font weight can be one of the font weight constants or a number between 100 and 900
Set font weight.
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'ext/RMagick/rmdraw.cpp', line 284
VALUE
Draw_font_weight_eq(VALUE self, VALUE weight)
{
Draw *draw;
size_t w;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
if (FIXNUM_P(weight))
{
w = FIX2INT(weight);
if (w < 100 || w > 900)
{
rb_raise(rb_eArgError, "invalid font weight (%" RMIuSIZE " given)", w);
}
draw->info->weight = w;
}
else
{
VALUE_TO_ENUM(weight, w, WeightType);
switch (w)
{
case AnyWeight:
draw->info->weight = 0;
break;
case NormalWeight:
draw->info->weight = 400;
break;
case BoldWeight:
draw->info->weight = 700;
break;
case BolderWeight:
if (draw->info->weight <= 800)
draw->info->weight += 100;
break;
case LighterWeight:
if (draw->info->weight >= 100)
draw->info->weight -= 100;
break;
default:
rb_raise(rb_eArgError, "unknown font weight");
break;
}
}
return weight;
}
|
#gravity=(grav) ⇒ Magick::GravityType
Set gravity to draw text. Gravity affects text placement in bounding area according to rules:
-
NorthWestGravity
- text bottom-left corner placed at top-left -
NorthGravity
- text bottom-center placed at top-center -
NorthEastGravity
- text bottom-right corner placed at top-right -
WestGravity
- text left-center placed at left-center -
CenterGravity
- text center placed at center -
EastGravity
- text right-center placed at right-center -
SouthWestGravity
- text top-left placed at bottom-left -
SouthGravity
- text top-center placed at bottom-center -
SouthEastGravity
- text top-right placed at bottom-right
351 352 353 354 355 356 357 358 359 360 361 |
# File 'ext/RMagick/rmdraw.cpp', line 351
VALUE
Draw_gravity_eq(VALUE self, VALUE grav)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
VALUE_TO_ENUM(grav, draw->info->gravity, GravityType);
return grav;
}
|
#pointsize=(pointsize) ⇒ Float
Set point size to draw text.
638 639 640 641 642 643 644 645 646 647 |
# File 'ext/RMagick/rmdraw.cpp', line 638
VALUE
Draw_pointsize_eq(VALUE self, VALUE pointsize)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
draw->info->pointsize = NUM2DBL(pointsize);
return pointsize;
}
|
#shadow_color=(shadow) ⇒ Magick::Pixel, String
Set the shadow color attribute.
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 |
# File 'ext/RMagick/rmdraw.cpp', line 1515
VALUE
PolaroidOptions_shadow_color_eq(VALUE self, VALUE shadow)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
Color_to_PixelColor(&draw->shadow_color, shadow);
return shadow;
}
|
#stroke=(stroke) ⇒ Magick::Pixel, String
Set stroke.
694 695 696 697 698 699 700 701 702 703 |
# File 'ext/RMagick/rmdraw.cpp', line 694
VALUE
Draw_stroke_eq(VALUE self, VALUE stroke)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
Color_to_PixelColor(&draw->info->stroke, stroke);
return stroke;
}
|
#stroke_pattern=(pattern) ⇒ Magick::Image
Accept an image as a stroke pattern.
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 |
# File 'ext/RMagick/rmdraw.cpp', line 714
VALUE
Draw_stroke_pattern_eq(VALUE self, VALUE pattern)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
if (draw->info->stroke_pattern != NULL)
{
// Do not trace destruction
DestroyImage(draw->info->stroke_pattern);
draw->info->stroke_pattern = NULL;
}
if (!NIL_P(pattern))
{
Image *image;
// DestroyDrawInfo destroys the clone
pattern = rm_cur_image(pattern);
image = rm_check_destroyed(pattern);
// Do not trace creation
draw->info->stroke_pattern = rm_clone_image(image);
}
return pattern;
}
|
#stroke_width=(stroke_width) ⇒ Float
Set stroke width.
750 751 752 753 754 755 756 757 758 759 |
# File 'ext/RMagick/rmdraw.cpp', line 750
VALUE
Draw_stroke_width_eq(VALUE self, VALUE stroke_width)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
draw->info->stroke_width = NUM2DBL(stroke_width);
return stroke_width;
}
|
#text_antialias=(text_antialias) ⇒ Boolean
Set whether to enable text antialias.
768 769 770 771 772 773 774 775 776 777 |
# File 'ext/RMagick/rmdraw.cpp', line 768
VALUE
Draw_text_antialias_eq(VALUE self, VALUE text_antialias)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
draw->info->text_antialias = (MagickBooleanType) RTEST(text_antialias);
return text_antialias;
}
|
#undercolor=(undercolor) ⇒ Magick::Pixel, String
Set undercolor.
799 800 801 802 803 804 805 806 807 808 |
# File 'ext/RMagick/rmdraw.cpp', line 799
VALUE
Draw_undercolor_eq(VALUE self, VALUE undercolor)
{
Draw *draw;
rb_check_frozen(self);
TypedData_Get_Struct(self, Draw, &rm_draw_data_type, draw);
Color_to_PixelColor(&draw->info->undercolor, undercolor);
return undercolor;
}
|