Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgStyleWriter.cpp File Reference
#include "SvgStyleWriter.h"
#include "SvgSavingContext.h"
#include "SvgUtil.h"
#include <KoShape.h>
#include <KoPathShape.h>
#include <KoPathSegment.h>
#include <KoFilterEffect.h>
#include <KoFilterEffectStack.h>
#include <KoColorBackground.h>
#include <KoGradientBackground.h>
#include <KoMeshGradientBackground.h>
#include <KoPatternBackground.h>
#include <KoVectorPatternBackground.h>
#include <KoShapeStroke.h>
#include <KoClipPath.h>
#include <KoClipMask.h>
#include <KoMarker.h>
#include <KoXmlWriter.h>
#include <QBuffer>
#include <QGradient>
#include <QLinearGradient>
#include <QRadialGradient>
#include <KisMimeDatabase.h>
#include "kis_dom_utils.h"
#include "kis_algebra_2d.h"
#include <SvgWriter.h>
#include <KoFlakeCoordinateSystem.h>

Go to the source code of this file.

Functions

QString convertGradientMode (QGradient::CoordinateMode mode)
 
void embedShapes (const QList< KoShape * > &shapes, KoXmlWriter &outWriter)
 

Function Documentation

◆ convertGradientMode()

QString convertGradientMode ( QGradient::CoordinateMode mode)
inline

Definition at line 375 of file SvgStyleWriter.cpp.

375 {
376 KIS_ASSERT_RECOVER_NOOP(mode != QGradient::StretchToDeviceMode);
377
378 return
379 mode == QGradient::ObjectBoundingMode ?
380 "objectBoundingBox" :
381 "userSpaceOnUse";
382
383}
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97

References KIS_ASSERT_RECOVER_NOOP.

◆ embedShapes()

void embedShapes ( const QList< KoShape * > & shapes,
KoXmlWriter & outWriter )

Definition at line 215 of file SvgStyleWriter.cpp.

216{
217 QBuffer buffer;
218 buffer.open(QIODevice::WriteOnly);
219 {
220 SvgWriter shapesWriter(shapes);
221 shapesWriter.saveDetached(buffer);
222 }
223 buffer.close();
224 outWriter.addCompleteElement(&buffer);
225}
void addCompleteElement(QIODevice *dev)
Implements exporting shapes to SVG.
Definition SvgWriter.h:33

References KoXmlWriter::addCompleteElement(), and SvgWriter::saveDetached().