eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // ImageFactory.h Image.Component package 00003 //============================================================================ 00004 // Usage : Tool for creation of synthetized images 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2007 by eLynx project 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 // See the GNU Library General Public License for more details. 00017 //---------------------------------------------------------------------------- 00018 #ifndef __ImageFactory_h__ 00019 #define __ImageFactory_h__ 00020 00021 #include <elx/core/CoreTypes.h> 00022 #include <elx/core/CoreParameters.h> 00023 #include "ImageLib.h" 00024 #include "ImageImpl.h" 00025 00026 namespace eLynx { 00027 namespace Image { 00028 00029 class ImageVariant; 00030 00031 enum EImageFactoryType 00032 { 00033 IFT_Empty, 00034 IFT_Checker, 00035 IFT_Gradient, 00036 IFT_Moivre, 00037 IFT_Noise, 00038 IFT_Perlin, 00039 IFT_Liquid, 00040 00041 IFT_Square, 00042 IFT_Circle, 00043 IFT_Gaussian, 00044 IFT_LensFlare, 00045 IFT_Butterworth, 00046 IFT_Plate, 00047 IFT_GradientWheel, 00048 IFT_Cellular, 00049 IFT_Galaxy, 00050 00051 IFT_ColorWheel, 00052 IFT_Hearts, 00053 IFT_Blend, 00054 IFT_Bands, 00055 IFT_Plasma, 00056 IFT_Julia, 00057 // IFT_LabGradient, 00058 00059 IFT_MAX, // not a type ! 00060 IFT_Default = IFT_Plate 00061 }; 00062 00063 ExportedByImage const char * elxToString(EImageFactoryType iType); 00064 ExportedByImage void elxReset(EImageFactoryType iType); 00065 ExportedByImage void elxReset(ParameterList& ioParameters); 00066 ExportedByImage void elxGetParameterList(EImageFactoryType iType, ParameterList& oParameters); 00067 ExportedByImage bool elxImageFactory(ImageVariant& ioImage, EImageFactoryType iType); 00068 00069 00072 template <typename T> 00073 ImageImpl< PixelL<T> > * elxCreateChecker(uint32 iWidth=256, uint32 iHeight=256, uint32 iN=4); 00074 00075 template <typename T> 00076 ImageImpl< PixelL<T> > * elxCreateNoise(uint32 iWidth=256, uint32 iHeight=256, int32 iSeed=0); 00077 00078 template <typename T> 00079 ImageImpl< PixelL<T> > * elxCreateSquare(uint32 iWidth=256, uint32 iHeight=256, double iCutoff=0.5); 00080 00081 template <typename T> 00082 ImageImpl< PixelL<T> > * elxCreateCircle(uint32 iDiameter); 00083 00084 template <typename T> 00085 ImageImpl< PixelL<T> > * elxCreateCircle(uint32 iWidth, uint32 iHeight, double iCutoff); 00086 00087 template <typename T> 00088 ImageImpl< PixelL<T> > * elxCreatePlate(uint32 iWidth, uint32 iHeight, double iScale); 00089 00090 template <typename T> 00091 ImageImpl< PixelL<T> > * elxCreateGaussian(uint32 iWidth, uint32 iHeight, double iVariance); 00092 00093 template <typename T> 00094 ImageImpl< PixelL<T> > * elxCreateButterworth(uint32 iWidth, uint32 iHeight, double iCutoff, uint32 iRank); 00095 00096 template <typename T> 00097 ImageImpl< PixelL<T> > * elxCreateGradient(uint32 iWidth, uint32 iHeight); 00098 00099 template <typename T> 00100 ImageImpl< PixelL<T> > * elxCreateGradientWheel(uint32 iWidth, uint32 iHeight, double iDegrees=0.0); 00101 00102 template <typename T> 00103 ImageImpl< PixelRGB<T> > * elxCreateBands(uint32 iWidth, uint32 iBandHeight); 00104 00105 template <typename T> 00106 ImageImpl< PixelRGB<T> > * elxCreateBlend(uint32 iWidth, uint32 iHeight, double iBlend=1.0); 00107 00108 template <typename T> 00109 ImageImpl< PixelL<T> > * elxCreateCellular(uint32 iWidth, uint32 iHeight, 00110 uint32 iCells=30, double iGamma=1.8, int32 iRandom=0); 00111 00112 template <typename T> 00113 ImageImpl< PixelRGB<T> > * elxCreatePlasma(uint32 iWidth, uint32 iHeight, 00114 double iRange=4.0, double iAmplitude=0.45, int32 iRandom=0); 00115 00116 template <typename T> 00117 ImageImpl< PixelRGB<T> > * elxCreateColorWheel(uint32 iWidth, uint32 iHeight); 00119 00122 ExportedByImage bool elxMakeChecker( 00123 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00124 uint32 iWidth=256, uint32 iHeight=256, uint32 iN=4); 00125 00126 ExportedByImage bool elxMakeMoivre( 00127 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00128 uint32 iWidth=256, uint32 iHeight=256, uint32 iScale=1); 00129 00130 ExportedByImage bool elxMakePlate( 00131 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00132 uint32 iWidth=256, uint32 iHeight=256, double iScale=2.0); 00133 00134 ExportedByImage bool elxMakeNoise( 00135 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00136 uint32 iWidth=256, uint32 iHeight=256, int32 iSeed=0); 00137 00138 ExportedByImage bool elxMakeCircle( 00139 ImageVariant& ioImage, EResolution iResolution, 00140 uint32 iDiameter); 00141 00142 ExportedByImage bool elxMakePerlin( 00143 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00144 uint32 iWidth=256, uint32 iHeight=256, 00145 uint32 iSeek=63, uint32 iPeriod=12413, double iScale=1.0); 00146 00147 ExportedByImage bool elxMakeLiquid( 00148 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00149 uint32 iWidth=256, uint32 iHeight=256, uint32 iIterations=200, 00150 int32 iRandom=50, double iPower=0.06); 00151 00152 ExportedByImage bool elxMakeLensFlare( 00153 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00154 uint32 iWidth=256, uint32 iHeight=256, uint32 iType=2, double iFocus=0.01); 00155 00156 ExportedByImage bool elxMakeJulia( 00157 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00158 uint32 iWidth=256, uint32 iHeight=256, 00159 uint32 iMaxIterations=200, double iZoom=1.0, double iRotation=0.0); 00160 00161 ExportedByImage bool elxMakeGalaxy( 00162 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00163 uint32 iWidth=256, uint32 iHeight=256, uint32 iArms=3, double iDensity=0.15); 00164 00165 ExportedByImage bool elxMakeBands( 00166 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00167 uint32 iWidth=256, uint32 iBandHeight=32); 00168 00169 ExportedByImage bool elxMakeGradient( 00170 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00171 uint32 iWidth=256, uint32 iHeight=256); 00172 00173 ExportedByImage bool elxMakeBlend( 00174 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00175 uint32 iWidth=256, uint32 iHeight=256, double iBlend=1.0); 00176 00177 ExportedByImage bool elxMakePlasma( 00178 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00179 uint32 iWidth=256, uint32 iHeight=256, 00180 double iRange=4.0, double iAmplitude=0.45, int32 iRandom=0); 00181 00182 ExportedByImage bool elxMakeCellular( 00183 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00184 uint32 iWidth=256, uint32 iHeight=256, 00185 uint32 iCells=30, double iGamma=1.8, int32 iRandom=0); 00186 00187 ExportedByImage bool elxMakeColorWheel( 00188 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00189 uint32 iWidth=256, uint32 iHeight=256); 00190 00191 ExportedByImage bool elxMakeGradientWheel( 00192 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00193 uint32 iWidth=256, uint32 iHeight=256, double iRotation=0.0); 00194 00196 00199 ExportedByImage bool elxMakeSquare( 00200 ImageVariant& ioImage, EResolution iResolution=RT_UINT8, 00201 uint32 iWidth=256, uint32 iHeight=256, double iCutoff=0.25); 00202 00203 ExportedByImage bool elxMakeCircle( 00204 ImageVariant& ioImage, EResolution iResolution, 00205 uint32 iWidth, uint32 iHeight, double iCutoff=0.5); 00206 00207 ExportedByImage bool elxMakeGaussian( 00208 ImageVariant& ioImage, EResolution iResolution, 00209 uint32 iWidth, uint32 iHeight, double iVariance=1.); 00210 00211 ExportedByImage bool elxMakeButterworth( 00212 ImageVariant& ioImage, EResolution iResolution, 00213 uint32 iWidth, uint32 iHeight, double iCutoff=0.5, uint32 iRank=1); 00214 00215 ExportedByImage bool elxMakeLabGradient( 00216 ImageVariant& ioImage, EResolution iResolution, 00217 uint32 iWidth, uint32 iHeight, double iLuminance=100.0); 00218 00220 00221 } // namespace Image 00222 } // namespace eLynx 00223 00224 #endif // __ImageFactory_h__