Magick++ 7.1.1
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 423 of file Statistic.cpp.

424 : _channels()
425{
426}

◆ ImageMoments() [2/3]

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

Definition at line 428 of file Statistic.cpp.

429 : _channels(imageMoments_._channels)
430{
431}

◆ ~ImageMoments()

Magick::ImageMoments::~ImageMoments ( void  )

Definition at line 433 of file Statistic.cpp.

434{
435}

◆ ImageMoments() [3/3]

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

Definition at line 449 of file Statistic.cpp.

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

Member Function Documentation

◆ channel()

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

Definition at line 437 of file Statistic.cpp.

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

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: