Beispiel #1
0
void QCamAutoAlign::shifted(const ShiftInfo & shift) {
   if (false && currentSize_ != tracker_->cam().size()) {
      currentSize_=tracker_->cam().size();
      cout << "reset tracker: "
           <<currentSize_.width()<<"x"<<currentSize_.height()
           <<" "
           <<tracker_->cam().size().width()<<tracker_->cam().size().height()<<endl;
      reset();
   } else {
      currentShift_ = shift;
      shiftFrame(currentShift_,tracker_->cam().yuvFrame(),yuvFrame_,
                 cropValue_,center_);
#if ONE_MAP
      if (shiftMap_) shiftMap_->add(shift.shift());
#else
      if (shiftXhisto_) shiftXhisto_->setValue(shift.shift().x());
      if (shiftYhisto_) shiftYhisto_->setValue(shift.shift().y());
#endif
      importProperties(tracker_->cam());
      setProperty("shift X",shift.shift().x());
      setProperty("shift Y",shift.shift().y());
      setProperty("shift rotation",shift.angle());
      setProperty("Center X",shift.center().x());
      setProperty("Center Y",shift.center().y());

      newFrameAvaible();
   }
}
Beispiel #2
0
void tmx::Tilemap::init(pugi::xml_node map) {
    setVersion(map.attribute("version").as_string());
    setOrientation(map.attribute("orientation").as_string());
    setWidth(map.attribute("width").as_uint());
    setHeight(map.attribute("height").as_uint());
    setTileWidth(map.attribute("tilewidth").as_uint());
    setTileHeight(map.attribute("tileheight").as_uint());
    setBackgroundColor(map.attribute("backgroundcolor").as_string());
    importProperties(map, mProperties);
}