本文整理汇总了C++中getSignal函数的典型用法代码示例。如果您正苦于以下问题:C++ getSignal函数的具体用法?C++ getSignal怎么用?C++ getSignal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSignal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getImage
bool PyrMean::update()
{
const bool rv = Node::update();
if (!rv) return false;
cv::Mat in = getImage("in");
if (in.empty()) return true;
cv::Mat out_3;
cv::Mat in_3 = cv::Mat(in.size(), CV_8UC3, cv::Scalar(0));
// just calling reshape(4) doesn't do the channel reassignment like this does
int ch[] = {0,0, 1,1, 2,2};
cv::mixChannels(&in, 1, &in_3, 1, ch, 3 );
int max_level = getSignal("max_level");
if (max_level > 4) { max_level = 4; setSignal("max_level", max_level); }
if (max_level < 0) { max_level = 0; setSignal("max_level", max_level); }
cv::pyrMeanShiftFiltering(in_3, out_3,
getSignal("sp"), getSignal("sr"),
max_level,
cv::TermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, getSignal("term"), 5)
);
cv::Mat out = cv::Mat(out_3.size(), CV_8UC4, cv::Scalar(0));
cv::mixChannels(&out_3, 1, &out, 1, ch, 3 );
setImage("out", out);
}
开发者ID:mmluqman,项目名称:vimjay,代码行数:31,代码来源:cluster.cpp
示例2: while
void GLXPlatformContext::update()
{
XEvent xev;
while(XCheckMaskEvent(mDisplay, StructureNotifyMask, &xev))
{
switch(xev.type)
{
case ConfigureNotify:
if(xev.xconfigure.width != mWidth || xev.xconfigure.height != mHeight)
{
mWidth = xev.xconfigure.width;
mHeight = xev.xconfigure.height;
std::pair<size_t, size_t> report = std::make_pair(mWidth, mHeight);
getSignal("WindowResized")->send(report);
}
break;
case ClientMessage:
if(xev.xclient.data.l[0] == mDeleteMessage)
{
getSignal("WindowClosed")->send(xev.xclient.data.l[0]);
}
break;
}
}
}
开发者ID:67-6f-64,项目名称:OryxEngine,代码行数:31,代码来源:GLXPlatformContext.cpp
示例3: getSignal
void ScrollView::enableMouseEvents()
{
mMouseConnections += getSignal( po::scene::MouseEvent::DOWN_INSIDE ).connect( std::bind( &ScrollView::mouseDownInside, this, ::_1 ) );
mMouseConnections += getSignal( po::scene::MouseEvent::DRAG ).connect( std::bind( &ScrollView::mouseDrag, this, ::_1 ) );
mMouseConnections += getSignal( po::scene::MouseEvent::UP ).connect( std::bind( &ScrollView::mouseUp, this, ::_1 ) );
mMouseEventsEnabled = true;
}
开发者ID:Potion,项目名称:Cinder-poScene,代码行数:8,代码来源:_ScrollView.cpp
示例4: sin
template<typename T> T ofxAlgebraic_<T>::getTri()
{
float phase = sin(TWO_PI * value * frequency / pointX);
if(phase>0.0){
return getSignal(fmod(value * (frequency*-1) / pointX, 1.0f) * 4 + 1);
} else if(phase<0.0){
return getSignal(fmod(value * frequency / pointX, 1.0f) * 4 - 3.0);
}
}
开发者ID:JoshuaBatty,项目名称:ofxAlgebraic,代码行数:10,代码来源:ofxAlgebraic.cpp
示例5: getSignal
bool Bezier::update()
{
//if (!ImageNode::update()) return false;
if (!Node::update()) return false;
cv::Mat out = cv::Mat(cv::Size(Config::inst()->im_width, Config::inst()->im_height), MAT_FORMAT_C3);
out = cv::Scalar(0,0,0);
std::vector<cv::Point2f> control_points;
control_points.push_back( cv::Point2f( getSignal("x0"), getSignal("y0") ));
control_points.push_back( cv::Point2f( getSignal("x1"), getSignal("y1") ));
control_points.push_back( cv::Point2f( getSignal("x2"), getSignal("y2") ));
control_points.push_back( cv::Point2f( getSignal("x3"), getSignal("y3") ));
int num = getSignal("num");
if (num < 2) { num = 2;
setSignal("num", num);
}
std::vector<cv::Point2f> bezier_points;
getBezier(control_points, bezier_points, num);
for (int i = 1; i < bezier_points.size(); i++) {
cv::line(out, bezier_points[i-1], bezier_points[i], cv::Scalar(255, 255, 255), 2, CV_AA );
}
setImage("out", out);
return true;
}
开发者ID:SebMenozzi,项目名称:binarymillenium,代码行数:30,代码来源:generate.cpp
示例6: emit
void BlackBoardModel::setVariable(Ogre::String const &name, AgentId const &value)
{
bool isNew = mVariables.end() == mVariables.find(name);
mVariables.erase(name);
mVariables[name] = Ogre::StringConverter::toString(value);
if(isNew)
emit(getSignal(PublicSignal::newVariable));
else
emit(getSignal(PublicSignal::variableChanged));
}
开发者ID:onze,项目名称:Steel,代码行数:12,代码来源:BlackBoardModel.cpp
示例7: addChild
void MaskingSample::setup()
{
ci::app::getWindow()->getSignalKeyUp().connect(std::bind(&MaskingSample::keyUp, this, std::placeholders::_1));
// Load the mask texture
ci::gl::TextureRef maskTexture = ci::gl::Texture::create(ci::loadImage(ci::app::loadAsset("circle_mask_blurred.jpg")));
// Create the mask shape
//mMask = Shape::create(maskTexture);
mMask = Shape::createRect(100, 100);
mMask->setAlignment(Alignment::CENTER_CENTER);
mMask->setPosition(ci::app::getWindowWidth()/2, ci::app::getWindowHeight()/2);
ci::app::timeline().apply(&mMask->getRotationAnim(), 0.0f, ci::toRadians(360.0f), 1.0f).loop();
ci::app::timeline().apply(&mMask->getScaleAnim(), ci::vec2(1.0f, 1.0f), ci::vec2(4.0f, 4.0f), 1.0f).loop().pingPong();
// Load the image texture
ci::gl::TextureRef texture = ci::gl::Texture::create(ci::loadImage(ci::app::loadAsset("cat.jpg")));
// Create the image shape
mImage = Image::create(texture);
addChild(mImage);
// Set the image mask
setMask(mMask);
// Connect mouse event
getSignal(MouseEvent::MOVE).connect(std::bind(&MaskingSample::onMouseMove, this, std::placeholders::_1));
}
开发者ID:PetrosKataras,项目名称:Cinder-poScene,代码行数:28,代码来源:MaskingSample.cpp
示例8: getImage
bool Contour::update()
{
//if (!ImageNode::update()) return false;
if (!Node::update()) return false;
cv::Mat in = getImage("in");
if (in.empty()) {
VLOG(2) << name << " in is empty";
return false;
}
if (!isDirty(this, 22)) { return true;}
std::vector<std::vector<cv::Point> > contours_orig;
cv::Mat in8;
cv::cvtColor(in, in8, CV_RGB2GRAY);
cv::findContours(in8, contours_orig, hierarchy, cv::RETR_TREE, cv::CHAIN_APPROX_SIMPLE);
const float eps = getSignal("epsilon"); // max error of approx
contours0.resize(contours_orig.size());
for( size_t k = 0; k < contours_orig.size(); k++ )
//approxPolyDP(cv::Mat(contours_orig[k]), contours0[k], eps, true);
approxPolyDP((contours_orig[k]), contours0[k], eps, true);
cv::Mat out = cv::Mat(Config::inst()->getImSize(), MAT_FORMAT_C3, cv::Scalar(0,0,0,255));
cv::drawContours( out, contours0, -1, cv::Scalar(255,255,255,255));
//1, CV_AA, hierarchy, std::abs(_levels) );
setImage("out", out);
return true;
}
开发者ID:mmluqman,项目名称:vimjay,代码行数:33,代码来源:structure.cpp
示例9: getTile
int TileSource::isBlockProvidingPowerTo(int x, int y, int z, int side) {
int id = getTile(x, y, z).id;
if(id == 0) return 0;
int (*getSignal)(Tile*, TileSource*, int, int, int, int) = (int (*)(Tile*, TileSource*, int, int, int, int)) Tile::tiles[id]->vtable[VT_TILE_GETSIGNAL];
return getSignal(Tile::tiles[id], this, x, y, z, side);
}
开发者ID:byteandahalf,项目名称:PocketPower-iOS,代码行数:7,代码来源:TileSource.cpp
示例10: getImage
bool Output::update()
{
if (!ImageNode::update()) return false;
cv::Mat in = getImage("in");
if (in.empty()) return true;
if (!ximage) return true;
XWindowAttributes xwAttr;
Status ret = XGetWindowAttributes( display, win, &xwAttr );
int screen_w = xwAttr.width;
int screen_h = xwAttr.height;
setSignal("disp_w", screen_w);
setSignal("disp_h", screen_h);
// TBD is this necessary or does X do it for me if the window is resized?
cv::Size sz = cv::Size(screen_w, screen_h);
cv::Mat scaled;
cv::resize(in, scaled, sz, 0, 0, cv::INTER_NEAREST );
XDestroyImage(ximage);
ximage = XGetImage(display, DefaultRootWindow(display), 0, 0, screen_w, screen_h, AllPlanes, ZPixmap);
bm::matToXImage(scaled, ximage, win, *display, *screen);
bool window_decorations_on = getSignal("decor");
setSignal("decor", window_decorations_on);
bm::setWindowDecorations(display, win, window_decorations_on);
}
开发者ID:SebMenozzi,项目名称:binarymillenium,代码行数:31,代码来源:output.cpp
示例11: error
/**
* Message AppConfig::getMessage(QVector<QString> messageBlock)
*
* Takes a block of strings corresponding to one CAN message definition as
* input and returns a Message struct with all applicable parameters set. This
* function will throw errors if the input data is missing or malformed.
*
* @param messageBlock - The block of strings corresponding to one CAN message
* defintion
* @returns A Message struct with all applicable parameters set, or an empty
* Message struct if an error occurred.
*/
Message AppConfig::getMessage(QVector<QString> messageBlock) {
QString msgDef = messageBlock[0];
QStringList sections = msgDef.split(" ", QString::SkipEmptyParts);
if (sections.size() != 5) {
emit error("Invalid message definition.");
return Message();
}
Message msg;
bool successful = true;
msg.id = sections[1].toUInt(&successful);
if (!successful) {
emit error(QString("Invalid message ID"));
return Message();
}
msg.dlc = sections[3].toUInt(&successful);
if (!successful) {
emit error(QString("Invalid DLC for message with ID: %1").arg(QString::number(msg.id, 16)));
return Message();
}
for (int i = 1; i < messageBlock.size(); i++) {
Signal sig = getSignal(messageBlock[i]);
if (!sig.valid()) {
return Message();
}
msg.sigs.push_back(sig);
}
return msg;
}
开发者ID:bastani2,项目名称:illini-motorsports,代码行数:45,代码来源:config.cpp
示例12: getPercentCurvedSignal
int RSSIFilter::getPercentCurvedSignal()
{
float rawcurved = (getSignal() / _max_quality_signal) * (_upper_scale - _lower_scale) + _lower_scale;
if(rawcurved < 0.01) return 0;
if(rawcurved > 0.99) return 100;
return (int)((-log((1-rawcurved)/rawcurved) - _scale_min) * 100 / (_scale_max - _scale_min) + 0.5);
}
开发者ID:CodingGhost,项目名称:MinimOSD-Extra,代码行数:8,代码来源:RSSIFilter.cpp
示例13: StopMongoProgram
BSONObj StopMongoProgram( const BSONObj &a ) {
assert( a.nFields() == 1 || a.nFields() == 2 );
assert( a.firstElement().isNumber() );
int port = int( a.firstElement().number() );
killDb( port, 0, getSignal( a ) );
cout << "shell: stopped mongo program on port " << port << endl;
return undefined_;
}
开发者ID:alanw,项目名称:mongo,代码行数:8,代码来源:utils.cpp
示例14: getSignal
void OISSubsystem::_mouseButton(uint button, bool up)
{
mButtonStates[button] = up;
if(!up)
{
getSignal(String("released_")+String(mButtons[button]))->fire(
MessageAny<uint>(button));
getSignal("mouseReleased")->fire(MessageAny<uint>(button));
}
else
{
mButtonPresses[button] = true;
getSignal("mousePressed")->fire(MessageAny<uint>(button));
getSignal(String("pressed_")+String(mButtons[button]))->fire(
MessageAny<uint>(button));
}
}
开发者ID:67-6f-64,项目名称:OryxEngine,代码行数:17,代码来源:OISSubsystem.cpp
示例15: StopMongoProgramByPid
BSONObj StopMongoProgramByPid( const BSONObj &a, void* data ) {
verify( a.nFields() == 1 || a.nFields() == 2 );
uassert( 15852 , "stopMongoByPid needs a number" , a.firstElement().isNumber() );
ProcessId pid = ProcessId::fromNative(int( a.firstElement().number() ));
int code = killDb( 0, pid, getSignal( a ) );
log() << "shell: stopped mongo program on pid " << pid << endl;
return BSON( "" << (double)code );
}
开发者ID:ambroff,项目名称:mongo,代码行数:8,代码来源:shell_utils_launcher.cpp
示例16: getRangeInCm
int IRDetector::getRangeInCm()
{
int range = (int) (500.0/(getSignal()+1)); // +1 to avoid divide-by-zero errors
if( range < MAX_RANGE )
return range+1;
else
return 0;
}
开发者ID:barnoid,项目名称:shonkbot,代码行数:8,代码来源:IRDetector.cpp
示例17: Agent
AgentId AgentManager::newAgent()
{
Agent *t = new Agent(getFreeAgentId(), mLevel);
mAgents.insert(std::pair<AgentId, Agent *>(t->id(), t));
// Debug::log("new agent with id ")(t->id()).endl();
SignalManager::instance().emit(getSignal(PublicSignal::agentCreated));
return t->id();
}
开发者ID:onze,项目名称:Steel,代码行数:8,代码来源:AgentManager.cpp
示例18: StopMongoProgram
/** stopMongoProgram(port[, signal]) */
BSONObj StopMongoProgram( const BSONObj &a, void* data ) {
assert( a.nFields() == 1 || a.nFields() == 2 );
uassert( 15853 , "stopMongo needs a number" , a.firstElement().isNumber() );
int port = int( a.firstElement().number() );
int code = killDb( port, 0, getSignal( a ) );
cout << "shell: stopped mongo program on port " << port << endl;
return BSON( "" << (double)code );
}
开发者ID:dibiasio,项目名称:mongo,代码行数:9,代码来源:shell_utils.cpp
示例19: StopMongoProgramByPid
BSONObj StopMongoProgramByPid( const BSONObj &a ) {
assert( a.nFields() == 1 || a.nFields() == 2 );
assert( a.firstElement().isNumber() );
int pid = int( a.firstElement().number() );
int code = killDb( 0, pid, getSignal( a ) );
cout << "shell: stopped mongo program on pid " << pid << endl;
return BSON( "" << code );
}
开发者ID:jit,项目名称:mongo,代码行数:8,代码来源:shell_utils.cpp
示例20: StopMongoProgram
/** stopMongoProgram(port[, signal]) */
BSONObj StopMongoProgram( const BSONObj &a, void* data ) {
int nFields = a.nFields();
verify( nFields >= 1 && nFields <= 3 );
uassert( 15853 , "stopMongo needs a number" , a.firstElement().isNumber() );
int port = int( a.firstElement().number() );
int code = killDb( port, ProcessId::fromNative(0), getSignal( a ), getStopMongodOpts( a ));
log() << "shell: stopped mongo program on port " << port << endl;
return BSON( "" << (double)code );
}
开发者ID:ambroff,项目名称:mongo,代码行数:10,代码来源:shell_utils_launcher.cpp
注:本文中的getSignal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论