資源簡介
本算法庫為一個(gè)輕量級的圖像基礎(chǔ)處理框架,適合于小白或者初學(xué)者,包含了基于C語言的圖像讀寫(支持BMP/JPG/PNG/TGA格式),自己編寫實(shí)現(xiàn)的圖像基本繪制(點(diǎn)/線/三角形/矩形/圓形/橢圓/任意多邊形)算法內(nèi)容,不依賴任何第三方庫,徹底拜托MFC/LIBPNG/LIBJPG/OPENCV等,為入門者掃清障礙!

代碼片段和文件信息
//?ImageBasicDemo.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include“ImgBasic\f_SF_ImageDrawing.h“
#include“ImgBasic\f_SF_Imgbase_RW.h“
#include
#include
#include
int?_tmain(int?argc?_TCHAR*?argv[])
{
char*?srcPath?=?“Test\\test.jpg“;
char*?savePath?=?“Result\\res.jpg“;
int?width?=?0?height?=?0?stride?=?0?component?=?0?mWidth?=?0?mHeight?=?0?mStride?=?0?mComponent?=?0;
unsigned?char*?srcData?=?f_SF_Imgbase_ImageLoad(srcPath?&width?&height?&component);
stride?=?width?*?4;
////////////////////////////////////////////////////////////////////////////////////////ImageProcess//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////BGRA32////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////Drawing//////////////////////////////////////////////////////////////////////////////////
int?facePoints[202]?=?{256327259352264375272399280420292440305456321472341483364486386480402466416450428434438414446393452368457345459321267313277303291300308301323305336315321314306312293311280312377313388303404298421297436300447311433309420308406310392313287338293332300330309329318331326336331344323346316347307347299346293342385344391335398330408328417329424331429336424341418345410346401346393345345341345363343385335396339407354411363411378407383396374385371362370340328433339430351427359431369428380429391432384442375450361454346450337443334435346436360437373435386434373435360437348435310337406337357338358375359397358412};
int?penColorR?=?255;
int?penColorG?=?0;
int?penColorB?=?0;
int?penSize?=?1;
for(int?i?=?0;?i?101;?i++)
{
int?points[2]?=?{facePoints[2?*?i]?facePoints[2?*?i?+?1]};
//Drawing?points
ImgDrawPoints(srcData?width?height?stride?points?2??penColorG?penColorBpenColorR1);
ImgDrawHollowPoints(srcData?width?height?stride?points?1?penColorR?penColorG?penColorB?penSize?5);
}
//Drawing?Rectangle
int?x?=?100?y?=?100?w?=?50?h?=?50;
ImgDrawRectangle(srcData?width?height?stride?x?y?w?h?penColorR?penColorG?penColorB?3);
//Drawing?Triangle
ImgDrawTriangle(srcData?width?height?stride?x?y?x?+?100?y?x?y?+?100?penColorG?penColorR?penColorB?1);
//fill?rectangle
ImgDrawFillRectangle(srcData?width?height?stride?100?300?w?h?penColorR?penColorG?penColorB);
//fill?triangle
ImgDrawFillTriangle(srcData?width?height?stride?x?y?+?100?x?+?100?y?+?100?x?y?+?200?penColorG?penColorR?penColorB);
int?polyPoints[8]?=?{200?200?250?130?280?220?2
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????3742??2019-05-31?16:24??ImageBasicDemo\ImageBasicDemo\ImageBasicDemo.cpp
?????文件???????4745??2019-05-31?16:28??ImageBasicDemo\ImageBasicDemo\ImageBasicDemo.vcxproj
?????文件???????1558??2019-05-31?16:24??ImageBasicDemo\ImageBasicDemo\ImageBasicDemo.vcxproj.filters
?????文件????????143??2019-05-31?15:57??ImageBasicDemo\ImageBasicDemo\ImageBasicDemo.vcxproj.user
?????文件??????99328??2019-05-31?16:25??ImageBasicDemo\ImageBasicDemo\ImageProcessBasicfr
?????文件???????5328??2019-05-31?16:25??ImageBasicDemo\ImageBasicDemo\ImageProcessBasicfr
?????文件??????23847??2019-05-31?16:24??ImageBasicDemo\ImageBasicDemo\ImgBasic\f_SF_ImageDrawing.h
?????文件???????3057??2019-05-31?15:37??ImageBasicDemo\ImageBasicDemo\ImgBasic\f_SF_Imgba
?????文件???????1764??2019-05-31?15:57??ImageBasicDemo\ImageBasicDemo\ReadMe.txt
?????文件?????434614??2019-05-31?16:28??ImageBasicDemo\ImageBasicDemo\Result\res.jpg
?????文件????????301??2019-05-31?15:57??ImageBasicDemo\ImageBasicDemo\stdafx.cpp
?????文件????????320??2019-05-31?15:57??ImageBasicDemo\ImageBasicDemo\stdafx.h
?????文件????????314??2019-05-31?15:57??ImageBasicDemo\ImageBasicDemo\targetver.h
?????文件?????170006??2019-05-15?17:21??ImageBasicDemo\ImageBasicDemo\Test\test.jpg
?????文件????????909??2019-05-31?15:57??ImageBasicDemo\ImageBasicDemo.sln
????..A..H.?????14336??2019-05-31?16:38??ImageBasicDemo\ImageBasicDemo.suo
?????目錄??????????0??2019-05-31?16:27??ImageBasicDemo\ImageBasicDemo\ImgBasic
?????目錄??????????0??2019-05-31?16:28??ImageBasicDemo\ImageBasicDemo\Result
?????目錄??????????0??2019-05-31?16:23??ImageBasicDemo\ImageBasicDemo\Test
?????目錄??????????0??2019-05-31?16:39??ImageBasicDemo\ImageBasicDemo
?????目錄??????????0??2019-05-31?16:38??ImageBasicDemo
-----------?---------??----------?-----??----
???????????????764312????????????????????21
評論
共有 條評論