-
大小: 158KB文件類型: .zip金幣: 2下載: 0 次發布日期: 2021-05-28
- 語言: C/C++
- 標簽: SLIC??superpixel??color??
資源簡介
SLIC圖像superpixel的C++代碼

代碼片段和文件信息
//=================================================================================
//=================================================================================
//
//?PictureHandler.cpp:?implementation?of?the?PictureHandler?class.
//
//?Copyright?(c)?2007?Radhakrishna?Achanta?(asv.radhakrishna?[at]?gmail?[dot]?com)
//?All?rights?reserved
//
//=================================================================================
//=================================================================================
#include?“stdafx.h“
#include?“PictureHandler.h“
#include???
//=================================================================================
//?Construction/Destruction
//=================================================================================
PictureHandler::PictureHandler()
{
StartUpGdiPlus();
}
PictureHandler::~PictureHandler()
{
ShutDownGdiPlus();
}
//=================================================================================
// StartUpGdiPlus()
//
// Starts?up?GdiPlus.?Can?also?be?used?for?other?things?like?memory?allocation.
//=================================================================================
void?PictureHandler::StartUpGdiPlus()
{
m_gdiplusStartupInput?=?new?GdiplusStartupInput();
Status?stat?=?GdiplusStartup(&m_gdiplusToken?m_gdiplusStartupInput?NULL);
_ASSERT(?stat?==?Ok?);
}
//=================================================================================
// ShutDownGdiPlus()
//
// Shuts?down?GdiPlus.?Can?also?be?used?for?other?things?like?memory?deallocation.
//=================================================================================
void?PictureHandler::ShutDownGdiPlus()
{
if?(m_gdiplusToken?!=?NULL)
{
GdiplusShutdown(m_gdiplusToken);
delete?m_gdiplusStartupInput;
m_gdiplusStartupInput?=?NULL;
m_gdiplusToken?=?NULL;
}
}
//=================================================================================
// GetEncoderClsid()
//
// The?encoder?CLSID?provided?depends?on?the?format?string?provided;
// L“image/jpeg“?for?JPEG?CLSID?and?L“image/bmp“?for?BMP?CLSID
//=================================================================================
int?PictureHandler::GetEncoderClsid(const?WCHAR*?format?CLSID*?pClsid)
{
???UINT??num?=?0;??????????//?number?of?image?encoders
???UINT??size?=?0;?????????//?size?of?the?image?encoder?array?in?bytes
???ImageCodecInfo*?pImageCodecInfo?=?NULL;
???GetImageEncodersSize(&num?&size);
???if(size?==?0)
??????return?-1;??//?Failure
???pImageCodecInfo?=?(ImageCodecInfo*)(malloc(size));
???if(pImageCodecInfo?==?NULL)
??????return?-1;??//?Failure
???GetImageEncoders(num?size?pImageCodecInfo);
???for(UINT?j?=?0;?j????{
??????if(?wcscmp(pImageCodecInfo[j].MimeType?format)?==?0?)
??????{
?????????*pClsid?=?pImageCodecInfo[j].Clsid;
?????????free(pImageCodecInfo);
?????????return?j;??//?Success
??????}????
???}
???free
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????35821??2011-03-23?15:42??SLICSuperpixelsAndSupervoxelsCode\LICENSE.txt
?????文件?????????911??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels.sln
?????目錄???????????0??2012-03-23?17:05??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\
?????文件???????10061??2011-03-08?11:12??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\PictureHandler.cpp
?????文件????????2521??2011-03-08?11:07??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\PictureHandler.h
?????文件????????3460??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\ReadMe.txt
?????目錄???????????0??2012-03-23?17:05??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\res\
?????文件???????67777??2007-11-28?15:21??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\res\SLICSuperpixels.ico
?????文件?????????406??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\res\SLICSuperpixels.rc2
?????文件?????????687??2011-03-08?10:54??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\resource.h
?????文件???????38792??2012-03-23?16:46??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLIC.cpp
?????文件????????9654??2012-03-23?16:43??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLIC.h
?????文件??????104976??2012-03-23?16:25??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLICSuperpixels.aps
?????文件????????1717??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLICSuperpixels.cpp
?????文件?????????562??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLICSuperpixels.h
?????文件????????4839??2012-03-23?16:25??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLICSuperpixels.rc
?????文件????????5842??2011-03-08?10:30??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLICSuperpixels.vcproj
?????文件????????8299??2012-03-23?16:50??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLICSuperpixelsDlg.cpp
?????文件????????1001??2012-03-23?16:09??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\SLICSuperpixelsDlg.h
?????文件?????????217??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\stdafx.cpp
?????文件????????1075??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\stdafx.h
?????文件????????1432??2011-03-08?10:01??SLICSuperpixelsAndSupervoxelsCode\SLICSuperpixels\targetver.h
?????文件????????2832??2012-03-23?17:04??SLICSuperpixelsAndSupervoxelsCode\USAGE_SLIC.txt
- 上一篇:圖像融合 NSCT算法 matlab
- 下一篇:表達式求值(C語言棧實現)
評論
共有 條評論