bool CSisr::loadTrainningSet(std::string path) { if (_trainningSet.size() != 0) { _trainningSet.clear(); } const char* cpath = path.c_str(); loadImages(_trainningSet, cpath, "*.bmp"); loadImages(_trainningSet, cpath, "*.jpg"); loadImages(_trainningSet, cpath, "*.png"); //loadImages(_trainningSet, cpath, "*.bmp"); return true; }
void SlideEventHandler::set(FileList fileList, osg::Switch* sw, float offsetX, float offsetY, osg::TexMat* texmatLeft, osg::TexMat* texmatRight, float radius, float height, float length, float timePerSlide, bool autoSteppingActive) { _switch = sw; _switch->setUpdateCallback(this); _fileList=FileList(fileList); osg::ref_ptr<osg::Group> imageGroup = loadImages(fileList[0],fileList[1],texmatLeft,texmatRight, radius, height, length); if (imageGroup.get())_switch->addChild(imageGroup.get()); _texmatLeft = texmatLeft; _texmatRight = texmatRight; _radius=radius; _height=height; _length=length; _timePerSlide = timePerSlide; _autoSteppingActive = autoSteppingActive; _initSeperationX = offsetX; _currentSeperationX = _initSeperationX; _initSeperationY = offsetY; _currentSeperationY = _initSeperationY; initTexMatrices(); }
bool NAnim::load(const std::string& _strFilename) { std::fstream file(_strFilename.c_str(), std::fstream::in | std::fstream::binary); im::bci::nanim::Nanim anim; if (false == anim.ParseFromIstream(&file)) { return false; } if (false == loadAnimations(anim)) { return false; } if (false == loadImages(anim)) { return false; } file.close(); google::protobuf::ShutdownProtobufLibrary(); if (false == extractFrames()) { return false; } return true; }
void MagScreen::optionChanged (CompOption *opt, MagOptions::Options num) { cleanup (); switch (optionGetMode ()) { case ModeImageOverlay: if (loadImages ()) mode = MagOptions::ModeImageOverlay; else mode = MagOptions::ModeSimple; break; case MagOptions::ModeFisheye: if (loadFragmentProgram ()) mode = MagOptions::ModeFisheye; else mode = MagOptions::ModeSimple; break; default: mode = MagOptions::ModeSimple; } if (zoom != 1.0) cScreen->damageScreen (); }
//-------------------------------------------------------------- void AssetManager::loadAssets() { loadImages(); loadVideos(); loadGrabbers(); loadStreams(); }
// ------------------------------------------------------------------------ void DicomParser::setUpDisplay() { parseDicom(); loadImages(); QWidget * w1 = new QWidget(this); QHBoxLayout * l1 = new QHBoxLayout; l1->addWidget(createTable()); l1->addWidget(createViewer()); w1->setLayout(l1); okButton = new QPushButton("OK", this); connect(okButton, SIGNAL(clicked()), this, SLOT(okPressed())); cancelButton = new QPushButton("Cancel", this); connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed())); QHBoxLayout * l2 = new QHBoxLayout; l2->addWidget(cancelButton); l2->addWidget(okButton); QWidget * w2 = new QWidget(this); w2->setLayout(l2); QVBoxLayout * l3 = new QVBoxLayout; l3->addWidget(w1); l3->addWidget(w2); this->setLayout(l3); }
PlayerBar::PlayerBar(Point start){ currentDungeon = DungeonLevel::NONE; hasDungeonMap=hasDungeonCompass = false; maxBombAmount = 8; mySword = SwordType::None; int worldX = start.y / Global::roomHeight; int worldY = start.x / Global::roomWidth; marker.setPoint(start.x + 16 +(worldY*Global::playerMarkerHeight), start.y + 32+(worldX*Global::playerMarkerWidth)); map.setPoint(start.x + 16, start.y+32); bar.setPoint(start.x, start.y); healthBarStart.setPoint(start.x + 320, start.y + 80); currentHealthPoint = 2; maxHealthPoint = 32; itemSlotStart.setPoint(start.x + 216, start.y + 36); diamondStart.setPoint(start.x + 152, start.y + 32); diamondTextStart.setPoint(start.x + 155, start.y + 30); itemSlotTextStart.setPoint(start.x + 228, start.y + 26); bombStart.setPoint(start.x + 150, start.y + 96); bombTextStart.setPoint(start.x + 170, start.y + 78); keyStart.setPoint(start.x + 150, start.y + 56); keyTextStart.setPoint(start.x + 170, start.y + 54); swordSlot.setPoint(start.x + 268, start.y+ 50); itemSlotImage.setPoint(start.x + 220, start.y + 50); keysAmount = 0; bombAmount = 1; diamondAmount = 255; loadImages(); setupPlayerBar(); }
ITexture* TextureMgr::loadTexture (const std::string& filename, Ctr::PixelFormat format) { if (filename.length() == 0) return nullptr; LOG ("Attempting to load texture " << filename); ITexture* texture = findTexture (filename); if (!texture) { std::vector<std::string> filenames; filenames.push_back(filename); TextureParameters resource = TextureParameters(filenames, loadImages(filenames),Ctr::TwoD); if (texture = _deviceInterface->createTexture(&resource)) { _textures.insert (std::make_pair(std::string(filename), texture)); LOG ("Loaded texture " << filename); } else { LOG ("Failed " << filename); } } return texture; }
void initialize() { hasSavePoint = false; if (currLevel == 0){ //glutSetCursor(GLUT_CURSOR_NONE); setMouse(win1.width / 2, win1.height / 2); updateProjection(win1); } glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glClearColor(0.0, 0.0, 0.0, 1.0); // specify clear values for the color buffers loadImages(); levels[currLevel] = new Level(currLevel + 1); Stamina = 100; makeEntites(); levelEdges = levels[currLevel]->getEdges(); camera1 = new Camera(Vector3(levels[currLevel]->startPoint->x, 2, levels[currLevel]->startPoint->y), findPosition(levels[currLevel]), Vector3(0, 1, 0)); if (levels[currLevel]->startNode->left || levels[currLevel]->startNode->right){ cylinder1.yaw(90); } startPlayer = cylinder1; resetEnemies(); sound = new Sound(); sound->Load(); sound->Play(SOUND_MUSIC1); }
void CController::loadNextPageSlot() { mView->clearOldestList(); loadImages(); mOffset += mNumberOfImagesOnPage; emit mView->loadFinishedSignal(); }
void t_chessGui::run() { chessCegui.init(); loadImages(); loadSprites(); initCegui(); initServer(); initConnect(); RedBox = sf::Shape::Rectangle(0,0,100,100,sf::Color(255,0,0)); BlackBox = sf::Shape::Rectangle(0,0,100,100,sf::Color(0,255,0)); BlueBox = sf::Shape::Rectangle(0,0,100,100,sf::Color(0,0,255)); BrownBox = sf::Shape::Rectangle(0,0,100,100,sf::Color(255,255,0)); PurpleBox = sf::Shape::Rectangle(0,0,100,100,sf::Color(160,32,240)); PinkBox = sf::Shape::Rectangle(0,0,100,100,sf::Color(255,182,193)); while (App.IsOpened()) { processEvents(); checkBuffer(); App.Clear(); drawBoard(); CEGUI::System::getSingleton().renderGUI(); App.Display(); } return; }
static void magOptionsChanged (CompScreen *s, CompOption *opt, MagScreenOptions num) { MAG_SCREEN (s); magCleanup (s); switch (magGetMode (s)) { case ModeImageOverlay: if (loadImages (s)) ms->mode = ModeImageOverlay; else ms->mode = ModeSimple; break; case ModeFisheye: if (loadFragmentProgram (s)) ms->mode = ModeFisheye; else ms->mode = ModeSimple; break; default: ms->mode = ModeSimple; } if (ms->zoom != 1.0) damageScreen (s); }
void Engine::Graphics::init() { loadImages(); loadMesh(); light.defaultInit(); light.setLight(); cam.init(800,600); cam.setProj(); //TODO: create a shader manager #ifdef _DEBUG D3DXCreateEffectFromFile(Engine::DX::instance()->getDevice(), L"Shader.fx", 0, 0, D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION, 0, &m_Effect, &m_EffectError); #else D3DXCreateEffectFromFile(Engine::DX::instance()->getDevice(), L"Shader.fx", 0, 0, 0, 0, &m_Effect, &m_ErrorEffect); #endif m_Effect->SetFloatArray("eyePos", (float*)cam.getEyePos(), 3); m_Effect->SetFloatArray("lightPos", (float*)light.getPosition(), 3); m_Effect->SetFloatArray("ambientLight", (float*)light.getAmbient(), 3); m_Effect->SetFloatArray("specularLight", (float*)light.getSpecular(), 3); m_Effect->SetFloatArray("diffuseLight", (float*)light.getDiffuse(), 3); m_Effect->SetFloatArray("lightAttenuation", (float*)&D3DXVECTOR3(light.getAttenuation0(), light.getAttenuation1(), light.getAttenuation2()), 3); }
int main (void) { /* center messages, etc. */ setupRects(); /* Basic setup */ startSDL(); /* load images */ loadImages(); /* blit them onto the screen */ showControls(); clearScreen(screen); /* go 3, 2, and 1 */ countdown(); /* put the paddle and the ball in the initial position */ initiateImages(); /* call game loop here, defined in gameloop.c, handover all the filled structs */ initGameloop(&mainPaddle, &mainBall, screen); int score = runGameloop(); printf("Score: %d\n", score); SDL_Quit(); return 0; }
void assetHandle::init(dbHandle& db_obj, std::string skin_id) { //std::vector<dbHandle::assetItem> items = db_obj.getIconPaths(); //for (int i = 0; i < items.size(); i++) //{ // sf::Texture texture; // texture.setSmooth(true); // texture.loadFromFile(items.at(i).path); // std::pair<std::string,sf::Texture> pair (items.at(i).id,texture); // textureMap.insert(pair); //} loadFonts(db_obj.exe_path + "\\skins\\" + skin_id + "\\fonts"); iconMap = loadImages(db_obj.exe_path + "\\icons"); textureMap = loadImages(db_obj.exe_path + "\\skins\\" + skin_id + "\\system"); staticImagesMap = loadImages(db_obj.exe_path + "\\skins\\" + skin_id + "\\pngs"); companiesMap = loadImages(db_obj.exe_path + "\\companies"); }
void testApp::setup() { ofSetFrameRate(12); ofSetLogLevel(OF_LOG_VERBOSE); loadImages("jpg8", jpg8); loadImages("png8", png8); loadImages("png16", png16); loadImages("exrFloat", exrFloat); resaveImages<ofImage>("jpg8"); resaveImages<ofImage>("png8"); resaveImages<ofShortImage>("png16"); resaveImages<ofFloatImage>("exrFloat"); img8 = exrFloat[0]; img16 = exrFloat[0]; imgf = exrFloat[0]; }
void Resource::load() { atexit( clearResource ); loadImages(); loadFonts(); // wczytanie map MapManager::load(); }
void LPhotoData::nextImage() { if (slideCount > 0) { loadImages(); currentSlide++; if (currentSlide > slideCount - 1) { currentSlide = 0; // imageTimer->stop(); } } }
int main() { loadImages(); initData(); initResults(); cross2DConv(); saveImages(); freeMem(); return 0; }
Sprite::Sprite(std::string fileName, int xpos, int ypos) : click(false){ img = new SDL_Surface*; loadImages(fileName); edge = new SDL_Rect*; (*edge) = new SDL_Rect; (*edge)->x = xpos; (*edge)->y = ypos; (*edge)->w = (*img)->w; (*edge)->h = (*img)->h; }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ sf::SoundBuffer soundBuffers[NUM_COL][MAX_PER_COL]; sf::Sound sounds[NUM_COL][MAX_PER_COL]; sf::Image buttons[NUM_COL][MAX_PER_COL]; sf::Sprite btns[NUM_COL][MAX_PER_COL]; sf::RenderWindow mainWin(sf::VideoMode(W_WIDTH, W_HEIGHT, 32), "Soundboard - by eyeosk", sf::Style::Close); sf::Image background; sf::Image header; sf::Sprite bg; sf::Sprite hd; hd.SetY(0); hd.SetX(W_WIDTH/4); bg.SetX(0); bg.SetY(0); background.LoadFromFile("background.png"); header.LoadFromFile("header.png"); bg.SetImage(background); hd.SetImage(header); int numInCol[NUM_COL]; for(int i = 0; i < NUM_COL; i++){ loadBuffers(soundBuffers[i], i); numInCol[i] = loadImages(buttons[i], i); setSprites(buttons[i], btns[i], numInCol[i]); setBuffers(soundBuffers[i], sounds[i], numInCol[i]); setSpritesPos(btns[i], i, numInCol[i]); } mainWin.SetFramerateLimit(360); while(mainWin.IsOpened()){ sf::Event mainEvent; while(mainWin.GetEvent(mainEvent)){ if(mainEvent.Type == sf::Event::Closed || (mainEvent.Type == sf::Event::KeyPressed && mainEvent.Key.Code == sf::Key::Escape)){ mainWin.Close(); } if(mainEvent.Type == sf::Event::MouseButtonPressed){ for(int i = 0; i < NUM_COL; i++){ for(int j = 0; j < numInCol[i]; j++){ if(checktangle(i, j, mainEvent.MouseButton.X, mainEvent.MouseButton.Y)){ sounds[i][j].Play(); } } } } } mainWin.Clear(); mainWin.Draw(bg); mainWin.Draw(hd); for(int i =0; i < NUM_COL; i++){ for(int j = 0; j < numInCol[i]; j++){ mainWin.Draw(btns[i][j]); } } mainWin.Display(); } return 0; }
Player::Player() { m_height = 40; m_width = 30; m_offencePotential = 25; m_health = 1000; m_maxHealth = 1000; inventory = std::make_unique<Inventory>(); loadImages(CharacterType::Player); };
void DeviceSkin::setTransform( const QMatrix& wm ) { transform = QImage::trueMatrix(wm,m_parameters.skinImageUp.width(),m_parameters.skinImageUp.height()); calcRegions(); loadImages(); if ( m_view ) { QPoint p = transform.map(QPolygon(m_parameters.screenRect)).boundingRect().topLeft(); m_view->move(p); } updateSecondaryScreen(); }
void HOGTrainer::train() { vector<Mat> fullPosLst; vector<Mat> fullNegLst; vector<Mat> negLst; vector<Mat> posLst; vector<Mat> gradientLst; vector<int> labels; loadImages(posDir, pos, fullPosLst); samplePos(fullPosLst, posLst, size); labels.assign(posLst.size(), +1); const unsigned int old = (unsigned int) labels.size(); loadImages(negDir, neg, fullNegLst); sampleNeg(fullNegLst, negLst, size); labels.insert(labels.end(), negLst.size(), -1); cout << old << " " << labels.size(); CV_Assert(old < labels.size()); computeHog(posLst, gradientLst, size); computeHog(negLst, gradientLst, size); trainSvm(gradientLst, labels); }
void ReportGenerationDialog::SetPatientTracker(PatientTracker *tracker) { if (tracker != NULL) { patientTracker = tracker; loadBasicInfo(); loadImages(); loadSelectedImagesAndValues(); loadDiagnosis(); } }
int processSet(Params *par, vector<char *> filenames, int findex, vector<BB> &bbs, clock_t start_t){ // cout << "TEST\n"; vector<DARY *> images; // cout << " OK 0 " << findex << " "<< filenames[findex]<< endl; //int t0 = printRuntime(start_t, clock(), "testpoint0"); loadImages(filenames, findex, images, par); // cout << " OK 1 " << endl; //int t1 = printRuntime(t0, clock(), "testpoint1"); if(findex>0){ computeDifferences(images); } // cout << " OK 2 " << endl; //int t2 = printRuntime(t1, clock(), "testpoint2"); normalizeDifference(images); //int t3 = printRuntime(t2, clock(), "testpoint3"); DARY *output = new DARY(images[0]->y(),images[0]->x(),UCHAR1FLOAT1); output->set(0.0); // cout << " OK 3 " << endl; detectDifferences(images, output, par->getValue("diff_thres.int"), par->getValue("median_size.int")); //int t4 = printRuntime(t3, clock(), "testpoint4"); // Detect using HOG (histogram of oriented gradients) if((int)par->getValue("match_images.int")){ matchImages(images,output); } for(uint i=0; i<images.size(); i++){ delete images[i];images.clear(); } // cout << " OK 4 " << endl; // Bounding box method int labels; labelSegments(output, labels); //int t5 = printRuntime(t4, clock(), "testpoint5"); int sel=-1; if(labels>1){ findBBs(output,bbs,labels); sel=selectBBs(bbs, par); // if(bbs.size()>0){ sel=0; } } // cout << " OK 4 " << endl; //int t6 = printRuntime(t5, clock(), "testpoint6"); if(findex==-1){ findex=1; } // coutBB used in drawBB prints to terminal if((int)par->getValue("draw_images.int")){ drawBB(filenames[findex],output,bbs,sel); } //int t7 = printRuntime(t6, clock(), "testpoint7"); //int t8 = printRuntime(start_t, clock(), "out of total"); delete output; return sel; }
Snake::Snake(QWidget *parent) : QWidget(parent) { setStyleSheet("background-color:black;"); leftDirection = false; rightDirection = true; upDirection = false; downDirection = false; inGame = true; resize(B_WIDTH, B_HEIGHT); loadImages(); initGame(); }
SingletonRender::SingletonRender() { // initialize all maps this->allDrawnNodes = QMap<int, DrawObject *>(); this->allConnections = QMap<int, QVector<DrawObject *>>(); this->allImages = QMap<QString, QPixmap *>(); // load all images if (loadImages() == true) { qDebug() << "images loaded successfully"; } else { qDebug() << "images loading failed"; } }
void SSAO::setup(int w, int h) { fbo_w = w; fbo_h = h; glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); setupShaders(); setupBuffers(); setupFBO(); loadImages(); mm.identity(); mm.scale(0.8f); mm.translate(0.0f, -50.0f, 0.0f); }
EverRiver::EverRiver(float x, float y, float* water) { riverSound = new Audio("audio/RiverInOut.mp3"); riverSound->start(); this->x = x; this->y = y; loadImages(); waterLevel = water; frameNum = 1; frameDir = 1; drawnFg = fgRiver1; }