Image Component Library (ICL)
|
00001 /******************************************************************** 00002 ** Image Component Library (ICL) ** 00003 ** ** 00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** 00005 ** Neuroinformatics Group ** 00006 ** Website: www.iclcv.org and ** 00007 ** http://opensource.cit-ec.de/projects/icl ** 00008 ** ** 00009 ** File : ICLCore/src/ICLCore/CCFunctions.h ** 00010 ** Module : ICLCore ** 00011 ** Authors: Christof Elbrechter, Andre Justus ** 00012 ** ** 00013 ** ** 00014 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00015 ** This file may be used under the terms of the GNU Lesser General ** 00016 ** Public License version 3.0 as published by the ** 00017 ** ** 00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL ** 00019 ** included in the packaging of this file. Please review the ** 00020 ** following information to ensure the license requirements will ** 00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00022 ** ** 00023 ** The development of this software was supported by the ** 00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00026 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00027 ** Excellence Initiative. ** 00028 ** ** 00029 ********************************************************************/ 00030 00031 #pragma once 00032 00033 #include <ICLUtils/CompatMacros.h> 00034 #include <ICLCore/Types.h> 00035 #include <ICLUtils/Size.h> 00036 #include <string> 00037 #include <ICLUtils/Macros.h> 00038 00039 namespace icl{ 00040 namespace core{ 00041 00043 00449 ICLCore_API void cc(const ImgBase *src, ImgBase *dst, bool roiOnly=false); 00450 00452 00455 ICLCore_API bool lut_available(format srcFmt, format dstFmt); 00456 00458 00462 ICLCore_API void createLUT(format srcFmt, format dstFmt); 00463 00465 00468 ICLCore_API void releaseLUT(format srcFmt, format dstFmt); 00469 00471 ICLCore_API void releaseAllLUTs(); 00472 00474 enum ccimpl{ 00475 ccAvailable = 0, 00476 ccEmulated = 1, 00477 ccAdapted = 2, 00478 ccUnavailable = 3, 00479 ccImpossible = 4 00480 }; 00481 00483 00484 ICLCore_API std::string translateCCImpl(ccimpl i); 00485 00487 ICLCore_API ccimpl translateCCImlp(const std::string &s); 00488 00490 ICLCore_API ccimpl cc_available(format srcFmt, format dstFmt); 00491 00492 00494 00500 ICLCore_API void convertYUV420ToRGB8(const unsigned char *pucSrc, const utils::Size &s, Img8u* poDst); 00501 00503 00507 //void convertToARGB32Interleaved(const Img8u *poSrc, unsigned char *pucDst); 00508 00510 00519 //void convertToARGB32Interleaved(const Img32f *poSrc, Img8u *poBuffer, unsigned char *pucDst); 00520 00521 00523 00529 template<class S, class D> ICLCore_API 00530 void planarToInterleaved(const Img<S> *src, D* dst, int dstLineStep = -1); 00531 00533 00538 template<class S, class D> ICLCore_API 00539 void interleavedToPlanar(const S *src, Img<D> *dst, int srcLineStep = -1); 00540 00541 00543 ICLCore_API void cc_util_rgb_to_yuv(const icl32s r, const icl32s g, const icl32s b, icl32s &y, icl32s &u, icl32s &v); 00544 00546 ICLCore_API void cc_util_yuv_to_rgb(const icl32s y, const icl32s u, const icl32s v, icl32s &r, icl32s &g, icl32s &b); 00547 00549 ICLCore_API void cc_util_rgb_to_hls(const icl32f r255, const icl32f g255, const icl32f b255, icl32f &h, icl32f &l, icl32f &s); 00550 00552 ICLCore_API void cc_util_hls_to_rgb(const icl32f h255, const icl32f l255, const icl32f sl255, icl32f &r, icl32f &g, icl32f &b); 00553 00555 ICLCore_API void cc_util_rgb_to_chroma(const icl32f r, const icl32f g, const icl32f b, icl32f &chromaR, icl32f &chromaG); 00556 00558 void cc_util_rgb_to_lab(const icl32f &r, const icl32f &g, const icl32f &b, icl32f &L, icl32f &A, icl32f &B); 00559 } // namespace core 00560 }