亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? image.cc

?? 一個機器人平臺
?? CC
?? 第 1 頁 / 共 2 頁
字號:
/************************************************************************* * image.cc - bitmap image class Nimage with processing functions *            originally by Neil Sumpter and others at U.Leeds, UK. * RTV * $Id: image.cc,v 1.1.4.1 2003/01/02 22:36:34 rtv Exp $ ************************************************************************/#include <math.h>#include <assert.h>#include <iostream>#include <fstream>using namespace std;#include "stage_types.hh"#include "image.hh"//#if INCLUDE_ZLIB#ifdef HAVE_LIBZ#include <zlib.h>#endif//#define DEBUGtypedef short           short_triple[3];unsigned int RGB( int r, int g, int b ){  unsigned int res;  //cout << "RGB!" << endl;  res = (((r << 8) | g) << 8) | b;  return res;}unsigned char aget_pixel(unsigned char* data, int width, int height, int x, int y){   if (x<0 || x>=width || y<0 || y>=height) return 0;  return (unsigned char)data[x+(y*width)]; }void aset_pixel(unsigned char* data, int width, int height, int x, int y, unsigned char c){  if (x<0 || x>=width || y<0 || y>=height) return;  data[(x + y*width)] = c;}// Default constructorNimage::Nimage(){    width = 0;    height = 0;    data = NULL;}// constuct by copying an existing imageNimage::Nimage(Nimage* img){#ifdef DEBUG  cout << "Image: " << width << 'x' << height << flush;#endif  width = img->get_width();  height = img->get_height();  data = new unsigned char[width*height];    this->copy_from(img); #ifdef DEBUG  cout << '@' << data << endl;#endif}// construct from width / height Nimage::Nimage(int w,int h){#ifdef DEBUG  cout << "Image: " << width << 'x' << height << flush;#endif    width = w; height = h;  data 	= new unsigned char[width*height];#ifdef DEBUG  cout << "unsigned char: " << sizeof( unsigned char ) << endl;  cout << '@' << data << endl;#endif  //cout << "constructed NImage" << endl;}// construct from width / height with existing dataNimage::Nimage(unsigned char* array, int w,int h){#ifdef DEBUG  cout << "Image: " << width << 'x' << height << flush;#endif  width 	= w;  height 	= h;  data 		= array;#ifdef DEBUG  cout << '@' << data << endl;#endif}//destructNimage::~Nimage(void) 	{	if (data) delete [] data;	data = NULL;}void Nimage::copy_from(Nimage* img){  if ((width != img->width)||(height !=img->height))    {      fprintf(stderr,"Nimage:: mismatch in size (copy_from)\n");      exit(0);    }    memcpy(data,img->data,width*height);}void Nimage::bgfill( int x, int y, unsigned char col ){  // simple recursive flood fill  if( x < 0 || x >= width ) return;  if( y < 0 || y >= height ) return;  set_pixel( x,y,col );   if( get_pixel( x,y-1 ) != col ) bgfill( x, y-1, col );  if( get_pixel( x,y+1 ) != col ) bgfill( x, y+1, col );  if( get_pixel( x+1,y ) != col ) bgfill( x+1, y, col );  if( get_pixel( x-1,y ) != col ) bgfill( x-1, y, col );} void Nimage::draw_box(int x,int y,int w,int h,unsigned char col){	int i;	for (i=0;i<w;i++)	{		data[x+i+y*width]=col;		data[x+i+(y+h)*width]=col;	}	for (i=0;i<h;i++)	{		data[x+(y+i)*width]=col;		data[x+w+(y+i)*width]=col;	}}void Nimage::save_raw(char* fname){  // this will not write files readable by load_raw!  FILE *stream = fopen( fname, "wb");  fwrite( this->get_data(), 1, width*height, stream );  fclose(stream);}void Nimage::load_raw(char* fname){  int n, m;  char p;  FILE *stream = fopen( fname, "r");  for( n=0; n<height; n++ )    for( m=0; m<width; m++ )      {	fread( &p, 1, 1, stream );	set_pixel( m,n, p );      }  fclose(stream);}// Load a pnm image.bool Nimage::load_pnm(const char* fname){  char magicNumber[10];  //char comment[512];  int whiteNum;  ifstream source( fname );  if( !source )  {    PRINT_ERR1("unable to open image file [%s]", fname);    return false;  }  source >> magicNumber;  if( strcmp(magicNumber, "P5" ) != 0 )  {    PRINT_ERR("image file is of incorrect type:"              " should be pnm, binary, monochrome (magic number P5)");    return false;   }    // ignore the end of this line  source.ignore( 1024, '\n' );    // ignore comment lines  while( source.peek() == '#' )    source.ignore( 1024, '\n' );    // get the width, height and white value    source >> width >> height >> whiteNum;  // skip to the end of the line again  source.ignore( 1024, '\n' );  unsigned int numPixels = width * height;  // make space for the pixels  if (data) delete[] data;  data = new unsigned char[ numPixels ];    source.read( (char*)data, numPixels );  // check that we read the right amount of data  assert( (unsigned int)(source.gcount()) == numPixels );  source.close();  return true;}// Load a gzipped pnm filebool Nimage::load_pnm_gz(const char* fname){//#ifndef INCLUDE_ZLIB#ifndef HAVE_LIBZ  printf("opening %s\n", fname);  printf("gzipped files not supported\n");  return false;#else      char line[1024];  char magicNumber[10];  //  char comment[256];  int whiteNum; #ifdef DEBUG  printf("opening %s\n", fname);#endif  gzFile file = gzopen(fname, "r");  if (file == NULL)  {    PRINT_ERR1("unable to open image file [%s]", fname);    return false;  }  // Extremely crude and ugly file parsing! Fix sometime.  Andrew.  // yeah - and it had a yukky bug. fixed that but it's still a crude  // parser - still the format definition for PNMs is strict, so we're  // almost certainly OK. - rtv  // (some weeks later) ok, so some programs don't insert a comment line into  // pnm files, so I'm detecting comment lines now.  // should change this to use libpnm in the near future - rtv  // Read and check the magic number  //  gzgets(file, magicNumber, sizeof(magicNumber));  if (strcmp(magicNumber, "P5\n") != 0)  {    PRINT_ERR("image file is of incorrect type:"              " should be pnm, binary, monochrome (magic number P5)");    return false;  }    //gzgets(file, comment, sizeof(comment));    do{    gzgets(file, line, sizeof(line));   } while( line[0] == '#' );        sscanf(line, "%d %d", &width, &height );  gzgets(file, line, sizeof(line));  sscanf(line, "%d", &whiteNum);  if (data)    delete[] data;  data = new unsigned char[ width * height ];    // zero the image  memset( data, 0, width * height * sizeof( data[0] ) );  for(int n=0; n<height; n++ )  {    for(int m=0; m<width; m++ )    {      unsigned char a = gzgetc(file);      if (a > 0)	set_pixel( m,n, 1 );    }  }  gzclose(file);  return true;#endif}// Load from an xfig file// Note that we need both the pixels-per-meter and the figure scale// to create an image of the correct size and scale.bool Nimage::load_fig(const char* filename, double ppm, double scale){  FILE *file = fopen(filename, "r");  if (file == NULL)  {    printf("unable to open image file\n");    return false;  }  char line[1024];  int format;  if (!fgets(line, sizeof(line), file))  {    printf("unexpected end-of-file\n");    fclose(file);    return false;  }  // Read the file format  if (strncmp(line, "#FIG 3.2", 8) == 0)    format = 32;  else  {    printf("unrecognized file format\n");    fclose(file);    return false;  }  // Read the header and discard most of it  // The <units> variable is used to handle imperial vs metric units.  // When using imperial units, xfig will use 1200 pixels/inch.  // When using metric units, xfig will use 450 pixels/cm.  // This latter figure is completely undocumented; its just a magic  // number I derived empirically.  ahoward  double units = 1200 / 0.0254;  for (int i = 0; i < 8;)  {    if (fgets(line, sizeof(line), file) == NULL)      break;    if (line[0] == '#')      continue;    if (i == 2)    {      if (strncmp(line, "Metric", 6) == 0)        units = 450 / 0.01;    }    i++;  }  // Create the figure  // We assume the whole page should be included,  // and that we are using US letter in landscape mode.  this->width = (int) (ppm * 11.5 * 0.0254 * scale);  this->height = (int) (ppm * 8.5 * 0.0254 * scale);  if (this->data)      delete[] this->data;  this->data = new unsigned char[ this->width * this->height ];  // Read the objects  while (true)  {    if (fgets(line, sizeof(line), file) == NULL)      break;    if (line[0] == '#')      continue;    int code = atoi(line);    if (code == 2)        load_fig_polyline(file, line, sizeof(line), ppm / units * scale);    else        printf("warning : unsupported object type in figure\n");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲美女在线国产| 国产成人99久久亚洲综合精品| 精品国产自在久精品国产| 日韩亚洲欧美一区二区三区| 91精品国产综合久久久久久久久久| 欧美一卡二卡在线| 亚洲欧美中日韩| 肉色丝袜一区二区| 精品一区二区三区香蕉蜜桃 | 91免费观看视频| 欧美日韩国产123区| 久久奇米777| 亚洲欧美日韩一区| 偷拍一区二区三区| 国产精品一区在线| 欧美精品 日韩| 亚洲精品成人精品456| 国产一区在线视频| 欧洲精品视频在线观看| 国产日韩欧美一区二区三区综合| 亚洲三级免费电影| 国产做a爰片久久毛片| 在线不卡免费av| 亚洲小说欧美激情另类| 丰满放荡岳乱妇91ww| 日韩一区二区三区精品视频| 1024精品合集| 国产一区二区按摩在线观看| 欧美四级电影在线观看| 韩国av一区二区三区四区| 成人免费av网站| 欧美韩日一区二区三区| 久久国产麻豆精品| 久久久久久久久久看片| 毛片av中文字幕一区二区| 91精品欧美综合在线观看最新| 亚洲一区二区三区自拍| 色婷婷综合久久久中文一区二区| 国产精品国产三级国产普通话蜜臀| 毛片av中文字幕一区二区| 欧美日韩亚洲丝袜制服| 日韩精品一二三四| 欧美电影影音先锋| 日本不卡123| wwwwww.欧美系列| 91免费版在线| 婷婷久久综合九色综合绿巨人 | 不卡高清视频专区| 亚洲国产视频一区| 亚洲欧洲无码一区二区三区| 欧美日韩一区小说| 国产成a人亚洲精品| 日日夜夜一区二区| 国产女人水真多18毛片18精品视频 | 欧美aaa在线| 亚洲视频在线观看三级| 日韩欧美一区二区三区在线| 成人精品国产免费网站| 有码一区二区三区| 久久久国产综合精品女国产盗摄| 91在线你懂得| 国产激情精品久久久第一区二区 | 蜜臀av性久久久久蜜臀aⅴ四虎| 日本一区二区动态图| 91精品黄色片免费大全| 欧美性xxxxx极品少妇| 99re这里只有精品首页| 成人av网址在线观看| 久久精品国产成人一区二区三区| 亚洲精品欧美在线| 日韩一区中文字幕| 亚洲欧洲三级电影| 欧美精品一区二区三区蜜桃| 久久久久免费观看| 欧美精品一区在线观看| 亚洲精品在线观看视频| 精品国产伦一区二区三区观看体验 | 国产综合久久久久久久久久久久| 亚洲国产日日夜夜| 精品一区二区精品| 精品一区二区av| 国产99一区视频免费 | 欧美丰满少妇xxxxx高潮对白 | 91丨porny丨在线| 日韩一卡二卡三卡| 91麻豆精品国产自产在线观看一区 | 国产麻豆成人精品| 高清beeg欧美| 色国产综合视频| 在线一区二区三区四区五区| 国产拍欧美日韩视频二区| 欧美一区二区三区影视| 久久久亚洲精品石原莉奈| 国产日韩高清在线| 亚洲一卡二卡三卡四卡| 成人小视频在线| 日本道色综合久久| 欧美丝袜丝交足nylons| 正在播放亚洲一区| 亚洲国产精品激情在线观看| 亚洲免费毛片网站| 国产在线一区二区| 在线观看亚洲精品| 久久精品日产第一区二区三区高清版| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 亚洲欧洲性图库| 国产一区二区三区四| 色狠狠色狠狠综合| 国产精品久久久久久久蜜臀| 午夜视频一区二区三区| 99久久婷婷国产| 久久久久久麻豆| 免费高清视频精品| 欧美在线免费播放| 欧美国产精品一区二区| 狂野欧美性猛交blacked| 欧美久久一二区| 蜜臀av一区二区| 日韩欧美精品在线视频| 美女网站一区二区| 日韩欧美的一区| 午夜国产精品一区| 久久伊人中文字幕| 国产在线精品视频| 综合激情成人伊人| 日韩午夜三级在线| 99视频有精品| 男人操女人的视频在线观看欧美| 久久美女高清视频| 欧美理论电影在线| 成人午夜激情视频| 美女一区二区在线观看| 亚洲精品老司机| 久久伊人蜜桃av一区二区| 欧美日韩中文国产| 成人av在线资源网站| 国产精品无遮挡| 久久午夜电影网| 日韩理论在线观看| 欧美精品一区二区三| 欧美一区二区三区在线看| 韩国av一区二区三区在线观看| 国产精品一区二区x88av| 欧美欧美午夜aⅴ在线观看| 成人精品视频一区二区三区| 国产一区二区三区| 国产69精品久久777的优势| 国产超碰在线一区| 不卡视频在线看| 在线中文字幕一区| 欧美日韩久久一区二区| 91精彩视频在线| 99久久免费视频.com| av不卡免费电影| 成人av中文字幕| 91在线观看美女| 99精品热视频| 91亚洲精品久久久蜜桃| 成人av第一页| 欧美影院午夜播放| 欧美高清视频www夜色资源网| 欧美在线啊v一区| 欧美精品99久久久**| 日韩欧美亚洲另类制服综合在线| 欧美精选午夜久久久乱码6080| 欧美日韩一区在线| 欧美一级一级性生活免费录像| 欧美一区二区日韩| 精品国产一二三| 久久国产综合精品| 久久爱另类一区二区小说| 激情深爱一区二区| www.av亚洲| 欧美日韩国产成人在线免费| 日韩午夜在线观看视频| 久久久精品天堂| 亚洲高清免费视频| 成人午夜视频在线观看| 日韩一二三区不卡| 欧美日韩免费观看一区三区| 欧美日本乱大交xxxxx| 日韩美女在线视频| 国产精品国产三级国产aⅴ入口 | 亚洲免费av在线| 热久久国产精品| 99久久免费视频.com| 日韩欧美一级精品久久| 国产精品对白交换视频| 天天做天天摸天天爽国产一区| 国产在线一区二区综合免费视频| 色综合久久中文字幕| 337p亚洲精品色噜噜狠狠| 国产精品欧美一区喷水| 日本午夜一本久久久综合| 国产999精品久久久久久绿帽| 91精品国产一区二区三区| 亚洲国产成人av好男人在线观看| 国产福利91精品一区二区三区| 91精品免费观看| 香蕉加勒比综合久久|