libpng使用例子

游戏素材处理:利用Python把多个序列帧合并为一个大序列图 目录 问题来源 代码解决 游戏素材的整理是一件挺麻烦的事情,但是只要用好了工具,便可以事半功倍。 问题来源 从网上找了一些游戏特效素材,其中包括很多批序列帧图集 一部分特效素材是所有子帧都拼在一张大图上的, 而另一部分是若干个单独的序列帧图片 这样使用起来极其不方便,需要把资源的形式统一。最终决定还是把零散的多个序列帧图片拼成一个大图比较方便管理。 代码解... 阅读详情

本例使用libpng,将一系列单个的序列帧png文件合并成一个大的png, 去除无用的空白,计算每个系列的最小有效范围。

请看源码吧,libpng用法有不明白的,可以参考一下,有抄到的到方请保留版权

 

 

//@author aerror 
//2011/12/02
#include "stdafx.h"
#include <Windows.h>
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <tchar.h>
#include <vector>
#include <string>
#include <list>


extern "C"{
#include "png.h"
}


	
#define EnsureVectorSize(v,ds)  {if(v.size()<(unsigned int)ds){ v.resize(ds);}}

typedef struct _RECTANGLE
{
	int top;
	int left;
	int bottom;
	int right;
}TRECTANGLE;



class PNG_SRC_FILE
{
public:
	std::string filename;
	png_bytep   bmp;
	unsigned int rawWidth  ;
	unsigned int rawHeight  ;
	PNG_SRC_FILE(const char * src)
	{
		filename =src;
		bmp = NULL;
	}
	virtual ~PNG_SRC_FILE()
	{
		if(bmp!=NULL)
		{
			delete []bmp;
		}
	}

};

typedef std::list<  PNG_SRC_FILE *> TPNG_SRC_FILE_LIST;
typedef std::list<   PNG_SRC_FILE *>::iterator TPNG_SRC_FILE_LIST_ITER;

bool filename_sort(PNG_SRC_FILE * x1,PNG_SRC_FILE * x2)
{
	return x1->filename < x2->filename;
}

typedef struct _tanimation_info
{

	const char *actionName;
	const char *actionDir;
	unsigned rowHeight;
	unsigned frameWidth;
	unsigned frameHeight;
	unsigned totalFrame;
	unsigned fps;
	TPNG_SRC_FILE_LIST  * filelist;
	unsigned int minTop     ;
	unsigned int maxBottom  ;
	unsigned int minLeft    ;
	unsigned int maxRight   ;

}TANIMATION_INFO;

	std::vector<BYTE>				s_srcDibBitsBuffer;
	std::vector<BYTE>				s_dstDibBitsBuffer;
	std::vector<BYTE>				s_dstPngRowsBuffer;
	std::vector<BYTE>				s_dstPngTempBuffer;
	
	

	int outputToPngFileNormal(const char *szFileName,unsigned int numDibBtis,const unsigned char *pDibBytes,unsigned int _width, unsigned int _height)
	{
		FILE *fp;
		png_structp png_ptr;
		png_infop info_ptr;
	

		/* open the file */
		fp = fopen(szFileName, "wb");
		if (fp == NULL)
		  return (ERROR);

		png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL, NULL, NULL);

		if (png_ptr == NULL)
		{
		  fclose(fp);
		  return (ERROR);
		}

		/* Allocate/initialize the image information data.  REQUIRED */
		info_ptr = png_create_info_struct(png_ptr);
		if (info_ptr == NULL)
		{
		  fclose(fp);
		  png_destroy_write_struct(&png_ptr,  png_infopp_NULL);
		  return (ERROR);
		}

		/* Set error handling.  REQUIRED if you aren't supplying your own
		* error handling functions in the png_create_write_struct() call.
		*/
		if (setjmp(png_jmpbuf(png_ptr)))
		{
		  /* If we get here, we had a problem reading the file */
		  fclose(fp);
		  png_destroy_write_struct(&png_ptr, &info_ptr);
		  return (ERROR);
		}

		png_init_io(png_ptr, fp);


		/* Set the image information here.  Width and height are up to 2^31,
		* bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
		* the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
		* PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
		* or PNG_COLOR_TYPE_RGB_ALPHA.  interlace is either PNG_INTERLACE_NONE or
		* PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST
		* currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. REQUIRED
		*/
		

		
		int src_bytes_per_pixel	= numDibBtis/_width/_height;	
		png_uint_32 k, height, width;

		height = _height;	
		width = _width;


		png_set_IHDR(png_ptr, info_ptr, width, height, 8, 
		   PNG_COLOR_TYPE_RGB_ALPHA,
		  PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);

		png_text text_ptr[2]={0,0};

		char szDetail[255]="pvr";
		/*sprintf(szDetail,"type=%d method=%d size=%dx%d lefttop=%d,%d frame=%dx%d\n",
						pInfo->type,
						pInfo->method,
						(int)(pInfo->width),
						(int)(pInfo->height), 
						(int)(pInfo->left),
						(int)(pInfo->top),
						(int)(pInfo->frmWidth),
						(int)(pInfo->frmHeith) );
*/
		text_ptr[0].key = "Author";
		text_ptr[0].text = "dany21cn@21cn.com";
		text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE;
		text_ptr[1].key = "Description";
		text_ptr[1].text = szDetail;
		text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE;
		png_set_text(png_ptr, info_ptr, text_ptr, 2);


		/* Write the file header information.  REQUIRED */
		png_write_info(png_ptr, info_ptr);

		if (height > PNG_UINT_32_MAX/png_sizeof(png_bytep))
		 png_error (png_ptr, "Image is too tall to process in memory");


		png_bytep image =  NULL;
		png_bytep imagerow =  NULL;
		
		
		EnsureVectorSize(s_dstPngRowsBuffer,width*4);
		imagerow =	&s_dstPngRowsBuffer[0];
		
		
		

		for(int y=0;y<_height;y++)
		{
			for(int x=0;x<_width;x++)
			{
				int dx = x;//+pInfo->left;
				int dy = y;//+pInfo->top;

				if(dx>width || dy>height)
				{
					printf("invalid offset operation\n");
					return ERROR;
				}

				const unsigned char* psrc = pDibBytes + y*_width*src_bytes_per_pixel+ x*src_bytes_per_pixel;
				png_bytep pdst = NULL;
				
				pdst = imagerow  +dx*4;
				
				if(src_bytes_per_pixel==4)
				{
					/*
					pdst[0] = psrc[2];
					pdst[1] = psrc[1];
					pdst[2] = psrc[0];
					pdst[3] = psrc[3];
					*/

					pdst[0] = psrc[0];
					pdst[1] = psrc[1];
					pdst[2] = psrc[2];
					pdst[3] = psrc[3];
				}
			
			}
			
			png_write_row(png_ptr,imagerow);

		}
		
		
		/* You can write optional chunks like tEXt, zTXt, and tIME at the end
		* as well.  Shouldn't be necessary in 1.1.0 and up as all the public
		* chunks are supported and you can use png_set_unknown_chunks() to
		* register unknown chunks into the info structure to be written out.
		*/

		/* It is REQUIRED to call this to finish writing the rest of the file */
		png_write_end(png_ptr, info_ptr);

		/* clean up after the write, and free any memory allocated */
		png_destroy_write_struct(&png_ptr, &info_ptr);

		fclose(fp);

		return 0;
	}


TRECTANGLE cutTransparent(png_bytep bmp, unsigned int width, unsigned int height )
{
	TRECTANGLE  t={0,0,height,width};

	//row by row from top
	//
	for(int y=0;y<height;y++)
	{
		bool thisLineEmpty = true;
		for(int x=0;x<width;x++)
		{
			unsigned char* psrc = bmp + y*width*4+ x*4;
			unsigned  int v =  *(unsigned int* )psrc;
			if(v &0xFF000000)
			{
				thisLineEmpty = false;
				break;
			}
		}

		if(thisLineEmpty)
		{
			t.top ++ ;
		}
		else
		{
			break;
		}
	}

	for(int y=height-1;y>=0;y--)
	{
		bool thisLineEmpty = true;
		for(int x=0;x<width;x++)
		{
			unsigned char* psrc = bmp + y*width*4+ x*4;
			unsigned  int v =  *(unsigned int* )psrc;
			if(v &0xFF000000)
			{
				thisLineEmpty = false;
				break;
			}
		}

		if(thisLineEmpty)
		{
			t.bottom --;
		}
		else
		{
			break;
		}
	}

	
	for(int x=0;x<width;x++)
	{
		bool thisLineEmpty = true;
		for(int y=0;y<height;y++)
		{
			unsigned char* psrc = bmp + y*width*4+ x*4;
			unsigned  int v =  *(unsigned int* )psrc;
			if(v &0xFF000000)
			{
				thisLineEmpty = false;
				break;
			}
		}

		if(thisLineEmpty)
		{
			t.left ++ ;
		}
		else
		{
			break;
		}
	}


	for(int x=width-1;x>=0;x--)
	{
		bool thisLineEmpty = true;
		for(int y=0;y<height;y++)
		{
			unsigned char* psrc = bmp + y*width*4+ x*4;
			unsigned  int v =  *(unsigned int* )psrc;
			if(v &0xFF000000)
			{
				thisLineEmpty = false;
				break;
			}
		}

		if(thisLineEmpty)
		{
			t.right --;
		}
		else
		{
			break;
		}
	}


	return t;
}


/**
stand=standby
attack=Normal attack
squat=Morale attack
attacked=under attack
defense=????
*/


void concat(const char *packsDir, const char *outputDir)
{
	WIN32_FIND_DATAA FindFileData;
	HANDLE hFind = INVALID_HANDLE_VALUE;
	char DirSpec[MAX_PATH];  // directory specification
	char DirBase[MAX_PATH];  // directory specification
	char filename_dest[MAX_PATH];
	char npc_name[MAX_PATH];

	DWORD dwError;


	TANIMATION_INFO aniInfo[4]={
		{ "stand","standby",0,0,0,0,0,0,0,0,0,0},
		{ "attack","Normal attack",0,0,0,0,0,0,0,0,0,0},
		{ "squat","Morale attack",0,0,0,0,0,0,0,0,0,0},
		{ "attacked","under attack",0,0,0,0,0,0,0,0,0,0}
	};

	
	strcpy(DirSpec,packsDir);
	int rlen = strlen(DirSpec);
	if(DirSpec[rlen -1]=='\\')
	{
		DirSpec[rlen-1]='\0';
	}
	strcpy(DirBase,DirSpec);
	char *last = strrchr(DirBase,'\\');
	strcpy(npc_name,last+1);


	char szCurPath[MAX_PATH];


	GetCurrentDirectoryA(MAX_PATH,szCurPath);
	
	unsigned int currentRowHeight = 0;
	unsigned int output_width=0;
	unsigned int output_height=0;
	for(int n=0;n<4;n++)
	{
	
		strcpy(DirSpec,DirBase);
		strcat(DirSpec,"\\序列\\");
		strcat(DirSpec,aniInfo[n].actionDir);
		SetCurrentDirectoryA(DirSpec);
		strcat(DirSpec,"\\*.png");
		
		aniInfo[n].filelist = new TPNG_SRC_FILE_LIST();
		TPNG_SRC_FILE_LIST &filelist = *aniInfo[n].filelist;

		hFind = FindFirstFileA(DirSpec, &FindFileData);
		if (hFind != INVALID_HANDLE_VALUE) 
		{
			while (FindNextFileA(hFind, &FindFileData) != 0) 
			{
				filelist.push_back(new PNG_SRC_FILE(FindFileData.cFileName));
			}
			dwError = GetLastError();
			FindClose(hFind);
		}

		if(filelist.empty())
		{
			continue;
		}

		filelist.sort(filename_sort);


		//剪切
		//
		unsigned int minTop    =0 ;
		unsigned int maxBottom =0 ;
		unsigned int minLeft   =0 ;
		unsigned int maxRight  =0 ;

		for(TPNG_SRC_FILE_LIST_ITER  iter = filelist.begin(); 
			iter !=filelist.end(); iter++)
		{
		
			png_structp png_ptr=NULL;
			png_infop info_ptr=NULL;
			png_infop end_info_ptr=NULL;

			/* open the file */
			FILE *fp = fopen((*iter)->filename.c_str(), "rb");
			if (fp == NULL)
				return ;
			png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,NULL, NULL, NULL);
			info_ptr = png_create_info_struct(png_ptr);
			end_info_ptr = png_create_info_struct(png_ptr);
			png_init_io(png_ptr, fp);
			png_read_info(png_ptr,info_ptr);

			png_bytep dibbytes = new png_byte[info_ptr->width * info_ptr->height * 4];
			
			(*iter)->bmp = dibbytes ;
			(*iter)->rawWidth = info_ptr->width;
			(*iter)->rawHeight = info_ptr->height;
			
			
			for(int y=0;y<info_ptr->height;y++)
			{
				png_bytep pdest = dibbytes + y*info_ptr->width*4;
				png_read_row(png_ptr,pdest,NULL);
			}

			TRECTANGLE cut = cutTransparent(dibbytes,info_ptr->width,info_ptr->height);
			if(minTop==0 || minTop> cut.top)
			{
				minTop = cut.top;
			}
			if(minLeft==0 || minLeft> cut.left)
			{
				minLeft = cut.left;
			}

			if(maxRight < cut.right)
			{
				maxRight = cut.right;
			}
			
			if(maxBottom < cut.bottom)
			{
				maxBottom  = cut.bottom;
			}
			

			png_destroy_read_struct(&png_ptr,&info_ptr,&end_info_ptr);
			fclose(fp);
		}

		
		aniInfo[n].fps = 10;
		aniInfo[n].frameWidth = maxRight - minLeft;
		aniInfo[n].frameHeight  = maxBottom-minTop;
		aniInfo[n].totalFrame= filelist.size();
		aniInfo[n].rowHeight = currentRowHeight;
		aniInfo[n].minTop     =minTop     ;
		aniInfo[n].maxBottom  =maxBottom  ;
		aniInfo[n].minLeft    =minLeft    ;
		aniInfo[n].maxRight   =maxRight   ;

		currentRowHeight += aniInfo[n].frameHeight;

		if(output_width  < aniInfo[n].frameWidth * aniInfo[n].totalFrame)
		{
			output_width   = aniInfo[n].frameWidth * aniInfo[n].totalFrame;
		}

		output_height = currentRowHeight;
	}
	
	EnsureVectorSize(s_srcDibBitsBuffer, output_height * output_width * 4);

	png_bytep  bigmap = &s_srcDibBitsBuffer[0];
	currentRowHeight = 0;
	
	std::string xml;
	const char *headline_fmt =  "<SWFLoader isBattle=\"true\" name=\"%s\" url=\"assets/soldiers/%s.swf\" load=\"false\">\n";
	const char *actionline_fmt =  "  <action name=\"%s\" rowHeight=\"%d\" frameWidth=\"%d\" frameHeight=\"%d\" fps=\"120\" totalFrame=\"%d\" attackFrame=\"0\" attackedFrame=\"0\" isRight=\"true\" offsetX=\"115\" offsetY=\"-268\"/>\n";
	const char *endline_fmt =  "</SWFLoader>\n";
	sprintf(DirSpec,headline_fmt,npc_name,npc_name);
	xml = DirSpec;

	for(int n=0;n<4;n++)
	{
		
		TPNG_SRC_FILE_LIST &filelist = *aniInfo[n].filelist;
		if(filelist.empty())
		{
			continue;
		}

		sprintf(DirSpec,actionline_fmt,aniInfo[n].actionName,aniInfo[n].rowHeight,aniInfo[n].frameWidth,aniInfo[n].frameHeight,aniInfo[n].totalFrame);
		xml +=DirSpec;

		int curCol= 0;
		for(TPNG_SRC_FILE_LIST_ITER   iter = filelist.begin(); 
			iter !=filelist.end(); iter++)
		{
			int yy = 0;
			for(int y=aniInfo[n].minTop;y<aniInfo[n].maxBottom;y++)
			{
				int xx = 0;
				for(int x=aniInfo[n].minLeft;x<aniInfo[n].maxRight;x++)
				{
					unsigned int* psrc = (unsigned int*)((*iter)->bmp + y*(*iter)->rawWidth *4+ x*4);
					int dx =  curCol * aniInfo[n].frameWidth  +  xx;
					int dy =  currentRowHeight +yy;
					unsigned int* dest = (unsigned int*)(bigmap + dy * output_width * 4 + dx*4);
					xx++;
					*dest = *psrc;
				}

				yy ++;
			}
			
			curCol ++;
			PNG_SRC_FILE * f = *iter;
			delete f;
		}

		delete aniInfo[n].filelist;

		currentRowHeight += aniInfo[n].frameHeight;
	}
	xml += endline_fmt;


	SetCurrentDirectoryA(szCurPath);

	strcpy(filename_dest,outputDir);
	if(outputDir[strlen(outputDir)-1]!='\\')
		strcat(filename_dest,"\\");
	strcat(filename_dest,npc_name);
	strcat(filename_dest,".png");
	outputToPngFileNormal(filename_dest,4*output_width * output_height, &s_srcDibBitsBuffer[0],output_width,output_height);

	strcpy(filename_dest,outputDir);
	
	if(outputDir[strlen(outputDir)-1]!='\\')
		strcat(filename_dest,"\\");
	strcat(filename_dest,"AnimationConfig.xml");

	FILE *xmlFile = fopen(filename_dest,"a");
	
	if(xmlFile==NULL)
	{
		return ;
	}

	fwrite(xml.c_str(),1,xml.length(),xmlFile);
	fclose(xmlFile);
}

void print_uasge()
{
	printf("USEAGE:\n"
			"   pngconcat  x:\\path\\to\\yournpcdirectory x:\\path\\to\\output \n"
			"EXAMPLE:\n"
			"   pngconcat  D:\\hero_xxxxxx D:\\temp \n"
			);
}

int checkDir(const char * szdir)
{
	 struct _stat buf;
   int result;
   char timebuf[26];
   const char* filename = szdir;
   errno_t err;

   // Get data associated with "crt_stat.c": 
   result = _stat( filename, &buf );

   // Check if statistics are valid: 
   if( result != 0 )
   {
      perror( "Problem getting information" );
      switch (errno)
      {
         case ENOENT:
           printf("File %s not found.\n", filename);
           break;
         case EINVAL:
           printf("Invalid parameter to _stat.\n");
           break;
         default:
           /* Should never be reached. */
           printf("Unexpected error in _stat.\n");
      }
	  return -1;
   }
   else
   {
	   if( (buf.st_mode & _S_IFDIR)==0)
	   {
		     printf("input %s is not a directory.\n", filename);
			 return -1;
	   }
		
   }
   return 0;
}

int _tmain(int argc, _TCHAR* argv[])
{
	
	if(argc != 3 || checkDir(argv[1])  || checkDir(argv[2]) )
	{
		print_uasge();
		return -1;
	}

	concat(argv[1],argv[2]);
	return 0;
}


 

使用libpng和GDI读取显示png图片 网上都是gdiplus的例子,其实GDI也是支持透明度的,放一个例子。 #include "png.h" #include "zlib.h" #include #pragma comment(lib, "Msimg32.lib")//AlphaBlend需要 void Draw(HWND hwnd, const char* pngfile, bool layered) { 阅读详情

相关推荐

使用libpng读写PNG图片

libpng是一款C语言编写的比较底层的读写PNG文件的跨平台的库。借助它,你可以轻松读写PNG文件的每一行像素。 因为PNG文件是经过压缩而且格式复杂的图形文件(有的PNG文件甚至像GIF文件一样带动画效果) 而且PNG可以是带透明通道的真彩色图像、不带透明通道的真彩色图像、索引颜色、灰度颜色等各种格式,如果大家都自己写程序分析PNG文件就会显得很麻烦、很累。因此,通过使用libpng你就能直接...

wang93IT的博客 1万+

libpng样例

读取png文件: #include #include #include /******************************图片数据*********************************/ typedef struct _pic_data pic_data; struct _pic_data { int width, height; /* 尺寸 */ int b

xiaolu 记录 1064

使用libpng读取PNG图片像素数据

libpng 是一套免费的、公开源代码的程序库,支持对 PNG 图形文件的创建、读写等操作。可以到www.libpng.org 上下载源代码。libpng 使用 zlib 程序库作为压缩引擎,zlib 也是著名的 gzip (GNU zip) 所采用的压缩引擎。zlib是通用的压缩库,提供了一套 in-memory 压缩和解压函数,并能检测解压出来的数据的完整性(integrity)。

2万+

【Photoshop】合并一系列序列帧图片成序列帧大图

在2D游戏中,序列帧图片的大图是很常见很常用的东西,他用于记录游戏主角的所有动作。比如上图,就是lf2中的一张序列帧大图。 其实大部分软件都不支持gif或者直接拉个视频进去这样,序列帧图片来完成游戏主角的动作表现这项技术一直很经典。所以我们需要学会利用Photoshop合并一系列序列帧图片成序列帧大图。 一般用视频软件或者Gif处理软件导出来的帧系列图片是这样的: 你不可能拿这多达1

编程记录,亲测有效 5万+

libpng的使用 | 在Linux系统下编译、安装与使用

libpng是官方的 PNG 参考库。它支持几乎所有 PNG 功能,具有可扩展性,并且经过了 23 多年的广泛测试。开发版本的主页(即可能有问题 或可能会发生变化或包含实验性功能)是https://libpng.sourceforge.io/,有关该库的问题的地方是png-mng-implement邮件列表。 libpng 可作为 ANSI C (C89) 源代码使用,并且需要zlib 1.0.4 或更高版本(出于性能和安全原因,建议使用1.2.5或更高版本)。

I_feige的博客 7457

深入解析libpng-1.2.23:PNG图像处理库核心功能

本文还有配套的精品资源,点击获取 简介:PNG是一种无损压缩图像格式,广泛用于网页设计和软件开发。libpng-1.2.23是该格式处理库的一个稳定版本,提供了全面的PNG标准支持,包含透明度、颜色空间转换等核心功能。该文详细介绍libpng的核心特性、使用方法及其在实际项目中的应用。libpng库由解码器、编码器、内存管理、错误处理和API接口等组件构成。使用该库涉及解压...

weixin_42584507的博客 2012

linux下libpng库的安装以及使用

前几天手里的智能锁项目 , 收到产品的建议(命令)说 , 就是人脸识别成功的时候 , 不要只显示摄像头捕捉到的图像 , 要弄个酷炫一点的背景, 背景里图片中间有个圆圈, 人脸就放到圆圈里也就是类似这样。。 当然, 这是我思考了好几个小时的结果, 开始想不明白要怎么实现,其实想通了也很简单, 三个步骤 A 把背景图像的RGB读出来 out_buf B 把摄像头采集到的图像读出来(分辨率和背...

weixin_38176039的博客 3万+

序列帧合并器 max序列帧.zip

一款不错的序列帧合成器,很好用可以自行设置行数、列数,还能设置多行,自动裁剪png图片,一键设置图片合成,有需要的欢迎下载。

libpng使用

最近看到一片关于如何使用C语言读和写png图片格式 我要讲的三个大部分分别是: 1、libpng是什么,能做什么? 2、怎样让自己的程序可以使用libpng库? 3、怎样借助libpng读写PNG文件 1、libpng是什么? libpng是一款C语言编写的比较底层的读写PNG文件的跨平台的库。借助它,你可以轻松读写PNG文件的每一行像素。 因为PNG文件是经过压缩而且格式复

化茧成蝶007 1万+

COMSOL网格划分技巧总结

在对马赫曾德尔型光学传感器进行模拟仿真时,在采用自动物理场自动控制网格-极细化的情况下透射谱曲线仍不理想,因此需要手动划分网格来对其进行更精细的剖分。 手动划分的基本原则是在作用边界,热点,曲边处做细致划分, 基底,包层等做粗略划分。对于光波导型的微纳结构,在仿真时一般需要用到创建边界层网格。 1.COMSOL所需要的网格数量 网格单元数越多,结果精细度越高,计算所需内存越多。在细化到一定程度后网格收敛,仿真结果提升不明显。 2.网格剖分类型 ...

qq_42453337的博客 4万+

el-table通过上下左右键移动光标

在Element Plus的el-table中包含el-input和el-select组件,要实现上下左右键控制光标位置,需要通过focus和blur跟踪判断当前是哪个el-input或el-select有焦点,当按键按下时,通过监听,计算下一个获取焦点元素的索引,通过focus方法将焦点切换至改元素。

秋思的博客 1357

Libpng源码的使用

上一篇讲了libpng和zlib的关系 zlib,Libpng,gzip,libzip库的联系与区别 接下来记录libpng的使用 准备 首先了解png,bmp文件格式的特点,本篇不详细介绍。 bmp图片是微软的图片格式,就是原始的像素数据加上bmp文件头组成,像素数据是倒装的,即第一个像素的(RGB)三个字节再原始文件的最后。png是原始数据压缩后加入png格式文件描述。 下载libpng和zlib的源码,放在同一个目录中 由于libpng实际上使用的是zlib的算法,libpng是zl

cc电子世界 5616

Mongodb操作与Java(四)MongoTemplate的使用

MongoTemplate的使用

A乐神的博客 3446

libpng库的使用讲解

由于个人想学习DirectFB的使用。而 DirectFB依赖于libpng和libjpeg库,所以需要简单了解下libpng库的使用方法。本文转自:http://www.cnblogs.com/xiaoxiaoboke/archive/2012/02/13/2349765.html。此篇文章讲解的非常不错。我个人会有简单的调整。新增了一个小例子对使用来个简单的小结。   libpng的数据结

ostar_liang的专栏 1万+

无法联网的情况下,dbeaver离线安装数据库驱动-clickhouse

无法联网的情况下,dbeaver离线安装数据库驱动-clickhouse

u012831187的博客 1万+

单细胞分析(16)—— RNA Velocity 分析流程

RNA velocity 是一种强大的单细胞转录组分析工具,它可以预测细胞的未来状态,揭示发育轨迹,并用于探索细胞状态转换。RNA velocity 是一种通过单细胞 RNA 测序(scRNA-seq)数据推测细胞未来状态的分析方法。🚀**RNA velocity 提供了一个全新的角度来理解细胞的动态变化,为单细胞转录组分析带来了更深入的时空信息!

阅读文献,记录学习笔记 2998

libpng的简单使用

libpng的简单使用

Karl的专栏 5888

Labview及NI-USRP驱动安装教程

软件下载 安装使用的LabVIEW2018及NI-USRP驱动程序已上传,下载地址: 天翼云盘链接 (访问码:oc33) 百度网盘链接 (提取码:88mi) (注:天翼云盘下载不限速) LabVIEW2018安装步骤 右键软件压缩包选择解压至LabVIEW2018 选中文件,鼠标右击选择以管理员身份打开2018LV-WinChn.exe文件。 点击确定。 点击Unzip解压。 点击确定。 点击下一步。 填写任意信息后,点击下一步。 点击下一步。 点击浏览更改安装路径建议安装到除C盘以

dadapongi6的博客 2万+

[libpng]CMake+VS2015下编译libpng,及使用小例

编译前的工作 在编译libpng前,需要把zlib编译好,并加载到编译环境里。 CMake + VS2015 下编译zlib,及使用小例 下载与解压 libpng的官网是 http://www.libpng.org/pub/png/libpng.html ,但它的源码是存在 https://sourceforge.net 上的;具体最新的版本可以先进官网看看,再点连接过去下载 我当...

weixin_30425949的博客 595

Badcase归因分析“四部曲”

badcase是业内的专业名词,简单解释一下。bad是坏,case是案例,说白了就是模型或者具体规则无法很好预测的那些案例。以分类模型为例,本来一个样本应该是负类的,结果预测为正类,那这个样本就能被称为bad case。那相对应的就是good case就是优秀案例。

qq_25438419的博客 3568

【HAL库】STM32CubeMX开发----STM32F407----ETH+LWIP----TCPclient客户端

STM32F407开发板 为TCPclient客户端,PC端 为TCPserver服务端,相互之间的发送和接收实验。

MQ0522的博客 3055

libpng 项目使用与配置教程

libpng 项目是一个用于处理 Portable Network Graphics (PNG) 文件格式的库。项目的目录结构如下: - `.github/`: 存放 GitHub Actions 的配置文件,用于自动化构建和测试等。 - `contrib/`: 包含了一些额外的、非官方的代码贡献。 - `scripts/`: 存放了一些辅助脚本,用于构建和测试等。 - `tests/`: 包含...

gitblog_01016的博客 756

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

zlib 与 libpng 的配置与使用 part 3 libpng的安装与生成PNG图片

libpng 的安装接下来,安装 libpng 的过程要稍微轻松些。先下载最新的 libpng 程序库源文件。网址是http://sourceforge.net/projects/libpng/或http://www.libpng.org/pub/png/。不妨设下载的文件是 libpng-1.2.5.tar.gz,将这个文件释放到D:/libpng/。修改D:/libpng/libpng

陈硕的Blog 2万+

InTheHand.Net.Personal+BlueTooth4,蓝牙开发

项目中有蓝牙开发的必备dll,现在网上相关的文档博客不少,有的说的多有的说少,但是却很少有这两个dll,分享一下。

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

上一篇: 排序组合,AS实现穷举算法
下一篇: LZMA 算法 AS3 移植 实现
aerror
博客等级 码龄23年 393粉丝 193原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址