本文整理汇总了C++中gem::Properties类的典型用法代码示例。如果您正苦于以下问题:C++ Properties类的具体用法?C++ Properties怎么用?C++ Properties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Properties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enumProperties
bool imageBase :: enumProperties(gem::Properties&readable,
gem::Properties&writeable)
{
readable.clear();
writeable.clear();
return false;
}
示例2: setProperties
void videoVLC::setProperties(gem::Properties&props)
{
int width=-1;
int height=-1;
m_props=props;
double d;
if(props.get("width", d)) {
if(d>0) {
width = d;
}
}
if(props.get("height", d)) {
if(d>0) {
height=d;
}
}
if(!m_mediaplayer) {
if(width>0) {
m_pixBlock.image.xsize=width;
}
if(height>0) {
m_pixBlock.image.ysize=height;
}
} else {
// changes will take effect with next restart
}
}
示例3: addProperties
static void addProperties(gem::Properties&props, int argc, t_atom*argv)
{
if(!argc)return;
if(argv->a_type != A_SYMBOL) {
::error("no key given...");
return;
}
std::string key=std::string(atom_getsymbol(argv)->s_name);
std::vector<gem::any> values;
argc--; argv++;
while(argc-->0) {
values.push_back(atom2any(argv++));
}
switch(values.size()) {
default:
props.set(key, values);
break;
case 1:
props.set(key, values[0]);
break;
case 0:
{
gem::any dummy;
props.set(key, dummy);
}
break;
}
}
示例4: enumProperties
bool videoUNICAP :: enumProperties(gem::Properties&readable,
gem::Properties&writeable) {
readable.clear();
writeable.clear();
if(m_handle) {
int count=0;
unicap_status_t status= unicap_reenumerate_properties(m_handle, &count );
if(!SUCCESS(status))
return false;
int id=0;
for(id=0; id<count; id++) {
unicap_property_t prop;
gem::any typ;
status = unicap_enumerate_properties(m_handle, NULL, &prop, id);
if(!SUCCESS(status))
continue;
debugPost("id='%s'\tcat='%s'\tunit='%s'\tflags=%d",
prop.identifier,
prop.category,
prop.unit,
prop.flags);
switch(prop.type) {
case UNICAP_PROPERTY_TYPE_RANGE:
debugPost("range %f-%f", prop.range.min, prop.range.min);
typ=prop.range.max;
break;
case UNICAP_PROPERTY_TYPE_VALUE_LIST:
debugPost("value_list %d", prop.value_list.value_count);
typ=prop.value_list.value_count;
break;
case UNICAP_PROPERTY_TYPE_MENU:
debugPost("menu '%s' of %d", prop.menu_item, prop.menu.menu_item_count);
typ=std::string(prop.menu_item);//prop.menu.menu_item_count;
break;
case UNICAP_PROPERTY_TYPE_FLAGS:
debugPost("flags");
break;
default:
debugPost("unknown");
// ?
break;
}
readable.set(prop.identifier, typ);
if(!(prop.flags & UNICAP_FLAGS_READ_ONLY))
writeable.set(prop.identifier, typ);
#warning check UNICAP_FLAGS_ON_OFF & UNICAP_FLAGS_ONE_PUSH
}
}
return true;
}
示例5: getProperties
void imageBase :: getProperties(gem::Properties&props) {
// nada
std::vector<std::string>keys=props.keys();
unsigned int i=0;
for(i=0; i<keys.size(); i++) {
gem::any unset;
props.set(keys[i], unset);
}
}
示例6: setParameters
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;
}
}
}
示例7: getWriteCapabilities
void imageMAGICK::getWriteCapabilities(std::vector<std::string>&mimetypes, gem::Properties&props) {
mimetypes.clear();
props.clear();
mimetypes = m_mimetypes;
gem::any value;
value=100.f;
props.set("quality", value);
}
示例8: getWriteCapabilities
void imageJPEG::getWriteCapabilities(std::vector<std::string>&mimetypes, gem::Properties&props) {
mimetypes.clear();
props.clear();
mimetypes.push_back("image/jpeg");
mimetypes.push_back("image/pjpeg");
gem::any value;
value=100.f;
props.set("quality", value);
}
示例9: enumProperties
bool videoVFW :: enumProperties(gem::Properties&readable, gem::Properties&writeable) {
readable.clear();
writeable.clear();
gem::any type=0;
writeable.set("width", type);
writeable.set("height", type);
return true;
}
示例10: getProperties
void videoDECKLINK::getProperties(gem::Properties&props)
{
std::vector<std::string>keys=props.keys();
unsigned int i;
for(i=0; i<keys.size(); i++) {
if("width"==keys[i]) {
props.set(keys[i], m_pixBlock.image.xsize);
}
if("height"==keys[i]) {
props.set(keys[i], m_pixBlock.image.ysize);
}
}
}
示例11: setProperties
void modelASSIMP3 :: setProperties(gem::Properties&props) {
double d;
#if 0
std::vector<std::string>keys=props.keys();
unsigned int i;
for(i=0; i<keys.size(); i++) {
post("key[%d]=%s ... %d", i, keys[i].c_str(), props.type(keys[i]));
}
#endif
std::string s;
if(props.get("textype", s)) {
// if there are NO texcoords, we only accept 'linear' and 'spheremap'
// else, we also allow 'UV'
// not-accepted textype, simply use the last one
if(m_have_texcoords && "UV" == s)
m_textype = "";
else
if(("linear" == s) || ("spheremap" == s))
m_textype = s;
m_rebuild = true;
}
if(props.get("rescale", d)) {
bool b=(bool)d;
if(b) {
float tmp;
tmp = m_max.x-m_min.x;
tmp = aisgl_max(m_max.y - m_min.y,tmp);
tmp = aisgl_max(m_max.z - m_min.z,tmp);
m_scale = 2.f / tmp;
m_offset.x=-m_center.x;
m_offset.y=-m_center.y;
m_offset.z=-m_center.z;
} else {
// FIXXME shouldn't this be the default???
m_scale=1.;
m_offset.x=m_offset.y=m_offset.z=0.f;
}
}
if(props.get("usematerials", d)) {
bool useMaterial=d;
if(useMaterial!=m_useMaterial)
m_rebuild=true;
m_useMaterial=useMaterial;
}
render();
}
示例12: getWriteCapabilities
void imageQT::getWriteCapabilities(std::vector<std::string>&mimetypes, gem::Properties&props) {
mimetypes.clear();
props.clear();
std::map<std::string, OSType>::iterator it;
for(it = s_mime2type.begin(); it!=s_mime2type.end(); ++it) {
mimetypes.push_back(it->first);
}
gem::any value;
value=100.f;
props.set("quality", value);
}
示例13: estimateSave
float imageTIFF::estimateSave(const imageStruct&img, const std::string&filename, const std::string&mimetype, const gem::Properties&props) {
float result=0;
if(mimetype == "image/tiff" || mimetype == "image/x-tiff")
result += 100;
if(gem::Properties::UNSET != props.type("xresolution"))result+=1.;
if(gem::Properties::UNSET != props.type("yresolution"))result+=1.;
if(gem::Properties::UNSET != props.type("resolutionunit"))result+=1.;
if(gem::Properties::UNSET != props.type("software"))result+=1.;
if(gem::Properties::UNSET != props.type("artist"))result+=1.;
if(gem::Properties::UNSET != props.type("hostcomputer"))result+=1.;
return result;
}
示例14: getProperties
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);
}
}
}
示例15: enumProperties
virtual bool enumProperties(gem::Properties&readable,
gem::Properties&writeable) {
// LATER: shouldn't we merge properties of all handles?
#ifdef __GNUC__
# warning enumProperties stub
#endif
readable.clear();
writeable.clear();
if(m_handle)
return m_handle->enumProperties(readable, writeable);
return false;
}