• 大小: 609KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: C/C++
  • 标签: C  language  IMAGE  READ  

资源简介

本算法库为一个轻量级的图像基础处理框架,适合于小白或者初学者,包含了基于C语言的图像读写(支持BMP/JPG/PNG/TGA格式),自己编写实现的图像基本绘制(点/线/三角形/矩形/圆形/椭圆/任意多边形)算法内容,不依赖任何第三方库,彻底拜托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

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       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\ImageProcessBasicframework.dll

     文件       5328  2019-05-31 16:25  ImageBasicDemo\ImageBasicDemo\ImageProcessBasicframework.lib

     文件      23847  2019-05-31 16:24  ImageBasicDemo\ImageBasicDemo\ImgBasic\f_SF_ImageDrawing.h

     文件       3057  2019-05-31 15:37  ImageBasicDemo\ImageBasicDemo\ImgBasic\f_SF_Imgbase_RW.h

     文件       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


评论

共有 条评论