15 #ifndef __IPSDKIMAGEPROCESSING_IMAGEINITIALIZEROPERATORS_H__ 16 #define __IPSDKIMAGEPROCESSING_IMAGEINITIALIZEROPERATORS_H__ 20 #include <IPSDKImageProcessing/Attribute/IPEnum/BaseIPEnumAttribute.h> 21 #include <IPSDKImageProcessing/OutputInitializer/Image/DuplicateImageInitializer.h> 22 #include <IPSDKImageProcessing/OutputInitializer/Image/TypedDuplicateImageInitializer.h> 23 #include <IPSDKImageProcessing/OutputInitializer/Image/CustomInitializer/CustomImageInitializer.h> 24 #include <IPSDKImageProcessing/OutputInitializer/Image/PromoteUnaryImageInitializer.h> 25 #include <IPSDKImageProcessing/OutputInitializer/Image/PromoteBinaryImageInitializer.h> 29 #include <boost/make_shared.hpp> 40 template <
typename InputAttributeType,
typename OutputAttributeType>
43 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
47 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
48 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
54 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
55 pInitializer->
init(pOutputAttribute, pInputAttribute, storagePolicy);
59 template <
typename InputAttributeType,
typename OutputAttributeType>
61 duplicateInOut(
const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
62 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
65 return duplicateInOut(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
66 boost::weak_ptr<InputAttributeType>(pInputAttribute),
75 template <
typename InputAttributeType,
typename OutputAttributeType>
78 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
83 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
84 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
90 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
91 pInitializer->
init(pOutputAttribute, pInputAttribute, imageBufferType, distributionPolicy);
95 template <
typename InputAttributeType,
typename OutputAttributeType>
97 duplicateInOut(
const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
98 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
102 return duplicateInOut(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
103 boost::weak_ptr<InputAttributeType>(pInputAttribute),
113 template <
typename InputAttributeType,
typename OutputAttributeType>
116 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
121 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
122 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
128 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
129 pInitializer->
init(pOutputAttribute, pInputAttribute, imageBufferType, storagePolicy);
133 template <
typename InputAttributeType,
typename OutputAttributeType>
136 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
140 return duplicateInOut(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
141 boost::weak_ptr<InputAttributeType>(pInputAttribute),
145 template <
typename InputAttributeType,
typename OutputAttributeType>
148 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
153 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
154 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
160 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
161 pInitializer->
init(pOutputAttribute, pInputAttribute, pIBTAttribute, storagePolicy);
165 template <
typename InputAttributeType,
typename OutputAttributeType>
168 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
172 return duplicateInOut(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
173 boost::weak_ptr<InputAttributeType>(pInputAttribute),
183 template <
typename OutputAttributeType>
185 customOutput(
const boost::weak_ptr<OutputAttributeType>& pOutputAttribute,
189 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
195 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
200 template <
typename OutputAttributeType>
202 customOutput(
const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
205 return customOutput(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
209 template <
typename OutputAttributeType>
211 customOutput(
const boost::weak_ptr<OutputAttributeType>& pOutputAttribute,
216 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
222 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
223 pInitializer->
init(pOutputAttribute, pCustomImageInfo, storagePolicy);
227 template <
typename OutputAttributeType>
229 customOutput(
const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
233 return customOutput(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
243 template <
typename InputAttributeType,
typename OutputAttributeType>
246 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
250 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
251 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
257 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
258 pInitializer->
init(pOutputAttribute, pInputAttribute,
261 boost::optional<ipUInt64>(), boost::optional<ipUInt64>(),
268 template <
typename InputAttributeType,
typename OutputAttributeType>
271 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
275 boost::weak_ptr<InputAttributeType>(pInputAttribute),
279 template <
typename InputAttributeType,
typename OutputAttributeType>
282 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
287 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
288 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
294 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
295 pInitializer->
init(pOutputAttribute, pInputAttribute,
298 boost::optional<ipUInt64>(), boost::optional<ipUInt64>(),
305 template <
typename InputAttributeType,
typename OutputAttributeType>
308 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
313 boost::weak_ptr<InputAttributeType>(pInputAttribute),
323 template <
typename InputAttributeType,
typename OutputAttributeType>
326 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
330 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
331 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
337 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
338 pInitializer->
init(pOutputAttribute, pInputAttribute,
341 boost::optional<ipUInt64>(), boost::optional<ipUInt64>(),
348 template <
typename InputAttributeType,
typename OutputAttributeType>
351 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
355 boost::weak_ptr<InputAttributeType>(pInputAttribute),
363 template <
typename InputAttributeType,
typename OutputAttributeType>
366 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
370 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
371 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
377 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
378 pInitializer->
init(pOutputAttribute, pInputAttribute,
381 boost::optional<ipUInt64>(), boost::optional<ipUInt64>(),
388 template <
typename InputAttributeType,
typename OutputAttributeType>
391 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
394 return duplicate2dInOut(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
395 boost::weak_ptr<InputAttributeType>(pInputAttribute),
405 template <
typename InputAttributeType,
typename OutputAttributeType>
408 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
412 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
413 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
419 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
420 pInitializer->
init(pOutputAttribute, pInputAttribute,
423 boost::optional<ipUInt64>(), boost::optional<ipUInt64>(),
430 template <
typename InputAttributeType,
typename OutputAttributeType>
433 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
437 boost::weak_ptr<InputAttributeType>(pInputAttribute),
446 template <
typename InputAttributeType,
typename OutputAttributeType>
449 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
454 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
455 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
461 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
462 pInitializer->
init(pOutputAttribute, pInputAttribute,
465 boost::optional<ipUInt64>(), boost::optional<ipUInt64>(),
472 template <
typename InputAttributeType,
typename OutputAttributeType>
475 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
480 boost::weak_ptr<InputAttributeType>(pInputAttribute),
490 template <
typename InputAttributeType,
typename OutputAttributeType>
492 promoteUnary(
const boost::weak_ptr<OutputAttributeType>& pOutputAttribute,
493 const boost::weak_ptr<InputAttributeType>& pInputAttribute,
497 typedef typename InputAttributeType::BaseImageAttributeType BaseInputAttributeType;
498 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
504 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
505 pInitializer->
init(pOutputAttribute, pInputAttribute, promoteUnaryType);
509 template <
typename InputAttributeType,
typename OutputAttributeType>
511 promoteUnary(
const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
512 const boost::shared_ptr<InputAttributeType>& pInputAttribute,
515 return promoteUnary(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
516 boost::weak_ptr<InputAttributeType>(pInputAttribute),
526 template <
typename InputAttributeType1,
typename InputAttributeType2,
typename OutputAttributeType>
529 const boost::weak_ptr<InputAttributeType1>& pInputAttribute1,
530 const boost::weak_ptr<InputAttributeType2>& pInputAttribute2,
532 const bool bAllowReInterpretation =
false)
535 typedef typename InputAttributeType1::BaseImageAttributeType BaseInputAttributeType1;
536 typedef typename InputAttributeType2::BaseImageAttributeType BaseInputAttributeType2;
537 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
543 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
544 pInitializer->
init(pOutputAttribute, pInputAttribute1, pInputAttribute2, promoteBinaryType, bAllowReInterpretation);
548 template <
typename InputAttributeType1,
typename InputAttributeType2,
typename OutputAttributeType>
550 promoteBinary(
const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
551 const boost::shared_ptr<InputAttributeType1>& pInputAttribute1,
552 const boost::shared_ptr<InputAttributeType2>& pInputAttribute2,
554 const bool bAllowReInterpretation =
false)
556 return promoteBinary(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
557 boost::weak_ptr<InputAttributeType1>(pInputAttribute1),
558 boost::weak_ptr<InputAttributeType2>(pInputAttribute2),
560 bAllowReInterpretation);
570 template <
typename InputAttributeType1,
typename InputAttributeType2,
typename OutputAttributeType>
573 const boost::weak_ptr<InputAttributeType1>& pInputAttribute1,
574 const boost::weak_ptr<InputAttributeType2>& pInputAttribute2,
578 typedef typename InputAttributeType1::BaseImageAttributeType BaseInputAttributeType1;
579 typedef typename InputAttributeType2::BaseImageAttributeType BaseInputAttributeType2;
580 typedef typename OutputAttributeType::BaseImageAttributeType BaseOutputAttributeType;
586 boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
587 pInitializer->
init(pOutputAttribute, pInputAttribute1, pInputAttribute2, promoteBinaryType,
true);
591 template <
typename InputAttributeType1,
typename InputAttributeType2,
typename OutputAttributeType>
594 const boost::shared_ptr<InputAttributeType1>& pInputAttribute1,
595 const boost::shared_ptr<InputAttributeType2>& pInputAttribute2,
599 boost::weak_ptr<InputAttributeType1>(pInputAttribute1),
600 boost::weak_ptr<InputAttributeType2>(pInputAttribute2),
611 #endif // __IPSDKIMAGEPROCESSING_IMAGEINITIALIZEROPERATORS_H__ void init(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< const InputAttributeType > &pInputAttribute, const image::eImageBufferType &imageBufferType=image::eImageBufferType::eIBT_None, const eImageInitializerDistributionPolicy &imageInitializerDistributionPolicy=eImageInitializerDistributionPolicy::eIIDP_AllowDistribution, const boost::optional< ipUInt64 > &sizeX=boost::optional< ipUInt64 >(), const boost::optional< ipUInt64 > &sizeY=boost::optional< ipUInt64 >(), const image::VolumeGeometry &volumeGeometry=image::VolumeGeometry(), const image::ColorGeometry &colorGeometry=image::ColorGeometry(), const image::TemporalGeometry &temporalGeometry=image::TemporalGeometry())
initialize object with a specified distribution type
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void init(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< const InputAttributeType1 > &pInputAttribute1, const boost::weak_ptr< const InputAttributeType2 > &pInputAttribute2, const ePromoteBinaryType &promoteBinaryType, const bool bAllowReInterpretation=false)
initialize object
processor::OutputInitializerPtr duplicateGreyInOut(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const eImageInitializerStoragePolicy &storagePolicy=eImageInitializerStoragePolicy::eIISP_Inherit)
function allowing to duplicate an input image to an output image with respect to input image geometry...
Definition: ImageInitializerOperators.h:245
processor::OutputInitializerPtr promoteUnary(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const ePromoteUnaryType &promoteUnaryType)
functions allowing to deduce output image buffer type promotion from an input image buffer type ...
Definition: ImageInitializerOperators.h:492
Predefined geometry component instances.
void init(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< const InputAttributeType > &pInputAttribute, const IBTAttributeConstWeakPtr &pIBTAttribute, const boost::optional< ipUInt64 > &sizeX=boost::optional< ipUInt64 >(), const boost::optional< ipUInt64 > &sizeY=boost::optional< ipUInt64 >(), const image::VolumeGeometry &volumeGeometry=image::VolumeGeometry(), const image::ColorGeometry &colorGeometry=image::ColorGeometry(), const image::TemporalGeometry &temporalGeometry=image::TemporalGeometry())
initialize object
boost::shared_ptr< const BaseImageBufferTypeAttribute > IBTAttributeConstPtr
Definition: ImageBufferTypeAttributeTypes.h:37
processor::OutputInitializerPtr duplicateInOut(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const eImageInitializerStoragePolicy &storagePolicy=eImageInitializerStoragePolicy::eIISP_Inherit)
function allowing to duplicate an input image to an output image
Definition: ImageInitializerOperators.h:42
IPSDKIMAGE_API ColorGeometry geometryGrey()
create a grey level color geometry
IPSDKIMAGE_API VolumeGeometry geometry2d()
create a 2d volume geometry
Definition of import/export macro for library.
boost::shared_ptr< BaseOutputInitializer > OutputInitializerPtr
shared pointer to output intializer
Definition: OutputInitializerTypes.h:51
Class allowing to initialize an output image from two other images deducing output image buffer type ...
Definition: PromoteBinaryImageInitializer.h:38
processor::OutputInitializerPtr duplicate2dInOut(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const eImageInitializerStoragePolicy &storagePolicy=eImageInitializerStoragePolicy::eIISP_Inherit)
function allowing to duplicate an input image to an output image with respect to input image geometry...
Definition: ImageInitializerOperators.h:365
boost::weak_ptr< const BaseImageBufferTypeAttribute > IBTAttributeConstWeakPtr
Definition: ImageBufferTypeAttributeTypes.h:43
IPSDKIMAGE_API TemporalGeometry geometrySingle()
create a single element temporal geometry
processor::OutputInitializerPtr customOutput(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const CustomImageInfoPtr &pCustomImageInfo)
function allowing to initialize an output image using a derived object to define output image propert...
Definition: ImageInitializerOperators.h:185
ePromoteUnaryType
Enumerate describing promote unary output image initializer type.
Definition: ImageInitializerTypes.h:55
eImageInitializerStoragePolicy
Enumerate describing image initializer storage policy.
Definition: ImageInitializerTypes.h:114
IPSDKIMAGE_API ColorGeometry geometryRgb()
create a rgb color geometry
processor::OutputInitializerPtr duplicateSingleInOut(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const eImageInitializerStoragePolicy &storagePolicy=eImageInitializerStoragePolicy::eIISP_Inherit)
function allowing to duplicate an input image to an output image with respect to input image geometry...
Definition: ImageInitializerOperators.h:325
processor::OutputInitializerPtr promoteBinary(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType1 > &pInputAttribute1, const boost::weak_ptr< InputAttributeType2 > &pInputAttribute2, const ePromoteBinaryType &promoteBinaryType, const bool bAllowReInterpretation=false)
functions allowing to deduce output image buffer type promotion from two input image buffer types ret...
Definition: ImageInitializerOperators.h:528
void init(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< const InputAttributeType > &pInputAttribute, const ePromoteUnaryType &promoteUnaryType)
initialize object
Class encapsulating volume geometryThis class allows to define geometry volume size and type (2d or 3...
Definition: VolumeGeometry.h:34
Class allowing to initialize an output image from an other image and from a given image buffer type a...
Definition: TypedDuplicateImageInitializer.h:42
Class encapsulating color geometryThis class allows to define geometry color size and type (grey...
Definition: ColorGeometry.h:35
Class allowing to initialize an output image from an other image and optionnaly from a given type...
Definition: DuplicateImageInitializer.h:42
boost::shared_ptr< BaseCustomImageInfo > CustomImageInfoPtr
shared pointer to CustomImageInfo
Definition: CustomImageInfoTypes.h:26
Predefined types for image initializer management.
Class encapsulating temporal geometryThis class allows to define geometry temporal size and type (sin...
Definition: TemporalGeometry.h:35
Class allowing to initialize an output image from an other image deducing output image buffer type fr...
Definition: PromoteUnaryImageInitializer.h:38
eImageInitializerDistributionPolicy
Enumerate describing image initializer distribution policy.
Definition: ImageInitializerTypes.h:99
Predefined type for image management.
Class allowing to initialize an output image from an object allowing to define output image propertie...
Definition: CustomImageInitializer.h:38
empty buffer type
Definition: ImageTypes.h:80
Image memory distribution is allowed.
Definition: ImageInitializerTypes.h:101
processor::OutputInitializerPtr promoteReInterpretable(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType1 > &pInputAttribute1, const boost::weak_ptr< InputAttributeType2 > &pInputAttribute2, const ePromoteBinaryType &promoteBinaryType)
functions allowing to deduce output image buffer type promotion from two input image buffer types ret...
Definition: ImageInitializerOperators.h:572
The allocated image has the same storage type than the input image.
Definition: ImageInitializerTypes.h:116
ePromoteBinaryType
Enumerate describing promote binary output image initializer type.
Definition: ImageInitializerTypes.h:76
processor::OutputInitializerPtr duplicateRgbInOut(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const eImageInitializerStoragePolicy &storagePolicy=eImageInitializerStoragePolicy::eIISP_Inherit)
function allowing to duplicate an input image to an output image with respect to input image geometry...
Definition: ImageInitializerOperators.h:407
void init(const ImageAttributeWeakPtr &pOutputAttribute, const CustomImageInfoPtr &pCustomImageInfo, const eImageInitializerStoragePolicy &storagePolicy)
initialize object
eImageBufferType
types associated to image buffers
Definition: ImageTypes.h:78