File indexing completed on 2024-12-22 04:15:42

0001 /*
0002  *  SPDX-FileCopyrightText: 2009 Cyrille Berger <cberger@cberger.net>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.1-only
0005  */
0006 
0007 #include "jp2_import.h"
0008 
0009 #include <kpluginfactory.h>
0010 #include <QFileInfo>
0011 
0012 #include <KisDocument.h>
0013 #include <kis_image.h>
0014 
0015 #include "jp2_converter.h"
0016 
0017 K_PLUGIN_FACTORY_WITH_JSON(ImportFactory, "krita_jp2_import.json", registerPlugin<jp2Import>();)
0018 
0019 jp2Import::jp2Import(QObject *parent, const QVariantList &) : KisImportExportFilter(parent)
0020 {
0021 }
0022 
0023 jp2Import::~jp2Import()
0024 {
0025 }
0026 
0027 KisImportExportErrorCode jp2Import::convert(KisDocument *document, QIODevice */*io*/,  KisPropertiesConfigurationSP /*configuration*/)
0028 {
0029     JP2Converter converter(document);
0030     KisImportExportErrorCode result = converter.buildImage(filename());
0031     if (result.isOk()) {
0032         document->setCurrentImage(converter.image());
0033     }
0034     return result;
0035 }
0036 
0037 #include <jp2_import.moc>
0038