⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rotateppm.cc

📁 torch tracking code, it is a good code
💻 CC
字号:
const char *help = "\progname: rotateppm.cc\n\code2html: This program reads a ppm image and rotate it.\n\version: Torch3 vision2.0, 2004-2005\n\(c) Sebastien Marcel (marcel@idiap.ch)\n";#include "ImageRgb.h"#include "ipRotate.h"#include "DiskXFile.h"#include "CmdLine.h"using namespace Torch;int main(int argc, char **argv){	char *image_filename;	bool verbose;	real angle;	int xc;	int yc;  	  	CmdLine cmd;	cmd.setBOption("write log", false);  	cmd.info(help);  	cmd.addText("\nArguments:");  	cmd.addSCmdArg("image filename", &image_filename, "image filename");  	cmd.addText("\nOptions:");  	cmd.addBCmdOption("-verbose", &verbose, false, "verbose");  	cmd.addRCmdOption("-angle", &angle, 0.0, "ccw angle in degree");  	cmd.addICmdOption("-xc", &xc, -1, "center X of rotation (if -1 center of the image)");  	cmd.addICmdOption("-yc", &yc, -1, "center Y of rotation (if -1 center of the image)");	cmd.read(argc, argv);	Image *image_in = NULL;	Image *image_out = NULL;	image_in = new ImageRgb();	image_in->setBOption("verbose", verbose);		image_in->load(image_filename);	if(verbose)	{		print("Image info:\n");		print("   width = %d\n", image_in->width);		print("   height = %d\n", image_in->height);		print("   format = %s (%d)\n", image_in->coding, image_in->n_planes);	}	if(xc == -1) xc = FixI(image_in->width/2.0);	if(yc == -1) yc = FixI(image_in->height/2.0);	ipRotate *imachine = NULL;	imachine = new ipRotate(angle, image_in->width, image_in->height, "rgb");	imachine->setBOption("verbose", verbose);	imachine->setCenter(xc, yc);	imachine->process(image_in);		image_out = new ImageRgb();	image_out->setBOption("verbose", verbose);	image_out->copyFrom(imachine->getWidthOut(), imachine->getHeightOut(), imachine->seq_out->frames[0], "rgb");	image_out->save("rotate.ppm");		delete imachine;	delete image_out;	delete image_in;	return(0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -