Loading...
Searching...
No Matches
Magick::Geometry Class Reference

## Public Member Functions

| Geometry (const char *geometry_)
| Geometry (const Geometry &geometry_)
| Geometry (const std::string &geometry_)
| Geometry (size_t width_, size_t height_,::ssize_t xOff_=0, ::ssize_t yOff_=0)
const Geometry & | operator= (const char *geometry_)
Geometry & | operator= (const Geometry &Geometry_)
const Geometry & | operator= (const std::string &geometry_)
| operator std::string () const
void | aspect (bool aspect_)
bool | aspect (void) const
void | fillArea (bool fillArea_)
bool | fillArea (void) const
void | greater (bool greater_)
bool | greater (void) const
void | height (size_t height_)
size_t | height (void) const
void | isValid (bool isValid_)
bool | isValid (void) const
void | less (bool less_)
bool | less (void) const
void | limitPixels (bool limitPixels_)
bool | limitPixels (void) const
void | percent (bool percent_)
bool | percent (void) const
void | width (size_t width_)
size_t | width (void) const
void | xOff (::ssize_t xOff_)
::ssize_t | xOff (void) const
void | yOff (::ssize_t yOff_)
::ssize_t | yOff (void) const
| Geometry (const MagickCore::RectangleInfo &rectangle_)
const Geometry & | operator= (const MagickCore::RectangleInfo &rectangle_)
| operator MagickCore::RectangleInfo () const

## Private Attributes

size_t | _width
size_t | _height
::ssize_t | _xOff
::ssize_t | _yOff
bool | _isValid
bool | _percent
bool | _aspect
bool | _greater
bool | _less
bool | _fillArea
bool | _limitPixels

## Detailed Description

Definition at line 37 of file Geometry.h.

## Constructor & Destructor Documentation

## Geometry() [1/5]

Magick::Geometry::Geometry | ( | void |  | ) |

Definition at line 72 of file Geometry.cpp.

: _width(0),
_height(0),
_xOff(0),
_yOff(0),
_isValid(false),
_percent(false),
_aspect(false),
_greater(false),
_less(false),
_fillArea(false),
_limitPixels(false)
{
}

## Geometry() [2/5]

Magick::Geometry::Geometry | ( | const char * | geometry_ | ) |

Definition at line 87 of file Geometry.cpp.

: _width(0),
_height(0),
_xOff(0),
_yOff(0),
_isValid(false),
_percent(false),
_aspect(false),
_greater(false),
_less(false),
_fillArea(false),
_limitPixels(false)
{
*this=geometry_; // Use assignment operator
}

## Geometry() [3/5]

Magick::Geometry::Geometry | ( | const Geometry & | geometry_ | ) |

Definition at line 103 of file Geometry.cpp.

: _width(geometry_._width),
_height(geometry_._height),
_xOff(geometry_._xOff),
_yOff(geometry_._yOff),
_isValid(geometry_._isValid),
_percent(geometry_._percent),
_aspect(geometry_._aspect),
_greater(geometry_._greater),
_less(geometry_._less),
_fillArea(geometry_._fillArea),
_limitPixels(geometry_._limitPixels)
{
}

## Geometry() [4/5]

Magick::Geometry::Geometry | ( | const std::string & | geometry_ | ) |

Definition at line 118 of file Geometry.cpp.

: _width(0),
_height(0),
_xOff(0),
_yOff(0),
_isValid(false),
_percent(false),
_aspect(false),
_greater(false),
_less(false),
_fillArea(false),
_limitPixels(false)
{
*this=geometry_; // Use assignment operator
}

## ~Geometry()

Magick::Geometry::~Geometry | ( | void |  | ) |

Definition at line 150 of file Geometry.cpp.

{
}

## Geometry() [5/5]

Magick::Geometry::Geometry | ( | const MagickCore::RectangleInfo & | rectangle_ | ) |

Definition at line 440 of file Geometry.cpp.

: _width(static_cast<size_t>(rectangle_.width)),
_height(static_cast<size_t>(rectangle_.height)),
_xOff(static_cast<ssize_t>(rectangle_.x)),
_yOff(static_cast<ssize_t>(rectangle_.y)),
_isValid(true),
_percent(false),
_aspect(false),
_greater(false),
_less(false),
_fillArea(false),
_limitPixels(false)
{
}

## Member Function Documentation

## aspect() [1/2]

void Magick::Geometry::aspect | ( | bool | aspect_ | ) |

Definition at line 329 of file Geometry.cpp.

{
_aspect=aspect_;
}

## aspect() [2/2]

bool Magick::Geometry::aspect | ( | void |  | ) | const

Definition at line 334 of file Geometry.cpp.

{
return(_aspect);
}

## fillArea() [1/2]

void Magick::Geometry::fillArea | ( | bool | fillArea_ | ) |

Definition at line 339 of file Geometry.cpp.

{
_fillArea=fillArea_;
}

## fillArea() [2/2]

bool Magick::Geometry::fillArea | ( | void |  | ) | const

Definition at line 344 of file Geometry.cpp.

{
return(_fillArea);
}

## greater() [1/2]

void Magick::Geometry::greater | ( | bool | greater_ | ) |

Definition at line 349 of file Geometry.cpp.

{
_greater=greater_;
}

## greater() [2/2]

bool Magick::Geometry::greater | ( | void |  | ) | const

Definition at line 354 of file Geometry.cpp.

{
return(_greater);
}

## height() [1/2]

void Magick::Geometry::height | ( | size_t | height_ | ) |

Definition at line 359 of file Geometry.cpp.

{
_height=height_;
}

## height() [2/2]

size_t Magick::Geometry::height | ( | void |  | ) | const

Definition at line 364 of file Geometry.cpp.

{
return(_height);
}

## isValid() [1/2]

void Magick::Geometry::isValid | ( | bool | isValid_ | ) |

Definition at line 369 of file Geometry.cpp.

{
_isValid=isValid_;
}

## isValid() [2/2]

bool Magick::Geometry::isValid | ( | void |  | ) | const

Definition at line 374 of file Geometry.cpp.

{
return(_isValid);
}

## less() [1/2]

void Magick::Geometry::less | ( | bool | less_ | ) |

Definition at line 379 of file Geometry.cpp.

{
_less=less_;
}

## less() [2/2]

bool Magick::Geometry::less | ( | void |  | ) | const

Definition at line 384 of file Geometry.cpp.

{
return(_less);
}

## limitPixels() [1/2]

void Magick::Geometry::limitPixels | ( | bool | limitPixels_ | ) |

Definition at line 389 of file Geometry.cpp.

{
_limitPixels=limitPixels_;
}

## limitPixels() [2/2]

bool Magick::Geometry::limitPixels | ( | void |  | ) | const

Definition at line 394 of file Geometry.cpp.

{
return(_limitPixels);
}

## operator MagickCore::RectangleInfo()

Magick::Geometry::operator MagickCore::RectangleInfo | ( |  | ) | const

Definition at line 466 of file Geometry.cpp.

{
RectangleInfo rectangle;
rectangle.width=_width;
rectangle.height=_height;
rectangle.x=_xOff;
rectangle.y=_yOff;
return(rectangle);
}

## operator std::string()

Magick::Geometry::operator std::string | ( |  | ) | const

Definition at line 268 of file Geometry.cpp.

{
char
buffer[MagickPathExtent];
std::string
geometry;
if (!isValid())
throwExceptionExplicit(MagickCore::OptionError,
"Invalid geometry argument");
if (_width)
{
FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _width);
geometry+=buffer;
}
if (_height)
{
FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _height);
geometry+='x';
geometry+=buffer;
}
if (_xOff || _yOff)
{
if (_xOff >= 0)
geometry+='+';
FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _xOff);
geometry+=buffer;
if (_yOff >= 0)
geometry+='+';
FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _yOff);
geometry+=buffer;
}
if (_percent)
geometry+='%';
if (_aspect)
geometry+='!';
if (_greater)
geometry+='>';
if (_less)
geometry+='<';
if (_fillArea)
geometry+='^';
if (_limitPixels)
geometry+='@';
return(geometry);
}

## operator=() [1/4]

const Magick::Geometry & Magick::Geometry::operator= | ( | const char * | geometry_ | ) |

Definition at line 154 of file Geometry.cpp.

{
*this=std::string(geometry_);
return(*this);
}

## operator=() [2/4]

Magick::Geometry & Magick::Geometry::operator= | ( | const Geometry & | Geometry_ | ) |

Definition at line 160 of file Geometry.cpp.

{
// If not being set to ourself
if (this != &geometry_)
{
_width=geometry_._width;
_height=geometry_._height;
_xOff=geometry_._xOff;
_yOff=geometry_._yOff;
_isValid=geometry_._isValid;
_percent=geometry_._percent;
_aspect=geometry_._aspect;
_greater=geometry_._greater;
_less=geometry_._less;
_fillArea=geometry_._fillArea;
_limitPixels=geometry_._limitPixels;
}
return(*this);
}

## operator=() [3/4]

const Magick::Geometry & Magick::Geometry::operator= | ( | const MagickCore::RectangleInfo & | rectangle_ | ) |

Definition at line 455 of file Geometry.cpp.

{
_width=static_cast<size_t>(rectangle_.width),
_height=static_cast<size_t>(rectangle_.height),
_xOff=static_cast<ssize_t>(rectangle_.x),
_yOff=static_cast<ssize_t>(rectangle_.y),
_isValid=true;
return(*this);
}

## operator=() [4/4]

const Magick::Geometry & Magick::Geometry::operator= | ( | const std::string & | geometry_ | ) |

Definition at line 180 of file Geometry.cpp.

{
char
geom[MagickPathExtent];
char
*pageptr;
ssize_t
flags,
x = 0,
y = 0;
size_t
height_val=0,
width_val=0;
// If argument does not start with digit, presume that it is a
// page-size specification that needs to be converted to an
// equivalent geometry specification using PostscriptGeometry()
(void) CopyMagickString(geom,geometry_.c_str(),MagickPathExtent);
if (geom[0] != '-' && geom[0] != '+' && geom[0] != 'x' &&
!isdigit(static_cast<int>(geom[0])))
{
pageptr=GetPageGeometry(geom);
if (pageptr != 0)
{
(void) CopyMagickString(geom,pageptr,MagickPathExtent);
pageptr=(char *) RelinquishMagickMemory(pageptr);
}
}
flags=GetGeometry(geom,&x,&y,&width_val,&height_val);
if (flags == NoValue)
{
// Total failure!
*this=Geometry();
isValid(false);
return(*this);
}
if ((flags & WidthValue) != 0)
{
_width=width_val;
isValid(true);
}
if ((flags & HeightValue) != 0)
{
_height=height_val;
isValid(true);
}
if ((flags & XValue) != 0)
{
_xOff=static_cast<ssize_t>(x);
isValid(true);
}
if ((flags & YValue) != 0)
{
_yOff=static_cast<ssize_t>(y);
isValid(true);
}
if ((flags & PercentValue) != 0)
_percent=true;
if ((flags & AspectValue) != 0)
_aspect=true;
if ((flags & LessValue) != 0)
_less=true;
if ((flags & GreaterValue) != 0)
_greater=true;
if ((flags & MinimumValue) != 0)
_fillArea=true;
if ((flags & AreaValue) != 0)
_limitPixels=true;
return(*this);
}

## percent() [1/2]

void Magick::Geometry::percent | ( | bool | percent_ | ) |

Definition at line 405 of file Geometry.cpp.

{
_percent = percent_;
}

## percent() [2/2]

bool Magick::Geometry::percent | ( | void |  | ) | const

Definition at line 410 of file Geometry.cpp.

{
return(_percent);
}

## width() [1/2]

void Magick::Geometry::width | ( | size_t | width_ | ) |

Definition at line 399 of file Geometry.cpp.

{
_width=width_;
isValid(true);
}

## width() [2/2]

size_t Magick::Geometry::width | ( | void |  | ) | const

Definition at line 415 of file Geometry.cpp.

{
return(_width);
}

## xOff() [1/2]

void Magick::Geometry::xOff | ( | ::ssize_t | xOff_ | ) |

Definition at line 420 of file Geometry.cpp.

{
_xOff=xOff_;
}

## xOff() [2/2]

ssize_t Magick::Geometry::xOff | ( | void |  | ) | const

Definition at line 425 of file Geometry.cpp.

{
return(_xOff);
}

## yOff() [1/2]

void Magick::Geometry::yOff | ( | ::ssize_t | yOff_ | ) |

Definition at line 430 of file Geometry.cpp.

{
_yOff=yOff_;
}

## yOff() [2/2]

ssize_t Magick::Geometry::yOff | ( | void |  | ) | const

Definition at line 435 of file Geometry.cpp.

{
return(_yOff);
}

## Field Documentation

## _aspect

bool Magick::Geometry::_aspect

private

Definition at line 136 of file Geometry.h.

## _fillArea

bool Magick::Geometry::_fillArea

private

Definition at line 139 of file Geometry.h.

## _greater

bool Magick::Geometry::_greater

private

Definition at line 137 of file Geometry.h.

## _height

size_t Magick::Geometry::_height

private

Definition at line 131 of file Geometry.h.

## _isValid

bool Magick::Geometry::_isValid

private

Definition at line 134 of file Geometry.h.

## _less

bool Magick::Geometry::_less

private

Definition at line 138 of file Geometry.h.

## _limitPixels

bool Magick::Geometry::_limitPixels

private

Definition at line 140 of file Geometry.h.

## _percent

bool Magick::Geometry::_percent

private

Definition at line 135 of file Geometry.h.

## _width

size_t Magick::Geometry::_width

private

Definition at line 130 of file Geometry.h.

## _xOff

::ssize_t Magick::Geometry::_xOff

private

Definition at line 132 of file Geometry.h.

## _yOff

::ssize_t Magick::Geometry::_yOff

private

Definition at line 133 of file Geometry.h.

The documentation for this class was generated from the following files:

- /build/imagemagick-icbe39/imagemagick-7.1.2.3+dfsg1/Magick++/lib/Magick++/Geometry.h
- /build/imagemagick-icbe39/imagemagick-7.1.2.3+dfsg1/Magick++/lib/Geometry.cpp