eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // IImageRestoration.h Image.Component package 00003 //============================================================================ 00004 // Usage : interface for misceallenous image processing 00005 // 00006 //---------------------------------------------------------------------------- 00007 // Copyright (C) 2008 by eLynx project 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Library General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2 of the License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00017 // See the GNU Library General Public License for more details. 00018 //---------------------------------------------------------------------------- 00019 #ifndef __IImageRestoration_h__ 00020 #define __IImageRestoration_h__ 00021 00022 #include <vector> 00023 00024 #include <elx/core/ProgressNotifier.h> 00025 #include <elx/math/Geometry.h> 00026 #include <elx/image/ImageLib.h> 00027 #include <elx/image/ImageImpl.h> 00028 00029 namespace eLynx { 00030 namespace Image { 00031 00032 // Forward declaration 00033 class AbstractImage; 00034 00036 enum ERestorationMethod 00037 { 00038 RM_FAST_INPAINT, // Convolution based inpainting 00039 RM_FAST_MARCHING, // Inpainting based on the distance to the known area 00040 RM_EXEMPLAR_BASED // 00041 }; 00042 00044 enum EIntaintPixelType 00045 { 00046 IPT_UNKNOWN = 0x00, // the pixel belongs to the unknow image area 00047 IPT_KNOWN = 0x01, // the pixel belongs to the known image area 00048 IPT_BOUNDARY = 0x02, // the pixel is inside of the region to inpait 00049 IPT_INPAINTED = 0x04, // the pixel has been inpainted 00050 IPT_SEEN = 0x08 // the pixel has been used for region detection 00051 }; 00052 00053 #define elxIPT_IS_UNKNOWN(_a_) ((_a_ & (IPT_KNOWN | IPT_INPAINTED)) == 0) 00054 #define elxIPT_IS_KNOWN(_a_) ((_a_ & (IPT_KNOWN | IPT_INPAINTED)) != 0) 00055 #define elxIPT_IS_BOUNDARY(_a_) ((_a_ & IPT_BOUNDARY) == IPT_BOUNDARY) 00056 #define elxIPT_IS_INPAINTED(_a_) ((_a_ & IPT_INPAINTED) == IPT_INPAINTED) 00057 #define elxIPT_IS_SEEN(_a_) ((_a_ & IPT_SEEN) == IPT_SEEN) 00058 #define elxIPT_IS_ORIG_KNOWN(_a_) ((_a_ & IPT_KNOWN) == IPT_KNOWN) 00059 00060 #define elxIPT_SET_UNKNOWN(_a_) { _a_ = IPT_UNKNOWN; } 00061 #define elxIPT_SET_KNOWN(_a_) { _a_ |= IPT_KNOWN; } 00062 #define elxIPT_SET_BOUNDARY(_a_) { _a_ |= IPT_BOUNDARY; } 00063 #define elxIPT_UNSET_BOUNDARY(_a_) { _a_ &= ~IPT_BOUNDARY; } 00064 #define elxIPT_SET_INPAINTED(_a_) { _a_ |= IPT_INPAINTED; } 00065 #define elxIPT_SET_SEEN(_a_) { _a_ |= IPT_SEEN; } 00066 00067 00070 00071 class ExportedByImage IImageRestoration 00072 { 00073 public: 00074 virtual ~IImageRestoration(); 00075 00097 virtual bool FastInpaint(AbstractImage& ioImage, 00098 const ImageLub& iBinaryMask, 00099 bool iUseRegion, 00100 uint32 iChannelMask, ProgressNotifier& iNotifier) const = 0; 00101 00102 00122 virtual bool FastMarchingInpaint(AbstractImage& ioImage, 00123 const ImageLub& iBinaryMask, 00124 uint32 iSize, 00125 bool iUseRegion, 00126 uint32 iChannelMask, ProgressNotifier& iNotifier) const = 0; 00127 00128 00152 virtual bool ExemplarBasedInpaint(AbstractImage& ioImage, 00153 const ImageLub& iBinaryMask, 00154 const Math::AOBBox2i& iSearchArea, 00155 uint32 iPatchSize, 00156 bool iUseRegion, 00157 uint32 iChannelMask, ProgressNotifier& iNotifier) const = 0; 00158 }; 00159 00160 } // namespace Image 00161 } // namespace eLynx 00162 00163 #endif // __IImageRestoration_h__