Commit 53c28ccc authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove abortive OpenImageIO plugin

It was a bad idea to begin with.
parent ae4d8bed
......@@ -65,7 +65,3 @@ add_subdirectory(odg)
add_subdirectory(qml)
add_subdirectory(tga)
add_subdirectory(heightmap)
#if(OIIO_FOUND)
# add_subdirectory(oiio)
#endif()
set(kritaoiioexport_PART_SRCS
kis_oiio_export.cpp
)
ki18n_wrap_ui(kritaoiioexport_PART_SRCS )
add_library(kritaoiioexport MODULE ${kritaoiioexport_PART_SRCS})
target_link_libraries(kritaoiioexport kritaui ${OIIO_LIBRARIES})
install(TARGETS kritaoiioexport DESTINATION ${CALLIGRA_PLUGIN_INSTALL_DIR})
install( FILES krita_oiio_export.desktop DESTINATION ${SERVICES_INSTALL_DIR}/calligra)
install( PROGRAMS krita_oiio.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
set(kritaoiioimport_PART_SRCS
kis_oiio_import.cpp
)
ki18n_wrap_ui(kritaoiioimport_PART_SRCS )
add_library(kritaoiioimport MODULE ${kritaoiioimport_PART_SRCS})
target_link_libraries(kritaoiioimport kritaui ${OIIO_LIBRARIES})
install(TARGETS kritaoiioimport DESTINATION ${CALLIGRA_PLUGIN_INSTALL_DIR})
install( FILES krita_oiio_import.desktop DESTINATION ${SERVICES_INSTALL_DIR}/calligra)
install( PROGRAMS krita_oiio.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
/*
* Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "kis_oiio_export.h"
#include <QCheckBox>
#include <QSlider>
#include <kpluginfactory.h>
#include <KisFilterChain.h>
#include <kis_paint_device.h>
#include <KisDocument.h>
#include <kis_image.h>
#include <kis_paint_layer.h>
K_PLUGIN_FACTORY(KisOiioExportFactory, registerPlugin<KisOiioExport>();)
K_EXPORT_PLUGIN(KisOiioExportFactory("calligrafilters"))
KisOiioExport::KisOiioExport(QObject *parent, const QVariantList &) : KisImportExportFilter(parent)
{
}
KisOiioExport::~KisOiioExport()
{
}
KisImportExportFilter::ConversionStatus KisOiioExport::convert(const QByteArray& from, const QByteArray& to)
{
dbgFile << "Oiio export! From:" << from << ", To:" << to << "";
KisDocument *input = dynamic_cast<KisDocument*>(m_chain->inputDocument());
QString filename = m_chain->outputFile();
if (!input)
return KisImportExportFilter::NoDocumentCreated;
if (filename.isEmpty()) return KisImportExportFilter::FileNotFound;
if (from != "application/x-krita")
return KisImportExportFilter::NotImplemented;
QUrl url = QUrl::fromLocalFile(filename);
qApp->processEvents(); // For vector layers to be updated
input->image()->waitForDone();
QRect rc = input->image()->bounds();
input->image()->refreshGraph();
input->image()->lock();
QImage image = input->image()->projection()->convertToQImage(0, 0, 0, rc.width(), rc.height());
input->image()->unlock();
image.save(url.toLocalFile());
return KisImportExportFilter::OK;
}
#include "kis_oiio_export.moc"
/*
* Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _KIS_Oiio_EXPORT_H_
#define _KIS_Oiio_EXPORT_H_
#include <QVariant>
#include <KisImportExportFilter.h>
class KisOiioExport : public KisImportExportFilter
{
Q_OBJECT
public:
KisOiioExport(QObject *parent, const QVariantList &);
virtual ~KisOiioExport();
public:
virtual KisImportExportFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
};
#endif
/*
* Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "kis_oiio_import.h"
#include <QCheckBox>
#include <QSlider>
#include <kpluginfactory.h>
#include <KoColorSpace.h>
#include <KisFilterChain.h>
#include <KoColorSpaceRegistry.h>
#include <KoCompositeOp.h>
#include <KoColorSpaceTraits.h>
#include <KoColorModelStandardIds.h>
#include <kis_transaction.h>
#include <kis_paint_device.h>
#include <KisDocument.h>
#include <kis_image.h>
#include <kis_paint_layer.h>
#include <kis_node.h>
#include <kis_group_layer.h>
#include <OpenImageIO/imageio.h>
#include <OpenImageIO/imagebuf.h>
OIIO_NAMESPACE_USING
K_PLUGIN_FACTORY(KisOiioImportFactory, registerPlugin<KisOiioImport>();)
K_EXPORT_PLUGIN(KisOiioImportFactory("calligrafilters"))
KisOiioImport::KisOiioImport(QObject *parent, const QVariantList &) : KisImportExportFilter(parent)
{
}
KisOiioImport::~KisOiioImport()
{
}
KisImportExportFilter::ConversionStatus KisOiioImport::convert(const QByteArray& from, const QByteArray& to)
{
dbgFile << "Oiio import! From:" << from << ", To:" << to << 0;
if (!(from == "image/oiio" || from == "image/x-xpixmap" || from == "image/gif" || from == "image/x-xbitmap"))
return KisImportExportFilter::NotImplemented;
if (to != "application/x-krita")
return KisImportExportFilter::BadMimeType;
KisDocument * doc = dynamic_cast<KisDocument*>(m_chain -> outputDocument());
if (!doc)
return KisImportExportFilter::NoDocumentCreated;
QString filename = m_chain -> inputFile();
doc->prepareForImport();
if (!filename.isEmpty()) {
QUrl url(filename);
if (url.isEmpty())
return KisImportExportFilter::FileNotFound;
QString localFile = url.toLocalFile();
ImageBuf buf(localFile::toStdString());
int nSubImages = buf.nsubimages();
// const KoColorSpace *colorSpace = KoColorSpaceRegistry::instance()->colorSpace(RGBAColorModelID.id(),
// Float32BitsColorDepthID.id(),
// "");
// KisImageSP image = new KisImage(doc->createUndoStore(), img.width(), img.height(), colorSpace, localFile);
// KisPaintLayerSP layer = new KisPaintLayer(image, image->nextLayerName(), 255);
// layer->paintDevice()->convertFromQImage(img, 0, 0, 0);
// image->addNode(layer.data(), image->rootLayer().data());
// doc->setCurrentImage(image);
return KisImportExportFilter::OK;
}
return KisImportExportFilter::StorageCreationError;
}
#include "kis_oiio_import.moc"
/*
* Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _KIS_Oiio_IMPORT_H_
#define _KIS_Oiio_IMPORT_H_
#include <QVariant>
#include <KisImportExportFilter.h>
class KisOiioImport : public KisImportExportFilter
{
Q_OBJECT
public:
KisOiioImport(QObject *parent, const QVariantList &);
virtual ~KisOiioImport();
public:
virtual KisImportExportFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
};
#endif
[Desktop Entry]
Name=Krita
Name[af]=Krita
Name[bg]=Krita
Name[br]=Krita
Name[bs]=Krita
Name[ca]=Krita
Name[ca@valencia]=Krita
Name[cy]=Krita
Name[da]=Krita
Name[de]=Krita
Name[el]=Krita
Name[en_GB]=Krita
Name[eo]=Krita
Name[es]=Krita
Name[et]=Krita
Name[eu]=Krita
Name[fi]=Krita
Name[fr]=Krita
Name[fy]=Krita
Name[ga]=Krita
Name[gl]=Krita
Name[he]=Krita
Name[hi]=केरिता
Name[hne]=केरिता
Name[hr]=Krita
Name[hu]=Krita
Name[ia]=Krita
Name[is]=Krita
Name[it]=Krita
Name[kk]=Krita
Name[ko]=Krita
Name[lt]=Krita
Name[lv]=Krita
Name[mr]=क्रिटा
Name[ms]=Krita
Name[nb]=Krita
Name[nds]=Krita
Name[ne]=क्रिता
Name[nl]=Krita
Name[pl]=Krita
Name[pt]=Krita
Name[pt_BR]=Krita
Name[ro]=Krita
Name[ru]=Krita
Name[se]=Krita
Name[sk]=Krita
Name[sl]=Krita
Name[sv]=Krita
Name[ta]=கிரிட்டா
Name[tg]=Krita
Name[tr]=Krita
Name[ug]=Krita
Name[uk]=Krita
Name[uz]=Krita
Name[uz@cyrillic]=Krita
Name[wa]=Krita
Name[xh]=Krita
Name[x-test]=xxKritaxx
Name[zh_CN]=Krita
Name[zh_TW]=繪圖_Krita
Exec=krita %u
MimeType=image/cineon;image/dpx;image/fits;image/field3d;image/vnd.radiance;image/exr;
Type=Application
Icon=calligrakrita
Categories=Qt;KDE;Office;Graphics;
StartupNotify=true
X-KDE-ServiceTypes=Calligra/Application
X-Calligra-DefaultMimeTypes=image/cineon,image/dpx,image/fits,image/field3d,image/vnd.radiance,image/exr
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.krita.krita
NoDisplay=true
[Desktop Entry]
Name=Krita Oiio OpenColorIO-based export Filter
Name[bs]=Krita Oiio OpenColorIO izvozni Filter
Name[ca]=Filtre d'exportació OIIO basat en OpenColorIO pel Krita
Name[ca@valencia]=Filtre d'exportació OIIO basat en OpenColorIO pel Krita
Name[da]=Krita Oiio OpenColorIO-baseret eksportfilter
Name[de]=Oiio-OpenColorIO-basierter Exportfilter für Krita
Name[el]=Φίλτρο εξαγωγής Oiio OpenColorIO-based του Krita
Name[en_GB]=Krita Oiio OpenColorIO-based export Filter
Name[es]=Filtro de exportación OIIO de OpenColorIO de Krita
Name[et]=Krita Oiio OpenColorIO põhine ekspordifilter
Name[eu]=Krita-ren Oiio OpenColorIO-n oinarritutako esportazio-iragazkia
Name[fi]=Kritan Oiio OpenColorIO -pohjainen vientisuodatin
Name[fr]=Filtre d'exportation Oiio OpenColorIO de Krita
Name[gl]=Filtro de exportación de Oiio baseado en OpenColorIO para Krita
Name[hu]=Krita Oiio OpenColorIO-alapú exportszűrő
Name[it]=Filtro di esportazione OiiO per Krita basato su OpenColorIO
Name[kk]=Krita-ның Oiio OpenColorIO-негіздеген экспорт сүзгісі
Name[ko]=Krita Oiio OpenColorIO 기반 내보내기 필터
Name[lt]=Krita Oiio OpenColorIO eksportavimo filtras
Name[nb]=Oiio OpenColorIO-basert eksportfilter for Krita
Name[nl]=Op Krita Oiio OpenColorIO gebaseerd exportfilter
Name[pl]=Filtr eksportu oparty o Oiio OpenColorIO Krity
Name[pt]=Filtro de Exportação OIIO do OpenColorIO para o Krita
Name[pt_BR]=Filtro de exportação baseado no OpenColorIO do Oiio para Krita
Name[sk]=Exportný filter Krita založený na Oiio OpenColorIO
Name[sv]=Krita Oiio OpenColorIO-baserat exportfilter
Name[tr]=Krita Oiio OpenColorIO-tabanlı dışa aktarım filtresi
Name[uk]=Фільтр експортування Oiio на основі OpenColorIO для Krita
Name[x-test]=xxKrita Oiio OpenColorIO-based export Filterxx
X-KDE-Export=image/cineon,image/dpx,image/fits,image/field3d,image/vnd.radiance,image/exr
X-KDE-ServiceTypes=Krita/FileFilter
Type=Service
X-KDE-Import=application/x-krita
X-KDE-Weight=1
X-KDE-Library=kritaoiioexport
NoDisplay=true
[Desktop Entry]
Name=Krita OpenColorIO-based Import Filter
Name[bs]=Krita Oiio OpenColorIO uvozni Filter
Name[ca]=Filtre d'importació basat en OpenColorIO pel Krita
Name[ca@valencia]=Filtre d'importació basat en OpenColorIO pel Krita
Name[da]=Krita OpenColorIO-baseret importfilter
Name[de]=OpenColorIO-basierter Importfilter für Krita
Name[el]=Φίλτρο εισαγωγής OpenColorIO-based του Krita
Name[en_GB]=Krita OpenColorIO-based Import Filter
Name[es]=Filtro de importación de OpenColorIO de Krita
Name[et]=Krita OpenColorIO põhine impordifilter
Name[eu]=Krita-ren OpenColorIO-n oinarritutako inportazio-iragazkia
Name[fi]=Kritan OpenColorIO-pohjainen tuontisuodatin
Name[fr]=Filtre d'importation OpenColorIO de Krita
Name[gl]=Filtro de importación baseado en OpenColorIO para Krita
Name[hu]=Krita OpenColorIO-alapú importszűrő
Name[it]=Filtro di importazione per Krita basato su OpenColorIO
Name[kk]=Krita-ның Oiio OpenColorIO-негіздеген импорт сүзгісі
Name[ko]=Krita Oiio OpenColorIO 기반 가져오기 필터
Name[lt]=Krita Oiio OpenColorIO importavimo filtras
Name[nb]=OpenColorIO-basert importfilter for Krita
Name[nl]=Op Krita OpenColorIO gebaseerd importfilter
Name[pl]=Filtr importu oparty o OpenColorIO Krity
Name[pt]=Filtro de Importação Baseado no OpenColorIO para o Krita
Name[pt_BR]=Filtro de importação baseado no OpenColorIO para Krita
Name[sk]=Importný filter Krita založený na OpenColorIO
Name[sv]=Krita OpenColorIO-baserat importfilter
Name[tr]=Krita Oiio OpenColorIO-tabanlı içe aktarım filtresi
Name[uk]=Фільтр імпортування на основі OpenColorIO для Krita
Name[x-test]=xxKrita OpenColorIO-based Import Filterxx
X-KDE-Export=application/x-krita
X-KDE-ServiceTypes=Krita/FileFilter
Type=Service
X-KDE-Import=image/cineon,image/dpx,image/fits,image/field3d,image/vnd.radiance,image/exr
X-KDE-Weight=2
X-KDE-Library=kritaoiioimport
NoDisplay=true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment