TEST_F(VideoThumbnailerTest, FrameSelection) { vector<VideoFrame> videoFrames; vector<Histogram<int> > histograms; VideoFrame frame1(5, 5, 15); fill(frame1.frameData.begin(), frame1.frameData.end(), 255); VideoFrame frame2(5, 5, 15); fill(frame2.frameData.begin(), frame2.frameData.end(), 0); VideoFrame frame3(5, 5, 15); fill(frame3.frameData.begin(), frame3.frameData.end(), 128); Histogram<int> hist1; hist1.r[255] = 25; hist1.g[255] = 25; hist1.b[255] = 25; Histogram<int> hist2; hist2.r[0] = 25; hist2.g[0] = 25; hist2.b[0] = 25; Histogram<int> hist3; hist3.r[128] = 25; hist3.g[128] = 25; hist3.b[128] = 25; videoFrames.push_back(frame1); videoFrames.push_back(frame2); videoFrames.push_back(frame3); histograms.push_back(hist1); histograms.push_back(hist2); histograms.push_back(hist3); //This test is bad //EXPECT_EQ(getBestThumbnailIndex(videoFrames, histograms), 1); }
frame2 (void) { asm ("frame2_label: .globl frame2_label"); frame3 (); }
void ModuleSceneIntro::LoadAssets() { App->renderer->camera.x = App->renderer->camera.y = 0; background_up = App->textures->Load("pinball/bg_up.png"); background_lights = App->textures->Load("pinball/bg_lights.png"); background = App->textures->Load("pinball/bg.png"); help = App->textures->Load("pinball/help.png"); ball = App->textures->Load("pinball/ballSmall.png"); rFlipper = App->textures->Load("pinball/rFlipper.png"); lFlipper = App->textures->Load("pinball/lFlipper.png"); circleTexture = App->textures->Load("pinball/circle.png"); orange_bump = App->textures->Load("pinball/orange_bump.png"); text = App->textures->Load("pinball/text.png"); // reds = App->textures->Load("pinball/Reds.png"); bonus1_fx = App->audio->LoadFx("pinball/bonus.wav"); bonus2_fx = App->audio->LoadFx("pinball/bonus1.wav"); bonus3_fx = App->audio->LoadFx("pinball/bonus2.wav"); bonusLong_fx = App->audio->LoadFx("pinball/long_bonus.wav"); bonusLong2_fx = App->audio->LoadFx("pinball/long_bonus2.wav"); ballBounce_fx = App->audio->LoadFx("pinball/ball_bounce.wav"); bell_fx = App->audio->LoadFx("pinball/bell.wav"); ding_fx = App->audio->LoadFx("pinball/ding_short.wav"); flipper_fx = App->audio->LoadFx("pinball/flipper.wav"); SDL_Rect frame1; frame1.x = 0; frame1.y = 0; frame1.h = 40; frame1.w = 90; SDL_Rect frame2(frame1); frame2.y += 40; SDL_Rect frame3(frame2); frame3.y += 40; SDL_Rect frame4(frame3); frame4.y += 40; SDL_Rect frame5(frame4); frame5.y += 40; circle.frames.PushBack(frame1); circle.frames.PushBack(frame2); circle.frames.PushBack(frame3); circle.frames.PushBack(frame4); circle.frames.PushBack(frame5); circle.speed = 0.1f; circle.loop = true; SDL_Rect LED; SDL_Rect NULLRECT; LED.x = 423; LED.y = 92; LED.w = 36; LED.h = 30; NULLRECT.x = 0; NULLRECT.y = 0; NULLRECT.w = 0; NULLRECT.y = 0; BlackBoxLed.frames.PushBack(LED); BlackBoxLed.frames.PushBack(NULLRECT); BlackBoxLed.loop = true; BlackBoxLed.speed = 0.005f; texts[0].h = 84; texts[0].w = 154; texts[0].x = 0; texts[0].y = 0; texts[4] = texts[2] = texts[1] = texts[0]; texts[1].x = 154; texts[5] = texts[3] = texts[1]; texts[2].y = texts[3].y = 84; texts[4].y = texts[5].y = 168; /* //Pos = 390 x 100 redsRect[0].x = 0; redsRect[0].y = 578; redsRect[0].w = 64; redsRect[0].h = 72; redsRect[3] = redsRect[2] = redsRect[1] = redsRect[0]; redsRect[1].x = 64; redsRect[2].x = 128; redsRect[3].x = 192; */ }
Settings::Settings(sfg::Desktop &theDesktop): window(sfg::Window::Create()), desktop(theDesktop), closeButton(sfg::Button::Create("Close")), colors{{"Black","Blue","Blue2","Brown","Green","Green2","Red","Red2", "Violet","Violet2","White","Yellow"}}, boardColors{{"Black","Blue","Brown"}} { window->SetRequisition(sf::Vector2f(100.f,100.f)); window->SetTitle("Settings"); window->Show(false); sfg::Box::Ptr buttonLayout1 = sfg::Box::Create(sfg::Box::Orientation::VERTICAL); sfg::RadioButtonGroup::Ptr buttonGroup1(sfg::RadioButtonGroup::Create()); sfg::Box::Ptr buttonLayout2 = sfg::Box::Create(sfg::Box::Orientation::VERTICAL); sfg::RadioButtonGroup::Ptr buttonGroup2(sfg::RadioButtonGroup::Create()); int iMax(colors.size()); for (int i=0; i<iMax; ++i) { whiteButtons[i] = sfg::RadioButton::Create(colors[i],buttonGroup1); blackButtons[i] = sfg::RadioButton::Create(colors[i],buttonGroup2); buttonLayout1->Pack(whiteButtons[i]); buttonLayout2->Pack(blackButtons[i]); } sfg::Frame::Ptr frame1(sfg::Frame::Create("White")); frame1->Add(buttonLayout1); sfg::Frame::Ptr frame2(sfg::Frame::Create("Black")); frame2->Add(buttonLayout2); sfg::Box::Ptr buttonLayout3 = sfg::Box::Create(sfg::Box::Orientation::VERTICAL); sfg::RadioButtonGroup::Ptr buttonGroup3(sfg::RadioButtonGroup::Create()); iMax = boardColors.size(); for (int i=0; i<iMax; ++i) { boardButtons[i] = sfg::RadioButton::Create(boardColors[i],buttonGroup3); buttonLayout3->Pack(boardButtons[i]); } sfg::Frame::Ptr frame3(sfg::Frame::Create("Board")); frame3->Add(buttonLayout3); sfg::Table::Ptr mainLayout(sfg::Table::Create()); mainLayout->SetRowSpacings(3.f); mainLayout->SetColumnSpacings(3.f); mainLayout->Attach(frame1,{0,0,1,1}); mainLayout->Attach(frame2,{1,0,1,1}); mainLayout->Attach(frame3,{2,0,1,1}); mainLayout->Attach(closeButton,{2,1,1,1}); closeButton->GetSignal(sfg::Widget::OnLeftClick).Connect(std::bind(&Settings::requestClose,this)); window->Add(mainLayout); }