Go to the documentation of this file.
39 # define MWAW_PICT_MAC
44 # include <librevenge/librevenge.h>
64 librevenge::RVNGBinaryData res;
66 librevenge::RVNGBinaryData dataV2;
90 if (diff)
return diff;
91 auto const &aPict =
static_cast<MWAWPictMac const &
>(a);
94 if (diff)
return (diff < 0) ? -1 : 1;
96 if (diff)
return (diff < 0) ? -1 : 1;
102 static bool convertPict1To2(librevenge::RVNGBinaryData
const &orig, librevenge::RVNGBinaryData &result);
internal and low level: map opcode id -> OpCode
Definition: MWAWPictMac.cxx:1058
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
SubType getSubType() const final
returns the picture subtype
Definition: MWAWPictMac.hxx:56
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
@ WP_POINT
Definition: MWAWPictMac.cxx:138
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
void set(MWAWVec2< T > const &x, MWAWVec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libmwaw_internal.hxx:1079
virtual ~Value()
Definition: MWAWPictMac.cxx:539
friend std::ostream & operator<<(std::ostream &o, Bitmap const &f)
operator<< for Bitmap
Definition: MWAWPictMac.cxx:290
@ WP_BITMAP
Definition: MWAWPictMac.cxx:139
MWAWColor m_rgb
the color when type=WP_COLOR
Definition: MWAWPictMac.cxx:522
Internal and low level: a class used to read and store all possible value.
Definition: MWAWPictMac.cxx:427
MWAWBox2i m_dst
another final dimension
Definition: MWAWPictMac.cxx:417
@ WP_PATTERN
Definition: MWAWPictMac.cxx:138
std::shared_ptr< Region > m_region
the region when type=WP_REGION
Definition: MWAWPictMac.cxx:534
bool isEmpty() const
returns true if the picture is valid and has size 0 or contains no data
Definition: MWAWPictData.hxx:91
MWAWBox2i m_box
the bounding box
Definition: MWAWPictMac.cxx:223
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:512
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
the class to store a color
Definition: libmwaw_internal.hxx:192
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
@ WP_RECT
Definition: MWAWPictMac.cxx:138
@ MWAW_R_OK
Definition: MWAWPict.hxx:73
PictParser()
the constructor
Definition: MWAWPictMac.cxx:1061
OpCode(int id, char const *nm, DataType type1=WP_NONE, DataType type2=WP_NONE, DataType type3=WP_NONE, DataType type4=WP_NONE, DataType type5=WP_NONE)
constructor
Definition: MWAWPictMac.cxx:555
std::shared_ptr< Bitmap > m_bitmap
the bitmap when type=WP_BITMAP
Definition: MWAWPictMac.cxx:536
@ WP_PBITMAP
Definition: MWAWPictMac.cxx:139
bool readBitmapData(MWAWInputStream &input, bool packed)
parses the bitmap data zone
Definition: MWAWPictMac.cxx:369
bool getBinary(MWAWEmbeddedObject &picture) const override
returns the final picture
Definition: MWAWPictBitmap.hxx:225
SubType
the picture subtype
Definition: MWAWPictData.hxx:56
int m_id
the opCode
Definition: MWAWPictMac.cxx:654
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
int m_int
the int value when type=WP_INT
Definition: MWAWPictMac.cxx:520
@ WP_POINTUBYTE
Definition: MWAWPictMac.cxx:138
~MWAWPictMac() final
destructor
Definition: MWAWPictMac.cxx:54
@ WP_UBYTE
Definition: MWAWPictMac.cxx:137
Internal and low level: a class to define each opcode and their arguments and read their data.
Definition: MWAWPictMac.cxx:544
@ PictMac
Definition: MWAWPictData.hxx:56
std::vector< DataType > m_types
the different argument types
Definition: MWAWPictMac.cxx:658
@ WP_UFIXED
Definition: MWAWPictMac.cxx:137
static bool readRect(MWAWInputStream &input, DataType type, MWAWBox2i &res)
read a rectangles field
Definition: MWAWPictMac.cxx:613
DataType
Internal and low level: the different types of arguments.
Definition: MWAWPictMac.cxx:136
@ WP_POLY
Definition: MWAWPictMac.cxx:138
MWAWBox2i m_box
the rectangle when type=WP_RECT
Definition: MWAWPictMac.cxx:530
@ WP_INT
Definition: MWAWPictMac.cxx:137
int m_rowBytes
the num of bytes used to store a row
Definition: MWAWPictMac.cxx:416
Value(Value const &)=default
int m_mode
the encoding mode ?
Definition: MWAWPictMac.cxx:423
a bitmap of bool to store black-white bitmap
Definition: MWAWPictBitmap.hxx:269
int m_subVersion
the picture subversion
Definition: MWAWPictMac.hxx:127
T y() const
second element
Definition: libmwaw_internal.hxx:673
Internal and low level: class used to read/store a picture region.
Definition: MWAWPictMac.cxx:147
bool dumpFile(librevenge::RVNGBinaryData &data, char const *fileName)
a debug function to store in a datafile in the current directory WARNING: this function erase the fil...
Definition: MWAWDebug.cxx:193
#define ADD_DATA_SHORT(resPtr, val)
T x() const
first element
Definition: libmwaw_internal.hxx:668
std::string m_text
the text when type=WP_TEXT
Definition: MWAWPictMac.cxx:526
void extendBDBox(float val)
udaptes the bdbox, by extended it by (val-previousVal)
Definition: MWAWPict.hxx:137
bool read(MWAWInputStream &input, bool packed, bool hasRegion)
tries to read a bitmap
Definition: MWAWPictMac.cxx:241
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictMac.hxx:80
@ WP_RPBITMAP
Definition: MWAWPictMac.cxx:139
void setRowPacked(int j, unsigned char const *val, unsigned char const *end)
sets all cell contents of a row given packed m_data
Definition: MWAWPictBitmap.hxx:337
bool computeSize(MWAWInputStream &input, int &sz) const
computes the size of the data
Definition: MWAWPictMac.cxx:595
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
std::vector< MWAWVec2i > m_listPoint
the list of points which defined the polygon when type=WP_POLY
Definition: MWAWPictMac.cxx:532
int m_version
the picture version
Definition: MWAWPictMac.hxx:125
bool getBinary(MWAWEmbeddedObject &picture) const final
returns the final picture
Definition: MWAWPictMac.hxx:61
bool saveBitmap() const
saves the bitmap in file (debugging function)
Definition: MWAWPictMac.cxx:323
Generic function used to define/store a picture.
Definition: MWAWPict.hxx:52
@ MWAW_R_BAD
Definition: MWAWPict.hxx:73
static bool readText(MWAWInputStream &input, DataType type, std::string &res)
low level: reads a string argument
Definition: MWAWPictMac.cxx:998
static bool readInt(MWAWInputStream &input, DataType type, int &res)
low level: reads a integer ( bytes or 2 bytes, signed or unsigned)
Definition: MWAWPictMac.cxx:773
static bool readPattern(MWAWInputStream &input, DataType type, int(&pat)[8])
low level: reads a pattern argument
Definition: MWAWPictMac.cxx:872
Value()
Definition: MWAWPictMac.cxx:428
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
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
@ WP_UNKNOWN
Definition: MWAWPictMac.cxx:139
static bool readValue(MWAWInputStream &input, DataType type, Value &val)
reads a argument of type type, if successfull updates val.
Definition: MWAWPictMac.cxx:711
bool read(MWAWInputStream &input)
tries to read the data
Definition: MWAWPictMac.cxx:168
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:289
@ WP_UINT
Definition: MWAWPictMac.cxx:137
bool unpackedData(unsigned char const *pData, int sz)
creates the bitmap from the packdata
Definition: MWAWPictMac.cxx:342
friend std::ostream & operator<<(std::ostream &o, Value const &f)
operator<< for Value
Definition: MWAWPictMac.cxx:451
Value & operator=(Value const &)=default
virtual ~OpCode()
Definition: MWAWPictMac.cxx:1052
std::shared_ptr< Region > m_region
the region
Definition: MWAWPictMac.cxx:419
std::vector< MWAWVec2i > m_points
the set of points which defines the mask
Definition: MWAWPictMac.cxx:225
librevenge::RVNGBinaryData m_data
the data size (without the empty header of 512 characters)
Definition: MWAWPictData.hxx:176
MWAWBox2i m_src
the initial dimension
Definition: MWAWPictMac.cxx:417
MWAWBox2i m_rect
the bitmap rectangle
Definition: MWAWPictMac.cxx:417
bool readData(MWAWInputStream &input, std::vector< Value > &listValue) const
tries to read the data in the file
Definition: MWAWPictMac.cxx:577
@ MWAW_R_OK_EMPTY
Definition: MWAWPict.hxx:73
an abstract class which defines basic formated picture ( AppleŠ Pict, DB3, ...)
Definition: MWAWPictData.hxx:53
Internal and low level: a class used to read pack/unpack black-white bitmap.
Definition: MWAWPictMac.cxx:229
std::string m_name
the opCode name
Definition: MWAWPictMac.cxx:656
DataType m_type
the stored type of the data
Definition: MWAWPictMac.cxx:448
@ WP_LTEXT
Definition: MWAWPictMac.cxx:138
bool convertToPict2(librevenge::RVNGBinaryData const &orig, librevenge::RVNGBinaryData &result)
internal and low level: tries to convert a Pict1.0 picture stored in orig in a Pict2....
Definition: MWAWPictMac.cxx:1146
@ WP_RBITMAP
Definition: MWAWPictMac.cxx:139
@ WP_TEXT
Definition: MWAWPictMac.cxx:138
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
Bitmap()
Definition: MWAWPictMac.cxx:230
Internal and low level: generic tools about Mac Pict1.0 picture.
Definition: MWAWPictMac.cxx:128
static bool readColor(MWAWInputStream &input, DataType type, MWAWColor &col)
low level: reads a color argument
Definition: MWAWPictMac.cxx:825
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:691
@ WP_REGION
Definition: MWAWPictMac.cxx:138
int m_pat[8]
the pattern when type=WP_PATTERN
Definition: MWAWPictMac.cxx:524
Region()
Definition: MWAWPictMac.cxx:149
static int getSize(MWAWInputStream &input, DataType type)
returns the size of the next argument of type type.
Definition: MWAWPictMac.cxx:664
static bool readPoly(MWAWInputStream &input, DataType type, MWAWBox2i &box, std::vector< MWAWVec2i > &res)
low level: reads a polygon argument
Definition: MWAWPictMac.cxx:936
std::vector< unsigned char > m_bitmap
the bitmap
Definition: MWAWPictMac.cxx:421
@ WP_NONE
Definition: MWAWPictMac.cxx:137
friend std::ostream & operator<<(std::ostream &o, Region const &f)
operator << for a Region
Definition: MWAWPictMac.cxx:155
static bool convertPict1To2(librevenge::RVNGBinaryData const &orig, librevenge::RVNGBinaryData &result)
convert a Pict1.0 in Pict2.0, if possible
Definition: MWAWPictMac.cxx:1254
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
static bool readPoint(MWAWInputStream &input, DataType type, MWAWVec2i &res)
low level: reads a point argument
Definition: MWAWPictMac.cxx:890
int cmp(MWAWPict const &a) const final
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictMac.hxx:87
MWAWVec2i m_point
the point when type=WP_POINT
Definition: MWAWPictMac.cxx:528
@ WP_POINTBYTE
Definition: MWAWPictMac.cxx:138
std::map< int, OpCode > m_mapIdOp
the map
Definition: MWAWPictMac.cxx:1141
MWAWPictMac(MWAWBox2f box)
protected constructor: use check to construct a picture
Definition: MWAWPictMac.hxx:106
@ WP_BYTE
Definition: MWAWPictMac.cxx:137
Class to read/store a Mac Pict1.0/2.0.
Definition: MWAWPictMac.hxx:51
OpCode(OpCode const &)=default
@ WP_COLOR
Definition: MWAWPictMac.cxx:138
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20