本文整理汇总了C++中setImage函数的典型用法代码示例。如果您正苦于以下问题:C++ setImage函数的具体用法?C++ setImage怎么用?C++ setImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setImage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setImage
void TSpriteIcon::draw(gcn::Graphics *graphics){
if( (sprite_ != NULL) && (!frames_.empty()) ){
setImage( frames_.at(sprite_->getFrameProgression()) );
}
gcn::Icon::draw(graphics);
}
开发者ID:hoodwolf,项目名称:Infraelly,代码行数:6,代码来源:TSpriteIcon.cpp
示例2: caRowColMenu
caRelatedDisplay::caRelatedDisplay(QWidget *parent) : caRowColMenu(parent)
{
setImage("fileopen.png");
setStacking(Row);
replacemodes << "false" << "false" << "false" << "false" << "false" << "false" << "false" << "false" << "false" << "false"<< "false" << "false" << "false" << "false" << "false" << "false";
}
开发者ID:SLAC-Advanced-Control-Systems,项目名称:caqtdm,代码行数:6,代码来源:carelateddisplay.cpp
示例3: setFileName
bool NAMFFmpegImageStream::open(const std::string & filename)
{
setFileName(filename);
if (! m_decoder->open(filename))
return false;
//setImage(
// m_decoder->video_decoder().width(), m_decoder->video_decoder().height(), 1, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE,
// const_cast<unsigned char *>(m_decoder->video_decoder().image()), NO_DELETE
//);
// OpenCV Image creation
//cvNamedWindow( "Test", 0 );
//cvResizeWindow("Test", m_decoder->video_decoder().width(), m_decoder->video_decoder().height());
// According to previous line the number of channels is 4: RGBA
_nbChannels = 4;
_opencvImage = cvCreateImage(cvSize(m_decoder->video_decoder().width(), m_decoder->video_decoder().height()), IPL_DEPTH_8U, _nbChannels);
//TEST
createIplImageFromGLimage(const_cast<unsigned char *>(m_decoder->video_decoder().image()));
process(_opencvImage);
//OpenCV_to_OSG(_opencvImage,this);
setImage(
m_decoder->video_decoder().width(), m_decoder->video_decoder().height(), 1, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE,
(unsigned char*)(_opencvImage->imageData), NO_DELETE
);
/*setImage(
m_decoder->video_decoder().width(), m_decoder->video_decoder().height(), 1, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE,
//(unsigned char*)(_opencvImage->imageData), NO_DELETE
_movieImage->data(),NO_DELETE
);*/
// END TEST
setPixelAspectRatio(m_decoder->video_decoder().pixelAspectRatio());
OSG_NOTICE<<"ffmpeg::open("<<filename<<") size("<<s()<<", "<<t()<<") aspect ratio "<<m_decoder->video_decoder().pixelAspectRatio()<<std::endl;
#if 1
// swscale is reported errors and then crashing when rescaling video of size less than 10 by 10.
if (s()<=10 || t()<=10) return false;
#endif
m_decoder->video_decoder().setUserData(this);
m_decoder->video_decoder().setPublishCallback(publishNewFrame);
/*if (m_decoder->audio_decoder().validContext())
{
OSG_NOTICE<<"Attaching FFmpegAudioStream"<<std::endl;
getAudioStreams().push_back(new osgFFmpeg::FFmpegAudioStream(m_decoder.get()));
}*/
_status = PAUSED;
applyLoopingMode();
start(); // start thread
return true;
}
开发者ID:SPhoenixx,项目名称:NAM,代码行数:66,代码来源:NAM-FFmpegImageStream.cpp
示例4: CacheReadResponder
CacheReadResponder(const LLUUID& id, LLImageFormatted* image)
: mFormattedImage(image), mID(id)
{
setImage(image);
}
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:5,代码来源:llviewerobjectbackup.cpp
示例5: setImage
void Sprite::applyImage(std::string theImage)
{
setImage(anImage);
}
开发者ID:asian182,项目名称:Daniel,代码行数:5,代码来源:Sprite.cpp
示例6: setImage
void ImageNode::setImage(float height, const Image& image, const Rect& imageRegion) noexcept
{
setImage(image, imageRegion);
setHeight(height);
}
开发者ID:GValiente,项目名称:torrijas,代码行数:5,代码来源:trjimagenode.cpp
示例7: QGraphicsWidget
UpcomingEventsWidget::UpcomingEventsWidget( const LastFmEventPtr &event,
QGraphicsItem *parent,
Qt::WindowFlags wFlags )
: QGraphicsWidget( parent, wFlags )
, m_mapButton( 0 )
, m_urlButton( 0 )
, m_image( new QLabel )
, m_event( event )
{
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );
m_image->setText( i18n("Loading picture...") );
m_image->setAttribute( Qt::WA_NoSystemBackground );
m_image->setAlignment( Qt::AlignCenter );
m_image->setFixedSize( 128, 128 );
QGraphicsProxyWidget *imageProxy = new QGraphicsProxyWidget( this );
imageProxy->setWidget( m_image );
m_attendance = createLabel();
m_date = createLabel();
m_location = createLabel();
m_name = createLabel();
m_participants = createLabel();
m_tags = createLabel();
m_venue = createLabel();
QGraphicsLinearLayout *buttonsLayout = new QGraphicsLinearLayout( Qt::Horizontal );
buttonsLayout->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed );
if( event && event->venue() && event->venue()->location )
{
QPointF geo( event->venue()->location->longitude, event->venue()->location->latitude );
if( !geo.isNull() )
{
m_mapButton = new Plasma::PushButton( this );
m_mapButton->setMaximumSize( QSizeF( 22, 22 ) );
m_mapButton->setIcon( KIcon("edit-find") ); // TODO: a map icon would be nice
m_mapButton->setToolTip( i18n( "View map" ) );
buttonsLayout->addItem( m_mapButton );
}
}
if( event && event->url().isValid() )
{
m_urlButton = new Plasma::PushButton( this );
m_urlButton->setMaximumSize( QSizeF( 22, 22 ) );
m_urlButton->setIcon( KIcon("applications-internet") );
m_urlButton->setToolTip( i18n( "Open Last.fm webpage for this event" ) );
connect( m_urlButton, SIGNAL(clicked()), this, SLOT(openUrl()) );
buttonsLayout->addItem( m_urlButton );
}
QSizePolicy::Policy minPol = QSizePolicy::Minimum;
QGraphicsWidget *supportLabel, *venueLabel, *locationLabel, *dateLabel, *attendLabel, *tagsLabel;
supportLabel = createLabel( i18nc("@label:textbox Supporing acts for an event", "Supporting:"), minPol );
venueLabel = createLabel( i18nc("@label:textbox", "Venue:"), minPol );
locationLabel = createLabel( i18nc("@label:textbox", "Location:"), minPol );
dateLabel = createLabel( i18nc("@label:textbox", "Date:"), minPol );
attendLabel = createLabel( i18nc("@label:textbox", "Attending:"), minPol );
tagsLabel = createLabel( i18nc("@label:textbox", "Tags:"), minPol );
QGraphicsGridLayout *infoLayout = new QGraphicsGridLayout;
infoLayout->addItem( supportLabel, 0, 0 );
infoLayout->addItem( venueLabel, 1, 0 );
infoLayout->addItem( locationLabel, 2, 0 );
infoLayout->addItem( dateLabel, 3, 0 );
infoLayout->addItem( attendLabel, 4, 0 );
infoLayout->addItem( tagsLabel, 5, 0 );
infoLayout->addItem( m_participants, 0, 1 );
infoLayout->addItem( m_venue, 1, 1 );
infoLayout->addItem( m_location, 2, 1 );
infoLayout->addItem( m_date, 3, 1 );
infoLayout->addItem( m_attendance, 4, 1 );
infoLayout->addItem( m_tags, 5, 1 );
QGraphicsGridLayout *layout = new QGraphicsGridLayout;
layout->addItem( imageProxy, 0, 0, 2, 1, Qt::AlignCenter );
layout->addItem( m_name, 0, 1 );
layout->addItem( buttonsLayout, 0, 2, Qt::AlignRight );
layout->addItem( infoLayout, 1, 1, 1, 2 );
setLayout( layout );
QString name = event->name();
if( event->isCancelled() )
name = i18nc( "@label:textbox Title for a canceled upcoming event", "<s>%1</s> (Canceled)", name );
setName( name );
setDate( event->date() );
setLocation( event->venue()->location );
setVenue( event->venue() );
setAttendance( event->attendance() );
setParticipants( event->participants() );
setTags( event->tags() );
setImage( event->imageUrl(LastFmEvent::Large) );
}
开发者ID:ErrAza,项目名称:amarok,代码行数:93,代码来源:UpcomingEventsWidget.cpp
示例8: setImage
void QImageItem::resetImage()
{
setImage(QImage());
}
开发者ID:derjasper,项目名称:ScannerApp,代码行数:4,代码来源:qimageitem.cpp
示例9: switch
void NovelLayer::playNext() {
// 次のアクションセット取得
auto actions = this->_player->popNextActions();
if (actions->empty() || actions == NULL) {
// アクションが無いのでシーン終了
this->endScene();
} else {
int rootActionIdx = this->beginAction();
// 取得したアクションを実行する
for (auto action : *actions) {
switch (action->getType()) {
case NovelAction::Type::Set:
setImage(action);
break;
case NovelAction::Type::Name:
setNameImage(action);
break;
case NovelAction::Type::Speak:
case NovelAction::Type::Narration:
this->updateSpeechBalloon(action);
break;
case NovelAction::Type::Delay:
this->playDelay(action);
break;
case NovelAction::Type::Shake:
break;
case NovelAction::Type::Wait:
this->playWait();
break;
case NovelAction::Type::Clear:
this->clearBalloons();
break;
case NovelAction::Type::ShowImage:
this->showItem(action, true);
break;
case NovelAction::Type::ShowImageInstant:
this->showItem(action, false);
break;
case NovelAction::Type::HideImage:
this->hideItem(true);
break;
case NovelAction::Type::HideImageInstant:
this->hideItem(false);
break;
case NovelAction::Type::Music:
if (action->getValue() == "fadeout") {
SoundManager::getInstance()->fadeOutBgm(1.0f);
} else {
SoundManager::getInstance()->playBgm(action->getValue());
}
break;
case NovelAction::Type::Effect:
SoundManager::getInstance()->playEffect(action->getValue());
break;
default:
break;
}
}
this->completeAction(rootActionIdx);
}
}
开发者ID:ken4500,项目名称:zoo,代码行数:61,代码来源:NovelLayer.cpp
示例10: setImage
Heightmap::Heightmap(string path)
{
setImage(path);
setTriangleSize(4.0, 40.0, 4.0);
}
开发者ID:SimonRhys,项目名称:Heightmap,代码行数:5,代码来源:Heightmap.cpp
示例11: setImage
void ImageLoader::elementWillMoveToNewOwnerDocument()
{
setImage(0);
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:4,代码来源:ImageLoader.cpp
示例12: FWARNING
void FileGrabForeground::draw(DrawActionBase *action, Viewport *port)
{
if(getActive() == false)
return;
if(getName().empty())
{
FWARNING(("FileGrabForeground::draw: no name ?!?\n"));
return;
}
Image::PixelFormat pixelFormat = (Image::PixelFormat)getPixelFormat();
pixelFormat = (pixelFormat == 0) ? Image::OSG_RGB_PF : pixelFormat;
// do we have an image yet? If not, create one.
if(getImage() == NullFC)
{
beginEditCP(this->getPtr(), FileGrabForeground::ImageFieldMask);
{
ImagePtr iPtr = Image::create();
iPtr->set(pixelFormat, 1);
setImage(iPtr);
}
endEditCP (this->getPtr(), FileGrabForeground::ImageFieldMask);
}
else if(getImage()->getPixelFormat() != pixelFormat)
{
ImagePtr iPtr = getImage();
beginEditCP(iPtr, Image::PixelFormatFieldMask);
{
iPtr->reformat(pixelFormat);
}
endEditCP (iPtr, Image::PixelFormatFieldMask);
}
// read pixels
Inherited::draw(action,port);
Char8 *name = new Char8 [ getName().size() + 32 ]; // this is really
// arbitrary... :(
sprintf(name, getName().c_str(), getFrame());
ImagePtr i = getImage();
i->write(name);
delete [] name;
if(getIncrement() != false)
{
beginEditCP(this->getPtr(), FileGrabForeground::FrameFieldMask);
{
setFrame(getFrame() + 1);
}
endEditCP (this->getPtr(), FileGrabForeground::FrameFieldMask);
}
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:61,代码来源:OSGFileGrabForeground.cpp
示例13: setImage
void OSCollapsibleItemHeader::setExpanded(bool expanded)
{
m_expanded = expanded;
setImage(m_expanded);
}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:5,代码来源:OSCollapsibleItemHeader.cpp
示例14: setImage
KisImagePyramid::~KisImagePyramid()
{
setImage(0);
}
开发者ID:KDE,项目名称:calligra-history,代码行数:4,代码来源:kis_image_pyramid.cpp
示例15: resetHistory
void CMyPaintDoc::clear() {
resetHistory();
setImage(NULL);
setFileImage();
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:5,代码来源:MyPaintDoc.cpp
示例16: setImage
void ImageLoader::elementDidMoveToNewDocument()
{
setImage(0);
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:4,代码来源:ImageLoader.cpp
示例17: setImage
void
Sheep::directionChanged(Direction newDir)
{
setImage(imageCache[(int)newDir]);
}
开发者ID:mvanderkolff,项目名称:navi-misc,代码行数:5,代码来源:Sheep.cpp
示例18: printNewStatsPageTwo
void STDCALL printNewStatsPageTwo(int currentPage)
{
if (!D2isLODGame()) return D2PrintStatsPage();
WCHAR text[BUFSIZE];
LPWSTR lpText;
bDontPrintBorder = false;
Unit* ptChar = D2GetClientPlayer();
d2_assert(!ptChar, "Printing stats page : no character selected",__FILE__,__LINE__);
d2_assert(ptChar->nUnitType != UNIT_PLAYER, "Printing stats page : bad unit type",__FILE__,__LINE__);
//Init data for print image
sDrawImageInfo data;
ZeroMemory(&data,sizeof(data));
//print background
fillRect(RX(0),RY(480),320,432,0,5);//552
setImage(&data, newStatsInterfaceImages);
setFrame(&data, 0);
D2PrintImage(&data, RX(0), RY(224), -1, 5, 0);
setFrame(&data, 1);
D2PrintImage(&data, RX(256),RY(224), -1, 5, 0);//256
setFrame(&data, 2);
D2PrintImage(&data, RX(0), RY(48), -1, 5, 0);//432
setFrame(&data, 3);
D2PrintImage(&data, RX(256),RY(48), -1, 5, 0);
D2SetFont(1);
for (int i=0; i<nbStatsInterface; i++)
manageStatLine(ptChar, &statsInterface[i], currentPage, text);
/*
// DWORD x,y;
// DWORD curValue;
// CharStatsBIN* charStats = D2GetCharStatsBIN(ptChar->nPlayerClass);
// DifficultyLevelsBIN* difficultyLevels = D2GetDifficultyLevelsBIN (D2GetDifficultyLevel());
//print deadly Strike / Critical Strike
x=RX(25);
y=RY(445);
Unit* ptItem = D2GetSkillItem(ptChar);
DWORD cs = ptItem ? D2GetCriticalStrikeFromMasteries(ptChar,ptItem,0,2) : 0;
cs = cs>100?100:cs;
cs += D2GetPlayerStat(ptChar, STATS_PASSIVE_CRITICAL_STRIKE, 0)*(100-cs)/100;
cs = cs>100?100:cs;
//SkillDescBIN* skilldesc = SgptDataTables->skilldesc + 9;
LPWSTR lpCS = D2GetStringFromIndex(skilldesc->strNameID);
lpText = D2GetStringFromIndex(getDescStrPos(STATS_ITEM_DEADLYSTRIKE));
curValue = D2GetPlayerStat(ptChar, STATS_ITEM_DEADLYSTRIKE, 0);
cs += curValue*(100-cs)/100;
curValue = cs>100?100:cs;
swprintf(text,L"%i%% %s/%s",curValue,lpCS,lpText);
D2SetFont(1);
D2SetFont( D2GetPixelLen(text)>0x110 ? 6 : 1);
D2PrintString(text, x, y, WHITE, 0);
*/
//print background previous/next page buttons
setImage(&data, statsBackgroundImages);
setFrame(&data, D2GetResolution()?1:0);
D2PrintImage(&data, getXPreviousPageBtn()-7, getYPreviousPageBtn()+8, -1, 5, 0);
//print button close
setImage(&data, D2LoadBuySelBtn());
setFrame(&data, 10 + isDownBtn.close);
D2PrintImage(&data, getXCloseBtn(), getYCloseBtn(), -1, 5, 0);
//print previous page button
setFrame(&data, 12 + isDownBtn.previousPage);
D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
//print next page button
setFrame(&data, 14 + isDownBtn.nextPage);
D2PrintImage(&data, getXNextPageBtn(), getYNextPageBtn(), -1, 5, 0);
//////////////////// POPUP PRINTING ////////////////////
//set MouseX & MouseY
DWORD mx = D2GetMouseX();
DWORD my = D2GetMouseY();
D2SetFont(1);
if (isOnCloseBtn(mx,my)) // print popup "close"
{
D2PrintPopup(D2GetStringFromIndex(0x1030), getXCloseBtn()+getLCloseBtn()/2, getYCloseBtn()-getHCloseBtn(), WHITE, 1);
}
else if (isOnPreviousPageBtn(mx,my)) //print popup "previous page"
{
lpText = getLocalString(STR_PREVIOUS_PAGE);
D2PrintPopup(lpText, getXPreviousPageBtn()+getLPreviousPageBtn()/2, getYPreviousPageBtn()-getHPreviousPageBtn(), WHITE, 1);
}
else if (isOnNextPageBtn(mx,my)) //print popup "next page"
{
lpText = getLocalString(STR_NEXT_PAGE);
D2PrintPopup(lpText, getXNextPageBtn()+getLNextPageBtn()/2, getYNextPageBtn()-getHNextPageBtn(), WHITE, 1);
//.........这里部分代码省略.........
开发者ID:ChaosMarc,项目名称:PlugY,代码行数:101,代码来源:NewInterface_StatsPageTwo.cpp
示例19: setImage
void BonusBall::setType(BonusType bt)
{
bonusType_ = bt;
setImage(findFileName(bt));
}
开发者ID:zlv,项目名称:Rong,代码行数:5,代码来源:bonusball.cpp
示例20: getImage
//.........这里部分代码省略.........
int x2 = x;
int y2 = y;
if (wrap) {
float dx = cc.x - x2;
float dy = cc.y - y2;
if (dx + wd < -dx) x2 -= wd;
else if ( -(dx - wd) < dx) x2 += wd;
if (dy + ht < - y2) y2 -= ht;
else if ( -(dy - ht) < dy) y2 += ht;
}
// There might be an inevitable amount of oscillation in wrap mode where
// points that might be within range in multiple directions
// will flip-flop between them.
// could try to smooth motion of colors and centers
const float span_x = (cc.max_x - cc.min_x)*(upper)+10;
const float span_y = (cc.max_y - cc.min_y)*upper;
const int mid_x = (cc.max_x + cc.min_x)/2;
const int mid_y = (cc.max_y + cc.min_y)/2;
if ((x2 < mid_x + span_x/2) && (x2 > mid_x - span_x/2) &&
(y2 < mid_y + span_y/2) && (y2 > mid_y - span_y/2)) {
const float kdist = find_dist(
src2.val[0], src2.val[1], src2.val[2], x2, y2,
cc.rgb.val[0], cc.rgb.val[1], cc.rgb.val[2], cc.x, cc.y,
max_space_dist, dist_weight,
use_manhat);
//in.cols, in.rows);
//,
//wrap); //, inst->color_weight);
// store the closest match
if (kdist < dist) {
dist = kdist;
dist_ind = k;
}
}
} // clusters
// update min maxes
if (x > nc[dist_ind].max_x) nc[dist_ind].max_x = x;
if (x < nc[dist_ind].min_x) nc[dist_ind].min_x = x;
if (y > nc[dist_ind].max_y) nc[dist_ind].max_y = y;
if (y < nc[dist_ind].min_y) nc[dist_ind].min_y = y;
nc[dist_ind].aggr_x += x;
nc[dist_ind].aggr_y += y;
nc[dist_ind].aggr_r += src2.val[0];
nc[dist_ind].aggr_g += src2.val[1];
nc[dist_ind].aggr_b += src2.val[2];
nc[dist_ind].numpix += 1.0;
// use the old cluster center color
out.at<cv::Vec4b>(y,x) = clusters[dist_ind].rgb;
// TBD optionally provide a scaled image that encodes distance from centers
//out.at<cv::Vec4b>(y,x) = cv::Vec4b(dist*1024, dist*512,
// dist*256, 0);
// clusters[dist_ind].rgb.val[2],0);
}} // xy loop throug input image
setImage("out", out);
//setSignal("num", nc.size());
/// update cluster_centers
for (int k = 0; k < nc.size(); k++) {
if (nc[k].numpix > 0) {
nc[k].x = (int) (nc[k].aggr_x/nc[k].numpix);
nc[k].y = (int) (nc[k].aggr_y/nc[k].numpix);
nc[k].rgb = cv::Vec4b(
(unsigned char) (nc[k].aggr_r/nc[k].numpix),
(unsigned char) (nc[k].aggr_g/nc[k].numpix),
(unsigned char) (nc[k].aggr_b/nc[k].numpix),
0
);
}
setSignal("x" + boost::lexical_cast<std::string>(k), nc[k].x);
setSignal("y" + boost::lexical_cast<std::string>(k), nc[k].y);
if (false) {
setSignal("mnx" + boost::lexical_cast<std::string>(k), nc[k].min_x);
setSignal("mny" + boost::lexical_cast<std::string>(k), nc[k].min_y);
setSignal("mxx" + boost::lexical_cast<std::string>(k), nc[k].max_x);
setSignal("mxy" + boost::lexical_cast<std::string>(k), nc[k].max_y);
}
setSignal("r" + boost::lexical_cast<std::string>(k), nc[k].rgb.val[0]);
setSignal("g" + boost::lexical_cast<std::string>(k), nc[k].rgb.val[1]);
setSignal("b" + boost::lexical_cast<std::string>(k), nc[k].rgb.val[2]);
setSignal("p" + boost::lexical_cast<std::string>(k), nc[k].numpix);
}
clusters = nc;
//setSignal("time", t1.elapsed());
}
开发者ID:mmluqman,项目名称:vimjay,代码行数:101,代码来源:cluster.cpp
注:本文中的setImage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论