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

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

?? bitmap.cc

?? 一個機器人平臺
?? CC
字號:
/////////////////////////////////////////////////////////////////////////////// File: fixedobstacle.cc// Author: Andrew Howard// Date: 29 Dec 2001// Desc: Simulates fixed obstacles//// CVS info://  $Source: /cvsroot/playerstage/code/stage/src/models/Attic/bitmap.cc,v $//  $Author: rtv $//  $Revision: 1.2.2.1 $/////////////////////////////////////////////////////////////////////////////#include <float.h>#include "image.hh"#include "world.hh"#include "bitmap.hh"#define DEBUG///////////////////////////////////////////////////////////////////////////// Default constructorCBitmap::CBitmap(LibraryItem* libit, CWorld *world, CEntity *parent)    : CEntity(libit, world, parent){  vision_return = true;  laser_return = LaserVisible;  sonar_return = true;  obstacle_return = true;  puck_return = false; // we trade velocities with pucks  idar_return = IDARReflect;  this->crop_ax = -DBL_MAX;  this->crop_ay = -DBL_MAX;  this->crop_bx = +DBL_MAX;  this->crop_by = +DBL_MAX;   this->filename = NULL;  this->scale = 1.0 / m_world->ppm;  this->image = NULL;#ifdef INCLUDE_RTK2  // We cant move fixed obstacles (yet!)  this->movemask = 0;  // TODO - add Update() method so we can move bitmaps around  //this->movemask = RTK_MOVE_TRANS | RTK_MOVE_ROT;#endif}///////////////////////////////////////////////////////////////////////////// Load the entity from the worldfilebool CBitmap::Load(CWorldFile *worldfile, int section){  PRINT_DEBUG2( "Loading from %p, %d\n", worldfile, section );  if (!CEntity::Load(worldfile, section))    return false;  // Get the name of the image file to load.  this->filename = worldfile->ReadFilename(section, "file", NULL);  if (!this->filename || strlen(this->filename) == 0)  {    PRINT_ERR("empty filename");    return false;  }  // Get the scale of the image;  // i.e. the width/length of each pixel in m.  // If no scale is specified, use the world resolution.  this->scale = worldfile->ReadLength(section, "scale", 0 );    if( this->scale != 0 )    PRINT_WARN("worldfile bitmap keyword 'scale' is deprecated,"		" please use 'resolution <meters per pixel>' instead");    // Get the scale of the image;  // i.e. the width/length of each pixel in m.  // If no scale is specified, use the world resolution.  this->scale = worldfile->ReadLength(section, "resolution", this->scale );  if (this->scale == 0)  {    this->scale = 1.0 / m_world->ppm;    PRINT_WARN2("\n\t- no resolution specified for image [%s]; using world default of %.2f",                this->filename, this->scale );  }  // Get the crop region;  // i.e. the bit of the image we are interested in  this->crop_ax = worldfile->ReadTupleLength(section, "crop", 0, -DBL_MAX);  this->crop_ay = worldfile->ReadTupleLength(section, "crop", 1, -DBL_MAX);  this->crop_bx = worldfile->ReadTupleLength(section, "crop", 2, +DBL_MAX);  this->crop_by = worldfile->ReadTupleLength(section, "crop", 3, +DBL_MAX);  // Create and load the image here (we need to know its size)  // Try to guess the file type from the extension.  assert( this->image = new Nimage );  int len = strlen(this->filename);  if (strcmp(&(this->filename[len - 4]), ".fig") == 0)  {    /* REINSTATE someday       if (!img.load_fig(this->filename, this->ppm, this->scale))       return false;    */    return false;  }   else if( strcmp( &(this->filename[ len - 7 ]), ".pnm.gz" ) == 0 )  {    if (!this->image->load_pnm_gz(this->filename))      return false;  }  else   {    if (!this->image->load_pnm(this->filename))      return false;  }  // Compute the object size based on the image  this->size_x = this->scale * this->image->width;  this->size_y = this->scale * this->image->height;  // is the pose explicitly set?  // if the pose was NOT set in the worldfile  if( (worldfile->ReadTupleLength( section, "pose", 0, DBL_MAX ) == DBL_MAX) )    {      // we shift so the global origin is at the bottom left corner of the image      this->SetGlobalPose( this->size_x/2.0, size_y/2.0, 0);          // record this position as the initial pose se we don't try to save it later      this->GetPose( init_px, init_py, init_pth );    }  // draw a border around the image  //this->image->draw_box(0,0,this->image->width-1, this->image->height-1, 255 );   // scan the image into a vector of rectangle descriptions  double sx = this->scale;  double sy = this->scale;  // Draw the image into the matrix (and GUI if compiled in)   // RTV - this box-drawing algorithm compresses hospital.world from  // 104,000+ pixels to 5,757 rectangles. it's not perfect but pretty  // darn good with bitmaps featuring lots of horizontal and vertical  // lines - such as most worlds. Also combined matrix & gui  // rendering loops.  hospital.pnm.gz now loads more than twice as  // fast and redraws waaaaaay faster. yay!    for (int y = 0; y < this->image->height; y++)    {      for (int x = 0; x < this->image->width; x++)	{	  //m_world->Ticker();	  if (this->image->get_pixel(x, y) == 0)	    continue;	  	  // a rectangle starts from this point	  int startx = x;	  int starty = this->image->height - y;	  int height = this->image->height; // assume full height for starters	  	  // grow the width - scan along the line until we hit an empty pixel	  for( ;  this->image->get_pixel( x, y ) > 0; x++ )	    {	      // handle horizontal cropping	      double ppx = x * sx; 	      if (ppx < this->crop_ax || ppx > this->crop_bx)		continue;	      	      // look down to see how large a rectangle below we can make	      int yy  = y;	      while( (this->image->get_pixel( x, yy ) > 0 ) 		     && (yy < this->image->height) )		{ 		  // handle vertical cropping		  double ppy = (this->image->height - yy) * sy;		  if (ppy < this->crop_ay || ppy > this->crop_by)		    continue;		  		  yy++; 		} 	      	      // now yy is the depth of a line of non-zero pixels	      // downward we store the smallest depth - that'll be the	      // height of the rectangle	      if( yy-y < height ) height = yy-y; // shrink the height to fit	    } 	  	  int width = x - startx;	  	  // delete the pixels we have used in this rect	  this->image->fast_fill_rect( startx, y, width, height, 0 );	  	  double px = ((startx + (width/2.0) + 0.5 ) * sx) - size_x/2.0;	  double py = ((starty - (height/2.0) - 0.5 ) * sy) - size_y/2.0;	  //double pth = 0;	  double pw = width * sx;	  double ph = height * sy;	  	  // store the rectangles for drawing into the GUI later	  bitmap_rectangle_t r;	  r.x = px;	  r.y = py;	  r.w = pw;	  r.h = ph;	  bitmap_rects.push_back( r );	  	  // create a matrix rectangle in global coordinates	  //this->LocalToGlobal( px, py, pth );	  //m_world->SetRectangle( px, py, pth, pw, ph, this, true);	}    }  return true;}bool ColorInRectangle( Nimage* image, uint8_t color, int x1, int y1, int x2, int y2 ){  // look in the rectangle for a pixel this color  for( int p=x1; p<x2; p++ )    for( int q=y1; q<y2; q++ )      if( image->get_pixel( p, q ) == color ) return true; // found one!   // we didn't find a pixel that color  return false;}#ifdef INCLUDE_RTK2void CBitmap::BuildQuadTree( uint8_t color, int x1, int y1, int x2, int y2 ){  //printf( "QT: %d  %d,%d %d,%d\n", color, x1,y1,x2,y2 );    if( ColorInRectangle( this->image, color, x1, y1, x2, y2 ) )    {      int width = x2-x1;      int height = y2-y1;      // split the rectangle along its longest axis      if( width > height )	{	  if( width <= 1 ) return;	  int xsplit = x1 + (x2-x1)/2;	  BuildQuadTree( color, x1, y1, xsplit, y2 );	  BuildQuadTree( color, xsplit, y1, x2, y2 );	  	}      else	{	  if( height <=1 ) return;	  int ysplit = y1 + (y2-y1)/2;	  BuildQuadTree( color, x1, y1, x2, ysplit );	  BuildQuadTree( color, x1, ysplit, x2, y2 );	  	  	}    }  else     // add this rect to the figure    {      double width = (double)(x2-x1) * this->scale;      double height =  (double)(y2-y1) * this->scale;      double px = (double)x1 * this->scale + width/2.0;      double py = (double)(this->image->height - y1) * this->scale - height/2.0;      //printf( "rect: %.2f,%.2f  %.2f,%.2f\n", px, py, width, height );            // create a rectangle       rtk_fig_rectangle( this->fig, px, py, 0.0, width, height, false);    }}#endif///////////////////////////////////////////////////////////////////////////// Initialise object by Copying image into matrixbool CBitmap::Startup(){  if (!CEntity::Startup())    {      PRINT_DEBUG( "CEntity::Startup() failed" );      return false;    }  if( !this->image )    {      PRINT_DEBUG( "bitmap has no image" );      //rtk_fig_clear( this->fig );      return true;    }  // draw the add the rectangles we pre-computed in Load() into the matrix  for(      std::vector<bitmap_rectangle_t>::iterator it = bitmap_rects.begin();      it != bitmap_rects.end();      it++ )      {      double th = 0;      this->LocalToGlobal( it->x, it->y, th );      m_world->SetRectangle( it->x, it->y, th, it->w, it->h, this, true);      //rtk_fig_rectangle(this->fig, it->x, it->y, 0, it->w, it->h, true );     }  return true;}///////////////////////////////////////////////////////////////////////////// Finalize objectvoid CBitmap::Shutdown(){  CEntity::Shutdown();}#ifdef INCLUDE_RTK2void CBitmap::RtkStartup(){  CEntity::RtkStartup();  // bitmaps don't need labels  //rtk_fig_clear( this->label );   rtk_fig_origin( this->fig, local_px, local_py, local_pth );  rtk_fig_color_rgb32(this->fig, this->color);    // add the figure we pre-computed in Startup() above    for(      std::vector<bitmap_rectangle_t>::iterator it = bitmap_rects.begin();      it != bitmap_rects.end();      it++ )      rtk_fig_rectangle(this->fig, it->x, it->y, 0, it->w, it->h, true ); }#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品一区二区在线播放| 日本不卡视频在线观看| 日韩欧美国产综合一区| 欧美手机在线视频| 在线播放视频一区| 欧美电视剧在线看免费| 久久久噜噜噜久久中文字幕色伊伊| 欧美成人免费网站| 中文字幕高清一区| 亚洲图片欧美视频| 国产一区二区在线看| 91一区二区三区在线观看| 日本黄色一区二区| 欧美va亚洲va| 一区二区三区中文在线| 久久99精品久久久久久国产越南| 91精品婷婷国产综合久久| 久久久99精品免费观看不卡| 亚洲美女淫视频| 国产尤物一区二区| 欧美精品粉嫩高潮一区二区| 中文字幕av资源一区| 亚洲成人av一区二区| 99精品视频一区二区三区| 久久色.com| 爽好多水快深点欧美视频| 91亚洲国产成人精品一区二三| 亚洲精品在线免费播放| 日韩1区2区3区| 欧美三级韩国三级日本三斤| 国产日韩欧美综合一区| 最新久久zyz资源站| 成人av在线一区二区三区| av资源网一区| 26uuu欧美日本| 亚洲成人综合视频| 色综合久久久久综合| 日韩区在线观看| 午夜天堂影视香蕉久久| 91女人视频在线观看| 久久一留热品黄| 韩国女主播一区二区三区| 欧美日韩的一区二区| 亚洲色大成网站www久久九九| 国产在线麻豆精品观看| 91精品国产入口| 午夜日韩在线电影| 欧美精品tushy高清| 日韩伦理av电影| 91麻豆国产精品久久| ...av二区三区久久精品| av一本久道久久综合久久鬼色| 久久九九国产精品| 韩国视频一区二区| 欧美成人一区二区| 成人永久免费视频| 亚洲免费观看高清在线观看| 欧美在线一区二区| 免费成人小视频| 中文字幕精品综合| 欧美人狂配大交3d怪物一区| 国产亚洲综合性久久久影院| 成人精品小蝌蚪| 一区二区三区日韩欧美| 欧美丝袜第三区| 国产一本一道久久香蕉| 亚洲视频资源在线| 在线影院国内精品| 972aa.com艺术欧美| 午夜精品成人在线视频| 久久色在线视频| 欧美日韩专区在线| 国产精品羞羞答答xxdd| 中文字幕一区二区视频| 欧美一区二区三区在线| www.成人在线| 天天亚洲美女在线视频| 亚洲同性gay激情无套| 制服视频三区第一页精品| 欧美三级日韩在线| 色综合天天综合给合国产| 成人免费观看视频| 日韩精品每日更新| 国产精品美女久久福利网站| 日韩欧美成人一区| 欧美制服丝袜第一页| 99久久亚洲一区二区三区青草| 黄色小说综合网站| 久久国产尿小便嘘嘘| 日av在线不卡| 理论电影国产精品| 色综合天天性综合| 91猫先生在线| 色狠狠色狠狠综合| 成人高清免费观看| av成人免费在线| 99精品热视频| 在线免费观看日本一区| 欧美日韩高清一区二区三区| 欧美日韩免费电影| 7799精品视频| 久久久久久亚洲综合影院红桃| 国产欧美精品一区二区色综合| 国产欧美va欧美不卡在线| 国产精品久久久久久久久免费相片| 国产欧美日产一区| 亚洲精品国产一区二区精华液 | 久久影音资源网| 88在线观看91蜜桃国自产| 精品久久国产老人久久综合| 欧美久久久久久久久中文字幕| 欧美精选在线播放| 中文字幕欧美日本乱码一线二线| 国产一区91精品张津瑜| 在线免费观看不卡av| 久久久精品免费网站| 欧美mv和日韩mv国产网站| 国产日韩精品视频一区| 亚洲欧美日韩国产成人精品影院| 日韩综合小视频| 国产xxx精品视频大全| 欧美日韩国产综合一区二区| 亚洲一区二区3| 国产成人免费在线视频| 777奇米成人网| 国产精品久久国产精麻豆99网站| 男女视频一区二区| 欧美性感一类影片在线播放| 中文字幕欧美区| 国产成人精品三级麻豆| 日韩欧美一区二区在线视频| 美女视频一区在线观看| 在线免费观看视频一区| 欧美高清在线精品一区| 国内精品第一页| 日韩一区二区三区免费看| 亚洲电影在线播放| 一本一道久久a久久精品| 综合在线观看色| 色综合久久精品| 欧美国产日韩一二三区| 激情综合网av| 日韩视频123| 91亚洲男人天堂| 亚洲黄色性网站| 91精品国产综合久久婷婷香蕉| 亚洲午夜视频在线| 精品日韩99亚洲| 成人动漫精品一区二区| 亚洲欧美另类久久久精品2019| 97se亚洲国产综合自在线不卡| 亚洲国产一区在线观看| 91精品国产综合久久小美女 | 欧美吞精做爰啪啪高潮| 亚洲福利一二三区| 久久久国际精品| 91在线观看污| 麻豆极品一区二区三区| **性色生活片久久毛片| 日韩一二三区视频| 91日韩精品一区| 国产精品一区免费视频| 日本欧美久久久久免费播放网| 国产精品天干天干在线综合| 欧美三级电影精品| 成人av电影免费在线播放| 亚洲成人资源网| 欧美国产亚洲另类动漫| 欧美大片顶级少妇| 欧美日韩一区二区三区四区五区| 高清成人免费视频| 蜜桃精品在线观看| 五月天视频一区| 一区二区日韩av| 三级欧美韩日大片在线看| 国产精品九色蝌蚪自拍| 久久美女艺术照精彩视频福利播放| 中文字幕va一区二区三区| 精品乱人伦小说| 国产日韩欧美综合一区| 亚洲丝袜精品丝袜在线| 亚洲黄色av一区| 日韩黄色小视频| 国产毛片一区二区| voyeur盗摄精品| 91黄色免费看| 久久色在线观看| 国产精品久久久久久久第一福利 | 亚洲免费观看高清完整版在线 | 欧美色综合久久| 正在播放亚洲一区| 久久久国产综合精品女国产盗摄| 国产精品成人网| 日韩国产精品久久| 国产jizzjizz一区二区| 欧美日韩亚洲不卡| 国产欧美一区二区精品忘忧草| 一区二区三区资源| 国产一区二区美女诱惑| 6080yy午夜一二三区久久|