41 #ifndef MWAW_PICT_DATA
42 # define MWAW_PICT_DATA
47 # include <libwpd/libwpd.h>
68 virtual bool getBinary(WPXBinaryData &res, std::string &s)
const {
77 virtual bool sure()
const {
117 if (diff)
return diff;
121 if (diff)
return (diff < 0) ? -1 : 1;
124 if (diff)
return (diff < 0) ? -1 : 1;
130 unsigned char const *data=
m_data.getDataBuffer();
131 unsigned char const *aData=
m_data.getDataBuffer();
132 for (
unsigned long c=0; c <
m_data.size(); c++, data++, aData++) {
133 if (*data < *aData)
return -1;
134 if (*data > *aData)
return 1;
142 static bool createFileData(WPXBinaryData
const &orig, WPXBinaryData &result);
174 return m_data.size() != 0;
210 return m_data.size() != 0;
virtual bool sure() const
returns true if we are relatively sure that the data are correct
Definition: MWAWPictData.hxx:77
static ReadResult checkOrGet(MWAWInputStreamPtr input, int size, Box2f &box, MWAWPictData **result=0L)
checks if the data pointed by input and of given size is a pict
Definition: MWAWPictData.cxx:56
Definition: MWAWPictData.hxx:59
a small table file (known by open office)
Definition: MWAWPictData.hxx:164
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictData.hxx:82
static ReadResult check(MWAWInputStreamPtr input, int size, Box2f &box)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:95
Definition: MWAWPictData.hxx:59
MWAWPictData(Box2f &)
Definition: MWAWPictData.hxx:146
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictData.hxx:173
ReadResult
an enum to defined the result of a parsing use by some picture's classes which can read their data ...
Definition: MWAWPict.hxx:74
virtual Type getType() const
returns the picture type
Definition: MWAWPictData.hxx:61
class to store small data which are potentially a picture
Definition: MWAWPictData.hxx:200
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictData.hxx:209
virtual SubType getSubType() const
returns the picture subtype
Definition: MWAWPictData.hxx:168
static ReadResult checkOrGet(MWAWInputStreamPtr input, int size, MWAWPictData **result=0L)
checks if the data pointed by input and of given size is a pict
Definition: MWAWPictData.cxx:95
static ReadResult checkOrGet(MWAWInputStreamPtr input, int size, MWAWPictData **result=0L)
checks if the data pointed by input and of given size is a pict
Definition: MWAWPictData.cxx:117
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:99
T y() const
second element
Definition: libmwaw_internal.hxx:448
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class ...
Definition: MWAWPictData.hxx:179
Definition: MWAWPictData.hxx:59
static bool createFileData(WPXBinaryData const &orig, WPXBinaryData &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:45
bool m_empty
some picture can be valid but empty
Definition: MWAWPictData.hxx:160
an abstract class which defines basic formated picture ( AppleŠ Pict, DB3, ...)
Definition: MWAWPictData.hxx:55
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class ...
Definition: MWAWPictData.hxx:215
T x() const
first element
Definition: libmwaw_internal.hxx:444
MWAWPictData()
protected constructor: use check to construct a picture
Definition: MWAWPictData.hxx:145
void setBdBox(Box2f const &box)
sets the bdbox of the picture
Definition: MWAWPict.hxx:84
Type
the different picture types:
Definition: MWAWPict.hxx:64
MWAWPictDUnknown()
protected constructor: uses check to construct a picture
Definition: MWAWPictData.hxx:222
virtual bool getBinary(WPXBinaryData &res, std::string &s) const
returns the final WPXBinary data
Definition: MWAWPictData.hxx:68
Definition: MWAWPict.hxx:64
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class ...
Definition: MWAWPictData.hxx:115
WPXBinaryData m_data
the data size (without the empty header of 512 characters)
Definition: MWAWPictData.hxx:157
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:348
virtual SubType getSubType() const =0
returns the picture subtype
SubType
the picture subtype
Definition: MWAWPictData.hxx:59
Definition: MWAWPict.hxx:74
virtual SubType getSubType() const
returns the picture subtype
Definition: MWAWPictData.hxx:204
bool isEmpty() const
returns true if the picture is valid and has size 0 or contains no data
Definition: MWAWPictData.hxx:87
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:792
Generic function used to define/store a picture.
Definition: MWAWPict.hxx:52
MWAWPictDB3()
protected constructor: uses check to construct a picture
Definition: MWAWPictData.hxx:186