Go to the documentation of this file.
41 #ifndef MWAW_PICT_DATA
42 # define MWAW_PICT_DATA
46 # include <librevenge/librevenge.h>
72 librevenge::RVNGBinaryData data;
125 if (diff)
return diff;
126 auto const &aPict =
static_cast<MWAWPictData const &
>(a);
128 diff =
static_cast<int>(
m_empty) -
static_cast<int>(aPict.m_empty);
129 if (diff)
return (diff < 0) ? -1 : 1;
134 if (diff)
return (diff < 0) ? -1 : 1;
136 if (
m_data.size() < aPict.m_data.size())
138 if (
m_data.size() > aPict.m_data.size())
140 unsigned char const *data=
m_data.getDataBuffer();
141 unsigned char const *aData=
m_data.getDataBuffer();
142 if (!data || !aData)
return 0;
143 for (
unsigned long c=0; c <
m_data.size(); c++, data++, aData++) {
144 if (*data < *aData)
return -1;
145 if (*data > *aData)
return 1;
153 static bool createFileData(librevenge::RVNGBinaryData
const &orig, librevenge::RVNGBinaryData &result);
198 return m_data.size() != 0;
241 return m_data.size() != 0;
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
ReadResult
an enum to defined the result of a parsing use by some picture's classes which can read their data
Definition: MWAWPict.hxx:73
@ MWAW_R_MAYBE
Definition: MWAWPict.hxx:73
static ReadResult checkOrGet(MWAWInputStreamPtr input, int size, MWAWPictData **result=nullptr)
checks if the data pointed by input and of given size is a pict
Definition: MWAWPictData.cxx:104
bool isEmpty() const
returns true if the picture is valid and has size 0 or contains no data
Definition: MWAWPictData.hxx:91
~MWAWPictDB3() final
destructor
Definition: MWAWPictData.cxx:99
SubType getSubType() const final
returns the picture subtype
Definition: MWAWPictData.hxx:190
MWAWPictDB3()
protected constructor: uses check to construct a picture
Definition: MWAWPictData.hxx:211
@ DB3
Definition: MWAWPictData.hxx:56
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
bool getBinary(MWAWEmbeddedObject &picture) const override
returns the final picture
Definition: MWAWPictData.hxx:68
@ Unknown
Definition: MWAWPictData.hxx:56
@ MWAW_R_OK
Definition: MWAWPict.hxx:73
MWAWPictDUnknown()
protected constructor: uses check to construct a picture
Definition: MWAWPictData.hxx:254
static MWAWPictData * get(MWAWInputStreamPtr const &input, int size)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:108
Type
the different picture types:
Definition: MWAWPict.hxx:63
virtual SubType getSubType() const =0
returns the picture subtype
int cmp(MWAWPict const &a) const final
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictData.hxx:246
SubType
the picture subtype
Definition: MWAWPictData.hxx:56
static ReadResult checkOrGet(MWAWInputStreamPtr input, int size, MWAWBox2f &box, MWAWPictData **result=nullptr)
checks if the data pointed by input and of given size is a pict 1.0, 2.0 or 2.1
Definition: MWAWPictMac.cxx:59
@ PictMac
Definition: MWAWPictData.hxx:56
static ReadResult checkOrGet(MWAWInputStreamPtr input, int size, MWAWBox2f &box, MWAWPictData **result=nullptr)
checks if the data pointed by input and of given size is a pict
Definition: MWAWPictData.cxx:60
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictData.hxx:85
bool m_empty
some picture can be valid but empty
Definition: MWAWPictData.hxx:179
virtual bool sure() const
returns true if we are relatively sure that the data are correct
Definition: MWAWPictData.hxx:79
T y() const
second element
Definition: libmwaw_internal.hxx:673
static ReadResult checkOrGet(MWAWInputStreamPtr input, int size, MWAWPictData **result=nullptr)
checks if the data pointed by input and of given size is a pict
Definition: MWAWPictData.cxx:130
SubType getSubType() const final
returns the picture subtype
Definition: MWAWPictData.hxx:233
~MWAWPictData() override
destructor
Definition: MWAWPictData.cxx:45
T x() const
first element
Definition: libmwaw_internal.hxx:668
@ PictData
Definition: MWAWPict.hxx:63
MWAWPictData(MWAWBox2f &)
Definition: MWAWPictData.hxx:161
static bool createFileData(librevenge::RVNGBinaryData const &orig, librevenge::RVNGBinaryData &result)
a file pict can be created from the data pict by adding a header with size 512, this function do this...
Definition: MWAWPictData.cxx:49
MWAWPictData()
protected constructor: use check to construct a picture
Definition: MWAWPictData.hxx:156
Generic function used to define/store a picture.
Definition: MWAWPict.hxx:52
@ MWAW_R_BAD
Definition: MWAWPict.hxx:73
int cmp(MWAWPict const &a) const final
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictData.hxx:203
Type getType() const override
returns the picture type
Definition: MWAWPictData.hxx:60
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
int cmp(MWAWPict const &a) const override
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictData.hxx:122
static ReadResult check(MWAWInputStreamPtr const &input, int size, MWAWBox2f &box)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:100
void setBdBox(MWAWBox2f const &box)
sets the bdbox of the picture
Definition: MWAWPict.hxx:84
librevenge::RVNGBinaryData m_data
the data size (without the empty header of 512 characters)
Definition: MWAWPictData.hxx:176
@ MWAW_R_OK_EMPTY
Definition: MWAWPict.hxx:73
an abstract class which defines basic formated picture ( AppleŠ Pict, DB3, ...)
Definition: MWAWPictData.hxx:53
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
~MWAWPictDUnknown() final
destructor
Definition: MWAWPictData.cxx:125
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictData.hxx:196
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPict.hxx:101
class to store small data which are potentially a picture
Definition: MWAWPictData.hxx:227
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictData.hxx:239
a small table file (known by open office)
Definition: MWAWPictData.hxx:184
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20