eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // ImageVariant.h Image.Component package 00003 //============================================================================ 00004 // Usage : define a variant image, an image than can have any 00005 // image implementation types. 00006 //---------------------------------------------------------------------------- 00007 // Inheritance : 00008 // ImageVariant 00009 //---------------------------------------------------------------------------- 00010 // Copyright (C) 2006 by eLynx project 00011 // 00012 // This library is free software; you can redistribute it and/or 00013 // modify it under the terms of the GNU Library General Public 00014 // License as published by the Free Software Foundation; either 00015 // version 2 of the License, or (at your option) any later version. 00016 // 00017 // This library is distributed in the hope that it will be useful, 00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00020 // See the GNU Library General Public License for more details. 00021 //---------------------------------------------------------------------------- 00022 #ifndef __ImageVariant_h__ 00023 #define __ImageVariant_h__ 00024 00025 #include <elx/image/ImageLib.h> 00026 #include <elx/image/Bayer.h> 00027 00028 #include <elx/image/IImageGeometry.h> 00029 #include <elx/image/IImageAnalyse.h> 00030 #include <elx/image/IImageOperators.h> 00031 #include <elx/image/IImagePointProcessing.h> 00032 #include <elx/image/IImageLocalProcessing.h> 00033 #include <elx/image/IImageGlobalProcessing.h> 00034 #include <elx/image/IImageEdgeProcessing.h> 00035 #include <elx/image/IImageMorphologicalProcessing.h> 00036 #include <elx/image/IImageMiscProcessing.h> 00037 #include <elx/image/IImageRestoration.h> 00038 00039 namespace eLynx { 00040 namespace Image { 00041 00042 class ImageFileInfo; 00043 class ImageFileOptions; 00044 00049 class ExportedByImage ImageVariant 00050 { 00051 public: 00054 00059 ImageVariant(); 00060 00072 ImageVariant(EPixelFormat iPixelFormat, uint32 iWidth, uint32 iHeight); 00073 00076 ImageVariant(const ImageVariant& iImage); 00077 00085 ImageVariant( 00086 const ImageVariant& iImage, 00087 EResolution iResolution, 00088 bool ibScaled=true); 00089 00094 ImageVariant( 00095 const ImageVariant& iImage, 00096 uint32 iChannel, 00097 bool ibScaled=true); 00098 00101 ImageVariant(const AbstractImage& iImage); 00102 00113 ImageVariant( 00114 const ImageVariant& iImage1, 00115 const ImageVariant& iImage2, 00116 bool ibComplex=false); 00117 00138 ImageVariant( 00139 const ImageVariant& iImage1, 00140 const ImageVariant& iImage2, 00141 const ImageVariant& iImage3, 00142 EColorSpace iColorSpace=CS_RGB); 00143 00153 ImageVariant( 00154 const ImageVariant& iImage1, 00155 const ImageVariant& iImage2, 00156 const ImageVariant& iImage3, 00157 const ImageVariant& iImage4); 00158 00165 ImageVariant( 00166 const char * iprFilename, 00167 ImageFileInfo * oprInfo=NULL, 00168 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00169 00173 const ImageVariant& operator = (const ImageVariant& iImage); 00174 00178 const ImageVariant& operator = (const AbstractImage& iImage); 00179 00183 bool operator == (const ImageVariant& iOther) const; 00184 00188 bool operator != (const ImageVariant& iOther) const; 00189 00192 virtual ~ImageVariant(); 00193 00196 void Release(); 00198 00201 00204 EPixelMode GetPixelMode() const; 00205 00208 EPixelType GetPixelType() const; 00209 00225 EColorSpace GetColorSpace() const; 00226 00229 EPixelFormat GetPixelFormat() const; 00230 00240 EResolution GetResolution() const; 00241 00249 uint32 GetChannelCount() const; 00250 00253 uint32 GetBitsPerPixel() const; 00254 00257 uint32 sizeofPixel() const; 00258 00262 bool IsMasking(uint32 iChannelMask) const; 00263 00270 bool IsColor() const; 00271 00276 bool IsGrey() const; 00277 00280 bool IsComplex() const; 00281 00284 bool HasAlpha() const; 00285 00290 bool IsL() const; 00291 00294 bool IsLA() const; 00295 00298 bool IsRGB() const; 00299 00302 bool IsRGBA() const; 00303 00306 bool IsHLS() const; 00307 00310 bool IsXYZ() const; 00311 00314 bool IsLuv() const; 00315 00318 bool IsLab() const; 00319 00322 bool IsLch() const; 00323 00326 bool IsHLab() const; 00327 00330 bool IsUInt8() const; 00331 00334 bool IsUInt16() const; 00335 00338 bool IsInt32() const; 00339 00342 bool IsFloat() const; 00343 00346 bool IsDouble() const; 00347 00350 bool IsLub() const; 00351 00354 bool IsLus() const; 00355 00358 bool IsLi() const; 00359 00362 bool IsLf() const; 00363 00366 bool IsLd() const; 00367 00370 bool IsLAub() const; 00371 00374 bool IsLAus() const; 00375 00378 bool IsLAi() const; 00379 00382 bool IsLAf() const; 00383 00386 bool IsLAd() const; 00387 00390 bool IsComplexi() const; 00391 00394 bool IsComplexf() const; 00395 00398 bool IsComplexd() const; 00399 00402 bool IsRGBub() const; 00403 00406 bool IsRGBus() const; 00407 00410 bool IsRGBi() const; 00411 00414 bool IsRGBf() const; 00415 00418 bool IsRGBd() const; 00419 00422 bool IsRGBAub() const; 00423 00426 bool IsRGBAus() const; 00427 00430 bool IsRGBAi() const; 00431 00434 bool IsRGBAf() const; 00435 00438 bool IsRGBAd() const; 00439 00442 bool IsHLSf() const; 00443 00446 bool IsHLSd() const; 00447 00450 bool IsXYZf() const; 00451 00454 bool IsXYZd() const; 00455 00458 bool IsLuvf() const; 00459 00462 bool IsLuvd() const; 00463 00466 bool IsLabf() const; 00467 00470 bool IsLabd() const; 00471 00474 bool IsLchf() const; 00475 00478 bool IsLchd() const; 00479 00482 bool IsHLabf() const; 00483 00486 bool IsHLabd() const; 00487 00489 00492 00495 bool IsValid() const; 00496 00499 uint32 GetWidth() const; 00500 00503 uint32 GetHeight() const; 00504 00507 uint32 sizeofWidth() const; 00508 00511 uint32 GetPixelCount() const; 00512 00515 uint32 GetSampleCount() const; 00516 00519 uint32 sizeofMap() const; 00521 00524 00527 boost::shared_ptr<AbstractImage> GetImpl(); 00528 00531 boost::shared_ptr<const AbstractImage> GetImpl() const; 00532 00536 void Invalidate(bool ibRelease=true); 00537 00540 void Assign(boost::shared_ptr<AbstractImage>& ipsAbstractImpl); 00542 00545 00553 bool CanLoad( 00554 const char * iprFilename, 00555 ImageFileInfo * oprInfo = NULL, 00556 bool ibPreview = false) const; 00557 00565 bool Load( 00566 const char * iprFilename, 00567 ImageFileInfo * oprInfo = NULL, 00568 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00569 00575 bool CanSave(const char * iprFilename) const; 00576 00584 bool Save( 00585 const char * iprFilename, 00586 ProgressNotifier& iNotifier=ProgressNotifier_NULL, 00587 const ImageFileOptions * iprOptions = NULL) const; 00589 00592 00604 bool ChangeResolution( 00605 EResolution iResolution, 00606 bool ibScaled = true); 00607 00608 bool ChangeColorSpace( 00609 EColorSpace iColorSpace, 00610 bool ibBlendAlpha = false); 00611 00612 bool ChangePixelFormat( 00613 EPixelFormat iPixelFormat, 00614 bool ibScaled = true, 00615 bool ibBlendAlpha = false); 00616 00617 bool ChangeToGrey( 00618 EColorToGreyConversion iMethod = CGC_Default, 00619 bool ibRemoveAlpha = false, 00620 bool ibBlendAlpha = false); 00621 00622 bool ChangeToBayer( 00623 EBayerMatrix iBayer = BM_GRBG, 00624 bool ibBlendAlpha = false, 00625 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00626 00627 bool ChangeToColor( 00628 EGreyToColorConversion iMethod = GCC_Default, 00629 bool ibRemoveAlpha = false, 00630 bool ibBlendAlpha = false); 00631 00632 bool ChangeToColor( 00633 EBayerToColorConversion iMethod, 00634 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00635 00636 // bool ChangeToRGB(EBayerToColorConversion iMethod, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00637 00638 bool ChangeToUByteFullDynamic(); 00639 00640 bool GetChannelAsRGBGrey( 00641 const ImageVariant& iImage, 00642 uint32 iChannel); 00643 00644 bool Split( 00645 ImageVariant&, 00646 ImageVariant&); 00647 00648 bool Split( 00649 ImageVariant&, 00650 ImageVariant&, 00651 ImageVariant&); 00652 00653 bool Split( 00654 ImageVariant&, 00655 ImageVariant&, 00656 ImageVariant&, 00657 ImageVariant&); 00658 00664 bool GetPlane(const ImageVariant& iImage, uint32 iPlane, bool ibScaled = true); 00665 00671 bool GetPlane(uint32 iPlane, ImageVariant& oPlane, bool ibScaled = true) const; 00672 00679 bool SetPlane(uint32 iPlane, const ImageVariant& iImage, bool ibResized = true, bool ibScaled = false); 00680 00685 bool SwapPlanes(uint32 iPlane1, uint32 iPlane2); 00686 00687 bool RemoveAlpha(bool ibBlendAlpha = false); 00688 bool AddAlpha(const ImageVariant& iAlpha); 00690 00693 00703 bool Flip( 00704 EFlipPlane iFlipPlane, 00705 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00706 00714 bool FlipVertical( 00715 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00716 00724 bool FlipHorizontal( 00725 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00726 00737 bool Rotate( 00738 ERightRotation iRotation, 00739 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00740 00748 bool Rotate180( 00749 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00750 00758 bool Rotate90Left( 00759 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00760 00768 bool Rotate90Right( 00769 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00770 00775 bool Rotate( 00776 double iDegrees, 00777 int32 iFlags = RF_Default, 00778 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00779 00791 bool Crop( 00792 uint32 iX, uint32 iY, 00793 uint32 iWidth, uint32 iHeight, 00794 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00795 00809 bool AddBorder( 00810 uint32 iLeft = 0, uint32 iRight = 0, 00811 uint32 iTop = 0, uint32 iBottom = 0, 00812 bool ibBlack = true, 00813 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00814 00824 bool Resize( 00825 uint32 iWidth, uint32 iHeight, 00826 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00827 00838 bool Resample( 00839 uint32 iWidth, uint32 iHeight, 00840 Math::EResampleFilter iFilter = Math::RF_Mitchell, 00841 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00842 00845 bool AutoCrop(); 00846 00855 bool Zoom( 00856 uint32 iZoom, 00857 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00858 00868 bool Bin2x2( 00869 EBinningMethod iMethod = BM_Mean, 00870 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00871 00881 bool Bin3x3( 00882 EBinningMethod iMethod = BM_Mean, 00883 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00884 00895 bool Shift( 00896 int32 iHorizontal, int32 iVertical, 00897 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00898 00899 bool Shift( 00900 double iHorizontal, double iVertical, 00901 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00902 00911 bool GetSubImage( 00912 const ImageVariant& iImage, 00913 uint32 iX, uint32 iY, uint32 iWidth, uint32 iHeight, 00914 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00915 00922 bool Insert( 00923 const ImageVariant& iImage, 00924 int32 iX, int32 iY, 00925 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00926 00927 boost::shared_ptr<ImageVariant> 00928 CreateThumbnailImage( 00929 uint32 iWidth, uint32 iHeight, 00930 bool ibConverveAspectRatio = true, 00931 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00932 00933 bool GetThumbnail( 00934 const ImageVariant& iImage, 00935 uint32 iWidth, uint32 iHeight, 00936 bool ibConverveAspectRatio = true, 00937 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00939 00942 bool Operator( 00943 EImageOperator iOperator, 00944 double iValue, 00945 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00946 00947 bool Neg( 00948 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00949 00950 bool Abs( 00951 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00952 00953 bool Add( 00954 double iScale, 00955 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00956 00957 bool Sub( 00958 double iScale, 00959 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00960 00961 bool Mul( 00962 double iScale, 00963 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00964 00965 bool Div( 00966 double iScale, 00967 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00968 00969 bool Dif( 00970 double iScale, 00971 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00972 00973 bool Min( 00974 double iScale, 00975 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00976 00977 bool Max( 00978 double iScale, 00979 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00980 00981 bool Mean( 00982 double iScale, 00983 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00984 00985 bool AddClamp( 00986 double iScale, 00987 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00988 00989 bool SubClamp( 00990 double iScale, 00991 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00992 00993 bool MulClamp( 00994 double iScale, 00995 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00996 00998 01001 01002 bool Operator( 01003 EImageOperator iOperator, 01004 const ImageVariant& iImage, 01005 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01006 01007 bool Add( 01008 const ImageVariant& iImage, 01009 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01010 01011 bool Sub( 01012 const ImageVariant& iImage, 01013 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01014 01015 bool Mul( 01016 const ImageVariant& iImage, 01017 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01018 01019 bool Div( 01020 const ImageVariant& iImage, 01021 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01022 01023 bool Min( 01024 const ImageVariant& iImage, 01025 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01026 01027 bool Max( 01028 const ImageVariant& iImage, 01029 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01030 01031 bool Mean( 01032 const ImageVariant& iImage, 01033 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01034 01035 bool AddClamp( 01036 const ImageVariant& iImage, 01037 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01038 01039 bool SubClamp( 01040 const ImageVariant& iImage, 01041 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01042 01043 bool MulClamp( 01044 const ImageVariant& iImage, 01045 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01047 01050 01052 bool Operator( 01053 EImageOperator iOperator, 01054 const ImageVariant& iImage, const ImageLub& iImageMask, 01055 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01056 01057 bool Add( 01058 const ImageVariant& iImage, const ImageLub& iImageMask, 01059 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01060 01061 bool Sub( 01062 const ImageVariant& iImage, const ImageLub& iImageMask, 01063 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01064 01065 bool Mul( 01066 const ImageVariant& iImage, const ImageLub& iImageMask, 01067 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01068 01069 bool Div( 01070 const ImageVariant& iImage, const ImageLub& iImageMask, 01071 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01072 01073 bool Min( 01074 const ImageVariant& iImage, const ImageLub& iImageMask, 01075 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01076 01077 bool Max( 01078 const ImageVariant& iImage, const ImageLub& iImageMask, 01079 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01080 01081 bool Mean( 01082 const ImageVariant& iImage, const ImageLub& iImageMask, 01083 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01084 01085 bool AddClamp( 01086 const ImageVariant& iImage, const ImageLub& iImageMask, 01087 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01088 01089 bool SubClamp( 01090 const ImageVariant& iImage, const ImageLub& iImageMask, 01091 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01092 01093 bool MulClamp( 01094 const ImageVariant& iImage, const ImageLub& iImageMask, 01095 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01097 01100 bool Build( 01101 EImageListOperator iOperator, 01102 const std::vector< const ImageVariant* >& iImageList, 01103 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01104 01105 bool BuildClipped( 01106 EImageListOperator iOperator, 01107 const std::vector< const ImageVariant* >& iImageList, 01108 uint32 iIteration, double iKappa, 01109 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01110 01111 bool BuildWeightedEntropy( 01112 const std::vector< const ImageVariant* >& iImageList, 01113 uint32 iW, uint32 iH, 01114 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01116 01119 01130 bool AdjustBrightness( 01131 double iBrightness, 01132 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01133 01144 bool AdjustContrast( 01145 double iContrast, 01146 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01147 01158 bool AdjustGamma( 01159 double iGamma, 01160 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01161 01169 bool AdjustBCG( 01170 double iBrightness, double iContrast, double iGamma, 01171 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01172 01185 bool Balance( 01186 double iRed, double iGreen, double iBlue, 01187 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01188 01199 bool Colorize( 01200 double iHue, double iSaturation, 01201 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01202 01209 bool AdjustHueSaturation( 01210 double iHue, double iSaturation, 01211 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01212 01219 bool Desaturate( 01220 double iFactor, 01221 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01222 01230 bool AdjustShadowHighlight( 01231 double iShadow=0.0, double iHighlight=1.0, 01232 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01233 01245 bool AdjustMidtone( 01246 double iMidtone, 01247 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01248 01261 bool AdjustSigmoid( 01262 double iAlpha, double iBeta, 01263 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01264 01275 bool Posterize( 01276 uint32 iLevels, 01277 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01278 01289 bool Solarize( 01290 double iValue, 01291 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01292 01295 // this = iScalar*this + (1-iScalar)*iImage. 01303 bool Blend( 01304 const ImageVariant& iImage, double iScalar, 01305 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01306 01307 bool Binarize( 01308 double iThreshold, bool ibNegative=false, 01309 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01310 01312 01315 01324 bool Convolve( 01325 const Math::ConvolutionKerneld& iKernel, 01326 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01327 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01328 01340 bool Convolve( 01341 const Math::ConvolutionKerneld& iKernel, 01342 double iThresholdMin, double iThresholdMax, 01343 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01344 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01345 01359 bool Convolve( 01360 const Math::ConvolutionKerneld& iKernel, 01361 double iThresholdMin, double iThresholdMax, double iBlend=1.0, 01362 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01363 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01364 01374 bool Convolve( 01375 const Math::ConvolutionKerneld& iKernel1, 01376 const Math::ConvolutionKerneld& iKernel2, 01377 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01378 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01379 01397 bool ApplyBoxBlur( 01398 uint32 iWidth=5, 01399 uint32 iHeight=5, 01400 double iBlend=1.0, 01401 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01402 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01403 01404 bool ApplySelectiveBlur( 01405 double iBlend=1.0, 01406 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01407 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01408 01409 bool ApplyFastGaussianBlur( 01410 double iRadius = 3.0, 01411 EBorderFill iBorder = BF_Nearest, 01412 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01413 01426 bool ApplyGaussian( 01427 uint32 iWidth, uint32 iHeight, double iVariance, 01428 double iBlend=1.0, 01429 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01430 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01431 01443 bool ApplyGaussian( 01444 double iRadius, double iVariance, 01445 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01446 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01447 01458 bool ApplyGaussian( 01459 double iRadius, 01460 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01461 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01462 01463 bool ApplyLoG( 01464 double iRadius=3.0, double iVariance=0.5, 01465 EBorderFill iBorder=BF_Nearest, 01466 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01467 01494 bool ApplyBilateral( 01495 double iRadius=1.5, 01496 double iVarianceSpatial=2.0, 01497 double iVarianceRange=20.0, 01498 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01499 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01500 01518 bool ApplySmooth( 01519 double iThresholdMin=0.0, double iThresholdMax=1.0, 01520 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01521 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01522 01549 bool ApplyMean( 01550 double iRadius, bool ibCircular=true, 01551 double iThresholdMin=0.0, double iThresholdMax=1.0, 01552 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01553 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01554 01576 bool ApplyCone( 01577 double iThresholdMin=0.0, double iThresholdMax=1.0, 01578 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01579 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01580 01602 bool ApplyPyramidal( 01603 double iThresholdMin=0.0, double iThresholdMax=1.0, 01604 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01605 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01606 01607 bool ApplyLowpass( 01608 double iAlpha, 01609 double iThresholdMin=0.0, double iThresholdMax=1.0, 01610 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01611 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01612 01613 bool ApplyLaplacian3x3( 01614 double iAlpha=0.0, 01615 double iThresholdMin=0.0, double iThresholdMax=1.0, 01616 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01617 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01618 01619 bool ApplyLaplacian( 01620 double iRadius=0.0, 01621 double iThresholdMin=0.0, double iThresholdMax=1.0, 01622 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01623 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01624 01625 bool ApplyEmboss( 01626 double iDegree=0.0, 01627 double iThresholdMin=0.0, double iThresholdMax=1.0, 01628 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01629 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01630 01631 bool ApplySharpen( 01632 double iRadius=3.0, 01633 double iThresholdMin=0.0, double iThresholdMax=1.0, 01634 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01635 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01636 01637 bool ApplySharpen3x3( 01638 double iAmount=5.0, 01639 double iThresholdMin=0.0, double iThresholdMax=1.0, 01640 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01641 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01642 01643 bool ApplySharpenMore( 01644 double iAlpha=1.0, 01645 double iThresholdMin=0.0, double iThresholdMax=1.0, 01646 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01647 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01648 01649 bool ApplySharpenSmooth( 01650 double iAlpha=0.0, 01651 double iThresholdMin=0.0, double iThresholdMax=1.0, 01652 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01653 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01654 01655 bool ApplySharpenSoft( 01656 double iThresholdMin=0.0, double iThresholdMax=1.0, 01657 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01658 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01659 01660 bool ApplyUnsharpMask( 01661 double iRadius=2.0, double iAmount1=0.5, double iAmount2=0.5, 01662 EBorderFill iBorder=BF_Nearest, 01663 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01665 01668 01675 virtual bool ApplyGradient( 01676 EEdgeDetector iDetector, EEdgeGradient iGradient=EG_Fast, 01677 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01678 01684 bool ApplyMarrHildreth( 01685 EBorderFill iBorder=BF_Nearest, 01686 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01687 01693 bool ApplyRoberts(bool ibFast=true, 01694 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01695 01706 bool ApplyCanny( 01707 EEdgeDetector iDetector, EEdgeGradient iGradient, 01708 double iRadius=1.5, double iThresholdLo=0.0, double iThresholdHi=1.0, 01709 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01710 01716 bool ApplyZeroCrossing(double iRadius, 01717 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01718 01725 bool ApplySegmentation(double iStep, 01726 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01728 01731 01742 bool ApplyRotationalGradient( 01743 double iXc, double iYc, 01744 double iRadialShift, double iRotationalShift, 01745 bool ibInterpolation = true, 01746 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01747 01756 bool RemoveGradient( 01757 ImageVariant& oBackground, 01758 const Math::Point2iList& iPoints, 01759 EGradientMethod iMethod = GM_Linear, 01760 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01761 01766 bool Debloom( 01767 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01768 01769 bool ApplyDigitalDevelopment( 01770 double iBackground, double iCrossOver, double iScale, 01771 double iVariance = 1.5, 01772 EColorEmphasis iEmphasis = CE_Default, 01773 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01774 /* 01783 bool ApplyChannelSubstitution( 01784 const ImageVariant& iHighResGrayImage, 01785 EChannelSubstitution iSubstitution, double iBlendScalar, 01786 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01787 */ 01789 01792 01804 bool ApplyMorphological( 01805 EMorphologicalFilterType iType, 01806 uint32 iWidth = 3, 01807 bool ibCircular = true, 01808 bool ibLuminance = true, 01809 uint32 iIteration = 1, 01810 double iBlend = 1.0, 01811 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01812 01822 bool Despeckle( 01823 uint32 iWidth = 3, 01824 bool ibCircular = true, 01825 bool ibLuminance = true, 01826 uint32 iIteration = 1, 01827 uint32 iChannelMask = CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01828 01838 bool Erode( 01839 uint32 iWidth = 3, 01840 bool ibCircular = true, 01841 bool ibLuminance = true, 01842 uint32 iIteration = 1, 01843 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01844 01854 bool Dilate( 01855 uint32 iWidth = 3, 01856 bool ibCircular = true, 01857 bool ibLuminance = true, 01858 uint32 iIteration = 1, 01859 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01860 01870 bool Open( 01871 uint32 iWidth = 3, 01872 bool ibCircular = true, 01873 bool ibLuminance = true, 01874 uint32 iIteration = 1, 01875 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01876 01886 bool Close( 01887 uint32 iWidth = 3, 01888 bool ibCircular = true, 01889 bool ibLuminance = true, 01890 uint32 iIteration = 1, 01891 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01892 01893 bool TopHat( 01894 uint32 iWidth = 3, 01895 bool ibCircular = true, 01896 bool ibLuminance = true, 01897 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01898 01910 bool ApplyMedian( 01911 uint32 iWidth = 3, 01912 uint32 iIteration = 1, 01913 bool ibCircular = true, 01914 bool ibLuminance = true, 01915 double iBlend = 1.0, 01916 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01917 01925 bool ApplyAdaptiveMedian( 01926 uint32 iWMax = 7, 01927 uint32 iIteration = 1, 01928 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01930 01933 01938 bool Normalize( 01939 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01940 01941 01942 bool AutoBalance( 01943 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01944 01945 bool AutoBrightness( 01946 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01947 01948 bool DeconvolveRL( 01949 const IImagePSF& iPSF, 01950 uint32 iIteration = 1, 01951 EBorderFill iBorder = BF_Nearest, 01952 uint32 iChannelMask = CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 01953 01954 bool DeconvolveRL( 01955 double iRadius, 01956 double iSigma = 2.0, 01957 uint32 iIteration = 1, 01958 EBorderFill iBorder = BF_Nearest, 01959 uint32 iChannelMask = CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 01960 01961 bool ApplyFFT( 01962 const ImageVariant& iFilter, 01963 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01964 01965 bool ApplyFFTLowPass( 01966 double iCutoff = 0.5, 01967 uint32 iRank = 2, 01968 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01969 01971 01974 01978 EBayerMatrix GetBayerMatrix() const; 01979 01983 bool SetBayerMatrix(EBayerMatrix iBayer); 01984 01988 bool IsBayer() const; 01989 01990 bool Affine( 01991 double iScaleR, double iOffsetR, double iScaleG, 01992 double iOffsetG, double iScaleB, double iOffsetB); 01994 01997 02018 bool FastInpaint( 02019 const ImageVariant& iBinaryMask, 02020 bool iUseRegion, 02021 uint32 iChannelMask=CM_All, 02022 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 02023 02042 bool FastMarchingInpaint( 02043 const ImageVariant& iBinaryMask, 02044 uint32 iSize, 02045 bool iUseRegion, 02046 uint32 iChannelMask=CM_All, 02047 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 02048 02049 02072 bool ExemplarBasedInpaint( 02073 const ImageVariant& iBinaryMask, 02074 const Math::AOBBox2i& iSearchArea, 02075 uint32 iPatchSize, 02076 bool iUseRegion, 02077 uint32 iChannelMask=CM_All, 02078 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 02080 02083 02088 bool ComputeMin(double& oMin, bool ibNormalized) const; 02089 02094 bool ComputeMin(double (&oMin)[PC_MAX], bool ibNormalized) const; 02095 02100 bool ComputeMax(double& oMax, bool ibNormalized) const; 02101 02106 bool ComputeMax(double (&oMax)[PC_MAX], bool ibNormalized) const; 02107 02113 bool ComputeMinMax(double& oMin, double& oMax, bool ibNormalized=true) const; 02114 02120 bool ComputeMinMax(double (&oMin)[PC_MAX], double (&oMax)[PC_MAX], bool ibNormalized) const; 02121 02127 bool ComputeMean(double& oMean, bool ibNormalized=true) const; 02128 02134 bool ComputeMean(double (&oMean)[PC_MAX], bool ibNormalized=true) const; 02135 02136 bool ComputeMedian(double& oMedian, bool ibNormalized=true) const; 02137 bool ComputeMedian(double (&oMedian)[PC_MAX], bool ibNormalized=true) const; 02138 02139 bool ComputeStandardDeviation(double& oDeviation, bool ibNormalized=false) const; 02140 bool ComputeStandardDeviation(double& oDeviation, double& oMean, bool ibNormalized=false) const; 02141 bool ComputeStandardDeviation(double(&oDeviation)[PC_MAX], bool ibNormalized=false) const; 02142 bool ComputeStandardDeviation(double(&oDeviation)[PC_MAX], double(&oMean)[PC_MAX], bool ibNormalized=false) const; 02143 02144 bool ComputeVariance(double& oVariance) const; 02145 bool ComputeVariance(double(&oVariance)[PC_MAX]) const; 02146 02147 bool ComputeEnergy(double& oEnergy) const; 02148 bool ComputeEnergy(double(&oEnergy)[PC_MAX]) const; 02149 02150 bool ComputeEntropy(double& oEntropy) const; 02151 bool ComputeEntropy(double(&oEntropy)[PC_MAX]) const; 02152 02153 bool ComputeHistogram(ImageHistogram& oHistogram) const; 02154 02155 /* deprecated */ 02156 bool ComputeMean(double& oMeanR, double& oMeanG, double& oMeanB, bool ibNormalized=false) const; 02157 bool ComputeStandardDeviation(double& oStdDevR, double& oStdDevG, double& oStdDevB, bool ibNormalized=false) const; 02158 bool ComputeStandardDeviation(double& oMeanR, double& oMeanG, double& oMeanB, 02159 double& oStdDevR, double& oStdDevG, double& oStdDevB, bool ibNormalized=false) const; 02160 /* end deprecated */ 02161 02163 02166 02169 boost::shared_ptr<IPixelIterator> Begin(); 02170 02173 boost::shared_ptr<IPixelIterator> Begin() const; 02174 02177 boost::shared_ptr<IPixelIterator> End(); 02178 02181 boost::shared_ptr<IPixelIterator> End() const; 02183 02186 bool Clear(uint32 iChannelMask=CM_All); 02187 bool Plot(int32 iX, int32 iY, uint32 iChannelMask=CM_All); 02188 bool DrawHLine(int32 iY, int32 iX1, int32 iX2, uint32 iChannelMask=CM_All); 02189 bool DrawLine(int32 iX1, int32 iY1, int32 iX2, int32 iY2, bool ibAntialiasing=false,uint32 iChannelMask=CM_All); 02190 bool DrawRectangle(int32 iX1, int32 iY1, int32 iX2, int32 iY2, bool ibSolid=false, uint32 iChannelMask=CM_All); 02191 bool DrawEllipse(int32 iX, int32 iY, uint32 iRadiusX, uint32 iRadiusY, bool ibSolid=false, uint32 iChannelMask=CM_All); 02192 bool DrawCircle(int32 iX, int32 iY, uint32 iRadius, bool ibSolid=false, uint32 iChannelMask=CM_All); 02193 bool DrawTriangle(int32 iX0, int32 iY0, int32 iX1, int32 iY1, int32 iX2, int32 iY2, bool ibSolid=false, uint32 iChannelMask=CM_All); 02194 bool Fill(int32 iX, int32 iY, uint32 iChannelMask=CM_All); 02195 bool GetFilledBBox(int32 iX, int32 iY, Math::AOBBox2i& oBBox) const; 02197 02198 // bool ApplyTransfertFunction(const Math::AbstractTransfertFunction& iTFn, uint32 iChannelMask=CM_All); 02199 02200 protected: 02203 boost::shared_ptr<AbstractImage> _spAbstractImpl; 02204 02208 EBayerMatrix _Bayer; 02209 }; 02210 02211 ExportedByImage bool elxUseable(const ImageVariant * iprImage); 02212 02213 } // namespace Image 02214 } // namespace eLynx 02215 02216 #endif // __ImageVariant_h__