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

Public Member Functions

 ImageMoments (const ImageMoments &imageMoments_)
 
ChannelMoments channel (const ChannelType channel_=CompositeChannels) const
 
 ImageMoments (const Image &image_)
 

Private Attributes

std::vector< ChannelMoments_channels
 

Detailed Description

Definition at line 77 of file ChannelMoments.h.

Constructor & Destructor Documentation

◆ ImageMoments() [1/3]

Magick::ImageMoments::ImageMoments ( void )

Definition at line 115 of file ChannelMoments.cpp.

116 : _channels()
117{
118}

◆ ImageMoments() [2/3]

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

Definition at line 120 of file ChannelMoments.cpp.

121 : _channels(imageMoments_._channels)
122{
123}

◆ ~ImageMoments()

Magick::ImageMoments::~ImageMoments ( void )

Definition at line 125 of file ChannelMoments.cpp.

126{
127}

◆ ImageMoments() [3/3]

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

Definition at line 141 of file ChannelMoments.cpp.

142 : _channels()
143{
144 MagickCore::ChannelMoments*
145 channel_moments;
146
147 GetPPException;
148 channel_moments=GetImageChannelMoments(image_.constImage(),exceptionInfo);
149 if (channel_moments != (MagickCore::ChannelMoments *) NULL)
150 {
151 switch(image_.constImage()->colorspace)
152 {
153 case RGBColorspace:
154 default:
155 _channels.push_back(Magick::ChannelMoments(RedChannel,
156 &channel_moments[RedChannel]));
157 _channels.push_back(Magick::ChannelMoments(GreenChannel,
158 &channel_moments[GreenChannel]));
159 _channels.push_back(Magick::ChannelMoments(BlueChannel,
160 &channel_moments[BlueChannel]));
161 break;
162 case CMYKColorspace:
163 _channels.push_back(Magick::ChannelMoments(CyanChannel,
164 &channel_moments[CyanChannel]));
165 _channels.push_back(Magick::ChannelMoments(MagentaChannel,
166 &channel_moments[MagentaChannel]));
167 _channels.push_back(Magick::ChannelMoments(YellowChannel,
168 &channel_moments[YellowChannel]));
169 _channels.push_back(Magick::ChannelMoments(BlackChannel,
170 &channel_moments[BlackChannel]));
171 break;
172 case GRAYColorspace:
173 _channels.push_back(Magick::ChannelMoments(GrayChannel,
174 &channel_moments[GrayChannel]));
175 break;
176 }
177 if (image_.constImage()->matte != MagickFalse)
178 _channels.push_back(Magick::ChannelMoments(AlphaChannel,
179 &channel_moments[AlphaChannel]));
180 if (image_.constImage()->colorspace != GRAYColorspace)
181 _channels.push_back(Magick::ChannelMoments(CompositeChannels,
182 &channel_moments[CompositeChannels]));
183 channel_moments=(MagickCore::ChannelMoments *) RelinquishMagickMemory(
184 channel_moments);
185 }
186 ThrowPPException(image_.quiet());
187}

Member Function Documentation

◆ channel()

Magick::ChannelMoments Magick::ImageMoments::channel ( const ChannelType channel_ = CompositeChannels) const

Definition at line 129 of file ChannelMoments.cpp.

131{
132 for (std::vector<ChannelMoments>::const_iterator it = _channels.begin();
133 it != _channels.end(); ++it)
134 {
135 if (it->channel() == channel_)
136 return(*it);
137 }
138 return(ChannelMoments());
139}

Member Data Documentation

◆ _channels

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

Definition at line 99 of file ChannelMoments.h.


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