Added support for using RawTherapee as a GIMP plugin for opening RAW files

plugin code taken from Darktable
This commit is contained in:
Alberto Griggio
2017-05-18 15:59:56 +02:00
parent 3999bf179e
commit 54b66b7736
8 changed files with 876 additions and 13 deletions

View File

@@ -679,13 +679,17 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
iops->attach_next_to (*vsep2, Gtk::POS_LEFT, 1, 1);
iops->attach_next_to (*progressLabel, Gtk::POS_LEFT, 1, 1);
iops->attach_next_to (*vsep1, Gtk::POS_LEFT, 1, 1);
iops->attach_next_to (*sendtogimp, Gtk::POS_LEFT, 1, 1);
if (!gimpPlugin) {
iops->attach_next_to (*sendtogimp, Gtk::POS_LEFT, 1, 1);
}
if (!simpleEditor) {
if (!gimpPlugin) {
iops->attach_next_to (*queueimg, Gtk::POS_LEFT, 1, 1);
}
iops->attach_next_to (*saveimgas, Gtk::POS_LEFT, 1, 1);
if (!gimpPlugin) {
iops->attach_next_to (*saveimgas, Gtk::POS_LEFT, 1, 1);
}
// Color management toolbar
@@ -1577,7 +1581,9 @@ bool EditorPanel::handleShortcutKey (GdkEventKey* event)
return true;
case GDK_KEY_s:
saveAsPressed();
if (!gimpPlugin) {
saveAsPressed();
}
return true;
case GDK_KEY_b:
@@ -1588,7 +1594,9 @@ bool EditorPanel::handleShortcutKey (GdkEventKey* event)
return true;
case GDK_KEY_e:
sendToGimpPressed();
if (!gimpPlugin) {
sendToGimpPressed();
}
return true;
case GDK_KEY_z:
@@ -1885,6 +1893,30 @@ void EditorPanel::sendToGimpPressed ()
}
bool EditorPanel::saveImmediately(const Glib::ustring &filename, SaveFormat sf)
{
rtengine::procparams::ProcParams pparams;
ipc->getParams (&pparams);
std::unique_ptr<rtengine::ProcessingJob> job(rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams));
// save immediately
rtengine::IImage16 *img = rtengine::processImage(job.get(), err, nullptr, options.tunnelMetaData, false);
int err = 0;
if (sf.format == "tif") {
err = img->saveAsTIFF(filename, sf.tiffBits, sf.tiffUncompressed);
} else if (sf.format == "png") {
err = img->saveAsPNG(filename, sf.pngCompression, sf.pngBits);
} else if (sf.format == "jpg") {
err = img->saveAsJPEG(filename, sf.jpegQuality, sf.jpegSubSamp);
} else {
err = 1;
}
img->free();
return !err;
}
void EditorPanel::openPreviousEditorImage()
{
if (!simpleEditor && fPanel && !fname.empty()) {