Scalable Vector Graphics generation.
More...
#include <SVG.h>
The SVG class performs generation of Scalable Vector Graphics output. Generated SVG data can be sent to either a disk file or to a memory buffer. The Bitmap class can be used to render SVG objects as images.
- See also
- Graphics, Bitmap
Definition at line 80 of file SVG.h.
◆ SVG() [1/2]
pcl::SVG::SVG |
( |
const String & |
filePath, |
|
|
int |
width = 0 , |
|
|
int |
height = 0 |
|
) |
| |
Constructs an SVG object that will send graphics output to a file at the specified filePath.
The optional width and height values, if nonzero, will be written as the corresponding attributes of the root <svg> XML element.
◆ SVG() [2/2]
pcl::SVG::SVG |
( |
int |
width = 0 , |
|
|
int |
height = 0 |
|
) |
| |
Constructs an SVG object that will send graphics output to a memory buffer.
The optional width and height values, if nonzero, will be written as the corresponding attributes of the <svg> XML element.
◆ ~SVG()
Destroys an SVG object.
Definition at line 105 of file SVG.h.
◆ Bounds()
Rect pcl::SVG::Bounds |
( |
| ) |
const |
|
inline |
Returns the bounding rectangle of this SVG object. The returned rectangle is equal to Rect( 0, 0, Width(), Height() ).
Definition at line 145 of file SVG.h.
◆ Data()
Returns a copy of the output data buffer generated by this SVG object as a dynamic array of bytes. If this object sends graphics output to a file buffer, or if a Graphics object is still painting it, this function returns an empty array.
◆ Description()
String pcl::SVG::Description |
( |
| ) |
const |
Returns the description attribute of this SVG object.
◆ FilePath()
String pcl::SVG::FilePath |
( |
| ) |
const |
Returns the output file path of this SVG object. If this object sends its graphics output to a memory buffer, this function returns an empty string.
◆ GetDimensions()
void pcl::SVG::GetDimensions |
( |
int & |
width, |
|
|
int & |
height |
|
) |
| const |
Obtains the dimensions (width, height) of this SVG object in pixels.
◆ Height()
int pcl::SVG::Height |
( |
| ) |
const |
|
inline |
Returns the height of this SVG object.
Definition at line 136 of file SVG.h.
◆ IsPainting()
bool pcl::SVG::IsPainting |
( |
| ) |
const |
Returns true iff this SVG instance is being actively painted by a Graphics object.
◆ Null()
static SVG& pcl::SVG::Null |
( |
| ) |
|
|
static |
Returns a reference to a null SVG instance. A null SVG does not correspond to an existing SVG object in the PixInsight core application.
◆ Resolution()
int pcl::SVG::Resolution |
( |
| ) |
const |
Returns the resolution attribute of this SVG object in dots per inch.
◆ SetDescription()
void pcl::SVG::SetDescription |
( |
const String & |
desc | ) |
|
Sets the description attribute of this SVG object.
If no specific value is set by a call to this function, a default description attribute is set to "Generated with " plus a string representing the version of the PixInsight core application.
◆ SetDimensions()
void pcl::SVG::SetDimensions |
( |
int |
width, |
|
|
int |
height |
|
) |
| const |
Sets the dimensions of this SVG object, width and height in pixels.
◆ SetResolution()
void pcl::SVG::SetResolution |
( |
int |
r | ) |
|
Sets the resolution attribute of this SVG object in dots per inch.
◆ SetTitle()
void pcl::SVG::SetTitle |
( |
const String & |
title | ) |
|
Sets the title attribute of this SVG object.
If no specific value is set by a call to this function, a default title attribute is set to "PixInsight SVG Document" by the PixInsight core application.
◆ SetViewBox() [1/2]
◆ SetViewBox() [2/2]
void pcl::SVG::SetViewBox |
( |
double |
x0, |
|
|
double |
y0, |
|
|
double |
x1, |
|
|
double |
y1 |
|
) |
| |
Sets the viewBox attribute of this SVG object.
- Parameters
-
x0 | Left coordinate of the viewBox rectangle. |
y0 | Upper coordinate of the viewBox rectangle. |
x1 | Right coordinate of the viewBox rectangle. |
y1 | Bottom coordinate of the viewBox rectangle. |
The viewBox defines a clipping rectangle for graphics output. It can be useful when an SVG drawing will be used as an element of a larger drawing.
◆ Title()
String pcl::SVG::Title |
( |
| ) |
const |
Returns the title attribute of this SVG object.
◆ ViewBox()
DRect pcl::SVG::ViewBox |
( |
| ) |
const |
Returns the viewBox attribute of this SVG object. The viewBox defines a clipping rectangle for graphics output. It can be useful when an SVG drawing will be used as an element of a larger drawing.
◆ Width()
int pcl::SVG::Width |
( |
| ) |
const |
|
inline |
Returns the width of this SVG object.
Definition at line 128 of file SVG.h.
The documentation for this class was generated from the following file: