16 #include <QImageReader>
17 #include <QOpenGLTexture>
25 m_associatedSensor(0) {
38 m_associatedSensor(0) {
48 QImage
image = reader.read();
50 error = reader.errorString();
124 else if (value > 1.0f)
144 assert(out.isOpen() && (out.openMode() & QIODevice::WriteOnly));
145 if (dataVersion < 38) {
155 uint32_t sensorUniqueID =
158 if (out.write((
const char*)&sensorUniqueID, 4) < 0)
return WriteError();
161 float texU = 1.0f, texV = 1.0f;
163 QDataStream outStream(&out);
172 outStream << fakeString;
178 return std::max(
static_cast<short>(38),
193 uint32_t sensorUniqueID = 0;
194 if (in.read((
char*)&sensorUniqueID, 4) < 0)
return ReadError();
201 QDataStream inStream(&in);
210 inStream >> fakeString;
std::shared_ptr< core::Tensor > image
Camera (projective) sensor.
virtual void lockVisibility(bool state)
Locks/unlocks visibility.
virtual void setVisible(bool state)
Sets entity visibility.
Hierarchical CLOUDVIEWER Object.
virtual short minimumFileVersion_MeOnly() const
virtual bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
Loads own object data.
void addDependency(ccHObject *otherObject, int flags, bool additive=true)
Adds a new dependence (additive or not)
virtual bool toFile_MeOnly(QFile &out, short dataVersion) const
Save own object data.
@ DP_NOTIFY_OTHER_ON_DELETE
virtual void onDeletionOf(const ccHObject *obj)
This method is called when another object is deleted.
float m_texAlpha
Texture transparency.
bool load(const QString &filename, QString &error)
Loads image from file.
unsigned m_height
Image height (in pixels)
ccImage()
Default constructor.
void setData(const QImage &image)
Sets image data.
void setAspectRatio(float ar)
Manually sets aspect ratio.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
short minimumFileVersion_MeOnly() const override
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
ccCameraSensor * m_associatedSensor
Associated sensor.
virtual void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
void setAlpha(float value)
Sets image texture transparency.
float m_aspectRatio
Aspect ratio w/h.
void setAssociatedSensor(ccCameraSensor *sensor)
Sets associated sensor.
virtual void onDeletionOf(const ccHObject *obj) override
This method is called when another object is deleted.
unsigned m_width
Image width (in pixels)
void updateAspectRatio()
Updates aspect ratio.
QImage m_image
Image data.
virtual unsigned getUniqueID() const
Returns object unique ID.
virtual void setName(const QString &name)
Sets object name.
virtual void setEnabled(bool state)
Sets the "enabled" property.
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
static bool ReadError()
Sends a custom error message (read error) and returns 'false'.
static bool WriteError()
Sends a custom error message (write error) and returns 'false'.
#define MACRO_Draw2D(context)
#define MACRO_Foreground(context)