void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { LLUUID inventory_item_id = findItemID(te.getID(), TRUE); if (inventory_item_id.notNull()) { LLToolPipette::getInstance()->setResult(TRUE, ""); // <FS:Ansariel> FIRE-8298: Apply now checkbox has no effect setCanApply(true, true); // </FS:Ansariel> setImageID(te.getID()); mNoCopyTextureSelected = FALSE; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture mNoCopyTextureSelected = TRUE; } else { childSetValue("texture_uuid", inventory_item_id.asString()); } commitIfImmediateSet(); } else { LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); } }
/** * Open the JPG images. * If file exists, the image are loaded in the pixel matrix. * * @param filename: Name of the Image to open. * @exception FileException Throwed when the file does not exists. * @exception FullHeapException Insufficient space for memory allocation. * @see Pixel. */ void JPGImage::openImage(string filename) throw (artemis::FileException*, artemis::FullHeapException*){ IplImage *image; setFilename(filename); image = cvLoadImage(getFilename().c_str(), 3); if (!image) throw new FileException(0, "The image file cannot be opened or the file does not exists", filename); //JPG is a multi channel colored image setChannels(image->nChannels); setImageID(0); //Properties of the Object //Size is the pixel area //Here is the calculus setSize((image->height)*(image->width)); setWidth(image->width); setHeight(image->height); //Transfer RGB from IplImage to Matrix of Pixels //The Matrix of Pixels can be accessed now //Full Load of the jpg image //This function load the JPEG image by OpenCV try{ loadPixelMatrix(); }catch(FullHeapException he){ throw he; } cvReleaseImage(&image); }
void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { //<edit> //LLUUID inventory_item_id = findItemID(te.getID(), TRUE); //if (inventory_item_id.notNull()) //{ LLToolPipette::getInstance()->setResult(TRUE, ""); setImageID(te.getID()); mNoCopyTextureSelected = FALSE; getChild<LLUICtrl>("texture_uuid")->setValue(te.getID().asString()); /* LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture mNoCopyTextureSelected = TRUE; } */ commitIfImmediateSet(); // } // else // { // LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); // } //</edit> }
/*! * Method for initializing the current wallpaper descriptor from theme ids * * \param landscapeID The theme-image-id for the landscape wallpaper * \param portraitID The theme-image-id for the portrait wallpaper */ bool WallpaperCurrentDescriptor::setFromIDs ( QString landscapeID, QString portraitID) { bool retval = false; SYS_DEBUG ("*** landscapeID = %s", SYS_STR(landscapeID)); SYS_DEBUG ("*** portraitID = %s", SYS_STR(portraitID)); /* * Hack, as nowadays only portrait mode image ids are pre-set... */ //if (landscapeID.isEmpty()) // landscapeID = portraitID; if (landscapeID.isEmpty () && portraitID.isEmpty ()) goto finalize; if (!landscapeID.isEmpty()) { if (landscapeID.startsWith("/")) { setFilename (landscapeID, WallpaperDescriptor::Landscape); setFilename (landscapeID, WallpaperDescriptor::OriginalLandscape); } else { setImageID (landscapeID, WallpaperDescriptor::Landscape); setImageID (landscapeID, WallpaperDescriptor::OriginalLandscape); } } if (!portraitID.isEmpty()) { if (portraitID.startsWith("/")) { setFilename (portraitID, WallpaperDescriptor::Portrait); setFilename (portraitID, WallpaperDescriptor::OriginalPortrait); } else { setImageID (portraitID, WallpaperDescriptor::Portrait); setImageID (portraitID, WallpaperDescriptor::OriginalPortrait); } } m_Valid = true; retval = true; finalize: SYS_DEBUG ("Returning %s", SYS_BOOL(retval)); return retval; }
Profile::Profile(ProfilePlugin *profilePlugin, QGraphicsItem *parent) : MContentItem(MContentItem::IconAndTwoTextLabels, parent), plugin(profilePlugin) { setTitle("Profile"); setSubtitle("Silent"); setObjectName("StatusIndicatorMenuExtensionContentItem"); setImageID("icon-m-profile-silent"); connect(this, SIGNAL(clicked()), this, SLOT(showProfileDialog())); }
// virtual BOOL LLFloaterTexturePicker::handleDragAndDrop( S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { BOOL handled = FALSE; bool is_mesh = cargo_type == DAD_MESH; if ((cargo_type == DAD_TEXTURE) || is_mesh) { LLInventoryItem *item = (LLInventoryItem *)cargo_data; BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); PermissionMask item_perm_mask = 0; if (copy) item_perm_mask |= PERM_COPY; if (mod) item_perm_mask |= PERM_MODIFY; if (xfer) item_perm_mask |= PERM_TRANSFER; //PermissionMask filter_perm_mask = getFilterPermMask(); Commented out due to no-copy texture loss. PermissionMask filter_perm_mask = mDnDFilterPermMask; if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask ) { if (drop) { // <FS:Ansariel> FIRE-8298: Apply now checkbox has no effect setCanApply(true, true); // </FS:Ansariel> setImageID( item->getAssetUUID() ); commitIfImmediateSet(); } *accept = ACCEPT_YES_SINGLE; } else { *accept = ACCEPT_NO; } } else { *accept = ACCEPT_NO; } handled = TRUE; lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << llendl; return handled; }
// virtual BOOL LLFloaterTexturePicker::handleDragAndDrop( S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { BOOL handled = FALSE; if (cargo_type == DAD_TEXTURE) { LLInventoryItem *item = (LLInventoryItem *)cargo_data; BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); PermissionMask item_perm_mask = 0; if (copy) item_perm_mask |= PERM_COPY; if (mod) item_perm_mask |= PERM_MODIFY; if (xfer) item_perm_mask |= PERM_TRANSFER; // <edit> //PermissionMask filter_perm_mask = mImmediateFilterPermMask; //if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask ) // </edit> { if (drop) { setImageID( item->getAssetUUID() ); commitIfImmediateSet(); } *accept = ACCEPT_YES_SINGLE; } // <edit> /*else { *accept = ACCEPT_NO; }*/ // </edit> } else { *accept = ACCEPT_NO; } handled = TRUE; lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << llendl; return handled; }
/** * Constructor of JPG Image Class. * It's advised when you want to create * a new JPG File. * NOTE: For default all JPG Files are opened * in colored mode with 8 bits per pixel. */ JPGImage::JPGImage(){ setFilename("NO_FILE"); setSize(0); setWidth(0); setHeight(0); setChannels(0); setImageID(0); setGrayScaleAvaliable(false); setBlackAndWhiteAvaliable(false); setBitsPerPixel(8); }
int WallpaperImage::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { typedef bb::cascades::ImageView QMocSuperClass; _id = QMocSuperClass::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 13) qt_static_metacall(this, _c, _id, _a); _id -= 13; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QUrl*>(_v) = url(); break; case 1: *reinterpret_cast< QString*>(_v) = imageID(); break; case 2: *reinterpret_cast< float*>(_v) = loading(); break; case 3: *reinterpret_cast< QUrl*>(_v) = defaultImage(); break; case 4: *reinterpret_cast< bool*>(_v) = ready(); break; } _id -= 5; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setUrl(*reinterpret_cast< QUrl*>(_v)); break; case 1: setImageID(*reinterpret_cast< QString*>(_v)); break; case 2: setLoading(*reinterpret_cast< float*>(_v)); break; case 3: setDefaultImage(*reinterpret_cast< QUrl*>(_v)); break; case 4: setReady(*reinterpret_cast< bool*>(_v)); break; } _id -= 5; } else if (_c == QMetaObject::ResetProperty) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 5; } #endif // QT_NO_PROPERTIES return _id; }
void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { LLUUID inventory_item_id = findItemID(te.getID(), TRUE); if (inventory_item_id.notNull()) { LLToolPipette::getInstance()->setResult(TRUE, ""); setImageID(te.getID()); mNoCopyTextureSelected = FALSE; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture mNoCopyTextureSelected = TRUE; } commitIfImmediateSet(); } else { LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); } }