9 #define MAGICKCORE_IMPLEMENTATION 1
10 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
15 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
45 return(!(left_ == right_));
51 return(!(left_ < right_) && (left_ != right_));
63 return((left_ > right_) || (left_ == right_));
69 return((left_ < right_) || (left_ == right_));
108 : _width(geometry_._width),
109 _height(geometry_._height),
110 _xOff(geometry_._xOff),
111 _yOff(geometry_._yOff),
112 _xNegative(geometry_._xNegative),
113 _yNegative(geometry_._yNegative),
114 _isValid(geometry_._isValid),
115 _percent(geometry_._percent),
116 _aspect(geometry_._aspect),
117 _greater(geometry_._greater),
118 _less(geometry_._less),
119 _fillArea(geometry_._fillArea),
120 _limitPixels(geometry_._limitPixels)
143 ssize_t yOff_,
bool xNegative_,
bool yNegative_)
148 _xNegative(xNegative_),
149 _yNegative(yNegative_),
166 *
this=std::string(geometry_);
173 if (
this != &geometry_)
175 _width=geometry_._width;
176 _height=geometry_._height;
177 _xOff=geometry_._xOff;
178 _yOff=geometry_._yOff;
179 _xNegative=geometry_._xNegative;
180 _yNegative=geometry_._yNegative;
181 _isValid=geometry_._isValid;
182 _percent=geometry_._percent;
183 _aspect=geometry_._aspect;
184 _greater=geometry_._greater;
185 _less=geometry_._less;
186 _fillArea=geometry_._fillArea;
187 _limitPixels=geometry_._limitPixels;
193 const std::string &geometry_)
213 (void) CopyMagickString(geom,geometry_.c_str(),MaxTextExtent);
214 if (geom[0] !=
'-' && geom[0] !=
'+' && geom[0] !=
'x' &&
215 !isdigit(static_cast<int>(geom[0])))
217 pageptr=GetPageGeometry(geom);
220 (void) CopyMagickString(geom,pageptr,MaxTextExtent);
221 pageptr=(
char *) RelinquishMagickMemory(pageptr);
225 flags=GetGeometry(geom,&x,&y,&width_val,&height_val);
227 if (flags == NoValue)
235 if ((flags & WidthValue) != 0)
241 if ((flags & HeightValue) != 0)
247 if ((flags & XValue) != 0)
249 _xOff=
static_cast<ssize_t
>(x);
253 if ((flags & YValue) != 0)
255 _yOff=
static_cast<ssize_t
>(y);
259 if ((flags & XNegative) != 0)
262 if ((flags & YNegative) != 0)
265 if ((flags & PercentValue) != 0)
268 if ((flags & AspectValue) != 0)
271 if ((flags & LessValue) != 0)
274 if ((flags & GreaterValue) != 0)
277 if ((flags & MinimumValue) != 0)
280 if ((flags & AreaValue) != 0)
286 Magick::Geometry::operator std::string()
const
289 buffer[MaxTextExtent];
299 FormatLocaleString(buffer,MaxTextExtent,
"%.20g",(
double) _width);
305 FormatLocaleString(buffer,MaxTextExtent,
"%.20g",(
double) _height);
317 FormatLocaleString(buffer,MaxTextExtent,
"%.20g",(
double) _xOff);
325 FormatLocaleString(buffer,MaxTextExtent,
"%.20g",(
double) _yOff);
351 : _width(static_cast<size_t>(rectangle_.width)),
352 _height(static_cast<size_t>(rectangle_.height)),
353 _xOff(static_cast<ssize_t>(rectangle_.x)),
354 _yOff(static_cast<ssize_t>(rectangle_.y)),
355 _xNegative(rectangle_.x < 0 ? true : false),
356 _yNegative(rectangle_.y < 0 ? true : false),
368 const MagickCore::RectangleInfo &rectangle_)
370 _width=
static_cast<size_t>(rectangle_.width),
371 _height=static_cast<size_t>(rectangle_.height),
372 _xOff=
static_cast<ssize_t
>(rectangle_.x),
373 _yOff=static_cast<ssize_t>(rectangle_.y),
374 _xNegative=rectangle_.x < 0 ?
true :
false,
375 _yNegative=rectangle_.y < 0 ?
true :
false,
380 Magick::Geometry::operator MagickCore::RectangleInfo()
const
382 RectangleInfo rectangle;
383 rectangle.
width=_width;
384 rectangle.height=_height;
385 _xNegative ? rectangle.x=
static_cast<ssize_t
>(0-_xOff) :
386 rectangle.x=static_cast<ssize_t>(_xOff);
387 _yNegative ? rectangle.y=
static_cast<ssize_t
>(0-_yOff) :
388 rectangle.y=static_cast<ssize_t>(_yOff);
395 return((left_.
x() == right_.
x()) &&
396 (left_.
y() == right_.
y()));
402 return(!(left_ == right_));
443 MagickCore::GeometryInfo
446 MagickCore::MagickStatusType
449 flags=ParseGeometry(offset_,&geometry_info);
450 _x=geometry_info.rho;
451 _y=geometry_info.sigma;
452 if ((flags & MagickCore::SigmaValue) == 0)
460 if (
this != &offset_)
470 *
this=offset_.c_str();
484 Magick::Offset::operator MagickCore::OffsetInfo()
const
const Geometry & operator=(const char *geometry_)
MagickPPExport int operator!=(const Magick::Color &left_, const Magick::Color &right_)
void width(size_t width_)
void aspect(bool aspect_)
void height(size_t height_)
void yNegative(bool yNegative_)
MagickPPExport int operator<(const Magick::Color &left_, const Magick::Color &right_)
void yOff(::ssize_t yOff_)
MagickPPExport int operator<=(const Magick::Color &left_, const Magick::Color &right_)
MagickPPExport int operator>=(const Magick::Color &left_, const Magick::Color &right_)
class MagickPPExport Geometry
void xOff(::ssize_t xOff_)
const Offset & operator=(const char *offset_)
void greater(bool greater_)
MagickPPExport void throwExceptionExplicit(const MagickCore::ExceptionType severity_, const char *reason_, const char *description_=(char *) NULL)
void fillArea(bool fillArea_)
MagickPPExport int operator>(const Magick::Color &left_, const Magick::Color &right_)
MagickPPExport int operator==(const Magick::Color &left_, const Magick::Color &right_)
void percent(bool percent_)
void xNegative(bool xNegative_)
void isValid(bool isValid_)
void limitPixels(bool limitPixels_)