SsdbShell::SsdbShell(bool showAutoCompl, QWidget* parent) : FastoEditorShell(common::convertFromString<QString>(SsdbLexer::version()), showAutoCompl, parent) { SsdbLexer* red = new SsdbLexer(this); registerImage(SsdbLexer::Command, GuiFactory::instance().commandIcon(SSDB).pixmap(QSize(64,64))); registerImage(SsdbLexer::HelpKeyword, GuiFactory::instance().messageBoxQuestionIcon().pixmap(QSize(64,64))); setLexer(red); setAllCommands(ALL_COMMANDS); VERIFY(connect(this, &SsdbShell::customContextMenuRequested, this, &SsdbShell::showContextMenu)); }
ofImage_<PixelType>::ofImage_(const ofImage_<PixelType>& mom) { #if defined(TARGET_ANDROID) || defined(TARGET_OF_IPHONE) registerImage(this); #endif clear(); clone(mom); update(); }
BaseShell::BaseShell(core::connectionTypes type, bool showAutoCompl, QWidget* parent) : gui::FastoEditorShell(showAutoCompl, parent) { VERIFY(connect(this, &BaseShell::customContextMenuRequested, this, &BaseShell::showContextMenu)); BaseQsciLexer* lex = nullptr; #ifdef BUILD_WITH_REDIS if (type == core::REDIS) { lex = new redis::Lexer(this); } #endif #ifdef BUILD_WITH_MEMCACHED if (type == core::MEMCACHED) { lex = new memcached::Lexer(this); } #endif #ifdef BUILD_WITH_SSDB if (type == core::SSDB) { lex = new ssdb::Lexer(this); } #endif #ifdef BUILD_WITH_LEVELDB if (type == core::LEVELDB) { lex = new leveldb::Lexer(this); } #endif #ifdef BUILD_WITH_ROCKSDB if (type == core::ROCKSDB) { lex = new rocksdb::Lexer(this); } #endif #ifdef BUILD_WITH_UNQLITE if (type == core::UNQLITE) { lex = new unqlite::Lexer(this); } #endif #ifdef BUILD_WITH_LMDB if (type == core::LMDB) { lex = new lmdb::Lexer(this); } #endif #ifdef BUILD_WITH_UPSCALEDB if (type == core::UPSCALEDB) { lex = new upscaledb::Lexer(this); } #endif registerImage(BaseQsciLexer::Command, gui::GuiFactory::instance().commandIcon(type).pixmap(image_size)); if (!lex) { NOTREACHED(); return; } setLexer(lex); lex->setFont(gui::GuiFactory::instance().font()); }
bool ofImage_<PixelType>::load(const ofBuffer & buffer){ #if defined(TARGET_ANDROID) registerImage(this); #endif bool bLoadedOk = ofLoadImage(pixels, buffer); if (!bLoadedOk) { ofLogError("ofImage") << "loadImage(): couldn't load image from ofBuffer"; clear(); return false; } update(); return bLoadedOk; }
bool ofImage_<PixelType>::load(string fileName){ #if defined(TARGET_ANDROID) registerImage(this); #endif bool bLoadedOk = ofLoadImage(pixels, fileName); if (!bLoadedOk) { ofLogError("ofImage") << "loadImage(): couldn't load image from \"" << fileName << "\""; clear(); return false; } update(); return bLoadedOk; }
ofImage_<PixelType>::ofImage_(){ width = 0; height = 0; bpp = 0; type = OF_IMAGE_UNDEFINED; bUseTexture = true; // the default is, yes, use a texture //----------------------- init free image if necessary ofInitFreeImage(); #if defined(TARGET_ANDROID) || defined(TARGET_OF_IPHONE) registerImage(this); #endif }
int main(int ac, char **av) { if (ac < 3) return EXIT_SUCCESS; int w = atoi(av[1]); int h = atoi(av[2]); unsigned short **img = NULL; initImg(&img, w, h); drawLines(img, w, h); registerImage(img, w, h, "lines.jmc"); freeImg(img, h); return EXIT_SUCCESS; }
bool ofImage_<PixelType>::loadImage(const ofBuffer & buffer){ #if defined(TARGET_ANDROID) || defined(TARGET_OF_IPHONE) registerImage(this); #endif bool bLoadedOk = ofLoadImage(pixels, buffer); if (!bLoadedOk) { ofLog(OF_LOG_ERROR, "Couldn't load image from buffer."); clear(); return false; } if (bLoadedOk && pixels.isAllocated() && bUseTexture){ tex.allocate(pixels.getWidth(), pixels.getHeight(), ofGetGlInternalFormat(pixels)); } update(); return bLoadedOk; }
ofImage_<PixelType>::ofImage_(const string & filename){ width = 0; height = 0; bpp = 0; type = OF_IMAGE_UNDEFINED; bUseTexture = true; // the default is, yes, use a texture //----------------------- init free image if necessary ofInitFreeImage(); #ifdef TARGET_ANDROID registerImage(this); #endif loadImage(filename); }
ofImage_<PixelType>::ofImage_(const ofPixels_<PixelType> & pix){ width = 0; height = 0; bpp = 0; type = OF_IMAGE_UNDEFINED; bUseTexture = true; // the default is, yes, use a texture //----------------------- init free image if necessary ofInitFreeImage(); #ifdef TARGET_ANDROID registerImage(this); #endif setFromPixels(pix); }
bool ofImage_<PixelType>::loadImage(const ofBuffer & buffer){ #if defined(TARGET_ANDROID) || defined(TARGET_OF_IOS) registerImage(this); #endif bool bLoadedOk = ofLoadImage(pixels, buffer); if (!bLoadedOk) { ofLogError("ofImage") << "loadImage(): couldn't load image from ofBuffer"; clear(); return false; } if (bLoadedOk && pixels.isAllocated() && bUseTexture){ tex.allocate(pixels.getWidth(), pixels.getHeight(), ofGetGlInternalFormat(pixels)); if(ofGetGLProgrammableRenderer() && (pixels.getNumChannels()==1 || pixels.getNumChannels()==2)){ tex.setRGToRGBASwizzles(true); } } update(); return bLoadedOk; }
void ofImage_<PixelType>::allocate(int w, int h, ofImageType newType){ if (width == w && height == h && newType == type){ return; } #if defined(TARGET_ANDROID) || defined(TARGET_OF_IPHONE) registerImage(this); #endif pixels.allocate(w, h, newType); // take care of texture allocation -- if (pixels.isAllocated() && bUseTexture){ tex.allocate(pixels.getWidth(), pixels.getHeight(), ofGetGlInternalFormat(pixels)); } width = pixels.getWidth(); height = pixels.getHeight(); bpp = pixels.getBitsPerPixel(); type = pixels.getImageType(); }
void DatasetManager::openFileHelper( boost::filesystem::path aPath, ProgressNotifier::Ptr aProgressNotifier, DatasetID aDatasetId, bool aUseAsCurrent ) { M4D::Imaging::AImage::Ptr image; if ( aPath.extension() == ".dcm" || aPath.extension() == ".DCM" ) { M4D::Dicom::DicomObjSetPtr dicomObjSet = M4D::Dicom::DicomObjSetPtr( new M4D::Dicom::DicomObjSet() ); M4D::Dicom::DcmProvider::LoadSerieThatFileBelongsTo( aPath, aPath.parent_path(), *dicomObjSet, aProgressNotifier ); image = M4D::Dicom::DcmProvider::CreateImageFromDICOM( dicomObjSet ); } else { image = M4D::Imaging::ImageFactory::LoadDumpedImage( aPath.string() ); } if (image) { registerImage( aDatasetId, aPath, image, aUseAsCurrent ); } if( aProgressNotifier ) { aProgressNotifier->finished(); } //mProdconn.PutDataset( image ); }
void ofImage_<PixelType>::allocate(int w, int h, ofImageType newType){ if (width == w && height == h && newType == type){ return; } #if defined(TARGET_ANDROID) || defined(TARGET_OF_IOS) registerImage(this); #endif pixels.allocate(w, h, newType); // take care of texture allocation -- if (pixels.isAllocated() && bUseTexture){ tex.allocate(pixels.getWidth(), pixels.getHeight(), ofGetGlInternalFormat(pixels)); if(ofGetGLProgrammableRenderer() && (pixels.getNumChannels()==1 || pixels.getNumChannels()==2)){ tex.setRGToRGBASwizzles(true); } } width = pixels.getWidth(); height = pixels.getHeight(); bpp = pixels.getBitsPerPixel(); type = pixels.getImageType(); }