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

## Public Member Functions

| PixelData (Magick::Image &image_, std::string map_, const StorageType type_)
| PixelData (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_)
const void * | data (void) const
::ssize_t | length (void) const
::ssize_t | size (void) const

## Private Member Functions

| PixelData (const PixelData &pixels_)
const PixelData & | operator= (const PixelData &pixels_)
void | 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_)
void | relinquish (void) throw ()

## Private Attributes

void * | _data
::ssize_t | _length
::ssize_t | _size

## Detailed Description

Definition at line 83 of file Pixels.h.

## Constructor & Destructor Documentation

## PixelData() [1/2]

Magick::PixelData::PixelData | ( | Magick::Image & | image_,
|  | std::string | map_,
|  | const StorageType | type_
| ) |  |

Definition at line 109 of file Pixels.cpp.

{
init(image_,0,0,image_.columns(),image_.rows(),map_,type_);
}

## PixelData() [2/2]

Magick::PixelData::PixelData | ( | 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_
| ) |  |

Definition at line 115 of file Pixels.cpp.

{
init(image_,x_,y_,width_,height_,map_,type_);
}

## ~PixelData()

Magick::PixelData::~PixelData | ( | void |  | ) |

Definition at line 122 of file Pixels.cpp.

{
relinquish();
}

## Member Function Documentation

## data()

const void * Magick::PixelData::data | ( | void |  | ) | const

Definition at line 127 of file Pixels.cpp.

{
return(_data);
}

## init()

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_
| ) |  |

private

Definition at line 142 of file Pixels.cpp.

{
size_t
size;
_data=(void *) NULL;
_length=0;
_size=0;
if ((x_ < 0) || (width_ == 0) || (y_ < 0) || (height_ == 0) ||
(x_ > (ssize_t) image_.columns()) || (((ssize_t) width_ + x_) > (ssize_t) image_.columns())
|| (y_ > (ssize_t) image_.rows()) || (((ssize_t) height_ + y_) > (ssize_t) 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 LongPixel:
size=sizeof(unsigned int);
break;
case LongLongPixel:
size=sizeof(MagickSizeType);
break;
case QuantumPixel:
size=sizeof(Quantum);
break;
case ShortPixel:
size=sizeof(unsigned short);
break;
default:
throwExceptionExplicit(MagickCore::OptionError,"Invalid type");
return;
}
_length=(ssize_t) (width_*height_*map_.length());
_size=_length*(ssize_t) size;
_data=AcquireMagickMemory((size_t) _size);
GetPPException;
MagickCore::ExportImagePixels(image_.image(),x_,y_,width_,height_,
map_.c_str(),type_,_data,exceptionInfo);
if (exceptionInfo->severity != MagickCore::UndefinedException)
relinquish();
ThrowPPException(image_.quiet());
}

## length()

ssize_t Magick::PixelData::length | ( | void |  | ) | const

Definition at line 132 of file Pixels.cpp.

{
return(_length);
}

## relinquish()

void Magick::PixelData::relinquish | ( | void |  | ) |
throw | ( |
| ) |  |

private

Definition at line 198 of file Pixels.cpp.

{
if (_data != (void *)NULL)
_data=RelinquishMagickMemory(_data);
_length=0;
_size=0;
}

## size()

ssize_t Magick::PixelData::size | ( | void |  | ) | const

Definition at line 137 of file Pixels.cpp.

{
return(_size);
}

## Field Documentation

## _data

void* Magick::PixelData::_data

private

Definition at line 119 of file Pixels.h.

## _length

::ssize_t Magick::PixelData::_length

private

Definition at line 120 of file Pixels.h.

## _size

::ssize_t Magick::PixelData::_size

private

Definition at line 121 of file Pixels.h.

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

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