12#include <QImageReader>
13#include <QSvgRenderer>
35 Q_UNUSED(resourcesInterface);
37 m_svg = dev->readAll();
39 QSvgRenderer renderer(
m_svg);
41 QRect box = renderer.viewBox();
42 if (box.isEmpty())
return false;
44 QImage image_(1000, (1000 * box.height()) / box.width(), QImage::Format_ARGB32);
47 p.fillRect(0, 0, image_.width(), image_.height(), Qt::white);
52 for (
int i = 0; i < 256; ++i) table.push_back(qRgb(i, i, i));
53 image_ = image_.convertToFormat(QImage::Format_Indexed8, table);
77 return QString(
".svg");
virtual void setSpacing(double spacing)
virtual QImage brushTipImage() const
brushImage the image the brush tip can paint with. Not all brush types have a single image.
virtual void setBrushType(enumBrushType type)
void predefinedBrushToXML(const QString &type, QDomElement &e) const
virtual void toXML(QDomDocument &, QDomElement &) const
virtual void setBrushTipImage(const QImage &image)
void setWidth(qint32 width)
void setHeight(qint32 height)
bool saveToDevice(QIODevice *dev) const override
QString defaultFileExtension() const override
KoResourceSP clone() const override
void toXML(QDomDocument &d, QDomElement &e) const override
KisSvgBrush(const QString &filename)
Construct brush to load filename later as brush.
bool loadFromDevice(QIODevice *dev, KisResourcesInterfaceSP resourcesInterface) override
QSharedPointer< KoResource > KoResourceSP
void setValid(bool valid)
void setName(const QString &name)