20#ifndef LIBREPCB_CORE_IMAGE_H
21#define LIBREPCB_CORE_IMAGE_H
26#include "../serialization/serializableobjectlist.h"
27#include "../types/angle.h"
28#include "../types/fileproofname.h"
29#include "../types/length.h"
30#include "../types/point.h"
50 Q_DECLARE_TR_FUNCTIONS(
Image)
73 const std::optional<UnsignedLength>& borderWidth)
noexcept;
97 bool setBorderWidth(
const std::optional<UnsignedLength>& width)
noexcept;
146 static
std::optional<QImage>
tryLoad(const QByteArray& data,
147 const QString& format,
148 QString* errorMsg =
nullptr) noexcept;
165 static constexpr const char* tagname =
"image";
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The Image class.
Definition image.h:49
const Angle & getRotation() const noexcept
Definition image.h:84
const PositiveLength & getWidth() const noexcept
Definition image.h:85
bool setPosition(const Point &pos) noexcept
Definition image.cpp:134
static const QStringList & getSupportedExtensions() noexcept
Get all supported file extensions.
Definition image.cpp:235
QString getFileBasename() const noexcept
Definition image.cpp:104
Signal< Image, Event > onEdited
Definition image.h:63
QString getFileExtension() const noexcept
Definition image.cpp:112
const FileProofName & getFileName() const noexcept
Definition image.h:79
Uuid mUuid
Definition image.h:151
bool operator==(const Image &rhs) const noexcept
Definition image.cpp:206
Event
Definition image.h:54
const PositiveLength & getHeight() const noexcept
Definition image.h:86
Slot< Image, Event > OnEditedSlot
Definition image.h:64
Angle mRotation
Definition image.h:154
bool setHeight(const PositiveLength &height) noexcept
Definition image.cpp:164
Point getCenter() const noexcept
Definition image.cpp:116
const Point & getPosition() const noexcept
Definition image.h:82
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition image.cpp:189
PositiveLength mHeight
Definition image.h:156
const Uuid & getUuid() const noexcept
Definition image.h:78
static std::optional< QImage > tryLoad(const QByteArray &data, const QString &format, QString *errorMsg=nullptr) noexcept
Try loading an image file.
Definition image.cpp:259
bool setWidth(const PositiveLength &width) noexcept
Definition image.cpp:154
bool setRotation(const Angle &rotation) noexcept
Definition image.cpp:144
Image & operator=(const Image &rhs) noexcept
Definition image.cpp:217
const std::optional< UnsignedLength > & getBorderWidth() const noexcept
Definition image.h:87
bool setBorderWidth(const std::optional< UnsignedLength > &width) noexcept
Definition image.cpp:174
std::optional< UnsignedLength > mBorderWidth
Definition image.h:157
~Image() noexcept
Definition image.cpp:97
Point mPosition
Definition image.h:153
FileProofName mFileName
Definition image.h:152
PositiveLength mWidth
Definition image.h:155
bool operator!=(const Image &rhs) const noexcept
Definition image.h:110
bool setFileName(const FileProofName &name) noexcept
Definition image.cpp:124
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The SExpression class.
Definition sexpression.h:69
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The Slot class is used to receive signals from non-QObject derived classes.
Definition signalslot.h:170
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
Definition occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
type_safe::constrained_type< QString, FileProofNameConstraint, FileProofNameVerifier > FileProofName
Definition fileproofname.h:90