eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // ImageConversion.h Image.Component package 00003 //============================================================================ 00004 // Usage : image conversion services 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2006 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 __ImageConversion_h__ 00019 #define __ImageConversion_h__ 00020 00021 #include "ImageImpl.h" 00022 00023 namespace eLynx { 00024 namespace Image { 00025 00028 00029 // ImageL<T> to ImageL<iResolution> as AbstractImage. 00030 template <typename T> 00031 boost::shared_ptr<AbstractImage> 00032 elxCreateImage( 00033 const ImageImpl< PixelL<T> >& iImage, 00034 EResolution iResolution, 00035 bool ibScaled); 00036 00037 // ImageComplex<T> to ImageComplex<iResolution> as AbstractImage. 00038 template <typename T> 00039 boost::shared_ptr<AbstractImage> 00040 elxCreateImage( 00041 const ImageImpl< PixelComplex<T> >& iImage, 00042 EResolution iResolution, 00043 bool ibScaled); 00044 00045 // ImageLA<T> to ImageLA<iResolution> as AbstractImage. 00046 template <typename T> 00047 boost::shared_ptr<AbstractImage> 00048 elxCreateImage( 00049 const ImageImpl< PixelLA<T> >& iImage, 00050 EResolution iResolution, 00051 bool ibScaled); 00052 00053 // ImageRGB<T> to ImageRGB<iResolution> as AbstractImage. 00054 template <typename T> 00055 boost::shared_ptr<AbstractImage> 00056 elxCreateImage( 00057 const ImageImpl< PixelRGB<T> >& iImage, 00058 EResolution iResolution, 00059 bool ibScaled); 00060 00061 #ifdef elxUSE_ImageHLS 00062 // ImageHLS<T> to ImageHLS<iResolution> as AbstractImage. 00063 template <typename T> 00064 boost::shared_ptr<AbstractImage> 00065 elxCreateImage( 00066 const ImageImpl< PixelHLS<T> >& iImage, 00067 EResolution iResolution, bool ibScaled); 00068 #endif 00069 00070 #ifdef elxUSE_ImageXYZ 00071 // ImageXYZ<T> to ImageXYZ<iResolution> as AbstractImage. 00072 template <typename T> 00073 boost::shared_ptr<AbstractImage> 00074 elxCreateImage( 00075 const ImageImpl< PixelXYZ<T> >& iImage, 00076 EResolution iResolution, 00077 bool ibScaled); 00078 #endif 00079 00080 #ifdef elxUSE_ImageLuv 00081 // ImageLuv<T> to ImageLuv<iResolution> as AbstractImage. 00082 template <typename T> 00083 boost::shared_ptr<AbstractImage> 00084 elxCreateImage( 00085 const ImageImpl< PixelLuv<T> >& iImage, 00086 EResolution iResolution, 00087 bool ibScaled); 00088 #endif 00089 00090 #ifdef elxUSE_ImageLab 00091 // ImageLab<T> to ImageLab<iResolution> as AbstractImage. 00092 template <typename T> 00093 boost::shared_ptr<AbstractImage> 00094 elxCreateImage( 00095 const ImageImpl< PixelLab<T> >& iImage, 00096 EResolution iResolution, 00097 bool ibScaled); 00098 #endif 00099 00100 #ifdef elxUSE_ImageLch 00101 // ImageLch<T> to ImageLch<iResolution> as AbstractImage. 00102 template <typename T> 00103 boost::shared_ptr<AbstractImage> 00104 elxCreateImage( 00105 const ImageImpl< PixelLch<T> >& iImage, 00106 EResolution iResolution, 00107 bool ibScaled); 00108 #endif 00109 00110 #ifdef elxUSE_ImageHLab 00111 // ImageHLab<T> to ImageHLab<iResolution> as AbstractImage. 00112 template <typename T> 00113 boost::shared_ptr<AbstractImage> 00114 elxCreateImage( 00115 const ImageImpl< PixelHLab<T> >& iImage, 00116 EResolution iResolution, 00117 bool ibScaled); 00118 #endif 00119 00120 // ImageRGBA<T> to ImageRGBA<iResolution> as AbstractImage. 00121 template <typename T> 00122 boost::shared_ptr<AbstractImage> 00123 elxCreateImage( 00124 const ImageImpl< PixelRGBA<T> >& iImage, 00125 EResolution iResolution, bool ibScaled); 00127 00128 00131 00132 // Create ImageLub from ImageL<T>. 00133 template <typename T> 00134 boost::shared_ptr< ImageImpl<PixelLub> > 00135 elxCreateImageLub( 00136 const ImageImpl< PixelL<T> >& iImage, 00137 bool ibScaled = true); 00138 00139 // Create ImageLus from ImageL<T>. 00140 template <typename T> 00141 boost::shared_ptr< ImageImpl<PixelLus> > 00142 elxCreateImageLus( 00143 const ImageImpl< PixelL<T> >& iImage, 00144 bool ibScaled = true); 00145 00146 // Create ImageLi from ImageL<T>. 00147 template <typename T> 00148 boost::shared_ptr< ImageImpl<PixelLi> > 00149 elxCreateImageLi( 00150 const ImageImpl< PixelL<T> >& iImage, 00151 bool ibScaled = true); 00152 00153 // Create ImageLf from ImageL<T>. 00154 template <typename T> 00155 boost::shared_ptr< ImageImpl<PixelLf> > 00156 elxCreateImageLf( 00157 const ImageImpl< PixelL<T> >& iImage, 00158 bool ibScaled = true); 00159 00160 // Create ImageLd from ImageL<T>. 00161 template <typename T> 00162 boost::shared_ptr< ImageImpl<PixelLd> > 00163 elxCreateImageLd( 00164 const ImageImpl< PixelL<T> >& iImage, 00165 bool ibScaled = true); 00167 00168 00171 00172 // Create ImageRGBub from ImageRGB<T>. 00173 template <typename T> 00174 boost::shared_ptr< ImageImpl<PixelRGBub> > 00175 elxCreateImageRGBub( 00176 const ImageImpl< PixelRGB<T> >& iImage, 00177 bool ibScaled = true); 00178 00179 // Create ImageRGBus from ImageRGB<T>. 00180 template <typename T> 00181 boost::shared_ptr< ImageImpl<PixelRGBus> > 00182 elxCreateImageRGBus( 00183 const ImageImpl< PixelRGB<T> >& iImage, 00184 bool ibScaled = true); 00185 00186 // Create ImageRGBi from ImageRGB<T>. 00187 template <typename T> 00188 boost::shared_ptr< ImageImpl<PixelRGBi> > 00189 elxCreateImageRGBi( 00190 const ImageImpl< PixelRGB<T> >& iImage, 00191 bool ibScaled = true); 00192 00193 // Create ImageRGBf from ImageRGB<T>. 00194 template <typename T> 00195 boost::shared_ptr< ImageImpl<PixelRGBf> > 00196 elxCreateImageRGBf( 00197 const ImageImpl< PixelRGB<T> >& iImage, 00198 bool ibScaled=true); 00199 00200 // Create ImageRGBd from ImageRGB<T>. 00201 template <typename T> 00202 boost::shared_ptr< ImageImpl<PixelRGBd> > 00203 elxCreateImageRGBd( 00204 const ImageImpl< PixelRGB<T> >& iImage, 00205 bool ibScaled = true); 00207 00208 00211 template <typename T, template <typename> class Pixel> 00212 boost::shared_ptr< ImageImpl< PixelRGB<T> > > 00213 elxCreateImageRGB( 00214 const ImageImpl< Pixel<T> >&); 00215 00216 #ifdef elxUSE_ImageHLS 00217 template <typename T, template <typename> class Pixel> 00218 boost::shared_ptr< ImageImpl< PixelHLS<T> > > 00219 elxCreateImageHLS( 00220 const ImageImpl< Pixel<T> >&); 00221 #endif 00222 00223 #ifdef elxUSE_ImageXYZ 00224 template <typename T, template <typename> class Pixel> 00225 boost::shared_ptr< ImageImpl< PixelXYZ<T> > > 00226 elxCreateImageXYZ( 00227 const ImageImpl< Pixel<T> >&); 00228 #endif 00229 00230 #ifdef elxUSE_ImageLuv 00231 template <typename T, template <typename> class Pixel> 00232 boost::shared_ptr< ImageImpl< PixelLuv<T> > > 00233 elxCreateImageLuv( 00234 const ImageImpl< Pixel<T> >&); 00235 #endif 00236 00237 #ifdef elxUSE_ImageLab 00238 template <typename T, template <typename> class Pixel> 00239 boost::shared_ptr< ImageImpl< PixelLab<T> > > 00240 elxCreateImageLab( 00241 const ImageImpl< Pixel<T> >&); 00242 #endif 00243 00244 #ifdef elxUSE_ImageLch 00245 template <typename T, template <typename> class Pixel> 00246 boost::shared_ptr< ImageImpl< PixelLch<T> > > 00247 elxCreateImageLch( 00248 const ImageImpl< Pixel<T> >&); 00249 #endif 00250 00251 #ifdef elxUSE_ImageHLab 00252 template <typename T, template <typename> class Pixel> 00253 boost::shared_ptr< ImageImpl< PixelHLab<T> > > 00254 elxCreateImageHLab( 00255 const ImageImpl< Pixel<T> >&); 00256 #endif 00257 00258 00259 00262 // Create ImageLA<T> from 2x ImageL<T>. 00263 template <typename T> 00264 boost::shared_ptr< ImageImpl< PixelLA<T> > > 00265 elxCreateImageLA( 00266 const ImageImpl< PixelL<T> >& iImageL, 00267 const ImageImpl< PixelL<T> >& iImageA); 00268 00269 // Create ImageComplex<T> from 2x ImageL<T>. 00270 template <typename T> 00271 boost::shared_ptr< ImageImpl< PixelComplex<T> > > 00272 elxCreateImageComplex( 00273 const ImageImpl< PixelL<T> >& iImageRe, 00274 const ImageImpl< PixelL<T> >& iImageIm); 00275 00276 // Create ImageRGB<T> from 3x ImageL<T>. 00277 template <typename T> 00278 boost::shared_ptr< ImageImpl< PixelRGB<T> > > 00279 elxCreateImageRGB( 00280 const ImageImpl< PixelL<T> >& iImageR, 00281 const ImageImpl< PixelL<T> >& iImageG, 00282 const ImageImpl< PixelL<T> >& iImageB); 00283 00284 // Create ImageRGB<T> from ImageRGBA<T>. 00285 template <typename T> 00286 boost::shared_ptr< ImageImpl< PixelRGB<T> > > 00287 elxCreateImageRGB( 00288 const ImageImpl< PixelRGBA<T> >& iImage, 00289 bool ibBlendAlpha=false); 00290 00291 #ifdef elxUSE_ImageHLS 00292 // Create ImageHLS<T> from 3x ImageL<T>. 00293 template <typename T> 00294 boost::shared_ptr< ImageImpl< PixelHLS<T> > > 00295 elxCreateImageHLS( 00296 const ImageImpl< PixelL<T> >& iImageH, 00297 const ImageImpl< PixelL<T> >& iImageL, 00298 const ImageImpl< PixelL<T> >& iImageS); 00299 #endif 00300 00301 #ifdef elxUSE_ImageXYZ 00302 // Create ImageXYZ<T> from 3x ImageL<T>. 00303 template <typename T> 00304 boost::shared_ptr< ImageImpl< PixelXYZ<T> > > 00305 elxCreateImageXYZ( 00306 const ImageImpl< PixelL<T> >& iImageX, 00307 const ImageImpl< PixelL<T> >& iImageY, 00308 const ImageImpl< PixelL<T> >& iImageZ); 00309 #endif 00310 00311 #ifdef elxUSE_ImageLuv 00312 // Create ImageLuv<T> from 3x ImageL<T>. 00313 template <typename T> 00314 boost::shared_ptr< ImageImpl< PixelLuv<T> > > 00315 elxCreateImageLuv( 00316 const ImageImpl< PixelL<T> >& iImageL, 00317 const ImageImpl< PixelL<T> >& iImageU, 00318 const ImageImpl< PixelL<T> >& iImageV); 00319 #endif 00320 00321 #ifdef elxUSE_ImageLab 00322 // Create ImageLab<T> from 3x ImageL<T>. 00323 template <typename T> 00324 boost::shared_ptr< ImageImpl< PixelLab<T> > > 00325 elxCreateImageLab( 00326 const ImageImpl< PixelL<T> >& iImageL, 00327 const ImageImpl< PixelL<T> >& iImageA, 00328 const ImageImpl< PixelL<T> >& iImageB); 00329 #endif 00330 00331 #ifdef elxUSE_ImageLch 00332 // Create ImageLch<T> from 3x ImageL<T>. 00333 template <typename T> 00334 boost::shared_ptr< ImageImpl< PixelLch<T> > > 00335 elxCreateImageLch( 00336 const ImageImpl< PixelL<T> >& iImageL, 00337 const ImageImpl< PixelL<T> >& iImageC, 00338 const ImageImpl< PixelL<T> >& iImageH); 00339 #endif 00340 00341 #ifdef elxUSE_ImageHLab 00342 // Create ImageLab<T> from 3x ImageL<T>. 00343 template <typename T> 00344 boost::shared_ptr< ImageImpl< PixelHLab<T> > > 00345 elxCreateImageHLab( 00346 const ImageImpl< PixelL<T> >& iImageL, 00347 const ImageImpl< PixelL<T> >& iImageA, 00348 const ImageImpl< PixelL<T> >& iImageB); 00349 #endif 00350 00351 // Create ImageRGBA<T> from 4x ImageL<T>. 00352 template <typename T> 00353 boost::shared_ptr< ImageImpl< PixelRGBA<T> > > 00354 elxCreateImageRGBA( 00355 const ImageImpl< PixelL<T> >& iImageR, 00356 const ImageImpl< PixelL<T> >& iImageG, 00357 const ImageImpl< PixelL<T> >& iImageB, 00358 const ImageImpl< PixelL<T> >& iImageA); 00359 00360 // Create ImageRGBA<T> from ImageRGB<T> and ImageL<T>. 00361 template <typename T> 00362 boost::shared_ptr< ImageImpl< PixelRGBA<T> > > 00363 elxCreateImageRGBA( 00364 const ImageImpl< PixelRGB<T> >& iImageRGB, 00365 const ImageImpl< PixelL<T> >& iImageA); 00367 00368 00371 template <typename T> 00372 bool elxMerge( 00373 ImageImpl< PixelLA<T> >& ioImage, 00374 const ImageImpl< PixelL<T> >& iPlaneL, 00375 const ImageImpl< PixelL<T> >& iPlaneA); 00376 00377 template <typename T> 00378 bool elxMerge( 00379 ImageImpl< PixelComplex<T> >& ioImage, 00380 const ImageImpl< PixelL<T> >& iPlaneRe, 00381 const ImageImpl< PixelL<T> >& iPlaneIm); 00382 00383 template <typename T> 00384 bool elxMerge( 00385 ImageImpl< PixelRGB<T> >& ioImage, 00386 const ImageImpl< PixelL<T> >& iPlaneR, 00387 const ImageImpl< PixelL<T> >& iPlaneG, 00388 const ImageImpl< PixelL<T> >& iPlaneB); 00389 00390 template <typename T> 00391 bool elxMerge( 00392 ImageImpl< PixelXYZ<T> >& ioImage, 00393 const ImageImpl< PixelL<T> >& iPlaneX, 00394 const ImageImpl< PixelL<T> >& iPlaneY, 00395 const ImageImpl< PixelL<T> >& iPlaneZ); 00396 00397 template <typename T> 00398 bool elxMerge( 00399 ImageImpl< PixelHLS<T> >& ioImage, 00400 const ImageImpl< PixelL<T> >& iPlaneH, 00401 const ImageImpl< PixelL<T> >& iPlaneL, 00402 const ImageImpl< PixelL<T> >& iPlaneS); 00403 00404 template <typename T> 00405 bool elxMerge( 00406 ImageImpl< PixelLab<T> >& ioImage, 00407 const ImageImpl< PixelL<T> >& iPlaneL, 00408 const ImageImpl< PixelL<T> >& iPlaneA, 00409 const ImageImpl< PixelL<T> >& iPlaneB); 00410 00411 template <typename T> 00412 bool elxMerge( 00413 ImageImpl< PixelLuv<T> >& ioImage, 00414 const ImageImpl< PixelL<T> >& iPlaneL, 00415 const ImageImpl< PixelL<T> >& iPlaneU, 00416 const ImageImpl< PixelL<T> >& iPlaneV); 00417 00418 template <typename T> 00419 bool elxMerge( 00420 ImageImpl< PixelRGBA<T> >& ioImage, 00421 const ImageImpl< PixelL<T> >& iPlaneR, 00422 const ImageImpl< PixelL<T> >& iPlaneG, 00423 const ImageImpl< PixelL<T> >& iPlaneB, 00424 const ImageImpl< PixelL<T> >& iPlaneA); 00425 00426 template <typename T> 00427 bool elxMerge( 00428 ImageImpl< PixelRGBA<T> >& ioImage, 00429 const ImageImpl< PixelRGB<T> >& iImageRGB, 00430 const ImageImpl< PixelL<T> >& iPlaneA); 00431 00432 00433 template <typename Pixel> 00434 bool elxMerge2( 00435 ImageImpl<Pixel>& ioImage, 00436 const ImageImpl< PixelL<typename Pixel::type> >& iPlane1, 00437 const ImageImpl< PixelL<typename Pixel::type> >& iPlane2); 00438 00439 template <typename Pixel> 00440 bool elxMerge3( 00441 ImageImpl<Pixel>& ioImage, 00442 const ImageImpl< PixelL<typename Pixel::type> >& iPlane1, 00443 const ImageImpl< PixelL<typename Pixel::type> >& iPlane2, 00444 const ImageImpl< PixelL<typename Pixel::type> >& iPlane3); 00445 00446 template <typename Pixel> 00447 bool elxMerge4( 00448 ImageImpl<Pixel>& ioImage, 00449 const ImageImpl< PixelL<typename Pixel::type> >& iPlane1, 00450 const ImageImpl< PixelL<typename Pixel::type> >& iPlane2, 00451 const ImageImpl< PixelL<typename Pixel::type> >& iPlane3, 00452 const ImageImpl< PixelL<typename Pixel::type> >& iPlane4); 00453 00455 00456 00459 // Split ImageLA<T> into ImageL<T> L and ImageL<T> A. 00460 template <typename T> 00461 bool elxSplit( 00462 const ImageImpl< PixelLA<T> >& iImage, 00463 ImageImpl< PixelL<T> >& oImageL, 00464 ImageImpl< PixelL<T> >& oImageA); 00465 00466 // Split ImageComplex<T> into ImageL<T> Im and ImageL<T> Re. 00467 template <typename T> 00468 bool elxSplit( 00469 const ImageImpl< PixelComplex<T> >& iImage, 00470 ImageImpl< PixelL<T> >& oImageIm, 00471 ImageImpl< PixelL<T> >& oImageRe); 00472 00473 // Split ImageRGB<T> into ImageL<T> R, ImageL<T> G and ImageL<T> B. 00474 template <typename T> 00475 bool elxSplit( 00476 const ImageImpl< PixelRGB<T> >& iImage, 00477 ImageImpl< PixelL<T> >& oImageR, 00478 ImageImpl< PixelL<T> >& oImageG, 00479 ImageImpl< PixelL<T> >& oImageB); 00480 00481 #ifdef elxUSE_ImageHLS 00482 // Split ImageHLS<T> into ImageL<T> H, ImageL<T> L and ImageL<T> S. 00483 template <typename T> 00484 bool elxSplit( 00485 const ImageImpl< PixelHLS<T> >& iImage, 00486 ImageImpl< PixelL<T> >& oImageH, 00487 ImageImpl< PixelL<T> >& oImageL, 00488 ImageImpl< PixelL<T> >& oImageS); 00489 #endif 00490 00491 #ifdef elxUSE_ImageXYZ 00492 // Split ImageXYZ<T> into ImageL<T> X, ImageL<T> Y and ImageL<T> Z. 00493 template <typename T> 00494 bool elxSplit( 00495 const ImageImpl< PixelXYZ<T> >& iImage, 00496 ImageImpl< PixelL<T> >& oImageX, 00497 ImageImpl< PixelL<T> >& oImageY, 00498 ImageImpl< PixelL<T> >& oImageZ); 00499 #endif 00500 00501 #ifdef elxUSE_ImageLuv 00502 // Split ImageLuv<T> into ImageL<T> L, ImageL<T> u and ImageL<T> v. 00503 template <typename T> 00504 bool elxSplit( 00505 const ImageImpl< PixelLuv<T> >& iImage, 00506 ImageImpl< PixelL<T> >& oImageL, 00507 ImageImpl< PixelL<T> >& oImageU, 00508 ImageImpl< PixelL<T> >& oImageV); 00509 #endif 00510 00511 #ifdef elxUSE_ImageLab 00512 // Split ImageLab<T> into ImageL<T> L, ImageL<T> a and ImageL<T> b. 00513 template <typename T> 00514 bool elxSplit( 00515 const ImageImpl< PixelLab<T> >& iImage, 00516 ImageImpl< PixelL<T> >& oImageL, 00517 ImageImpl< PixelL<T> >& oImageA, 00518 ImageImpl< PixelL<T> >& oImageB); 00519 #endif 00520 00521 #ifdef elxUSE_ImageLch 00522 // Split ImageLch<T> into ImageL<T> L, ImageL<T> c and ImageL<T> h. 00523 template <typename T> 00524 bool elxSplit( 00525 const ImageImpl< PixelLch<T> >& iImage, 00526 ImageImpl< PixelL<T> >& oImageL, 00527 ImageImpl< PixelL<T> >& oImageC, 00528 ImageImpl< PixelL<T> >& oImageH); 00529 #endif 00530 00531 #ifdef elxUSE_ImageHLab 00532 // Split ImageHLab<T> into ImageL<T> L, ImageL<T> a and ImageL<T> b. 00533 template <typename T> 00534 bool elxSplit( 00535 const ImageImpl< PixelHLab<T> >& iImage, 00536 ImageImpl< PixelL<T> >& oImageL, 00537 ImageImpl< PixelL<T> >& oImageA, 00538 ImageImpl< PixelL<T> >& oImageB); 00539 #endif 00540 00541 00542 // Split ImageRGBA<T> into ImageL<T> R, ImageL<T> G, ImageL<T> B and ImageL<T> A. 00543 template <typename T> 00544 bool elxSplit( 00545 const ImageImpl< PixelRGBA<T> >& iImage, 00546 ImageImpl< PixelL<T> >& oImageR, 00547 ImageImpl< PixelL<T> >& oImageG, 00548 ImageImpl< PixelL<T> >& oImageB, 00549 ImageImpl< PixelL<T> >& oImageA); 00550 00551 // Split ImageRGBA<T> into ImageRGB<T> RGB and ImageL<T> A. 00552 template <typename T> 00553 bool elxSplit( 00554 const ImageImpl< PixelRGBA<T> >& iImage, 00555 ImageImpl< PixelRGB<T> >& oImageRGB, 00556 ImageImpl< PixelL<T> >& oImageA); 00557 00558 // generic split 00559 template <typename Pixel> 00560 bool elxSplit2( 00561 const ImageImpl<Pixel>& iImage, 00562 ImageImpl< PixelL<typename Pixel::type> >& oImage1, 00563 ImageImpl< PixelL<typename Pixel::type> >& oImage2); 00564 00565 template <typename Pixel> 00566 bool elxSplit3( 00567 const ImageImpl<Pixel>& iImage, 00568 ImageImpl< PixelL<typename Pixel::type> >& oImage1, 00569 ImageImpl< PixelL<typename Pixel::type> >& oImage2, 00570 ImageImpl< PixelL<typename Pixel::type> >& oImage3); 00571 00572 template <typename Pixel> 00573 bool elxSplit4( 00574 const ImageImpl<Pixel>& iImage, 00575 ImageImpl< PixelL<typename Pixel::type> >& oImage1, 00576 ImageImpl< PixelL<typename Pixel::type> >& oImage2, 00577 ImageImpl< PixelL<typename Pixel::type> >& oImage3, 00578 ImageImpl< PixelL<typename Pixel::type> >& oImage4); 00579 00581 00582 00583 00586 00587 // Create image converted into RGB space, ISO resolution. 00588 template <class Pixel> 00589 boost::shared_ptr< ImageImpl< PixelRGB<typename Pixel::type> > > 00590 elxCreateImageRGB(const ImageImpl< Pixel >& iImage); 00591 00592 #ifdef elxUSE_ImageHLS 00593 // Create image converted into HLS space, ISO resolution. 00594 template <class Pixel> 00595 boost::shared_ptr< ImageImpl< PixelHLS<typename Pixel::type> > > 00596 elxCreateImageHLS(const ImageImpl< Pixel >& iImage); 00597 #endif 00598 00599 #ifdef elxUSE_ImageXYZ 00600 // Create image converted into CIE XYZ space, ISO resolution. 00601 template <class Pixel> 00602 boost::shared_ptr< ImageImpl< PixelXYZ<typename Pixel::type> > > 00603 elxCreateImageXYZ(const ImageImpl< Pixel >& iImage); 00604 #endif 00605 00606 #ifdef elxUSE_ImageLuv 00607 // Create image converted into CIE Luv space, ISO resolution. 00608 template <class Pixel> 00609 boost::shared_ptr< ImageImpl< PixelLuv<typename Pixel::type> > > 00610 elxCreateImageLuv(const ImageImpl< Pixel >& iImage); 00611 #endif 00612 00613 #ifdef elxUSE_ImageLab 00614 // Create image converted into CIE Lab space, ISO resolution. 00615 template <class Pixel> 00616 boost::shared_ptr< ImageImpl< PixelLab<typename Pixel::type> > > 00617 elxCreateImageLab(const ImageImpl< Pixel >& iImage); 00618 #endif 00619 00620 #ifdef elxUSE_ImageLch 00621 // Create image converted into CIE Lch space, ISO resolution. 00622 template <class Pixel> 00623 boost::shared_ptr< ImageImpl< PixelLch<typename Pixel::type> > > 00624 elxCreateImageLch(const ImageImpl< Pixel >& iImage); 00625 #endif 00626 00627 #ifdef elxUSE_ImageHLab 00628 // Create image converted into Hunter Lab space, ISO resolution. 00629 template <class Pixel> 00630 boost::shared_ptr< ImageImpl< PixelHLab<typename Pixel::type> > > 00631 elxCreateImageHLab(const ImageImpl< Pixel >& iImage); 00632 #endif 00633 00635 00636 00637 00640 00641 template <class Pixel> 00642 boost::shared_ptr< ImageImpl< PixelL<typename Pixel::type> > > 00643 elxCreateImageL( 00644 const ImageImpl< Pixel >& iImage); 00645 00646 // LA<T> to L<T> with blending alpha option 00647 template <typename T> 00648 boost::shared_ptr< ImageImpl< PixelL<T> > > 00649 elxCreateImageL( 00650 const ImageImpl< PixelLA<T> >& iImage, 00651 bool ibBlendAlpha); 00652 00653 // All to L space (ISO resolution) 00654 template <class Pixel> 00655 boost::shared_ptr< ImageImpl< PixelL<typename Pixel::type> > > 00656 elxCreateImageL( 00657 const ImageImpl< Pixel >& iImage, 00658 EColorToGreyConversion iMethod = CGC_Default); 00659 00664 template <typename T> 00665 boost::shared_ptr< ImageImpl< PixelL<T> > > 00666 elxCreateGreyImage( 00667 const ImageImpl< PixelRGB<T> >& iImage, 00668 EColorToGreyConversion iMethod = CGC_Default); 00669 00670 template <typename T> 00671 boost::shared_ptr< ImageImpl< PixelL<T> > > 00672 elxCreateGreyImage( 00673 const ImageImpl< PixelRGBA<T> >& iImage, 00674 bool ibBlendAlpha, 00675 EColorToGreyConversion iMethod = CGC_Default); 00676 00677 template <typename T> 00678 boost::shared_ptr< ImageImpl< PixelLA<T> > > 00679 elxCreateGreyImage( 00680 const ImageImpl< PixelRGBA<T> >& iImage, 00681 EColorToGreyConversion iMethod = CGC_Default); 00682 00684 template <typename T> 00685 boost::shared_ptr< ImageImpl< PixelRGB<T> > > 00686 elxCreateImageRGBGrey( 00687 const ImageImpl< PixelL<T> >& iImage, 00688 EGreyToColorConversion iMethod=GCC_Default); 00689 00691 template <typename T> 00692 boost::shared_ptr< ImageImpl< PixelRGBA<T> > > 00693 elxCreateImageRGBAGrey( 00694 const ImageImpl< PixelLA<T> >& iImage, 00695 EGreyToColorConversion iMethod=GCC_Default); 00696 00698 00699 // RGB<T> to L<T> iChannelsIn=3 iChannelOut=1 00700 // RGB<T> to LA<T> iChannelsIn=3 iChannelOut=2 00701 // RGBA<T> to L<T> iChannelsIn=4 iChannelOut=1 00702 // RGBA<T> to LA<T> iChannelsIn=4 iChannelOut=2 00703 template <typename T> 00704 void elxRGBToL( 00705 EColorToGreyConversion iMethod, 00706 T * iprDst, 00707 const T * iprSrc, 00708 size_t iSize, 00709 size_t iChannelsIn=3, 00710 size_t iChannelOut=1); 00711 00712 // Create ImageRGB<t> from Image<T> and channel. 00713 template <class Pixel> 00714 boost::shared_ptr< ImageImpl< PixelRGB<typename Pixel::type> > > 00715 elxCreateImageRGBGrey( 00716 const ImageImpl<Pixel>& iImage, 00717 uint32 iChannel); 00718 00719 00722 template <class Pixel> 00723 boost::shared_ptr< ImageImpl< PixelL<typename Pixel::type> > > 00724 elxCreateImageComplex( 00725 const ImageImpl< Pixel >& iImage); 00727 00728 template <typename Pixel> 00729 boost::shared_ptr< ImageImpl< PixelL<typename Pixel::type> > > 00730 elxCreateChannel( 00731 const ImageImpl<Pixel>& iImage, uint32 iChannel, bool ibScale=true); 00732 00733 template <typename Pixel> 00734 bool elxSetChannel( 00735 ImageImpl<Pixel>& ioImage, 00736 const ImageImpl< PixelL<typename Pixel::type> >& iPlane, 00737 uint32 iChannel); 00738 00739 } // namespace Image 00740 } // namespace eLynx 00741 00742 #include <elx/image/inl/Conversion/Resolution.inl> 00743 #include <elx/image/inl/Conversion/ResolutionLow.inl> 00744 #include <elx/image/inl/Conversion/Merge.inl> 00745 #include <elx/image/inl/Conversion/Split.inl> 00746 #include <elx/image/inl/Conversion/Color.inl> 00747 #include <elx/image/inl/Conversion/Grey.inl> 00748 #include <elx/image/inl/Conversion/Complex.inl> 00749 00750 #endif // __ImageConversion_h__