Canvas5Image.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
/*
* Parser to Canvas 5/6 drawing document ( image part )
*/
#ifndef CANVAS5_IMAGE
# define CANVAS5_IMAGE
#include <string>
#include <utility>
#include <vector>
#include <librevenge/librevenge.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWGraphicStyle.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWPosition.hxx"
namespace Canvas5Structure
{
struct Stream;
}
namespace Canvas5ImageInternal
{
struct VKFLImage;
struct VKFLShape;
struct State;
}
class Canvas5Parser;
class Canvas5StyleManager;
class Canvas5Image
{
friend class Canvas5Parser;
public:
explicit Canvas5Image(Canvas5Parser &parser);
virtual ~Canvas5Image();
int version() const;
// interface with other parser
bool readAGIFRsrc(std::shared_ptr<Canvas5Structure::Stream> stream);
bool readMACORsrc(std::shared_ptr<Canvas5Structure::Stream> stream);
bool readQkTmRsrc(Canvas5Structure::Stream &stream);
bool readVKFL(std::shared_ptr<Canvas5Structure::Stream> stream, long len, std::shared_ptr<Canvas5ImageInternal::VKFLImage> &image);
bool readImages(std::shared_ptr<Canvas5Structure::Stream> stream);
bool readImages9(std::shared_ptr<Canvas5Structure::Stream> stream);
bool getBitmap(int bitmapId, MWAWEmbeddedObject &object);
std::shared_ptr<Canvas5ImageInternal::VKFLImage> getGIF(int gifId);
bool readMacroIndent(Canvas5Structure::Stream &stream, std::vector<unsigned> &id, std::string &extra);
std::shared_ptr<Canvas5ImageInternal::VKFLImage> getMACO(std::vector<unsigned> const &id);
bool getQuickTime(int quicktimeId, MWAWEmbeddedObject &object);
bool getArrow(std::shared_ptr<Canvas5ImageInternal::VKFLImage> image, MWAWGraphicStyle::Arrow &arrow) const;
bool getTexture(std::shared_ptr<Canvas5ImageInternal::VKFLImage> image, MWAWEmbeddedObject &texture, MWAWVec2i &textureDim, MWAWColor &averageColor) const;
bool send(std::shared_ptr<Canvas5ImageInternal::VKFLImage> image, MWAWListenerPtr listener,
MWAWBox2f const &box, MWAWTransformation const &transformation, int depth=0) const;
protected:
//
// Low level
//
std::shared_ptr<Canvas5StyleManager> getStyleManager() const;
bool readVKFLShape(std::shared_ptr<Canvas5Structure::Stream> stream, Canvas5ImageInternal::VKFLImage &image);
bool readVKFLShapeMainData(std::shared_ptr<Canvas5Structure::Stream> stream, Canvas5ImageInternal::VKFLImage &image, Canvas5ImageInternal::VKFLShape &shape,
MWAWEntry const &data);
bool readVKFLShapeOtherData(std::shared_ptr<Canvas5Structure::Stream> stream, Canvas5ImageInternal::VKFLImage &image,
std::tuple<MWAWEntry, unsigned, long> const &dataTypePos,
std::vector<long> &childFieldPos, int subId);
bool send(Canvas5ImageInternal::VKFLImage const &image, size_t &shapeId, MWAWListenerPtr listener,
MWAWGraphicStyle const &style, MWAWTransformation const &transformation, int depth=0) const;
private:
Canvas5Image(Canvas5Image const &orig) = delete;
Canvas5Image &operator=(Canvas5Image const &orig) = delete;
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
std::shared_ptr<Canvas5ImageInternal::State> m_state;
Canvas5Parser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWGraphicStyle.hxx
MWAWInputStream.hxx
MWAWPosition.hxx
Canvas5Image::send
bool send(std::shared_ptr< Canvas5ImageInternal::VKFLImage > image, MWAWListenerPtr listener, MWAWBox2f const &box, MWAWTransformation const &transformation, int depth=0) const
try to send a image where box is the image bdbox before applying transformation
Definition Canvas5Image.cxx:1688
Canvas5Image::getGIF
std::shared_ptr< Canvas5ImageInternal::VKFLImage > getGIF(int gifId)
try to retrieve a gif given a GIF id
Definition Canvas5Image.cxx:272
Canvas5Image::getQuickTime
bool getQuickTime(int quicktimeId, MWAWEmbeddedObject &object)
try to retrieve a quicktime given a quicktimeId
Definition Canvas5Image.cxx:292
Canvas5Image::readMacroIndent
bool readMacroIndent(Canvas5Structure::Stream &stream, std::vector< unsigned > &id, std::string &extra)
try to read a macro indent (low level)
Definition Canvas5Image.cxx:426
Canvas5Image::readQkTmRsrc
bool readQkTmRsrc(Canvas5Structure::Stream &stream)
try to read the QkTm rsrc block: a list of media? v6
Definition Canvas5Image.cxx:757
Canvas5Image::~Canvas5Image
virtual ~Canvas5Image()
destructor
Definition Canvas5Image.cxx:247
Canvas5Image::readImages9
bool readImages9(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the list of bitmap: v9
Definition Canvas5Image.cxx:358
Canvas5Image::operator=
Canvas5Image & operator=(Canvas5Image const &orig)=delete
Canvas5Image::m_state
std::shared_ptr< Canvas5ImageInternal::State > m_state
the state
Definition Canvas5Image.hxx:155
Canvas5Image::version
int version() const
returns the file version
Definition Canvas5Image.cxx:251
Canvas5Image::getArrow
bool getArrow(std::shared_ptr< Canvas5ImageInternal::VKFLImage > image, MWAWGraphicStyle::Arrow &arrow) const
try to retrieve an arrow from a VKFL image
Definition Canvas5Image.cxx:823
Canvas5Image::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition Canvas5Image.hxx:152
Canvas5Image::readImages
bool readImages(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the second big block: the list of bitmap
Definition Canvas5Image.cxx:314
Canvas5Image::Canvas5Image
Canvas5Image(Canvas5Image const &orig)=delete
Canvas5Image::readVKFLShapeMainData
bool readVKFLShapeMainData(std::shared_ptr< Canvas5Structure::Stream > stream, Canvas5ImageInternal::VKFLImage &image, Canvas5ImageInternal::VKFLShape &shape, MWAWEntry const &data)
try to read a shape header in an image
Definition Canvas5Image.cxx:1221
Canvas5Image::readVKFL
bool readVKFL(std::shared_ptr< Canvas5Structure::Stream > stream, long len, std::shared_ptr< Canvas5ImageInternal::VKFLImage > &image)
try to read an unknown vectorized graphic format used to store symbol, texture and arrow
Definition Canvas5Image.cxx:889
Canvas5Image::m_mainParser
Canvas5Parser * m_mainParser
the main parser;
Definition Canvas5Image.hxx:158
Canvas5Image::getMACO
std::shared_ptr< Canvas5ImageInternal::VKFLImage > getMACO(std::vector< unsigned > const &id)
try to retrieve a macros image given a MACO id
Definition Canvas5Image.cxx:282
Canvas5Image::readVKFLShapeOtherData
bool readVKFLShapeOtherData(std::shared_ptr< Canvas5Structure::Stream > stream, Canvas5ImageInternal::VKFLImage &image, std::tuple< MWAWEntry, unsigned, long > const &dataTypePos, std::vector< long > &childFieldPos, int subId)
try to read a external data corresponding to some shapes in an image
Definition Canvas5Image.cxx:1443
Canvas5Image::getTexture
bool getTexture(std::shared_ptr< Canvas5ImageInternal::VKFLImage > image, MWAWEmbeddedObject &texture, MWAWVec2i &textureDim, MWAWColor &averageColor) const
try to retrieve an texture from a VKFL image
Definition Canvas5Image.cxx:865
Canvas5Image::readMACORsrc
bool readMACORsrc(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the macros rsrc blocks: a list of vectorised image
Definition Canvas5Image.cxx:459
Canvas5Image::Canvas5Image
Canvas5Image(Canvas5Parser &parser)
constructor
Definition Canvas5Image.cxx:240
Canvas5Image::getStyleManager
std::shared_ptr< Canvas5StyleManager > getStyleManager() const
return the style manager
Definition Canvas5Image.cxx:256
Canvas5Image::readVKFLShape
bool readVKFLShape(std::shared_ptr< Canvas5Structure::Stream > stream, Canvas5ImageInternal::VKFLImage &image)
try to read a shape in an image
Definition Canvas5Image.cxx:1121
Canvas5Image::Canvas5Parser
friend class Canvas5Parser
Definition Canvas5Image.hxx:79
Canvas5Image::getBitmap
bool getBitmap(int bitmapId, MWAWEmbeddedObject &object)
try to retrieve a bitmap given a bitmapId
Definition Canvas5Image.cxx:261
Canvas5Image::readAGIFRsrc
bool readAGIFRsrc(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the AGIF rsrc block: a list of vectorised image v6
Definition Canvas5Image.cxx:629
Canvas5Parser
the main class to read a Canvas 5-10 files (and probably some not password protected Windows 11 files...
Definition Canvas5Parser.hxx:72
Canvas5StyleManager
the main class to read the style part of Canvas 5 file
Definition Canvas5StyleManager.hxx:86
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWGraphicStyle
a structure used to define a picture style
Definition MWAWGraphicStyle.hxx:48
MWAWTransformation
a transformation which stored the first row of a 3x3 perspective matrix
Definition libmwaw_internal.hxx:1199
libmwaw_internal.hxx
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition libmwaw_internal.hxx:838
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition libmwaw_internal.hxx:1193
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
MWAWListenerPtr
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition libmwaw_internal.hxx:553
Canvas5ImageInternal
Internal: the structures of a Canvas5Image.
Definition Canvas5Image.cxx:70
Canvas5Structure
a namespace used to define basic function or structure to read a Canvas v5-v11 file
Definition Canvas5BMParser.hxx:64
Canvas5ImageInternal::State
Internal: the state of a Canvas5Image.
Definition Canvas5Image.cxx:215
Canvas5ImageInternal::VKFLImage
Internal: the internal image of a Canvas5Image.
Definition Canvas5Image.cxx:169
Canvas5ImageInternal::VKFLShape
Internal: the internal shape of a Canvas5Image.
Definition Canvas5Image.cxx:96
Canvas5Structure::Stream
a sub stream of Canvas5Structure
Definition Canvas5Structure.hxx:49
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
MWAWGraphicStyle::Arrow
a structure used to define an arrow
Definition MWAWGraphicStyle.hxx:59