void EditorScrollButton::setActive(bool state) { isActive = state; if (state == true) { setImages(&activeNormal, &activeOver, &activeDown); } else { setImages(&inactive, &inactive, &inactive); } }
void MainWindow::xorSlot(){ QString path = QFileDialog::getOpenFileName(this,"Image to make the operation ..","",tr("Images (*.dcm *.pgm)")); if(path==""){ QMessageBox::information(this,"Information","You haven't selected any file image."); } else{ if(path.contains(".dcm")){ MedicalImages mi(path.toStdString().c_str()); path = path.replace(".dcm",".pgm"); mi.writeToPPM(path.toStdString().c_str()); } P2 res; res.load(path.toStdString().c_str()); image = applyXor(image,res); setImages(); } }
void MainWindow::res() { QString path = QFileDialog::getOpenFileName(this,"Image to make the operation ..","",tr("Images (*.dcm *.pgm)")); if(path==""){ QMessageBox::information(this,"Information","You haven't selected any file image."); } else{ int opt = QInputDialog::getInt(this,"Options\n0. result = x - y\n1.result = |x-y|\n2.result = MAX - |x-y|","Substraction Options"); if(path.contains(".dcm")){ MedicalImages mi(path.toStdString().c_str()); path = path.replace(".dcm",".pgm"); mi.writeToPPM(path.toStdString().c_str()); } P2 res; res.load(path.toStdString().c_str()); image = applyMinus(image,res,opt); setImages(); } }
void MedicalWindow::open() { QString pathImage = QFileDialog::getOpenFileName(this,"Open an image..","",tr("Images (*.dcm)")); if(pathImage==""){ QMessageBox::information(this,"Information","You haven't selected any file image."); } else{ int frame = QInputDialog::getInt(this,"Frame","Frame that you want to display:"); idcm = new ImagenDCM(pathImage.toStdString().c_str(),frame); viewer->setDicomImage(idcm); sliderW->setMinimum(1); sliderW->setMaximum(idcm->getWindowWidth()); double min = 0,max = 0; idcm->getMinMax(min,max); sliderC->setMinimum(min); sliderC->setMaximum(max); setImages(); saveAction->setEnabled(true); } }
PlayButton::PlayButton() : DrawableButton("PlayButton", DrawableButton::ImageFitted) { DrawablePath normal, over, down; Path p; p.addTriangle(0.0f, 0.0f, 0.0f, 20.0f, 18.0f, 10.0f); normal.setPath(p); normal.setFill(Colours::lightgrey); normal.setStrokeThickness(0.0f); over.setPath(p); over.setFill(Colours::black); over.setStrokeFill(Colours::black); over.setStrokeThickness(5.0f); down.setPath(p); down.setFill(Colours::pink); down.setStrokeFill(Colours::pink); down.setStrokeThickness(5.0f); setImages(&normal, &over, &over); // setBackgroundColours(Colours::darkgrey, Colours::yellow); setClickingTogglesState(true); setTooltip("Start/stop acquisition"); }
void MainWindow::kmeansSlot() { int g = QInputDialog::getInt(this,"Enter the number of groups","K value"); image = kmeans(g,image); setImages(); }
AppIconButton::AppIconButton(const String &label, const String &shell, const Drawable *image) : DrawableButton(label, DrawableButton::ImageAboveTextLabel), shell(shell) { // FIXME: supposedly setImages will "create internal copies of its drawables" // this relates to AppsPageComponent ownership of drawable icons ... docs are unclear setImages(image); }
void MainWindow::sigma() { int sigma = QInputDialog::getInt(this,"Sigma value","Sigma value"); image = sigmaFilter(image,sigma); setImages(); }
void MainWindow::pixel() { int thres = QInputDialog::getInt(this,"Threshold value","Threshold value"); image = noiseCleaningPixels(image,thres); setImages(); }
void MainWindow::gaussian() { double sigma = QInputDialog::getInt(this,"Sigma value","Sigma value"); image = gaussianFilter(image,sigma); setImages(); }
void MainWindow::horizontal() { int line = QInputDialog::getInt(this,"Line value","Line value"); image = horizontalIntensity(image,line); setImages(); }
GearButton::GearButton(): ImageButton ("GearButton") { setImages( false, false, true, ImageCache::getFromMemory(BinaryData::gearbutton_png, BinaryData::gearbutton_pngSize), 1.0f, Colours::transparentWhite, ImageCache::getFromMemory(BinaryData::gearbuttonover_png, BinaryData::gearbuttonover_pngSize), 1.0f, Colours::transparentWhite, ImageCache::getFromMemory(BinaryData::gearbuttondownr_png, BinaryData::gearbuttondownr_pngSize), 1.0f, Colours::transparentWhite); }
Button::Button( const std::string & normalImage, const std::string & clickedImage, const std::string & disabledImage) : Button() { setImages(normalImage, clickedImage, disabledImage); }
void VolumeCtrl::updateIcon(int v) { if (v >= 0 && v <= 10) { // volume0 setImages(QPixmap(":/default/volume0.png"), QPixmap(":/default/volume0-active.png")); } else if (v > 10 && v <= 33) { // volume1 setImages(QPixmap(":/default/volume1.png"), QPixmap(":/default/volume1-active.png")); } else if (v > 33 && v <= 75) { setImages(QPixmap(":/default/volume2.png"), QPixmap(":/default/volume2-active.png")); // volume2 } else if (v > 76) { // volume3 setImages(QPixmap(":/default/volume3.png"), QPixmap(":/default/volume3-active.png")); } update(); }
SocialPost::SocialPost(const QString &identifier, const QString &name, const QString &body, const QDateTime ×tamp, const QMap<int, SocialPostImage::ConstPtr> &images, const QVariantMap &extra, const QList<int> &accounts) : d_ptr(new SocialPostPrivate(identifier, body, name, timestamp ,extra, accounts)) { setImages(images); }
Game::Game() { numbActivedTiles = 0; setActiveCardToPassive(); createTileArray(); setBords(); arrangementTiles(); setImages(); }
void MainWindow::isodataSlot() { Histogram hist(image); histogram = hist.getImage(); image = isodata(image,hist,0,image.getLevel()+1); setImages(); }
void MainWindow::cannySlot() { int high = QInputDialog::getInt(this,"High Threshold value","High Threshold value"); int low = QInputDialog::getInt(this,"Low Threshold value","Low Threshold value"); image = canny(image,low,high); setImages(); }
void MainWindow::equalization() { Histogram hist(image); histogram = hist.getImage(); image = histogramEqualization(image,hist); setImages(); }
void FractalControl::setImagesSize() { const QStringList sl(m_imagesSizeEdit->text().split(",")); if (sl.size() == 2) { m_geo.m_imagesSize = QSize(sl[0].toInt(), sl[1].toInt()); setImages(m_geo.m_images.empty()); } }
void ofxGuiGrid::setCamsUtils( CamsUtils* utils ) { if ( utils == NULL ) { return; } this->utils = utils; if ( mDisplayMode == kofxGui_Grid_List ) { setImages(); } }
SystemMenu::SystemMenu(Adx *a, Panel *p, QWidget *parent) : GenericButton(p, parent) { app = a; setFixedWidth(28); setIconSize(QSize(17, 16)); setImages(QPixmap(":/default/ame-logo.png"), QPixmap(":/default/ame-logo-active.png")); rebuildMenu(); }
void MainWindow::gamma() { Histogram hist(image); histogram = hist.getImage(); double gamma = QInputDialog::getDouble(this,"Gamma value","Gamma value"); image = applyContrast(image,gamma); setImages(); }
void MainWindow::manual() { Histogram hist(image); histogram = hist.getImage(); double thres = QInputDialog::getDouble(this,"Threshold value","Threshold value"); image = changeLUT(image,thres); setImages(); }
PngSequenceSprite::PngSequenceSprite(SpriteEngine& engine, const std::vector<std::string>& imageFiles) : ds::ui::Sprite(engine) , mLoopStyle(Loop) , mCurrentFrameIndex(0) , mPlaying(true) , mFrameTime(0.0f) , mNumFrames(0) { mLayoutFixedAspect = true; setImages(imageFiles); mFrames[0]->show(); mLastFrameTime = ci::app::getElapsedSeconds(); }
std::shared_ptr<Button> Button::create( const std::string & normalImage, const std::string & clickedImage, const std::string & disabledImage) { auto button = std::make_shared<Button>(normalImage, clickedImage, disabledImage); if (!button || !button->setImages(normalImage, clickedImage, disabledImage)) { return nullptr; } return button; }
bool ofxGuiGrid::mouseReleased( int x, int y, int button ) { if ( !mIsActive ) { //! This control is not active now return false; } bool handled = mMouseIsDown; if ( mMouseIsDown ) { mMouseIsDown = false; //! Check the Double Click Mode first if ( bDblClickMode ) { return true; } //! Handle the controls bool handled2 = false; for ( int i = 0; i < mObjects.size(); ++i ) { if ( (ofxGuiObject*)mObjects[i]->mouseReleased( x, y, button ) ) { return true; } } } if ( mDisplayMode == kofxGui_Grid_Display && mDraggingRawIndex != -1) { ofxPoint2f inside = mouseToLocal( x, y ); if ( isPointInsideMe( inside ) ) { int id = mouseToGridId( inside ); if ( id < mXGrid * mYGrid && id != -1 ) { printf( "\nofxGuiGrid::mouseReleased()\tid=%d\n", id ); printf( "\nofxGuiGrid::mouseReleased()\tmDraggingRawIndex=%d\n", mDraggingRawIndex ); if ( !utils->isUsed( id ) ) { utils->setCam( id, utils->getRawCam(mDraggingRawIndex) ); utils->setSelected( mDraggingRawIndex ); setImages(); //! Save the info for reset rawIdArray[id] = mDraggingRawIndex; mGlobals->mListener->handleGui( mParamId, kofxGui_Set_Grid_Released, &mDraggingRawIndex, sizeof(int) ); } } //! reset the index mDraggingRawIndex = -1; } } return handled; }
MuteButton::MuteButton() : ImageButton("MuteButton") { Image offimage = ImageCache::getFromMemory(BinaryData::muteoff_png, BinaryData::muteoff_pngSize); Image onimage = ImageCache::getFromMemory(BinaryData::muteon_png, BinaryData::muteon_pngSize); setImages(false, true, true, offimage, 1.0f, Colours::white.withAlpha(0.0f), offimage, 1.0f, Colours::black.withAlpha(0.0f), onimage, 1.0f, Colours::white.withAlpha(0.0f)); setClickingTogglesState(true); }
SignalChainScrollButton::SignalChainScrollButton(int d) : DrawableButton("SCSB", DrawableButton::ImageFitted) { direction = d; DrawablePath normal; Path p; if (direction == DOWN) { p.addTriangle(0.0f, 0.0f, 9.0f, 20.0f, 18.0f, 0.0f); } else { p.addTriangle(0.0f, 20.0f, 9.0f, 0.0f, 18.0f, 20.0f); } inactive.setPath(p); inactive.setFill(Colours::black); inactive.setStrokeFill(Colours::grey); inactive.setStrokeThickness(1.0f); activeNormal.setPath(p); activeNormal.setFill(Colours::grey); activeNormal.setStrokeFill(Colours::grey); activeNormal.setStrokeThickness(1.0f); activeOver.setPath(p); activeOver.setFill(Colours::grey); activeOver.setStrokeFill(Colours::grey); activeOver.setStrokeThickness(3.0f); activeDown.setPath(p); activeDown.setFill(Colours::white); activeDown.setStrokeFill(Colours::white); activeDown.setStrokeThickness(3.0f); setImages(&inactive, &inactive, &inactive); //setBackgroundColours(Colours::black, Colours::black); setClickingTogglesState(false); }
void MainWindow::otsuThresh() { Histogram hist(image); histogram = hist.getImage(); image = otsu(image,hist); setImages(); }