eLynx SDK
v3.0.1 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 00092 ImageVariant(const AbstractImage& iImage); 00093 00104 ImageVariant( 00105 const ImageVariant& iImage1, 00106 const ImageVariant& iImage2, 00107 bool ibComplex=false); 00108 00129 ImageVariant( 00130 const ImageVariant& iImage1, 00131 const ImageVariant& iImage2, 00132 const ImageVariant& iImage3, 00133 EColorSpace iColorSpace=CS_RGB); 00134 00144 ImageVariant( 00145 const ImageVariant& iImage1, 00146 const ImageVariant& iImage2, 00147 const ImageVariant& iImage3, 00148 const ImageVariant& iImage4); 00149 00156 ImageVariant( 00157 const char * iprFilename, 00158 ImageFileInfo * oprInfo=NULL, 00159 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00160 00164 const ImageVariant& operator = (const ImageVariant& iImage); 00165 00169 const ImageVariant& operator = (const AbstractImage& iImage); 00170 00174 bool operator == (const ImageVariant& iOther) const; 00175 00179 bool operator != (const ImageVariant& iOther) const; 00180 00183 virtual ~ImageVariant(); 00184 00187 void Release(); 00189 00192 00195 EPixelMode GetPixelMode() const; 00196 00199 EPixelType GetPixelType() const; 00200 00216 EColorSpace GetColorSpace() const; 00217 00220 EPixelFormat GetPixelFormat() const; 00221 00231 EResolution GetResolution() const; 00232 00240 uint32 GetChannelCount() const; 00241 00244 uint32 GetBitsPerPixel() const; 00245 00248 uint32 sizeofPixel() const; 00249 00253 bool IsMasking(uint32 iChannelMask) const; 00254 00261 bool IsColor() const; 00262 00267 bool IsGrey() const; 00268 00271 bool IsComplex() const; 00272 00275 bool HasAlpha() const; 00276 00281 bool IsL() const; 00282 00285 bool IsLA() const; 00286 00289 bool IsRGB() const; 00290 00293 bool IsRGBA() const; 00294 00297 bool IsHLS() const; 00298 00301 bool IsXYZ() const; 00302 00305 bool IsLuv() const; 00306 00309 bool IsLab() const; 00310 00313 bool IsLch() const; 00314 00317 bool IsHLab() const; 00318 00321 bool IsUInt8() const; 00322 00325 bool IsUInt16() const; 00326 00329 bool IsInt32() const; 00330 00333 bool IsFloat() const; 00334 00337 bool IsDouble() const; 00338 00341 bool IsLub() const; 00342 00345 bool IsLus() const; 00346 00349 bool IsLi() const; 00350 00353 bool IsLf() const; 00354 00357 bool IsLd() const; 00358 00361 bool IsLAub() const; 00362 00365 bool IsLAus() const; 00366 00369 bool IsLAi() const; 00370 00373 bool IsLAf() const; 00374 00377 bool IsLAd() const; 00378 00381 bool IsComplexi() const; 00382 00385 bool IsComplexf() const; 00386 00389 bool IsComplexd() const; 00390 00393 bool IsRGBub() const; 00394 00397 bool IsRGBus() const; 00398 00401 bool IsRGBi() const; 00402 00405 bool IsRGBf() const; 00406 00409 bool IsRGBd() const; 00410 00413 bool IsRGBAub() const; 00414 00417 bool IsRGBAus() const; 00418 00421 bool IsRGBAi() const; 00422 00425 bool IsRGBAf() const; 00426 00429 bool IsRGBAd() const; 00430 00433 bool IsHLSf() const; 00434 00437 bool IsHLSd() const; 00438 00441 bool IsXYZf() const; 00442 00445 bool IsXYZd() const; 00446 00449 bool IsLuvf() const; 00450 00453 bool IsLuvd() const; 00454 00457 bool IsLabf() const; 00458 00461 bool IsLabd() const; 00462 00465 bool IsLchf() const; 00466 00469 bool IsLchd() const; 00470 00473 bool IsHLabf() const; 00474 00477 bool IsHLabd() const; 00478 00480 00483 00486 bool IsValid() const; 00487 00490 uint32 GetWidth() const; 00491 00494 uint32 GetHeight() const; 00495 00498 uint32 sizeofWidth() const; 00499 00502 uint32 GetPixelCount() const; 00503 00506 uint32 GetSampleCount() const; 00507 00510 uint32 sizeofMap() const; 00512 00515 00518 boost::shared_ptr<AbstractImage> GetImpl(); 00519 00522 boost::shared_ptr<const AbstractImage> GetImpl() const; 00523 00527 void Invalidate(bool ibRelease=true); 00528 00531 void Assign(boost::shared_ptr<AbstractImage>& ipsAbstractImpl); 00533 00536 00544 bool CanLoad( 00545 const char * iprFilename, 00546 ImageFileInfo * oprInfo = NULL, 00547 bool ibPreview = false) const; 00548 00556 bool Load( 00557 const char * iprFilename, 00558 ImageFileInfo * oprInfo = NULL, 00559 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00560 00566 bool CanSave(const char * iprFilename) const; 00567 00575 bool Save( 00576 const char * iprFilename, 00577 ProgressNotifier& iNotifier=ProgressNotifier_NULL, 00578 const ImageFileOptions * iprOptions = NULL) const; 00580 00583 00593 bool ChangeResolution( 00594 EResolution iResolution, 00595 bool ibScaled = true); 00596 00597 bool ChangeColorSpace( 00598 EColorSpace iColorSpace, 00599 bool ibBlendAlpha = false); 00600 00601 bool ChangePixelFormat( 00602 EPixelFormat iPixelFormat, 00603 bool ibScaled = true, 00604 bool ibBlendAlpha = false); 00605 00606 bool ChangeToGrey( 00607 EColorToGreyConversion iMethod = CGC_Default, 00608 bool ibRemoveAlpha = false, 00609 bool ibBlendAlpha = false); 00610 00611 bool ChangeToBayer( 00612 EBayerMatrix iBayer = BM_GRBG, 00613 bool ibBlendAlpha = false, 00614 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00615 00616 bool ChangeToColor( 00617 EGreyToColorConversion iMethod = GCC_Default, 00618 bool ibRemoveAlpha = false, 00619 bool ibBlendAlpha = false); 00620 00621 bool ChangeToColor( 00622 EBayerToColorConversion iMethod, 00623 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00624 00625 // bool ChangeToRGB(EBayerToColorConversion iMethod, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00626 00627 bool ChangeToUByteFullDynamic(); 00628 00629 bool GetChannelAsRGBGrey( 00630 const ImageVariant& iImage, 00631 uint32 iChannel); 00632 00633 bool Split( 00634 ImageVariant&, 00635 ImageVariant&); 00636 00637 bool Split( 00638 ImageVariant&, 00639 ImageVariant&, 00640 ImageVariant&); 00641 00642 bool Split( 00643 ImageVariant&, 00644 ImageVariant&, 00645 ImageVariant&, 00646 ImageVariant&); 00647 00648 bool RemoveAlpha(bool ibBlendAlpha = false); 00649 00650 //bool AddAlpha(const ImageVariant& iAlpha); 00652 00655 00665 bool Flip( 00666 EFlipPlane iFlipPlane, 00667 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00668 00676 bool FlipVertical( 00677 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00678 00686 bool FlipHorizontal( 00687 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00688 00699 bool Rotate( 00700 ERightRotation iRotation, 00701 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00702 00710 bool Rotate180( 00711 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00712 00720 bool Rotate90Left( 00721 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00722 00730 bool Rotate90Right( 00731 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00732 00737 bool Rotate( 00738 double iDegrees, 00739 int32 iFlags = RF_Default, 00740 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00741 00753 bool Crop( 00754 uint32 iX, uint32 iY, 00755 uint32 iWidth, uint32 iHeight, 00756 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00757 00771 bool AddBorder( 00772 uint32 iLeft = 0, uint32 iRight = 0, 00773 uint32 iTop = 0, uint32 iBottom = 0, 00774 bool ibBlack = true, 00775 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00776 00786 bool Resize( 00787 uint32 iWidth, uint32 iHeight, 00788 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00789 00800 bool Resample( 00801 uint32 iWidth, uint32 iHeight, 00802 Math::EResampleFilter iFilter = Math::RF_Mitchell, 00803 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00804 00813 bool Zoom( 00814 uint32 iZoom, 00815 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00816 00826 bool Bin2x2( 00827 EBinningMethod iMethod = BM_Mean, 00828 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00829 00839 bool Bin3x3( 00840 EBinningMethod iMethod = BM_Mean, 00841 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00842 00853 bool Shift( 00854 int32 iHorizontal, int32 iVertical, 00855 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00856 00857 bool Shift( 00858 double iHorizontal, double iVertical, 00859 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00860 00869 bool GetSubImage( 00870 const ImageVariant& iImage, 00871 uint32 iX, uint32 iY, uint32 iWidth, uint32 iHeight, 00872 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00873 00880 bool Insert( 00881 const ImageVariant& iImage, 00882 int32 iX, int32 iY, 00883 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00884 00885 boost::shared_ptr<ImageVariant> 00886 CreateThumbnailImage( 00887 uint32 iWidth, uint32 iHeight, 00888 bool ibConverveAspectRatio = true, 00889 ProgressNotifier& iNotifier=ProgressNotifier_NULL) const; 00890 00891 bool GetThumbnail( 00892 const ImageVariant& iImage, 00893 uint32 iWidth, uint32 iHeight, 00894 bool ibConverveAspectRatio = true, 00895 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00897 00900 bool Operator( 00901 EImageOperator iOperator, 00902 double iValue, 00903 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00904 00905 bool Neg( 00906 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00907 00908 bool Abs( 00909 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00910 00911 bool Add( 00912 double iScale, 00913 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00914 00915 bool Sub( 00916 double iScale, 00917 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00918 00919 bool Mul( 00920 double iScale, 00921 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00922 00923 bool Div( 00924 double iScale, 00925 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00926 00927 bool Dif( 00928 double iScale, 00929 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00930 00931 bool Min( 00932 double iScale, 00933 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00934 00935 bool Max( 00936 double iScale, 00937 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00938 00939 bool Mean( 00940 double iScale, 00941 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00942 00943 bool AddClamp( 00944 double iScale, 00945 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00946 00947 bool SubClamp( 00948 double iScale, 00949 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00950 00951 bool MulClamp( 00952 double iScale, 00953 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00954 00956 00959 00960 bool Operator( 00961 EImageOperator iOperator, 00962 const ImageVariant& iImage, 00963 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00964 00965 bool Add( 00966 const ImageVariant& iImage, 00967 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00968 00969 bool Sub( 00970 const ImageVariant& iImage, 00971 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00972 00973 bool Mul( 00974 const ImageVariant& iImage, 00975 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00976 00977 bool Div( 00978 const ImageVariant& iImage, 00979 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00980 00981 bool Min( 00982 const ImageVariant& iImage, 00983 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00984 00985 bool Max( 00986 const ImageVariant& iImage, 00987 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00988 00989 bool Mean( 00990 const ImageVariant& iImage, 00991 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00992 00993 bool AddClamp( 00994 const ImageVariant& iImage, 00995 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00996 00997 bool SubClamp( 00998 const ImageVariant& iImage, 00999 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01000 01001 bool MulClamp( 01002 const ImageVariant& iImage, 01003 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01005 01008 01010 bool Operator( 01011 EImageOperator iOperator, 01012 const ImageVariant& iImage, const ImageLub& iImageMask, 01013 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01014 01015 bool Add( 01016 const ImageVariant& iImage, const ImageLub& iImageMask, 01017 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01018 01019 bool Sub( 01020 const ImageVariant& iImage, const ImageLub& iImageMask, 01021 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01022 01023 bool Mul( 01024 const ImageVariant& iImage, const ImageLub& iImageMask, 01025 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01026 01027 bool Div( 01028 const ImageVariant& iImage, const ImageLub& iImageMask, 01029 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01030 01031 bool Min( 01032 const ImageVariant& iImage, const ImageLub& iImageMask, 01033 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01034 01035 bool Max( 01036 const ImageVariant& iImage, const ImageLub& iImageMask, 01037 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01038 01039 bool Mean( 01040 const ImageVariant& iImage, const ImageLub& iImageMask, 01041 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01042 01043 bool AddClamp( 01044 const ImageVariant& iImage, const ImageLub& iImageMask, 01045 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01046 01047 bool SubClamp( 01048 const ImageVariant& iImage, const ImageLub& iImageMask, 01049 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01050 01051 bool MulClamp( 01052 const ImageVariant& iImage, const ImageLub& iImageMask, 01053 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01055 01058 bool Build( 01059 EImageListOperator iOperator, 01060 const std::vector< const ImageVariant* >& iImageList, 01061 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01062 01063 bool BuildClipped( 01064 EImageListOperator iOperator, 01065 const std::vector< const ImageVariant* >& iImageList, 01066 uint32 iIteration, double iKappa, 01067 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01068 01069 bool BuildWeightedEntropy( 01070 const std::vector< const ImageVariant* >& iImageList, 01071 uint32 iW, uint32 iH, 01072 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01074 01077 01088 bool AdjustBrightness( 01089 double iBrightness, 01090 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01091 01102 bool AdjustContrast( 01103 double iContrast, 01104 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01105 01116 bool AdjustGamma( 01117 double iGamma, 01118 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01119 01127 bool AdjustBCG( 01128 double iBrightness, double iContrast, double iGamma, 01129 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01130 01141 bool AdjustMidtone( 01142 double iMidtone, 01143 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01144 01156 bool AdjustSigmoid( 01157 double iAlpha, double iBeta, 01158 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01159 01167 bool Balance( 01168 double iChannel0, double iChannel1, double iChannel2, 01169 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01170 01180 bool Posterize( 01181 uint32 iLevels, 01182 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01183 01193 bool Solarize( 01194 double iValue, 01195 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01196 01206 bool Colorize( 01207 double iHue, double iSaturation, 01208 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01209 01210 bool Desaturate( 01211 double iFactor, 01212 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01213 01219 bool AdjustHueSaturation(double iHue, double iSaturation, 01220 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01221 01222 bool Blend( 01223 const ImageVariant& iImage, double iScalar, 01224 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01225 01226 bool Binarize( 01227 double iThreshold, bool ibNegative=false, 01228 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01229 01231 01234 01243 bool Convolve( 01244 const Math::ConvolutionKerneld& iKernel, 01245 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01246 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01247 01259 bool Convolve( 01260 const Math::ConvolutionKerneld& iKernel, 01261 double iThresholdMin, double iThresholdMax, 01262 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01263 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01264 01278 bool Convolve( 01279 const Math::ConvolutionKerneld& iKernel, 01280 double iThresholdMin, double iThresholdMax, double iBlend=1.0, 01281 bool ibAbsolute=false, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01282 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01283 01293 bool Convolve( 01294 const Math::ConvolutionKerneld& iKernel1, 01295 const Math::ConvolutionKerneld& iKernel2, 01296 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01297 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01298 01316 bool ApplyBoxBlur( 01317 uint32 iWidth=5, 01318 uint32 iHeight=5, 01319 double iBlend=1.0, 01320 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01321 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01322 01323 bool ApplySelectiveBlur( 01324 double iBlend=1.0, 01325 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01326 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01327 01328 bool ApplyFastGaussianBlur( 01329 double iRadius = 3.0, 01330 EBorderFill iBorder = BF_Nearest, 01331 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01332 01345 bool ApplyGaussian( 01346 uint32 iWidth, uint32 iHeight, double iVariance, 01347 double iBlend=1.0, 01348 EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01349 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01350 01362 bool ApplyGaussian( 01363 double iRadius, double iVariance, 01364 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01365 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01366 01377 bool ApplyGaussian( 01378 double iRadius, 01379 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01380 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01381 01382 bool ApplyLoG( 01383 double iRadius=3.0, double iVariance=0.5, 01384 EBorderFill iBorder=BF_Nearest, 01385 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01386 01413 bool ApplyBilateral( 01414 double iRadius=1.5, 01415 double iVarianceSpatial=2.0, 01416 double iVarianceRange=20.0, 01417 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01418 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01419 01437 bool ApplySmooth( 01438 double iThresholdMin=0.0, double iThresholdMax=1.0, 01439 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01440 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01441 01468 bool ApplyMean( 01469 double iRadius, bool ibCircular=true, 01470 double iThresholdMin=0.0, double iThresholdMax=1.0, 01471 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01472 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01473 01495 bool ApplyCone( 01496 double iThresholdMin=0.0, double iThresholdMax=1.0, 01497 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01498 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01499 01521 bool ApplyPyramidal( 01522 double iThresholdMin=0.0, double iThresholdMax=1.0, 01523 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01524 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01525 01526 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01527 bool ApplyLowpass( 01528 double iAlpha, 01529 double iThresholdMin=0.0, double iThresholdMax=1.0, 01530 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01531 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01532 01533 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01534 bool ApplyLaplacian3x3( 01535 double iAlpha=0.0, 01536 double iThresholdMin=0.0, double iThresholdMax=1.0, 01537 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01538 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01539 01540 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01541 bool ApplyLaplacian( 01542 double iRadius=0.0, 01543 double iThresholdMin=0.0, double iThresholdMax=1.0, 01544 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01545 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01546 01547 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01548 bool ApplyEmboss( 01549 double iDegree=0.0, 01550 double iThresholdMin=0.0, double iThresholdMax=1.0, 01551 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01552 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01553 01554 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01555 bool ApplySharpen( 01556 double iRadius=3.0, 01557 double iThresholdMin=0.0, double iThresholdMax=1.0, 01558 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01559 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01560 01561 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01562 bool ApplySharpenMore( 01563 double iAlpha=1.0, 01564 double iThresholdMin=0.0, double iThresholdMax=1.0, 01565 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01566 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01567 01568 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01569 bool ApplySharpenSmooth( 01570 double iAlpha=0.0, 01571 double iThresholdMin=0.0, double iThresholdMax=1.0, 01572 double iBlend=1.0, EBorderFill iBorder=BF_Nearest, uint32 iIteration=1, 01573 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01574 01575 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01576 bool ApplySharpenSoft( 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 01581 // <br>Note: <br><br><img src="res/formula/thresholds.png"> 01582 bool ApplyUnsharpMask( 01583 double iRadius=2.0, double iAmount1=0.5, double iAmount2=0.5, 01584 EBorderFill iBorder=BF_Nearest, 01585 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01587 01590 01597 virtual bool ApplyGradient( 01598 EEdgeDetector iDetector, EEdgeGradient iGradient=EG_Fast, 01599 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01600 01606 bool ApplyMarrHildreth( 01607 EBorderFill iBorder=BF_Nearest, 01608 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01609 01615 bool ApplyRoberts(bool ibFast=true, 01616 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01617 01628 bool ApplyCanny( 01629 EEdgeDetector iDetector, EEdgeGradient iGradient, 01630 double iRadius=1.5, double iThresholdLo=0.0, double iThresholdHi=1.0, 01631 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01632 01639 bool ApplyZeroCrossingEdgeDetector(double iRadius, double iVariance, 01640 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01641 01648 bool ApplySegmentation(double iStep, 01649 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01651 01654 01665 bool ApplyRotationalGradient( 01666 double iXc, double iYc, 01667 double iRadialShift, double iRotationalShift, 01668 bool ibInterpolation = true, 01669 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01670 01679 bool RemoveGradient( 01680 ImageVariant& oBackground, 01681 const Math::Point2iList& iPoints, 01682 EGradientMethod iMethod = GM_Linear, 01683 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01684 01689 bool Debloom( 01690 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01691 01692 bool ApplyDigitalDevelopment( 01693 double iBackground, double iCrossOver, double iScale, 01694 double iVariance = 1.5, 01695 EColorEmphasis iEmphasis = CE_Default, 01696 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01697 /* 01706 bool ApplyChannelSubstitution( 01707 const ImageVariant& iHighResGrayImage, 01708 EChannelSubstitution iSubstitution, double iBlendScalar, 01709 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01710 */ 01712 01715 01727 bool ApplyMorphological( 01728 EMorphologicalFilterType iType, 01729 uint32 iWidth = 3, 01730 bool ibCircular = true, 01731 bool ibLuminance = true, 01732 uint32 iIteration = 1, 01733 double iBlend = 1.0, 01734 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01735 01745 bool Despeckle( 01746 uint32 iWidth = 3, 01747 bool ibCircular = true, 01748 bool ibLuminance = true, 01749 uint32 iIteration = 1, 01750 uint32 iChannelMask = CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01751 01761 bool Erode( 01762 uint32 iWidth = 3, 01763 bool ibCircular = true, 01764 bool ibLuminance = true, 01765 uint32 iIteration = 1, 01766 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01767 01777 bool Dilate( 01778 uint32 iWidth = 3, 01779 bool ibCircular = true, 01780 bool ibLuminance = true, 01781 uint32 iIteration = 1, 01782 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01783 01793 bool Open( 01794 uint32 iWidth = 3, 01795 bool ibCircular = true, 01796 bool ibLuminance = true, 01797 uint32 iIteration = 1, 01798 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01799 01809 bool Close( 01810 uint32 iWidth = 3, 01811 bool ibCircular = true, 01812 bool ibLuminance = true, 01813 uint32 iIteration = 1, 01814 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01815 01816 bool TopHat( 01817 uint32 iWidth = 3, 01818 bool ibCircular = true, 01819 bool ibLuminance = true, 01820 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01821 01833 bool ApplyMedian( 01834 uint32 iWidth = 3, 01835 uint32 iIteration = 1, 01836 bool ibCircular = true, 01837 bool ibLuminance = true, 01838 double iBlend = 1.0, 01839 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01840 01848 bool ApplyAdaptiveMedian( 01849 uint32 iWMax = 7, 01850 uint32 iIteration = 1, 01851 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01853 01856 01861 bool Normalize( 01862 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01863 01864 bool AutoBalance( 01865 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01866 01867 bool AutoBrightness( 01868 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01869 01870 bool DeconvolveRL( 01871 const IImagePSF& iPSF, 01872 uint32 iIteration = 1, 01873 EBorderFill iBorder = BF_Nearest, 01874 uint32 iChannelMask = CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 01875 01876 bool DeconvolveRL( 01877 double iRadius, 01878 double iSigma = 2.0, 01879 uint32 iIteration = 1, 01880 EBorderFill iBorder = BF_Nearest, 01881 uint32 iChannelMask = CM_All, ProgressNotifier& iNotifier = ProgressNotifier_NULL); 01882 01883 bool ApplyFFT( 01884 const ImageVariant& iFilter, 01885 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01886 01887 bool ApplyFFTLowPass( 01888 double iCutoff = 0.5, 01889 uint32 iRank = 2, 01890 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01891 01893 01896 01900 EBayerMatrix GetBayerMatrix() const; 01901 01905 bool SetBayerMatrix(EBayerMatrix iBayer); 01906 01910 bool IsBayer() const; 01911 01912 bool Affine( 01913 double iScaleR, double iOffsetR, double iScaleG, 01914 double iOffsetG, double iScaleB, double iOffsetB); 01916 01919 01940 bool FastInpaint( 01941 const ImageVariant& iBinaryMask, 01942 bool iUseRegion, 01943 uint32 iChannelMask=CM_All, 01944 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01945 01964 bool FastMarchingInpaint( 01965 const ImageVariant& iBinaryMask, 01966 uint32 iSize, 01967 bool iUseRegion, 01968 uint32 iChannelMask=CM_All, 01969 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 01970 01971 01994 bool ExemplarBasedInpaint( 01995 const ImageVariant& iBinaryMask, 01996 const Math::AOBBox2i& iSearchArea, 01997 uint32 iPatchSize, 01998 bool iUseRegion, 01999 uint32 iChannelMask=CM_All, 02000 ProgressNotifier& iNotifier=ProgressNotifier_NULL); 02002 02005 02010 bool ComputeMin(double& oMin, bool ibNormalized) const; 02011 02016 bool ComputeMin(double (&oMin)[PC_MAX], bool ibNormalized) const; 02017 02022 bool ComputeMax(double& oMax, bool ibNormalized) const; 02023 02028 bool ComputeMax(double (&oMax)[PC_MAX], bool ibNormalized) const; 02029 02035 bool ComputeMinMax(double& oMin, double& oMax, bool ibNormalized=true) const; 02036 02042 bool ComputeMinMax(double (&oMin)[PC_MAX], double (&oMax)[PC_MAX], bool ibNormalized) const; 02043 02049 bool ComputeMean(double& oMean, bool ibNormalized=true) const; 02050 02056 bool ComputeMean(double (&oMean)[PC_MAX], bool ibNormalized=true) const; 02057 02058 bool ComputeMedian(double& oMedian, bool ibNormalized=true) const; 02059 bool ComputeMedian(double (&oMedian)[PC_MAX], bool ibNormalized=true) const; 02060 02061 bool ComputeStandardDeviation(double& oDeviation, bool ibNormalized=false) const; 02062 bool ComputeStandardDeviation(double& oDeviation, double& oMean, bool ibNormalized=false) const; 02063 bool ComputeStandardDeviation(double(&oDeviation)[PC_MAX], bool ibNormalized=false) const; 02064 bool ComputeStandardDeviation(double(&oDeviation)[PC_MAX], double(&oMean)[PC_MAX], bool ibNormalized=false) const; 02065 02066 bool ComputeVariance(double& oVariance) const; 02067 bool ComputeVariance(double(&oVariance)[PC_MAX]) const; 02068 02069 bool ComputeEnergy(double& oEnergy) const; 02070 bool ComputeEnergy(double(&oEnergy)[PC_MAX]) const; 02071 02072 bool ComputeEntropy(double& oEntropy) const; 02073 bool ComputeEntropy(double(&oEntropy)[PC_MAX]) const; 02074 02075 bool ComputeHistogram(ImageHistogram& oHistogram) const; 02076 02077 /* deprecated */ 02078 bool ComputeMean(double& oMeanR, double& oMeanG, double& oMeanB, bool ibNormalized=false) const; 02079 bool ComputeStandardDeviation(double& oStdDevR, double& oStdDevG, double& oStdDevB, bool ibNormalized=false) const; 02080 bool ComputeStandardDeviation(double& oMeanR, double& oMeanG, double& oMeanB, 02081 double& oStdDevR, double& oStdDevG, double& oStdDevB, bool ibNormalized=false) const; 02082 /* end deprecated */ 02083 02085 02088 02091 boost::shared_ptr<IPixelIterator> Begin(); 02092 02095 boost::shared_ptr<IPixelIterator> Begin() const; 02096 02099 boost::shared_ptr<IPixelIterator> End(); 02100 02103 boost::shared_ptr<IPixelIterator> End() const; 02105 02108 bool Clear(uint32 iChannelMask=CM_All); 02109 bool Plot(int32 iX, int32 iY, uint32 iChannelMask=CM_All); 02110 bool DrawHLine(int32 iY, int32 iX1, int32 iX2, uint32 iChannelMask=CM_All); 02111 bool DrawLine(int32 iX1, int32 iY1, int32 iX2, int32 iY2, bool ibAntialiasing=false,uint32 iChannelMask=CM_All); 02112 bool DrawRectangle(int32 iX1, int32 iY1, int32 iX2, int32 iY2, bool ibSolid=false, uint32 iChannelMask=CM_All); 02113 bool DrawEllipse(int32 iX, int32 iY, uint32 iRadiusX, uint32 iRadiusY, bool ibSolid=false, uint32 iChannelMask=CM_All); 02114 bool DrawCircle(int32 iX, int32 iY, uint32 iRadius, bool ibSolid=false, uint32 iChannelMask=CM_All); 02115 bool DrawTriangle(int32 iX0, int32 iY0, int32 iX1, int32 iY1, int32 iX2, int32 iY2, bool ibSolid=false, uint32 iChannelMask=CM_All); 02116 bool Fill(int32 iX, int32 iY, uint32 iChannelMask=CM_All); 02117 bool GetFilledBBox(int32 iX, int32 iY, Math::AOBBox2i& oBBox) const; 02119 02120 // bool ApplyTransfertFunction(const Math::AbstractTransfertFunction& iTFn, uint32 iChannelMask=CM_All); 02121 02122 protected: 02125 boost::shared_ptr<AbstractImage> _spAbstractImpl; 02126 02130 EBayerMatrix _Bayer; 02131 }; 02132 02133 ExportedByImage bool elxUseable(const ImageVariant * iprImage); 02134 02135 } // namespace Image 02136 } // namespace eLynx 02137 02138 #endif // __ImageVariant_h__