#include <kis_image_manager.h>
Definition at line 20 of file kis_image_manager.h.
◆ KisImageManager()
◆ ~KisImageManager()
| KisImageManager::~KisImageManager |
( |
| ) |
|
|
inlineoverride |
◆ importImage
| qint32 KisImageManager::importImage |
( |
const QUrl & | url, |
|
|
const QString & | layerType = "KisPaintLayer" ) |
|
slot |
Import an image as a layer. If there is more than one layer in the image, import all of them as separate layers.
- Parameters
-
| url | the url to the image file |
| layerType | the layer type |
- Returns
- the number of layers added
Definition at line 94 of file kis_image_manager.cc.
95{
97
98 if (!currentImage) {
99 return 0;
100 }
101
103 qint32 rc = 0;
104
105 if (urlArg.isEmpty()) {
107 dialog.setCaption(i18n(
"Import Image"));
108 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
111 Q_FOREACH (const QString &fileName, fileNames) {
112 paths << fileName;
113 }
114
115 } else {
116 paths.push_back(urlArg.toLocalFile());
117 }
118
119 if (paths.empty()) {
120 return 0;
121 }
122
123 Q_FOREACH(const QString &path, paths) {
124 if (path.endsWith("svg")) {
126 }
127 else {
129 }
130 }
131
133
134 return rc;
135}
static QStringList supportedMimeTypes(Direction direction)
QWidget * canvas() const
Return the actual widget that is displaying the current image.
QWidget * mainWindowAsQWidget() const
KisImageWSP image() const
Return the image this view is displaying.
References KisViewManager::canvas(), KisViewManager::image(), KisImportExportManager::Import, m_view, KisViewManager::mainWindowAsQWidget(), KoFileDialog::OpenFiles, and KisImportExportManager::supportedMimeTypes().
◆ resizeCurrentImage
| void KisImageManager::resizeCurrentImage |
( |
qint32 | w, |
|
|
qint32 | h, |
|
|
qint32 | xOffset, |
|
|
qint32 | yOffset ) |
|
slot |
◆ rotateCurrentImage
| void KisImageManager::rotateCurrentImage |
( |
double | radians | ) |
|
|
slot |
◆ scaleCurrentImage
| void KisImageManager::scaleCurrentImage |
( |
const QSize & | size, |
|
|
qreal | xres, |
|
|
qreal | yres, |
|
|
KisFilterStrategy * | filterStrategy ) |
|
slot |
◆ setup()
Definition at line 48 of file kis_image_manager.cc.
49{
50
53
54 action = actionManager->
createAction(
"image_properties");
56
57 action = actionManager->
createAction(
"import_layer_as_paint_layer");
59
60 action = actionManager->
createAction(
"import_layer_as_transparency_mask");
62
63 action = actionManager->
createAction(
"import_layer_as_filter_mask");
65
66 action = actionManager->
createAction(
"import_layer_as_selection_mask");
68
71}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisAction * createAction(const QString &name)
void slotImportLayerFromFile()
void slotImportLayerAsSelectionMask()
void slotImportLayerAsFilterMask()
void slotImageProperties()
void slotImportLayerAsTransparencyMask()
References connect(), KisActionManager::createAction(), slotImageColor(), slotImageProperties(), slotImportLayerAsFilterMask(), slotImportLayerAsSelectionMask(), slotImportLayerAsTransparencyMask(), and slotImportLayerFromFile().
◆ setView()
◆ shearCurrentImage
| void KisImageManager::shearCurrentImage |
( |
double | angleX, |
|
|
double | angleY ) |
|
slot |
◆ slotImageColor
| void KisImageManager::slotImageColor |
( |
| ) |
|
|
slot |
Definition at line 191 of file kis_image_manager.cc.
192{
194 if (!image) return;
195
196 QColorDialog dlg;
197 dlg.setOption(QColorDialog::ShowAlphaChannel, true);
198 dlg.setWindowTitle(i18n("Select a Color"));
200 dlg.setCurrentColor(oldBgColor.
toQColor());
201
203
206
207 connect(&dlg, SIGNAL(currentColorChanged(QColor)), &compressor, SLOT(start()));
208 connect(&compressor, SIGNAL(timeout()), &proxy, SLOT(start()));
209
210 if (dlg.exec() == QDialog::Accepted) {
211 if (compressor.isActive()) {
212 compressor.stop();
213 updateCall();
214 }
215 } else {
217 }
218}
KoColor defaultProjectionColor() const
void toQColor(QColor *c) const
a convenience method for the above.
void updateImageBackgroundColor(KisImageSP image, const QColorDialog *dlg)
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)
void changeImageDefaultProjectionColor(KisImageSP image, const KoColor &color)
References KisLayerUtils::changeImageDefaultProjectionColor(), connect(), KisImage::defaultProjectionColor(), KisSignalCompressor::FIRST_INACTIVE, KisViewManager::image(), KisSignalCompressor::isActive(), m_view, KisSignalCompressor::stop(), KoColor::toQColor(), updateImageBackgroundColor(), and void().
◆ slotImageProperties
| void KisImageManager::slotImageProperties |
( |
| ) |
|
|
slot |
Definition at line 163 of file kis_image_manager.cc.
164{
166 if (!image) return;
167
169 if (dlg->exec() == QDialog::Accepted) {
170 if (dlg->convertLayerPixels()) {
174
175 } else {
177 }
178 }
179 delete dlg;
180}
KisDisplayColorConverter displayColorConverter
void convertImageColorSpace(const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
void convertImageProjectionColorSpace(const KoColorSpace *dstColorSpace)
KisCanvas2 * canvasBase() const
Return the canvas base class.
References KisViewManager::canvasBase(), KisImage::convertImageColorSpace(), KisImage::convertImageProjectionColorSpace(), KisCanvas2::displayColorConverter, KisViewManager::image(), KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), m_view, and KisViewManager::mainWindowAsQWidget().
◆ slotImportLayerAsFilterMask
| void KisImageManager::slotImportLayerAsFilterMask |
( |
| ) |
|
|
slot |
◆ slotImportLayerAsSelectionMask
| void KisImageManager::slotImportLayerAsSelectionMask |
( |
| ) |
|
|
slot |
◆ slotImportLayerAsTransparencyMask
| void KisImageManager::slotImportLayerAsTransparencyMask |
( |
| ) |
|
|
slot |
◆ slotImportLayerFromFile
| void KisImageManager::slotImportLayerFromFile |
( |
| ) |
|
|
slot |
◆ m_view
The documentation for this class was generated from the following files: