Magick++ 7.1.2
Loading...
Searching...
No Matches
Magick::ImageMoments Class Reference
Collaboration diagram for Magick::ImageMoments:

Public Member Functions

 ImageMoments (const ImageMoments &imageMoments_)
 
ChannelMoments channel (const PixelChannel channel_) const
 
 ImageMoments (const Image &image_)
 

Private Attributes

std::vector< ChannelMoments_channels
 

Detailed Description

Definition at line 219 of file Statistic.h.

Constructor & Destructor Documentation

◆ ImageMoments() [1/3]

Magick::ImageMoments::ImageMoments ( void )

Definition at line 427 of file Statistic.cpp.

428 : _channels()
429{
430}

◆ ImageMoments() [2/3]

Magick::ImageMoments::ImageMoments ( const ImageMoments & imageMoments_)

Definition at line 432 of file Statistic.cpp.

433 : _channels(imageMoments_._channels)
434{
435}

◆ ~ImageMoments()

Magick::ImageMoments::~ImageMoments ( void )

Definition at line 437 of file Statistic.cpp.

438{
439}

◆ ImageMoments() [3/3]

Magick::ImageMoments::ImageMoments ( const Image & image_)

Definition at line 453 of file Statistic.cpp.

454 : _channels()
455{
456 MagickCore::ChannelMoments*
457 channel_moments;
458
459 GetPPException;
460 channel_moments=GetImageMoments(image_.constImage(),exceptionInfo);
461 if (channel_moments != (MagickCore::ChannelMoments *) NULL)
462 {
463 ssize_t
464 i;
465
466 for (i=0; i < (ssize_t) GetPixelChannels(image_.constImage()); i++)
467 {
468 PixelChannel channel=GetPixelChannelChannel(image_.constImage(),i);
469 PixelTrait traits=GetPixelChannelTraits(image_.constImage(),channel);
470 if (traits == UndefinedPixelTrait)
471 continue;
472 if ((traits & UpdatePixelTrait) == 0)
473 continue;
474 _channels.push_back(Magick::ChannelMoments(channel,
475 &channel_moments[channel]));
476 }
477 _channels.push_back(Magick::ChannelMoments(CompositePixelChannel,
478 &channel_moments[CompositePixelChannel]));
479 channel_moments=(MagickCore::ChannelMoments *) RelinquishMagickMemory(
480 channel_moments);
481 }
482 ThrowPPException(image_.quiet());
483}

Member Function Documentation

◆ channel()

Magick::ChannelMoments Magick::ImageMoments::channel ( const PixelChannel channel_) const

Definition at line 441 of file Statistic.cpp.

443{
444 for (std::vector<ChannelMoments>::const_iterator it = _channels.begin();
445 it != _channels.end(); ++it)
446 {
447 if (it->channel() == channel_)
448 return(*it);
449 }
450 return(ChannelMoments());
451}

Member Data Documentation

◆ _channels

std::vector<ChannelMoments> Magick::ImageMoments::_channels
private

Definition at line 241 of file Statistic.h.


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