コード例 #1
0
ファイル: portraitcut.cpp プロジェクト: kobeyuan/PCM
PortraitCut::PortraitCut(int oWidth, int oHeight, vector<ImageAbs*>* images, short* required, ushort* result, FILE* fp) {

  _n = images->size();
  _wh = oWidth*oHeight;
  _w = oWidth; _h = oHeight;
  _size.x = _w; _size.y=_h;
  //_required = required;
  //_ownRequired = false;
  _idata = new ImageData(images,_w, _h);
  _labels = result;
 
  if (fp)
    _fp = fp;
  else {
    _fp = fopen("notspecified.txt","w");
  }

  mutualInit();
  //for (int i=0; i<_images.size(); ++i)
  //_images[i] = new ImageAbs(*((*images)[i]));


  //saveLabels("out.pgm");


  //int w = (*images)[0]->_size.x, h = (*images)[0]->_size.y;
  //RGBImage im = (RGBImage) imNew(IMAGE_RGB, w, h);
  //memcpy(im->data, (*images)[0]->_data,w*h*3);

  //int res = imSave(im,"test.ppm");
  //assert(res==0);
  //imFree(im);
}
コード例 #2
0
ファイル: portraitcut.cpp プロジェクト: kobeyuan/PCM
PortraitCut::PortraitCut(int oWidth, int oHeight, vector<ImageAbs*>* images, ushort* result, FILE* fp) 
  /*: wxThread(wxTHREAD_JOINABLE)*/ {
  _n = images->size();
  _wh = oWidth*oHeight;
  _w = oWidth; _h = oHeight;
  _size.x = _w; _size.y=_h;
  //_required = new short[_w*_h];
  //_ownRequired = true;
  _idata = new ImageData(images,_w, _h);
  _labels = result;
  if (fp)
    _fp = fp;
  else {
    _fp = fopen("notspecified.txt","w");
  }
  assert(_fp);

  mutualInit();

}
コード例 #3
0
ファイル: draw.C プロジェクト: doctorpangloss/Roto
Draw::Draw(ImgSequence *is, QGLWidget *parent) : 
  _is(is), _parent(parent) {
  _w = is->width();
  _h = is->height();
  _frame = is->getStart();
  _mousePressed = 0;
  _currDPath = NULL;
  _selected = NULL;
  //_selectedPatch = NULL;
  _popupPicked = NULL;
  //_popupPatchPicked = NULL;
  //_propPatch = NULL;
  preRegister = false;
  _tool = D_DRAW; 

  _dc = _is->getRelativeDrawCurves(0);
  _corrShow = 0;
  _currColor.Set(0,0,0);
  //_capturePatch = false;
  //_captureDPatch = NULL;
  //DrawPatch::_globalh = _h;
  _sens = 30.f;
  _pressure = 20.f;
  _canNum = 0;
  _spliceFlag=-1;
  _spliceIndex=-1;
  _dAlpha=1.f;
  _zoom = 1.f;
  _copyPtr=NULL;
  _copyFrame=-1;
  _dragDirty = false;
  _justPasted = false;
  _renderMode=0;
  _freeDraw = true;
  _captureColor = false;

  mutualInit();



}