41 #ifndef MWAW_PICT_DATA
42 # define MWAW_PICT_DATA
47 # include <libwpd/libwpd.h>
70 virtual bool getBinary(WPXBinaryData &res, std::string &s)
const {
79 virtual bool sure()
const {
119 if (diff)
return diff;
123 if (diff)
return (diff < 0) ? -1 : 1;
126 if (diff)
return (diff < 0) ? -1 : 1;
132 unsigned char const *data=
m_data.getDataBuffer();
133 unsigned char const *aData=
m_data.getDataBuffer();
134 for (
unsigned long c=0; c <
m_data.size(); c++, data++, aData++) {
135 if (*data < *aData)
return -1;
136 if (*data > *aData)
return 1;
144 static bool createFileData(WPXBinaryData
const &orig, WPXBinaryData &result);
176 return m_data.size() != 0;
212 return m_data.size() != 0;
virtual bool sure() const
returns true if we are relatively sure that the data are correct
Definition: MWAWPictData.hxx:79
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:61
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
Definition: ACText.hxx:44
a small table file (known by open office)
Definition: MWAWPictData.hxx:166
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictData.hxx:84
static ReadResult check(MWAWInputStreamPtr input, int size, Box2f &box)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:97
Definition: MWAWPictData.hxx:61
MWAWPictData(Box2f &)
Definition: MWAWPictData.hxx:148
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictData.hxx:175
ReadResult
an enum to defined the result of a parsing use by some picture's classes which can read their data ...
Definition: MWAWPict.hxx:79
virtual Type getType() const
returns the picture type
Definition: MWAWPictData.hxx:63
class to store small data which are potentially a picture
Definition: MWAWPictData.hxx:202
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictData.hxx:211
virtual SubType getSubType() const
returns the picture subtype
Definition: MWAWPictData.hxx:170
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:96
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:118
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:104
T y() const
second element
Definition: libmwaw_internal.hxx:399
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:181
Definition: MWAWPictData.hxx:61
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:162
an abstract class which defines basic formated picture ( AppleŠ Pict, DB3, ...)
Definition: MWAWPictData.hxx:57
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:217
T x() const
first element
Definition: libmwaw_internal.hxx:395
MWAWPictData()
protected constructor: use check to construct a picture
Definition: MWAWPictData.hxx:147
void setBdBox(Box2f const &box)
sets the bdbox of the picture
Definition: MWAWPict.hxx:89
Type
the different picture types:
Definition: MWAWPict.hxx:69
MWAWPictDUnknown()
protected constructor: uses check to construct a picture
Definition: MWAWPictData.hxx:224
virtual bool getBinary(WPXBinaryData &res, std::string &s) const
returns the final WPXBinary data
Definition: MWAWPictData.hxx:70
Definition: MWAWPict.hxx:69
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:117
WPXBinaryData m_data
the data size (without the empty header of 512 characters)
Definition: MWAWPictData.hxx:159
virtual SubType getSubType() const =0
returns the picture subtype
SubType
the picture subtype
Definition: MWAWPictData.hxx:61
Definition: MWAWPict.hxx:79
virtual SubType getSubType() const
returns the picture subtype
Definition: MWAWPictData.hxx:206
bool isEmpty() const
returns true if the picture is valid and has size 0 or contains no data
Definition: MWAWPictData.hxx:89
Vec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:743
Generic function used to define/store a picture.
Definition: MWAWPict.hxx:55
MWAWPictDB3()
protected constructor: uses check to construct a picture
Definition: MWAWPictData.hxx:188