Exemplo n.º 1
0
void filmQT4L::getProperties(gem::Properties&props) {
  std::vector<std::string> keys=props.keys();
  gem::any value;
  double d;
  unsigned int i=0;
  for(i=0; i<keys.size(); i++) {
    std::string key=keys[i];
    props.erase(key);
    if("fps"==key) {
      d=m_fps;
      value=d; props.set(key, value);
    }
    if("frames"==key) {
      d=m_numFrames;
      value=d; props.set(key, value);
    }
    if("tracks"==key) {
      d=m_numTracks;
      value=d; props.set(key, value);
    }
    if("width"==key) {
      d=m_image.image.xsize;
      value=d; props.set(key, value);
    }
    if("height"==key) {
      d=m_image.image.ysize;
      value=d; props.set(key, value);
    }
  }
}
Exemplo n.º 2
0
 void setParameters(gem::Properties&parms) {
   unsigned int i=0;
   for(i=0; i<m_parameterNames.size(); i++) {
     std::string key=m_parameterNames[i];
     std::string s1, s2;
     double d1, d2;
     switch(m_parameter.type(key)) {
     case gem::Properties::NONE:
       if(gem::Properties::NONE==parms.type(key)) {
         parms.erase(key);
         setParameter(i);
       }
       break;
     case gem::Properties::DOUBLE:
       if(m_parameter.get(key, d1) && parms.get(key, d2)) {
         if(d1!=d2) {
           m_parameter.set(key, d2);
           setParameter(i, d2);
         }
       }
       break;
     case gem::Properties::STRING:
       if(m_parameter.get(key, s1) && parms.get(key, s2)) {
         if(s1!=s2) {
           m_parameter.set(key, s2);
           setParameter(i, s2);
         }
       }
       break;
     default: break;
     }
   }
 }
Exemplo n.º 3
0
void imageBase :: setProperties(gem::Properties&props) {
    // nada
    m_properties=props;
#if 0
    std::vector<std::string> keys=props.keys();
    int i=0;
    for(i=0; i<keys.size(); i++) {
        enum gem::Properties::PropertyType typ=props.type(keys[i]);
        std::cerr  << "key["<<keys[i]<<"]: "<<typ<<" :: ";
        switch(typ) {
        case (gem::Properties::NONE):
            props.erase(keys[i]);
            break;
        case (gem::Properties::DOUBLE):
            std::cerr << gem::any_cast<double>(props.get(keys[i]));
            break;
        case (gem::Properties::STRING):
            std::cerr << "'" << gem::any_cast<std::string>(props.get(keys[i])) << "'";
            break;
        default:
            std::cerr << "<unknown:" << props.get(keys[i]).get_type().name() << ">";
            break;
        }
    }
    std::cerr << std::endl;
#endif
}
Exemplo n.º 4
0
void videoUNICAP :: getProperties(gem::Properties&props) {
  if(!m_handle)return;
  unicap_status_t status=0;

  std::vector<std::string> keys=props.keys();

  bool getwidth=false, getheight=false;
  int i=0;
  for(i=0; i<keys.size(); i++) {
    std::string key=keys[i];
    unicap_property_t prop;
    strncpy(prop.identifier, key.c_str(), 128);

    if("width"==key) {
      getwidth=true;
      continue;
    }
    if("height"==key) {
      getheight=true;
      continue;
    }

    status= unicap_get_property(m_handle, &prop );

    if(SUCCESS(status)) {
      switch(prop.type) {
      case UNICAP_PROPERTY_TYPE_VALUE_LIST: 
      case UNICAP_PROPERTY_TYPE_FLAGS: 
      case UNICAP_PROPERTY_TYPE_RANGE: 
        props.set(key, prop.value);
        break;
      case UNICAP_PROPERTY_TYPE_MENU:
        props.set(key, std::string(prop.menu_item));
        break;
      default:
        props.erase(key);
        // ?
        break;
      }
    }
  }


  if(getwidth||getheight) {
    unicap_format_t fmt;
    status=unicap_get_format(m_handle, &fmt);
    post("getting dimen");post_fmt(&fmt);
    if(SUCCESS(status)) {
      if(getwidth )props.set("width" , fmt.size.width);
      if(getheight)props.set("height", fmt.size.height);
    }
  }


}
Exemplo n.º 5
0
void filmTEST::getProperties(gem::Properties&props) {
  std::vector<std::string> keys=props.keys();
  unsigned int i=0;
  for(i=0; i<keys.size(); i++) {
    std::string key=keys[i];
    props.erase(key);
#define SETPROP(k, v) } else if(k == key) { double d=(double)v; props.set(key, v)
    if(""==key) {
      SETPROP("fps", m_fps);
      SETPROP("frames", m_numFrames);
      SETPROP("width", m_image.image.xsize);
      SETPROP("height", m_image.image.ysize);
    }
  }
}
Exemplo n.º 6
0
  virtual void getProperties(gem::Properties&props) {
    std::vector<std::string> ids;
    if(props.type("backends")!=gem::Properties::UNSET) {
      unsigned int i;
      for(i=0; i<m_ids.size(); i++) {
        ids.push_back(m_ids[i]);
      }
    }
    props.erase("backends");

    if(m_handle)
      m_handle->getProperties(props);
    else
      props.clear();

    if(!ids.empty()) {
      props.set("backends", ids);
    }
  }