Magick::Image::Image(const Geometry &size_,const Color &color_)
: _imgRef(new ImageRef)
{
- try
- {
- read(size_,color_);
- }
- catch(const Warning &/*warning_*/)
- {
- // FIXME: need a way to report warnings in constructor
- }
- catch(const Error & /*error_*/)
- {
- // Release resources
- delete _imgRef;
- throw;
- }
-}
+ // xc: prefix specifies an X11 color string
+ std::string imageSpec("xc:");
+ imageSpec+=color_;
-Magick::Image::Image(const Geometry &size_,const std::string &imageSpec_)
- : _imgRef(new ImageRef)
-{
try
{
- read(size_,imageSpec_);
+ // Set image size
+ size(size_);
+
+ // Initialize, Allocate and Read images
+ read(imageSpec);
}
catch(const Warning &/*warning_*/)
{
read(blob_);
}
-void Magick::Image::read(const Geometry &size_,const Color &color_)
-{
- // xc: prefix specifies an X11 color string
- std::string imageSpec("xc:");
- imageSpec+=color_;
- read(size_,imageSpec);
-}
-
void Magick::Image::read(const Geometry &size_,const std::string &imageSpec_)
{
size(size_);
// Construct a blank image canvas of specified size and color
Image(const Geometry &size_,const Color &color_);
- // Construct image of specified size from image file or image specification
- Image(const Geometry &size_,const std::string &imageSpec_);
-
// Copy constructor
Image(const Image &image_);
void read(const Blob &blob_,const Geometry &size_,
const std::string &magick_);
- // Read a blank image canvas of specified size and color
- void read(const Geometry &size_,const Color &color_);
-
// Read single image frame of specified size into current object
void read(const Geometry &size_,const std::string &imageSpec_);