|
NovaSVG 0.10.0
A header-only SVG library
|
#include <novasvg.h>


Public Member Functions | |
| Element ()=default | |
| Constructs a null element. | |
| bool | hasAttribute (const std::string &name) const |
| Checks if the element has a specific attribute. | |
| const std::string & | getAttribute (const std::string &name) const |
| Retrieves the value of an attribute. | |
| void | setAttribute (const std::string &name, const std::string &value) |
| Sets the value of an attribute. | |
| void | render (Bitmap &bitmap, const Matrix &matrix=Matrix()) const |
| Renders the element onto a bitmap using a transformation matrix. | |
| Bitmap | renderToBitmap (int width=-1, int height=-1, const Color &backgroundColor=Color(0, 0, 0, 0)) const |
| Renders the element to a bitmap with specified dimensions. | |
| Matrix | getLocalMatrix () const |
| Retrieves the local transformation matrix of the element. | |
| Matrix | getGlobalMatrix () const |
| Retrieves the global transformation matrix of the element. | |
| Box | getLocalBoundingBox () const |
| Retrieves the local bounding box of the element. | |
| Box | getGlobalBoundingBox () const |
| Retrieves the global bounding box of the element. | |
| Box | getBoundingBox () const |
| Retrieves the bounding box of the element without any transformations. | |
| NodeList | children () const |
| Returns the child nodes of this node. | |
Public Member Functions inherited from novasvg::Node | |
| Node ()=default | |
| Constructs a null node. | |
| bool | isTextNode () const |
| Checks if the node is a text node. | |
| bool | isElement () const |
| Checks if the node is an element node. | |
| TextNode | toTextNode () const |
| Converts the node to a TextNode. | |
| Element | toElement () const |
| Converts the node to an Element. | |
| Element | parentElement () const |
| Returns the parent element. | |
| bool | isNull () const |
| Checks if the node is null. | |
| operator bool () const | |
| Checks if the node is not null. | |
| bool | operator== (const Node &node) const |
| Checks if two nodes are equal. | |
| bool | operator!= (const Node &node) const |
| Checks if two nodes are not equal. | |
Friends | |
| class | Node |
| class | Document |
Additional Inherited Members | |
Protected Member Functions inherited from novasvg::Node | |
| Node (SVGNode *node) | |
| SVGNode * | node () const |
Protected Attributes inherited from novasvg::Node | |
| SVGNode * | m_node {nullptr} |
|
default |
Constructs a null element.
|
inline |
Returns the child nodes of this node.
Definition at line 993 of file novasvg.h.
References novasvg::SVGElement::children(), children(), and novasvg::Node::m_node.
Referenced by children().
|
inline |
Retrieves the value of an attribute.
| name | The name of the attribute to retrieve. |
Definition at line 910 of file novasvg.h.
References novasvg::emptyString, novasvg::SVGElement::getAttribute(), and novasvg::Node::m_node.
|
inline |
Retrieves the bounding box of the element without any transformations.
Definition at line 986 of file novasvg.h.
References novasvg::Node::m_node, and novasvg::SVGElement::paintBoundingBox().
Referenced by getGlobalBoundingBox(), and getLocalBoundingBox().
|
inline |
Retrieves the global bounding box of the element.
Definition at line 981 of file novasvg.h.
References getBoundingBox(), getGlobalMatrix(), and novasvg::Box::transformed().
|
inline |
Retrieves the global transformation matrix of the element.
Definition at line 966 of file novasvg.h.
References novasvg::SVGElement::localTransform(), novasvg::Node::m_node, novasvg::Node::parentElement(), and novasvg::Transform::postMultiply().
Referenced by getGlobalBoundingBox().
|
inline |
Retrieves the local bounding box of the element.
Definition at line 976 of file novasvg.h.
References getBoundingBox(), getLocalMatrix(), and novasvg::Box::transformed().
|
inline |
Retrieves the local transformation matrix of the element.
Definition at line 959 of file novasvg.h.
References novasvg::SVGElement::localTransform(), and novasvg::Node::m_node.
Referenced by getLocalBoundingBox().
|
inline |
Checks if the element has a specific attribute.
| name | The name of the attribute to check. |
Definition at line 903 of file novasvg.h.
References novasvg::SVGElement::hasAttribute(), and novasvg::Node::m_node.
Renders the element onto a bitmap using a transformation matrix.
| bitmap | The bitmap to render onto. |
| The | root transformation matrix. |
Definition at line 924 of file novasvg.h.
References novasvg::Bitmap::isNull(), novasvg::Node::m_node, novasvg::Painting, and novasvg::SVGElement::render().
Referenced by renderToBitmap().
|
inline |
Renders the element to a bitmap with specified dimensions.
| width | The desired width in pixels, or -1 to auto-scale based on the intrinsic size. |
| height | The desired height in pixels, or -1 to auto-scale based on the intrinsic size. |
| backgroundColor | The background color to render onto. |
Definition at line 933 of file novasvg.h.
References novasvg::Bitmap::clear(), novasvg::SVGElement::localTransform(), novasvg::Node::m_node, novasvg::Transform::mapRect(), render(), and novasvg::Color::value().
|
inline |
Sets the value of an attribute.
| name | The name of the attribute to set. |
| value | The value to assign to the attribute. |
Definition at line 917 of file novasvg.h.
References novasvg::Node::m_node, and novasvg::SVGElement::setAttribute().