gui
[lbook_fbreader.git] / fbreader / src / formats / pdb / PluckerImages.h
blobc65f38da935a5e6591cec4746a3a4dba0c506a2b
1 /*
2 * Copyright (C) 2004-2008 Geometer Plus <contact@geometerplus.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
20 #ifndef __PLUCKERIMAGES_H__
21 #define __PLUCKERIMAGES_H__
23 #include <string>
25 #include <ZLImage.h>
26 #include "../../bookmodel/BookModel.h"
28 class ZCompressedFileImage : public ZLSingleImage {
30 public:
31 ZCompressedFileImage(const std::string &mimeType, const std::string &path, size_t offset, size_t size);
32 const shared_ptr<std::string> stringData() const;
34 private:
35 std::string myPath;
36 size_t myOffset;
37 size_t myCompressedSize;
40 class DocCompressedFileImage : public ZLSingleImage {
42 public:
43 DocCompressedFileImage(const std::string &mimeType, const std::string &path, size_t offset, size_t compressedSize);
44 const shared_ptr<std::string> stringData() const;
46 private:
47 std::string myPath;
48 size_t myOffset;
49 size_t myCompressedSize;
52 class PluckerMultiImage : public ZLMultiImage {
54 public:
55 PluckerMultiImage(unsigned int rows, unsigned int columns, const ZLImageMap &imageMap);
57 void addId(const std::string &id);
59 unsigned int rows() const;
60 unsigned int columns() const;
61 shared_ptr<const ZLImage> subImage(unsigned int row, unsigned int column) const;
63 private:
64 unsigned int myRows, myColumns;
65 const ZLImageMap &myImageMap;
66 std::vector<std::string> myIds;
69 inline ZCompressedFileImage::ZCompressedFileImage(const std::string &mimeType, const std::string &path, size_t offset, size_t compressedSize) : ZLSingleImage(mimeType), myPath(path), myOffset(offset), myCompressedSize(compressedSize) {}
71 inline DocCompressedFileImage::DocCompressedFileImage(const std::string &mimeType, const std::string &path, size_t offset, size_t compressedSize) : ZLSingleImage(mimeType), myPath(path), myOffset(offset), myCompressedSize(compressedSize) {}
73 inline PluckerMultiImage::PluckerMultiImage(unsigned int rows, unsigned int columns, const ZLImageMap &imageMap) : myRows(rows), myColumns(columns), myImageMap(imageMap) {}
74 inline void PluckerMultiImage::addId(const std::string &id) { myIds.push_back(id); }
75 inline unsigned int PluckerMultiImage::rows() const { return myRows; }
76 inline unsigned int PluckerMultiImage::columns() const { return myColumns; }
78 #endif /* __PLUCKERIMAGES_H__ */