LibreOffice Module svgio (master) 1
svgfegaussianblurnode.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
22#include <o3tl/string_view.hxx>
23
24namespace svgio::svgreader
25{
27 : SvgFilterNode(SVGToken::FeGaussianBlur, rDocument, pParent)
28 , maStdDeviation(SvgNumber(0.0))
29{
30}
31
33
34void SvgFeGaussianBlurNode::parseAttribute(const OUString& /*rTokenName*/, SVGToken aSVGToken,
35 const OUString& aContent)
36{
37 // parse own
38 switch (aSVGToken)
39 {
41 {
42 SvgNumber aNum;
43
44 if (readSingleNumber(aContent, aNum))
45 {
46 if (aNum.isPositive())
47 {
48 maStdDeviation = aNum;
49 }
50 }
51 break;
52 }
53 default:
54 {
55 break;
56 }
57 }
58}
59
61{
64 std::move(rTarget)));
65
67}
68
69} // end of namespace svgio::svgreader
70
71/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvgFeGaussianBlurNode(SvgDocument &rDocument, SvgNode *pParent)
virtual void parseAttribute(const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent) override
void apply(drawinglayer::primitive2d::Primitive2DContainer &rTarget) const override
double getNumber() const
Definition: SvgNumber.hxx:85
FilterGroup & rTarget
bool readSingleNumber(std::u16string_view rCandidate, SvgNumber &aNum)
Definition: svgtools.cxx:1076