Image1::Ref Image1::fromImage1uint8(const ReferenceCountedPointer<Image1uint8>& im) { Ref out = createEmpty(static_cast<WrapMode>(im->wrapMode())); out->resize(im->width(), im->height()); int N = im->width() * im->height(); const Color1uint8* src = reinterpret_cast<Color1uint8*>(im->getCArray()); for (int i = 0; i < N; ++i) { out->data[i] = Color1(src[i]); } return out; }
Image4uint8::Ref Image4uint8::fromImage4(const ReferenceCountedPointer<Image4>& im) { Ref out = createEmpty(static_cast<WrapMode>(im->wrapMode())); out->copyArray(im->getCArray(), im->width(), im->height()); return out; }
/** @param saveName Initial value of the box and what will be returned in the event that the user presses ok. @return True unless cancelled */ static bool getFilename(std::string& saveName, GWindow* osWindow, GuiSkinRef skin) { ReferenceCountedPointer<SaveDialog> guiWindow = new SaveDialog(saveName, skin); guiWindow->showModal(osWindow); return guiWindow->ok; }
Image1uint8::Ref Image1uint8::fromImage3uint8(const ReferenceCountedPointer<class Image3uint8>& im) { return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode()); }