ApplePictParser.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 #ifndef APPLEPICT_PARSER
35 # define APPLEPICT_PARSER
36 
37 #include <string>
38 #include <vector>
39 
40 #include <librevenge/librevenge.h>
41 
42 #include "MWAWDebug.hxx"
43 #include "MWAWGraphicStyle.hxx"
44 #include "MWAWInputStream.hxx"
45 
46 #include "MWAWParser.hxx"
47 
49 {
50 struct Bitmap;
51 struct Pixmap;
52 struct Region;
53 struct State;
54 
55 class SubDocument;
56 }
57 
62 {
64 public:
69  };
70 
72  ApplePictParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
74  ~ApplePictParser() final;
75 
77  bool checkHeader(MWAWHeader *header, bool strict=false) final;
78 
80  void parse(librevenge::RVNGDrawingInterface *documentInterface) final;
81 
82 protected:
84  bool readZone();
85 
87  void init();
88 
90  void createDocument(librevenge::RVNGDrawingInterface *documentInterface);
91 
92 protected:
94  bool createZones();
95 
96  //
97  // low level
98  //
99 
101  void drawLine(MWAWVec2i const &pt);
103  bool readAndDrawRectangle(DrawingMethod method);
105  void drawRectangle(DrawingMethod method);
109  void drawRoundRectangle(DrawingMethod method);
111  bool readAndDrawCircle(DrawingMethod method);
113  void drawCircle(DrawingMethod method);
115  bool readAndDrawPie(DrawingMethod method);
117  void drawPie(DrawingMethod method, int startAngle, int dAngle);
119  bool readAndDrawPolygon(DrawingMethod method);
121  void drawPolygon(DrawingMethod method);
123  bool readAndDrawText(std::string &text);
125  void drawText(MWAWEntry const &entry);
126 
128  void drawBitmap(ApplePictParserInternal::Bitmap const &bitmap);
130  void drawPixmap(ApplePictParserInternal::Pixmap const &pixmap);
131 
133  bool readRGBColor(MWAWColor &color);
135  bool readBWPattern(MWAWGraphicStyle::Pattern &pattern);
137  bool readColorPattern(MWAWGraphicStyle::Pattern &pattern);
139  bool readRegion(ApplePictParserInternal::Region &region);
141  bool readBitmap(ApplePictParserInternal::Bitmap &bitmap, bool isPacked, bool hasRgn);
143  bool readPixmap(ApplePictParserInternal::Pixmap &pixmap, bool isPacked, bool haColorTable, bool hasRectMode, bool hasRgn);
145  bool readQuicktime(MWAWEmbeddedObject &object, MWAWBox2f &bdBox);
146 
148  static std::string getDrawingName(DrawingMethod method)
149  {
150  switch (method) {
151  case D_FRAME:
152  return "frame";
153  case D_PAINT:
154  return "paint";
155  case D_ERASE:
156  return "erase";
157  case D_INVERT:
158  return "invert";
159  case D_FILL:
160  return "fill";
161  case D_TEXT:
162  return "text";
163  case D_UNDEFINED:
164 #if !defined(__clang__)
165  default:
166 #endif
167  break;
168  }
169  return "";
170  }
172  static std::string getModeName(int mode);
173  //
174  // data
175  //
177  std::shared_ptr<ApplePictParserInternal::State> m_state;
178 };
179 #endif
180 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
ApplePictParser::DrawingMethod
DrawingMethod
the drawing method: frame, paint, ...
Definition: ApplePictParser.hxx:66
ApplePictParserInternal::State::m_version
int m_version
the file version
Definition: ApplePictParser.cxx:681
ApplePictParser::ApplePictParser
ApplePictParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: ApplePictParser.cxx:780
MWAWGraphicStyle::Pattern::getUniqueColor
bool getUniqueColor(MWAWColor &col) const
check if the pattern has only one color; if so returns true...
Definition: MWAWGraphicStyle.cxx:86
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
ApplePictParser::createDocument
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: ApplePictParser.cxx:829
MWAWSubDocument::m_zone
MWAWEntry m_zone
if valid the zone to parse
Definition: MWAWSubDocument.hxx:79
ApplePictParser::readRGBColor
bool readRGBColor(MWAWColor &color)
try to read a rgb color
Definition: ApplePictParser.cxx:1715
ApplePictParserInternal::State::initPatterns
void initPatterns()
init the patterns list
ApplePictParser::readRegion
bool readRegion(ApplePictParserInternal::Region &region)
try to read a region
Definition: ApplePictParser.cxx:2140
ApplePictParserInternal::Pixmap::m_pixelSize
int m_pixelSize
physical bit by image
Definition: ApplePictParser.cxx:559
MWAWGraphicStyle::Pattern::empty
bool empty() const
return true if we does not have a pattern
Definition: MWAWGraphicStyle.hxx:304
ApplePictParserInternal::Pixmap::m_version
int m_version
the pixmap version
Definition: ApplePictParser.cxx:554
MWAWGraphicListenerPtr
std::shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:549
ApplePictParserInternal::State::m_bdBox
MWAWBox2f m_bdBox
the bounding rectangle
Definition: ApplePictParser.cxx:683
MWAWPageSpan::setPageSpan
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
ApplePictParser::readAndDrawRoundRectangle
bool readAndDrawRoundRectangle(DrawingMethod method)
read the current round rectangle and draw it
Definition: ApplePictParser.cxx:1630
MWAWInputStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
seeks to a offset position, from actual, beginning or ending position
Definition: MWAWInputStream.cxx:154
ApplePictParserInternal::SubDocument
Internal: the subdocument of a ApplePictParser.
Definition: ApplePictParser.cxx:733
MWAWGraphicShape::getBdBox
MWAWBox2f getBdBox() const
returns the basic bdbox
Definition: MWAWGraphicShape.hxx:197
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
ApplePictParserInternal::Pixmap::m_compCount
int m_compCount
logical components per pixels
Definition: ApplePictParser.cxx:560
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
ApplePictParserInternal::Pixmap::m_indices
std::vector< int > m_indices
the pixmap indices
Definition: ApplePictParser.cxx:569
ApplePictParserInternal::Bitmap::m_region
std::shared_ptr< Region > m_region
the region
Definition: ApplePictParser.cxx:204
ApplePictParserInternal::State::m_opColor
MWAWColor m_opColor
the op color
Definition: ApplePictParser.cxx:709
MWAWPictBitmapIndexed::setColors
void setColors(std::vector< MWAWColor > const &cols)
sets the array of indexed colors
Definition: MWAWPictBitmap.hxx:446
libmwaw::DebugFile::addDelimiter
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
ApplePictParserInternal::State::m_foreColor
MWAWColor m_foreColor
the foreground color
Definition: ApplePictParser.cxx:703
MWAWParser::getGraphicListener
MWAWGraphicListenerPtr & getGraphicListener()
returns the graphic listener
Definition: MWAWParser.hxx:130
MWAWGraphicStyle::setSurfaceColor
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:415
ApplePictParserInternal::Pixmap::m_colors
std::vector< MWAWColor > m_colors
the colors
Definition: ApplePictParser.cxx:571
ApplePictParser::readColorPattern
bool readColorPattern(MWAWGraphicStyle::Pattern &pattern)
try to read a color pattern
Definition: ApplePictParser.cxx:1743
ApplePictParserInternal::ColorTable
Internal and low level: a class used to read a color map in a Apple Pict.
Definition: ApplePictParser.cxx:212
ApplePictParser::D_INVERT
@ D_INVERT
Definition: ApplePictParser.hxx:67
ApplePictParser::drawBitmap
void drawBitmap(ApplePictParserInternal::Bitmap const &bitmap)
draw a bitmap
Definition: ApplePictParser.cxx:2549
MWAWGraphicShape::pie
static MWAWGraphicShape pie(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a pie
Definition: MWAWGraphicShape.hxx:147
MWAWPictBitmapIndexed::set
void set(int i, int j, int v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:425
ApplePictParserInternal::Pixmap::m_resolution
int m_resolution[2]
horizontal/vertical definition
Definition: ApplePictParser.cxx:557
ApplePictParser::readZone
bool readZone()
try to read a zone
Definition: ApplePictParser.cxx:877
MWAWFont::boldBit
@ boldBit
Definition: MWAWFont.hxx:190
MWAWInputStream
Internal class used to read the file stream Internal class used to read the file stream,...
Definition: MWAWInputStream.hxx:54
ApplePictParser::readAndDrawCircle
bool readAndDrawCircle(DrawingMethod method)
read the current circle and draw it
Definition: ApplePictParser.cxx:1648
ApplePictParser::drawRoundRectangle
void drawRoundRectangle(DrawingMethod method)
draw the current round rectangle
Definition: ApplePictParser.cxx:2399
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:341
libmwaw::DebugFile::open
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
ApplePictParserInternal::State::m_fillPattern
MWAWGraphicStyle::Pattern m_fillPattern
the fill pattern
Definition: ApplePictParser.cxx:715
ApplePictParserInternal::Bitmap::m_bitmap
std::vector< unsigned char > m_bitmap
the bitmap
Definition: ApplePictParser.cxx:206
ApplePictParserInternal::State::m_penPattern
MWAWGraphicStyle::Pattern m_penPattern
the pen pattern
Definition: ApplePictParser.cxx:711
ApplePictParser::D_FILL
@ D_FILL
Definition: ApplePictParser.hxx:67
MWAWInputStream::readLong
long readLong(int num)
return a int8, int16, int32 readed from actualPos
Definition: MWAWInputStream.cxx:229
MWAWGraphicShape
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:46
ApplePictParser::drawPixmap
void drawPixmap(ApplePictParserInternal::Pixmap const &pixmap)
draw a pixmap
Definition: ApplePictParser.cxx:2566
MWAWFontConverter.hxx
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
ApplePictParserInternal::ColorTable::m_flags
int m_flags
the color table flags
Definition: ApplePictParser.cxx:253
ApplePictParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: ApplePictParser.cxx:2264
MWAWGraphicShape::line
static MWAWGraphicShape line(MWAWVec2f const &orign, MWAWVec2f const &dest)
static constructor to create a line
Definition: MWAWGraphicShape.cxx:228
MWAWParser::version
int version() const
returns the works version
Definition: MWAWParser.hxx:108
MWAWGraphicStyle::Pattern::getAverageColor
bool getAverageColor(MWAWColor &col) const
return the average color
Definition: MWAWGraphicStyle.cxx:101
MWAWPrinter.hxx
ApplePictParser::readAndDrawPie
bool readAndDrawPie(DrawingMethod method)
read the current pie and draw it
Definition: ApplePictParser.cxx:1666
ApplePictParserInternal::State::m_backColor
MWAWColor m_backColor
the background color
Definition: ApplePictParser.cxx:705
MWAWDocument::MWAW_K_DRAW
@ MWAW_K_DRAW
vectorized grphic
Definition: MWAWDocument.hxx:83
ApplePictParserInternal::Pixmap::extractColor
MWAWColor extractColor(const std::vector< unsigned char > &data, size_t rIdx, size_t gIdx, size_t bIdx)
Definition: ApplePictParser.cxx:326
ApplePictParser::readBitmap
bool readBitmap(ApplePictParserInternal::Bitmap &bitmap, bool isPacked, bool hasRgn)
read a bitmap
Definition: ApplePictParser.cxx:1808
ApplePictParserInternal::State::m_textMode
int m_textMode
the text mode
Definition: ApplePictParser.cxx:697
MWAWFont::Line::Simple
@ Simple
Definition: MWAWFont.hxx:49
ApplePictParserInternal::Region::operator<<
friend std::ostream & operator<<(std::ostream &o, Region const &rgn)
operator<<
Definition: ApplePictParser.cxx:73
ApplePictParserInternal::Pixmap
Internal and low level: a class used to read pack/unpack color pixmap (version 2)
Definition: ApplePictParser.cxx:260
ApplePictParserInternal::Bitmap::m_src
MWAWBox2i m_src
the initial dimension
Definition: ApplePictParser.cxx:202
MWAWInputStream::isEnd
bool isEnd()
returns true if we are at the end of the section/file
Definition: MWAWInputStream.cxx:177
MWAWPictBitmap::getBinary
bool getBinary(MWAWEmbeddedObject &picture) const override
returns the final picture
Definition: MWAWPictBitmap.hxx:225
ApplePictParserInternal::ColorTable::ColorTable
ColorTable()
constructor
Definition: ApplePictParser.cxx:214
ApplePictParserInternal::State::m_roundRectangle
MWAWBox2i m_roundRectangle
the last round rectangle
Definition: ApplePictParser.cxx:719
MWAWBox2::getIntersection
MWAWBox2< T > getIntersection(MWAWBox2< T > const &box) const
returns the intersection between this and box
Definition: libmwaw_internal.hxx:1139
ApplePictParserInternal::Pixmap::m_packType
int m_packType
the packing format
Definition: ApplePictParser.cxx:555
ApplePictParser::D_ERASE
@ D_ERASE
Definition: ApplePictParser.hxx:67
ApplePictParserInternal::Bitmap::m_mode
int m_mode
the encoding mode ?
Definition: ApplePictParser.cxx:208
libmwaw::DebugFile::addNote
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
MWAWInputStream::tell
long tell()
returns actual offset position
Definition: MWAWInputStream.cxx:147
MWAWSubDocument
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:42
ApplePictParserInternal::Bitmap::Bitmap
Bitmap()
Definition: ApplePictParser.cxx:95
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
MWAWGraphicShape::m_bdBox
MWAWBox2f m_bdBox
the shape bdbox
Definition: MWAWGraphicShape.hxx:218
ApplePictParserInternal::State::m_backgroundPattern
MWAWGraphicStyle::Pattern m_backgroundPattern
the background pattern
Definition: ApplePictParser.cxx:713
MWAWGraphicStyle::Pattern::m_data
std::vector< unsigned char > m_data
the pattern data: a sequence of data: p[0..7,0],p[8..15,0]...p[0..7,1],p[8..15,1],...
Definition: MWAWGraphicStyle.hxx:363
ApplePictParserInternal::State::m_penPosition
MWAWVec2i m_penPosition
the actual pen position
Definition: ApplePictParser.cxx:687
MWAWPictBitmapColor::set
void set(int i, int j, MWAWColor const &v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:529
ApplePictParser::D_FRAME
@ D_FRAME
Definition: ApplePictParser.hxx:67
ApplePictParserInternal::Pixmap::computeHeight
int computeHeight(MWAWInputStream &input, const int height, const int width, const bool packed, const int szRowSize) const
computes the height based on available data
Definition: ApplePictParser.cxx:335
MWAWParser::ascii
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
ApplePictParserInternal::Pixmap::m_planeBytes
long m_planeBytes
offset to the next plane
Definition: ApplePictParser.cxx:562
MWAWFont::embossBit
@ embossBit
Definition: MWAWFont.hxx:190
MWAWPictBitmapColor::valid
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:489
MWAWGraphicShape::circle
static MWAWGraphicShape circle(MWAWBox2f const &box)
static constructor to create a circle
Definition: MWAWGraphicShape.hxx:129
ApplePictParserInternal::Pixmap::operator<<
friend std::ostream & operator<<(std::ostream &o, Pixmap const &f)
operator<< for Pixmap
Definition: ApplePictParser.cxx:284
MWAWParser::asciiName
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
ApplePictParser::readPixmap
bool readPixmap(ApplePictParserInternal::Pixmap &pixmap, bool isPacked, bool haColorTable, bool hasRectMode, bool hasRgn)
read a pixmap
Definition: ApplePictParser.cxx:1863
MWAWGraphicStyle::Pattern
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:277
MWAWSubDocument.hxx
MWAWPageSpan::setFormLength
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
MWAWGraphicShape::Polygon
@ Polygon
Definition: MWAWGraphicShape.hxx:49
MWAWBox2::getUnion
MWAWBox2< T > getUnion(MWAWBox2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:1129
ApplePictParser
the main class to read a ApplePict file
Definition: ApplePictParser.hxx:62
ApplePictParserInternal::State::m_ovalSize
MWAWVec2i m_ovalSize
the actual ovalsize
Definition: ApplePictParser.cxx:693
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:188
ApplePictParserInternal::Bitmap::m_rowBytes
int m_rowBytes
the num of bytes used to store a row
Definition: ApplePictParser.cxx:201
MWAWSubDocument::m_input
std::shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
ApplePictParserInternal::Bitmap::unpackedData
bool unpackedData(unsigned char const *pData, int sz)
creates the bitmap from the packdata
Definition: ApplePictParser.cxx:113
libmwaw::DebugFile::reset
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
ApplePictParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
the main parse function
Definition: ApplePictParser.cxx:804
ApplePictParser::readAndDrawText
bool readAndDrawText(std::string &text)
read the current text and draw it
Definition: ApplePictParser.cxx:1774
MWAWPictBitmapBW
a bitmap of bool to store black-white bitmap
Definition: MWAWPictBitmap.hxx:269
MWAWFont::Line::None
@ None
Definition: MWAWFont.hxx:49
ApplePictParser::createZones
bool createZones()
finds the different objects zones
Definition: ApplePictParser.cxx:853
MWAWFont::shadowBit
@ shadowBit
Definition: MWAWFont.hxx:191
ApplePictParserInternal::State::m_penMode
int m_penMode
the pen mode
Definition: ApplePictParser.cxx:695
ApplePictParserInternal::Pixmap::m_src
MWAWBox2i m_src
the initial dimension
Definition: ApplePictParser.cxx:565
MWAWParser::setAsciiName
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
MWAWParagraph.hxx
libmwaw::DebugFile::skipZone
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:113
MWAWVec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:673
ApplePictParserInternal::Pixmap::m_dst
MWAWBox2i m_dst
another final dimension
Definition: ApplePictParser.cxx:565
MWAWEmbeddedObject::isEmpty
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:486
MWAWGraphicStyle::m_lineWidth
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:508
ApplePictParser::~ApplePictParser
~ApplePictParser() final
destructor
Definition: ApplePictParser.cxx:787
MWAWPageSpan::setFormWidth
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
MWAWPosition.hxx
ApplePictParser::readAndDrawPolygon
bool readAndDrawPolygon(DrawingMethod method)
read the current polygon and draw it
Definition: ApplePictParser.cxx:1687
ApplePictParserInternal::State::m_hiliteColor
MWAWColor m_hiliteColor
the hilite color
Definition: ApplePictParser.cxx:707
MWAWVec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:668
ApplePictParserInternal::State
Internal: the state of a ApplePictParser.
Definition: ApplePictParser.cxx:578
ApplePictParser::drawPolygon
void drawPolygon(DrawingMethod method)
draw the current polygon
Definition: ApplePictParser.cxx:2484
ApplePictParserInternal::SubDocument::SubDocument
SubDocument(ApplePictParser &pars, MWAWInputStreamPtr const &input, MWAWEntry const &entry)
Definition: ApplePictParser.cxx:735
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
ApplePictParserInternal::SubDocument::operator!=
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: ApplePictParser.cxx:742
MWAWPictBitmapBW::setRowPacked
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
ApplePictParserInternal::Pixmap::unpackedData
bool unpackedData(unsigned char const *pData, int sz, int byteSz, int nSize, std::vector< unsigned char > &res) const
creates the pixmap from the packdata
Definition: ApplePictParser.cxx:294
MWAWEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
MWAWGraphicShape::m_vertices
std::vector< MWAWVec2f > m_vertices
the list of vertices for lines or polygons
Definition: MWAWGraphicShape.hxx:226
ApplePictParserInternal::State::m_isHiliteMode
bool m_isHiliteMode
true if we must use the hilite mode
Definition: ApplePictParser.cxx:699
ApplePictParserInternal::State::updatePosition
void updatePosition(MWAWBox2f const &bdBox, MWAWPosition &pos)
update the position
Definition: ApplePictParser.cxx:675
MWAWParser::setGraphicListener
void setGraphicListener(MWAWGraphicListenerPtr &listener)
sets the graphic listener
Definition: MWAWParser.cxx:125
ApplePictParser::m_state
std::shared_ptr< ApplePictParserInternal::State > m_state
the state
Definition: ApplePictParser.hxx:177
MWAWParser::setVersion
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
M_PI
#define M_PI
Definition: libmwaw_internal.hxx:52
MWAWGraphicStyle::Pattern::m_dim
MWAWVec2i m_dim
the dimension width x height
Definition: MWAWGraphicStyle.hxx:358
ApplePictParserInternal::Bitmap::readBitmapData
bool readBitmapData(MWAWInputStream &input, bool packed)
parses the bitmap data zone
Definition: ApplePictParser.cxx:140
ApplePictParser::drawPie
void drawPie(DrawingMethod method, int startAngle, int dAngle)
draw the current circle
Definition: ApplePictParser.cxx:2425
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
MWAWPictData.hxx
ApplePictParserInternal::State::m_textPosition
MWAWVec2i m_textPosition
the actual text position
Definition: ApplePictParser.cxx:689
ApplePictParserInternal::State::m_origin
MWAWVec2f m_origin
the origin
Definition: ApplePictParser.cxx:685
MWAWGraphicShape::m_type
Type m_type
the type
Definition: MWAWGraphicShape.hxx:216
libmwaw::DebugFile::setStream
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
MWAWVec2< float >
MWAWGraphicListener.hxx
MWAWInputStream::readULong
unsigned long readULong(int num)
returns a uint8, uint16, uint32 readed from actualPos
Definition: MWAWInputStream.hxx:144
MWAWGraphicShape.hxx
libmwaw::ParseException
Definition: libmwaw_internal.hxx:144
MWAWDebug.hxx
ApplePictParserInternal::State::State
State()
constructor
Definition: ApplePictParser.cxx:580
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:57
MWAWEntry::begin
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
ApplePictParserInternal::SubDocument::parse
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: ApplePictParser.cxx:758
MWAWEntry::setLength
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:72
MWAWParser::getPageSpan
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
ApplePictParserInternal::Region::Region
Region()
constructor
Definition: ApplePictParser.cxx:66
MWAWGraphicStyle::setPattern
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:426
ApplePictParser::drawText
void drawText(MWAWEntry const &entry)
draw a current text
Definition: ApplePictParser.cxx:2510
MWAWGraphicParser
virtual class which defines the ancestor of all graphic zone parser
Definition: MWAWParser.hxx:251
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
ApplePictParserInternal::State::m_rectangle
MWAWBox2i m_rectangle
the last rectangle
Definition: ApplePictParser.cxx:717
ApplePictParserInternal::Pixmap::m_rowBytes
int m_rowBytes
the num of bytes used to store a row
Definition: ApplePictParser.cxx:552
ApplePictParserInternal::State::isInvisible
bool isInvisible(ApplePictParser::DrawingMethod method) const
returns true if the shape is invisible
Definition: ApplePictParser.cxx:610
ApplePictParserInternal::Pixmap::m_mode
int m_mode
the encoding mode ?
Definition: ApplePictParser.cxx:573
ApplePictParserInternal::Region::m_bdBox
MWAWBox2i m_bdBox
the bdbox
Definition: ApplePictParser.cxx:86
ApplePictParserInternal::Region
internal: low level class to store a region
Definition: ApplePictParser.cxx:64
ApplePictParserInternal::Pixmap::get
bool get(MWAWEmbeddedObject &picture) const
returns the pixmap
Definition: ApplePictParser.cxx:513
ApplePictParser::drawLine
void drawLine(MWAWVec2i const &pt)
draw a line from current position to position
Definition: ApplePictParser.cxx:2368
ApplePictParser::getModeName
static std::string getModeName(int mode)
debug function to print a mode name
Definition: ApplePictParser.cxx:2193
ApplePictParserInternal::Region::m_points
std::vector< MWAWVec2i > m_points
the set of points which defines the mask
Definition: ApplePictParser.cxx:88
MWAWGraphicShape::arc
static MWAWGraphicShape arc(MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
static constructor to create a arc
Definition: MWAWGraphicShape.hxx:137
MWAWPictBitmapBW::valid
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:289
ApplePictParserInternal::State::m_afterQuicktime
bool m_afterQuicktime
a flag to know if we have found a quicktime picture/movie
Definition: ApplePictParser.cxx:727
MWAWGraphicStyle::Pattern::m_colors
MWAWColor m_colors[2]
the two indexed colors
Definition: MWAWGraphicStyle.hxx:361
MWAWParser::getParserState
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
ApplePictParserInternal::SubDocument::~SubDocument
~SubDocument() final
destructor
Definition: ApplePictParser.cxx:739
ApplePictParser::readBWPattern
bool readBWPattern(MWAWGraphicStyle::Pattern &pattern)
try to read a bw pattern
Definition: ApplePictParser.cxx:1727
MWAWHeader.hxx
Defines MWAWHeader (document's type, version, kind)
ApplePictParser::D_PAINT
@ D_PAINT
Definition: ApplePictParser.hxx:67
MWAWEntry::end
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
MWAWGraphicStyle::m_lineColor
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:516
ApplePictParserInternal::ColorTable::operator<<
friend std::ostream & operator<<(std::ostream &o, ColorTable const &f)
operator<< for ColorTable
Definition: ApplePictParser.cxx:240
MWAWBox2i
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1191
ApplePictParserInternal::Pixmap::m_colorTable
std::shared_ptr< ColorTable > m_colorTable
the color table
Definition: ApplePictParser.cxx:563
ApplePictParser.hxx
ApplePictParserInternal::State::m_pie
MWAWBox2i m_pie
the last pie
Definition: ApplePictParser.cxx:723
MWAWGraphicStyle.hxx
ApplePictParserInternal::Pixmap::readPixmapData
bool readPixmapData(MWAWInputStream &input)
parses the pixmap data zone
Definition: ApplePictParser.cxx:355
MWAWFont::italicBit
@ italicBit
Definition: MWAWFont.hxx:190
ApplePictParser::readAndDrawRectangle
bool readAndDrawRectangle(DrawingMethod method)
read the current rectangle and draw it
Definition: ApplePictParser.cxx:1612
ApplePictParser::init
void init()
inits all internal variables
Definition: ApplePictParser.cxx:791
MWAWParser::getInput
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
MWAWPictBitmapIndexed::valid
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:385
ApplePictParserInternal::ColorTable::read
bool read(MWAWInputStream &input)
tries to read a colortable
Definition: ApplePictParser.cxx:219
ApplePictParserInternal::Bitmap::get
bool get(MWAWEmbeddedObject &picture) const
returns the bitmap and the type
Definition: ApplePictParser.cxx:187
MWAWPictBitmapIndexed
a bitmap of int to store indexed bitmap
Definition: MWAWPictBitmap.hxx:357
ApplePictParserInternal::SubDocument::SubDocument
SubDocument(SubDocument const &orig)=delete
ApplePictParserInternal
Internal: the structures of a ApplePictParser.
Definition: ApplePictParser.cxx:61
ApplePictParser::D_UNDEFINED
@ D_UNDEFINED
Definition: ApplePictParser.hxx:68
ApplePictParserInternal::State::m_penSize
MWAWVec2i m_penSize
the actual pensize
Definition: ApplePictParser.cxx:691
ApplePictParserInternal::Pixmap::m_compSize
int m_compSize
logical bits by components
Definition: ApplePictParser.cxx:561
MWAWPosition::Page
@ Page
Definition: MWAWPosition.hxx:51
MWAWSubDocument::m_parser
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
ApplePictParser::getDrawingName
static std::string getDrawingName(DrawingMethod method)
debug function to print a drawing method
Definition: ApplePictParser.hxx:148
ApplePictParserInternal::Bitmap::operator<<
friend std::ostream & operator<<(std::ostream &o, Bitmap const &f)
operator<< for Bitmap
Definition: ApplePictParser.cxx:105
libmwaw::DebugFile::addPos
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
MWAWEntry::valid
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:99
MWAWInputStream::checkPosition
bool checkPosition(long pos) const
checks if a position is or not a valid file position
Definition: MWAWInputStream.hxx:105
ApplePictParserInternal::Pixmap::m_packSize
long m_packSize
size of data in the packed state
Definition: ApplePictParser.cxx:556
MWAWInputStream::size
long size() const
returns the stream size
Definition: MWAWInputStream.hxx:100
ApplePictParser::drawRectangle
void drawRectangle(DrawingMethod method)
draw the current rectangle
Definition: ApplePictParser.cxx:2383
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
ApplePictParserInternal::Pixmap::m_region
std::shared_ptr< Region > m_region
the region
Definition: ApplePictParser.cxx:567
ApplePictParserInternal::Bitmap
Internal and low level: a class used to read pack/unpack black-white bitmap.
Definition: ApplePictParser.cxx:94
ApplePictParserInternal::State::m_font
MWAWFont m_font
the actual font
Definition: ApplePictParser.cxx:701
ApplePictParserInternal::Pixmap::m_pixelType
int m_pixelType
format of pixel image
Definition: ApplePictParser.cxx:558
MWAWInputStream.hxx
ApplePictParserInternal::SubDocument::operator=
SubDocument & operator=(SubDocument const &orig)=delete
ApplePictParser::readQuicktime
bool readQuicktime(MWAWEmbeddedObject &object, MWAWBox2f &bdBox)
try to read a quicktime zone
Definition: ApplePictParser.cxx:1944
MWAWDocument::MWAW_T_APPLEPICT
@ MWAW_T_APPLEPICT
Apple Pict: v1 or v2.
Definition: MWAWDocument.hxx:201
MWAWHeader::reset
void reset(MWAWDocument::Type type, int vers, Kind kind=MWAWDocument::MWAW_K_TEXT)
resets the data
Definition: MWAWHeader.hxx:84
MWAWListenerPtr
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
MWAWFont.hxx
MWAWPosition::m_anchorTo
AnchorTo m_anchorTo
anchor position
Definition: MWAWPosition.hxx:270
librevenge
Definition: MWAWDocument.hxx:57
MWAWPictBitmap.hxx
MWAWPageSpan::setMargins
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
ApplePictParser::drawCircle
void drawCircle(DrawingMethod method)
draw the current circle
Definition: ApplePictParser.cxx:2412
MWAWBox2< int >
ApplePictParserInternal::State::updatePosition
void updatePosition(MWAWVec2f const &orig, MWAWPosition &pos)
update the position
Definition: ApplePictParser.cxx:669
MWAWPictBitmapColor
a bitmap of MWAWColor to store true color bitmap
Definition: MWAWPictBitmap.hxx:469
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
ApplePictParserInternal::Pixmap::Pixmap
Pixmap()
Definition: ApplePictParser.cxx:261
MWAWGraphicShape::rectangle
static MWAWGraphicShape rectangle(MWAWBox2f const &box, MWAWVec2f const &corners=MWAWVec2f(0, 0))
static constructor to create a rectangle
Definition: MWAWGraphicShape.hxx:120
ApplePictParserInternal::Bitmap::m_rect
MWAWBox2i m_rect
the bitmap rectangle
Definition: ApplePictParser.cxx:202
ApplePictParserInternal::Region::m_extra
std::string m_extra
extra data
Definition: ApplePictParser.cxx:90
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MWAWParser.hxx
MWAWInputStream::read
const uint8_t * read(size_t numBytes, unsigned long &numBytesRead)
! reads numbytes data, WITHOUT using any endian or section consideration
Definition: MWAWInputStream.cxx:140
ApplePictParserInternal::Bitmap::m_dst
MWAWBox2i m_dst
the final dimension
Definition: ApplePictParser.cxx:202
ApplePictParser::D_TEXT
@ D_TEXT
Definition: ApplePictParser.hxx:68
MWAWParser::resetGraphicListener
void resetGraphicListener()
resets the listener
Definition: MWAWParser.cxx:130
ApplePictParserInternal::Pixmap::m_rect
MWAWBox2i m_rect
the pixmap rectangle
Definition: ApplePictParser.cxx:553
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:99
MWAWGraphicListener
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:60
ApplePictParserInternal::State::m_circle
MWAWBox2i m_circle
the last circle
Definition: ApplePictParser.cxx:721
ApplePictParserInternal::State::updateStyle
void updateStyle(ApplePictParser::DrawingMethod method, MWAWGraphicStyle &style)
update the actual style
Definition: ApplePictParser.cxx:618
ApplePictParserInternal::State::m_points
std::vector< MWAWVec2i > m_points
the last polygon points
Definition: ApplePictParser.cxx:725
ApplePictParserInternal::ColorTable::m_colors
std::vector< MWAWColor > m_colors
the list of colors
Definition: ApplePictParser.cxx:256

Generated on Fri Sep 18 2020 18:14:52 for libmwaw by doxygen 1.8.20