本文整理汇总了C++中magick::Image::constImage方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::constImage方法的具体用法?C++ Image::constImage怎么用?C++ Image::constImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类magick::Image
的用法示例。
在下文中一共展示了Image::constImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_,
const ::ssize_t y_,const size_t width_,const size_t height_,
std::string map_,const StorageType type_)
{
size_t
size;
_data=(void *) NULL;
_length=0;
_size=0;
if ((x_ < 0) || (width_ == 0) || (y_ < 0) || (height_ == 0) ||
(x_ > image_.columns()) || ((width_ + x_) > image_.columns())
|| (y_ > image_.rows()) || ((height_ + y_) > image_.rows())
|| (map_.length() == 0))
return;
switch(type_)
{
case CharPixel:
size=sizeof(unsigned char);
break;
case DoublePixel:
size=sizeof(double);
break;
case FloatPixel:
size=sizeof(float);
break;
case IntegerPixel:
case LongPixel:
size=sizeof(unsigned int);
break;
case QuantumPixel:
size=sizeof(Quantum);
break;
case ShortPixel:
size=sizeof(unsigned short);
break;
default:
throwExceptionExplicit(OptionError,"Invalid type");
return;
}
_length=width_*height_*map_.length();
_size=_length*size;
_data=AcquireMagickMemory(_size);
GetPPException;
MagickCore::ExportImagePixels(image_.constImage(),x_,y_,width_,height_,
map_.c_str(),type_,_data,exceptionInfo);
if (exceptionInfo->severity != UndefinedException)
relinquish();
ThrowPPException(image_.quiet());
}
示例2: ZoomImage
void ZoomImage(Magick::Image& dst, const Magick::Image& src, int width, int height)
{
MagickLib::ExceptionInfo exceptionInfo;
MagickLib::GetExceptionInfo( &exceptionInfo );
MagickLib::Image* newImage = MagickLib::ZoomImage( src.constImage(), width, height,
//MagickLib::Image* newImage = Img::ZoomImage( src.constImage(), width, height,
&exceptionInfo);
dst.replaceImage( newImage );
Magick::throwException( exceptionInfo );
}