MWAWPictBitmap.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MWAWPictBitmap.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 /* This header contains code specific to some bitmap
35 */
36
37 #ifndef MWAW_PICT_BITMAP
38 # define MWAW_PICT_BITMAP
39
40 #include <assert.h>
41
42 #include <vector>
43
44 #include "libmwaw_internal.hxx"
45 #include "MWAWDebug.hxx"
46 #include "MWAWPict.hxx"
47
49 //
50 // Some container
51 //
53
55 template <class T> class MWAWPictBitmapContainer
56 {
57 public:
59 MWAWPictBitmapContainer(MWAWVec2i const &sz) : m_size(sz), m_data(0L)
60 {
61 if (m_size[0]*m_size[1] == 0) return;
62 m_data = new T[size_t(m_size[0]*m_size[1])];
63 std::uninitialized_fill_n(m_data, m_size[0] * m_size[1], T());
64 }
66 virtual ~MWAWPictBitmapContainer()
67 {
68 if (m_data) delete [] m_data;
69 }
70
72 bool ok() const
73 {
74 return (m_data != 0L);
75 }
76
78 int cmp(MWAWPictBitmapContainer<T> const &orig) const
79 {
80 int diff = m_size.cmpY(orig.m_size);
81 if (diff) return diff;
82 if (!m_data) return orig.m_data ? 1 : 0;
83 if (!orig.m_data) return -1;
84 for (int i=0; i < m_size[0]*m_size[1]; i++) {
85 if (m_data[i] < orig.m_data[i]) return -1;
86 if (m_data[i] > orig.m_data[i]) return 1;
87 }
88 return 0;
89 }
91 MWAWVec2i const &size() const
92 {
93 return m_size;
94 }
96 int numRows() const
97 {
98 return m_size[0];
99 }
101 int numColumns() const
102 {
103 return m_size[1];
104 }
105
107 T const &get(int i, int j) const
108 {
109 if (m_data == 0L || i<0 || i >= m_size[0] || j<0 || j >= m_size[1])
110 throw libmwaw::GenericException();
111 return m_data[i+m_size[0]*j];
112 }
114 T const *getRow(int j) const
115 {
116 if (m_data == 0L || j<0 || j >= m_size[1])
117 throw libmwaw::GenericException();
118 return m_data+m_size[0]*j;
119 }
120
122 void set(int i, int j, T const &v)
123 {
124 if (m_data == 0L || i<0 || i >= m_size[0] || j<0 || j >= m_size[1]) {
125 MWAW_DEBUG_MSG(("MWAWPictBitmapContainer::set: call with bad coordinate %d %d\n", i, j));
126 return;
127 }
128 m_data[i+j*m_size[0]] = v;
129 }
130
132 template <class U>
133 void setRow(int j, U const *val)
134 {
135 if (m_data == 0L || j<0 || j >= m_size[1]) {
136 MWAW_DEBUG_MSG(("MWAWPictBitmapContainer::setRow: call with bad coordinate %d\n", j));
137 return;
138 }
139 for (int i = 0, ind=j*m_size[0]; i < m_size[0]; i++, ind++) m_data[ind] = T(val[i]);
140 }
141
143 template <class U>
144 void setColumn(int i, U const *val)
145 {
146 if (m_data == 0L || i<0 || i >= m_size[0]) {
147 MWAW_DEBUG_MSG(("MWAWPictBitmapContainer::setColumn: call with bad coordinate %d\n", i));
148 return;
149 }
150 for (int j = 0, ind=i; j < m_size[1]; j++, ind+=m_size[0]) m_data[ind] = T(val[i]);
151 }
152
153 private:
154 MWAWPictBitmapContainer(MWAWPictBitmapContainer const &orig);
155 MWAWPictBitmapContainer &operator=(MWAWPictBitmapContainer const &orig);
156 protected:
158 MWAWVec2i m_size;
160 T *m_data;
161 };
162
164 class MWAWPictBitmapContainerBool : public MWAWPictBitmapContainer<bool>
165 {
166 public:
168 MWAWPictBitmapContainerBool(MWAWVec2i const &sz) : MWAWPictBitmapContainer<bool>(sz) {}
169
171 int cmp(MWAWPictBitmapContainerBool const &orig) const
172 {
173 int diff = m_size.cmpY(orig.m_size);
174 if (diff) return diff;
175 if (!m_data) return orig.m_data ? 1 : 0;
176 if (!orig.m_data) return -1;
177 for (int i=0; i < m_size[0]*m_size[1]; i++) {
178 if (m_data[i] == orig.m_data[i]) continue;
179 return m_data[i] ? 1 : -1;
180 }
181 return 0;
182 }
183
185 void setRowPacked(int j, unsigned char const *val)
186 {
187 if (m_data == 0L || j<0 || j >= m_size[1]) {
188 MWAW_DEBUG_MSG(("MWAWPictBitmapContainerBool::setRowPacked: call with bad coordinate %d\n", j));
189 return;
190 }
191 for (int i = 0, ind = j*m_size[0]; i < m_size[0];) {
192 unsigned char v = *(val++);
193 unsigned char mask = 0x80;
194 for (int p = 0; p < 8 && i < m_size[0]; i++, p++, ind++) {
195 m_data[ind] = ((v&mask) != 0);
196 mask = (unsigned char)(mask >> 1);
197 }
198 }
199 }
200 };
201
203 class MWAWPictBitmap : public MWAWPict
204 {
205 public:
207 enum SubType { BW, Indexed, Color };
209 virtual Type getType() const
210 {
211 return MWAWPict::Bitmap;
212 }
214 virtual SubType getSubType() const = 0;
215
217 virtual bool getBinary(librevenge::RVNGBinaryData &res, std::string &s) const
218 {
219 if (!valid()) return false;
220
221 s = "image/pict";
222 createFileData(res);
223 return true;
224 }
225
227 virtual bool valid() const
228 {
229 return false;
230 }
231
234 virtual int cmp(MWAWPict const &a) const
235 {
236 int diff = MWAWPict::cmp(a);
237 if (diff) return diff;
238 MWAWPictBitmap const &aPict = static_cast<MWAWPictBitmap const &>(a);
239
240 // the type
241 diff = getSubType() - aPict.getSubType();
242 if (diff) return (diff < 0) ? -1 : 1;
243
244 return 0;
245 }
246
247 protected:
249 virtual bool createFileData(librevenge::RVNGBinaryData &result) const = 0;
250
252 MWAWPictBitmap(MWAWVec2i const &sz)
253 {
254 setBdBox(MWAWBox2f(MWAWVec2f(0,0), sz));
255 }
256 };
257
259 class MWAWPictBitmapBW : public MWAWPictBitmap
260 {
261 public:
263 virtual SubType getSubType() const
264 {
265 return BW;
266 }
267
270 virtual int cmp(MWAWPict const &a) const
271 {
272 int diff = MWAWPictBitmap::cmp(a);
273 if (diff) return diff;
274 MWAWPictBitmapBW const &aPict = static_cast<MWAWPictBitmapBW const &>(a);
275
276 return m_data.cmp(aPict.m_data);
277 }
278
280 virtual bool valid() const
281 {
282 return m_data.ok();
283 }
284
286 MWAWPictBitmapBW(MWAWVec2i const &sz) : MWAWPictBitmap(sz), m_data(sz) { }
287
289 MWAWVec2i const &size() const
290 {
291 return m_data.size();
292 }
294 int numRows() const
295 {
296 return m_data.numRows();
297 }
299 int numColumns() const
300 {
301 return m_data.numColumns();
302 }
304 bool get(int i, int j) const
305 {
306 return m_data.get(i,j);
307 }
309 bool const *getRow(int j) const
310 {
311 return m_data.getRow(j);
312 }
314 void set(int i, int j, bool v)
315 {
316 m_data.set(i,j, v);
317 }
319 void setRow(int j, bool const *val)
320 {
321 m_data.setRow(j, val);
322 }
324 void setRowPacked(int j, unsigned char const *val)
325 {
326 m_data.setRowPacked(j, val);
327 }
329 void setColumn(int i, bool const *val)
330 {
331 m_data.setColumn(i, val);
332 }
333
334 protected:
336 virtual bool createFileData(librevenge::RVNGBinaryData &result) const;
337
339 MWAWPictBitmapContainerBool m_data;
340 };
341
343 class MWAWPictBitmapIndexed : public MWAWPictBitmap
344 {
345 public:
347 virtual SubType getSubType() const
348 {
349 return Indexed;
350 }
351
354 virtual int cmp(MWAWPict const &a) const
355 {
356 int diff = MWAWPictBitmap::cmp(a);
357 if (diff) return diff;
358 MWAWPictBitmapIndexed const &aPict = static_cast<MWAWPictBitmapIndexed const &>(a);
359
360 diff=int(m_colors.size())-int(aPict.m_colors.size());
361 if (diff) return (diff < 0) ? -1 : 1;
362 for (size_t c=0; c < m_colors.size(); c++) {
363 if (m_colors[c] < aPict.m_colors[c])
364 return 1;
365 if (m_colors[c] > aPict.m_colors[c])
366 return -1;
367 }
368 return m_data.cmp(aPict.m_data);
369 }
370
372 virtual bool valid() const
373 {
374 return m_data.ok();
375 }
376
378 MWAWPictBitmapIndexed(MWAWVec2i const &sz) : MWAWPictBitmap(sz), m_data(sz), m_colors() { }
379
381 MWAWVec2i const &size() const
382 {
383 return m_data.size();
384 }
386 int numRows() const
387 {
388 return m_data.numRows();
389 }
391 int numColumns() const
392 {
393 return m_data.numColumns();
394 }
396 int get(int i, int j) const
397 {
398 return m_data.get(i,j);
399 }
401 int const *getRow(int j) const
402 {
403 return m_data.getRow(j);
404 }
405
407 void set(int i, int j, int v)
408 {
409 m_data.set(i,j, v);
410 }
412 template <class U> void setRow(int j, U const *val)
413 {
414 m_data.setRow(j, val);
415 }
417 template <class U> void setColumn(int i, U const *val)
418 {
419 m_data.setColumn(i, val);
420 }
421
423 std::vector<MWAWColor> const &getColors() const
424 {
425 return m_colors;
426 }
428 void setColors(std::vector<MWAWColor> const &cols)
429 {
430 m_colors = cols;
431 }
432
433 protected:
435 virtual bool createFileData(librevenge::RVNGBinaryData &result) const;
436
438 MWAWPictBitmapContainer<int> m_data;
440 std::vector<MWAWColor> m_colors;
441 };
442
450 class MWAWPictBitmapColor : public MWAWPictBitmap
451 {
452 public:
454 virtual SubType getSubType() const
455 {
456 return Indexed;
457 }
458
461 virtual int cmp(MWAWPict const &a) const
462 {
463 int diff = MWAWPictBitmap::cmp(a);
464 if (diff) return diff;
465 MWAWPictBitmapColor const &aPict = static_cast<MWAWPictBitmapColor const &>(a);
466
467 return m_data.cmp(aPict.m_data);
468 }
469
471 virtual bool valid() const
472 {
473 return m_data.ok();
474 }
475
477 MWAWPictBitmapColor(MWAWVec2i const &sz, bool useAlphaChannel=false) : MWAWPictBitmap(sz), m_data(sz), m_hasAlpha(useAlphaChannel) { }
478
480 MWAWVec2i const &size() const
481 {
482 return m_data.size();
483 }
485 int numRows() const
486 {
487 return m_data.numRows();
488 }
490 int numColumns() const
491 {
492 return m_data.numColumns();
493 }
495 MWAWColor get(int i, int j) const
496 {
497 return m_data.get(i,j);
498 }
500 MWAWColor const *getRow(int j) const
501 {
502 return m_data.getRow(j);
503 }
504
506 void set(int i, int j, MWAWColor const &v)
507 {
508 m_data.set(i,j, v);
509 }
511 void setRow(int j, MWAWColor const *val)
512 {
513 m_data.setRow(j, val);
514 }
516 void setColumn(int i, MWAWColor const *val)
517 {
518 m_data.setColumn(i, val);
519 }
520
521 protected:
523 virtual bool createFileData(librevenge::RVNGBinaryData &result) const;
524
526 MWAWPictBitmapContainer<MWAWColor> m_data;
527
529 bool m_hasAlpha;
530 };
531 #endif
532 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWPictBitmapBW::setColumn
void setColumn(int i, bool const *val)
sets all cell contents of a column
Definition: MWAWPictBitmap.hxx:329
MWAWPictBitmapColor::MWAWPictBitmapColor
MWAWPictBitmapColor(MWAWVec2i const &sz, bool useAlphaChannel=false)
the constructor
Definition: MWAWPictBitmap.hxx:477
MWAWPictBitmap::BW
Definition: MWAWPictBitmap.hxx:207
MWAWPictBitmapContainer::numColumns
int numColumns() const
gets the number of column
Definition: MWAWPictBitmap.hxx:101
MWAWPictBitmapIndexed::size
MWAWVec2i const & size() const
the picture size
Definition: MWAWPictBitmap.hxx:381
MWAWPictBitmapColor::set
void set(int i, int j, MWAWColor const &v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:506
MWAWPictBitmapContainer::m_data
T * m_data
the m_data placed by row ie. d_00, d_10, ... , d_{X-1}0, ..
Definition: MWAWPictBitmap.hxx:160
MWAWPictBitmap::cmp
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class ...
Definition: MWAWPictBitmap.hxx:234
MWAWPictBitmapColor::valid
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:471
MWAWPictBitmapColor::cmp
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class ...
Definition: MWAWPictBitmap.hxx:461
MWAWPictBitmap::Indexed
Definition: MWAWPictBitmap.hxx:207
libmwaw_internal.hxx
MWAWPictBitmapBW::valid
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:280
MWAWPictBitmapContainer::m_size
MWAWVec2i m_size
the size
Definition: MWAWPictBitmap.hxx:158
MWAWPictBitmapContainer::size
MWAWVec2i const & size() const
return the array size
Definition: MWAWPictBitmap.hxx:91
MWAWPictBitmapContainer::setColumn
void setColumn(int i, U const *val)
sets a column of m_data
Definition: MWAWPictBitmap.hxx:144
MWAWPictBitmapColor::numRows
int numRows() const
the number of rows
Definition: MWAWPictBitmap.hxx:485
MWAWPictBitmapContainer::setRow
void setRow(int j, U const *val)
sets a line of m_data
Definition: MWAWPictBitmap.hxx:133
MWAWPictBitmapContainer::set
void set(int i, int j, T const &v)
sets a cell m_data
Definition: MWAWPictBitmap.hxx:122
MWAWPictBitmapIndexed::setColumn
void setColumn(int i, U const *val)
sets all cell contents of a column
Definition: MWAWPictBitmap.hxx:417
MWAWPictBitmapColor::setRow
void setRow(int j, MWAWColor const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:511
MWAWPictBitmap::getSubType
virtual SubType getSubType() const =0
returns the picture subtype
MWAWPictBitmap::Color
Definition: MWAWPictBitmap.hxx:207
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:177
MWAWPict::cmp
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:102
MWAWPictBitmapContainer::get
T const & get(int i, int j) const
accessor of a cell m_data
Definition: MWAWPictBitmap.hxx:107
MWAWPictBitmapColor
a bitmap of MWAWColor to store true color bitmap
Definition: MWAWPictBitmap.hxx:450
MWAWPictBitmapIndexed::getRow
int const * getRow(int j) const
returns the cells content of a row
Definition: MWAWPictBitmap.hxx:401
MWAWPictBitmapBW::numColumns
int numColumns() const
the number of columns
Definition: MWAWPictBitmap.hxx:299
MWAWPictBitmapBW::numRows
int numRows() const
the number of rows
Definition: MWAWPictBitmap.hxx:294
MWAWPict::setBdBox
void setBdBox(MWAWBox2f const &box)
sets the bdbox of the picture
Definition: MWAWPict.hxx:85
MWAWPictBitmapContainer
a template class to store a 2D array of m_data
Definition: MWAWPictBitmap.hxx:55
MWAWPictBitmapIndexed::valid
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:372
MWAWPictBitmapBW::setRow
void setRow(int j, bool const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:319
MWAWPictBitmapContainer::numRows
int numRows() const
gets the number of row
Definition: MWAWPictBitmap.hxx:96
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
MWAWPictBitmapIndexed::getColors
std::vector< MWAWColor > const & getColors() const
returns the array of indexed colors
Definition: MWAWPictBitmap.hxx:423
MWAWVec2::cmpY
int cmpY(MWAWVec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:665
MWAWPict.hxx
MWAWPictBitmapBW
a bitmap of bool to store black-white bitmap
Definition: MWAWPictBitmap.hxx:259
MWAWPictBitmapBW::getRow
bool const * getRow(int j) const
returns the cells content of a row
Definition: MWAWPictBitmap.hxx:309
MWAWPictBitmapIndexed::set
void set(int i, int j, int v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:407
libmwaw::GenericException
Definition: libmwaw_internal.hxx:145
MWAWPictBitmapIndexed::MWAWPictBitmapIndexed
MWAWPictBitmapIndexed(MWAWVec2i const &sz)
the constructor
Definition: MWAWPictBitmap.hxx:378
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:721
MWAWPictBitmap::SubType
SubType
the picture subtype: blackwhite, indexed, color
Definition: MWAWPictBitmap.hxx:207
MWAWPictBitmapContainerBool
a bool container with a function to put packed row
Definition: MWAWPictBitmap.hxx:164
MWAWPictBitmapBW::set
void set(int i, int j, bool v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:314
MWAWPictBitmapColor::m_hasAlpha
bool m_hasAlpha
true if the bitmap has alpha color
Definition: MWAWPictBitmap.hxx:529
MWAWPictBitmapIndexed
a bitmap of int to store indexed bitmap
Definition: MWAWPictBitmap.hxx:343
MWAWPictBitmap::MWAWPictBitmap
MWAWPictBitmap(MWAWVec2i const &sz)
protected constructor: use check to construct a picture
Definition: MWAWPictBitmap.hxx:252
MWAWPictBitmapIndexed::setColors
void setColors(std::vector< MWAWColor > const &cols)
sets the array of indexed colors
Definition: MWAWPictBitmap.hxx:428
MWAWPictBitmapContainer::MWAWPictBitmapContainer
MWAWPictBitmapContainer(MWAWVec2i const &sz)
constructor given size
Definition: MWAWPictBitmap.hxx:59
MWAWPictBitmapIndexed::m_data
MWAWPictBitmapContainer< int > m_data
the m_data
Definition: MWAWPictBitmap.hxx:438
MWAWPictBitmapBW::createFileData
virtual bool createFileData(librevenge::RVNGBinaryData &result) const
function which creates the result file
Definition: MWAWPictBitmap.cxx:227
MWAWPict::Type
Type
the different picture types:
Definition: MWAWPict.hxx:64
MWAWPictBitmapContainerBool::cmp
int cmp(MWAWPictBitmapContainerBool const &orig) const
a comparison operator
Definition: MWAWPictBitmap.hxx:171
MWAWPictBitmap::getBinary
virtual bool getBinary(librevenge::RVNGBinaryData &res, std::string &s) const
returns the final librevenge::RVNGBinary data
Definition: MWAWPictBitmap.hxx:217
MWAWPictBitmapContainer::operator=
MWAWPictBitmapContainer & operator=(MWAWPictBitmapContainer const &orig)
MWAWPictBitmapContainerBool::setRowPacked
void setRowPacked(int j, unsigned char const *val)
allows to use packed m_data
Definition: MWAWPictBitmap.hxx:185
MWAWPictBitmapColor::getRow
MWAWColor const * getRow(int j) const
returns the cells content of a row
Definition: MWAWPictBitmap.hxx:500
MWAWPictBitmapIndexed::setRow
void setRow(int j, U const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:412
MWAWPictBitmap::createFileData
virtual bool createFileData(librevenge::RVNGBinaryData &result) const =0
abstract function which creates the result file
MWAWDebug.hxx
MWAWPictBitmapContainer::~MWAWPictBitmapContainer
virtual ~MWAWPictBitmapContainer()
destructor
Definition: MWAWPictBitmap.hxx:66
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1082
MWAWPictBitmapIndexed::createFileData
virtual bool createFileData(librevenge::RVNGBinaryData &result) const
the function which creates the result file
Definition: MWAWPictBitmap.cxx:246
MWAWPictBitmap
Generic class used to construct bitmap.
Definition: MWAWPictBitmap.hxx:203
MWAWPictBitmapBW::MWAWPictBitmapBW
MWAWPictBitmapBW(MWAWVec2i const &sz)
the constructor
Definition: MWAWPictBitmap.hxx:286
MWAWPictBitmapColor::numColumns
int numColumns() const
the number of columns
Definition: MWAWPictBitmap.hxx:490
MWAWPictBitmapContainer::cmp
int cmp(MWAWPictBitmapContainer< T > const &orig) const
a comparison operator
Definition: MWAWPictBitmap.hxx:78
MWAWPictBitmapContainer::ok
bool ok() const
returns ok, if the m_data is allocated
Definition: MWAWPictBitmap.hxx:72
MWAWPictBitmapIndexed::numRows
int numRows() const
the number of rows
Definition: MWAWPictBitmap.hxx:386
MWAWPictBitmapContainer::getRow
T const * getRow(int j) const
accessor of a row m_data
Definition: MWAWPictBitmap.hxx:114
MWAWPictBitmapColor::setColumn
void setColumn(int i, MWAWColor const *val)
sets all cell contents of a column
Definition: MWAWPictBitmap.hxx:516
MWAWPictBitmap::valid
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:227
MWAWPictBitmapBW::cmp
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class ...
Definition: MWAWPictBitmap.hxx:270
MWAWPictBitmapBW::getSubType
virtual SubType getSubType() const
returns the picture subtype
Definition: MWAWPictBitmap.hxx:263
MWAWPict::Bitmap
Definition: MWAWPict.hxx:64
MWAWPictBitmapColor::createFileData
virtual bool createFileData(librevenge::RVNGBinaryData &result) const
the function which creates the result file
Definition: MWAWPictBitmap.cxx:236
MWAWPictBitmapIndexed::m_colors
std::vector< MWAWColor > m_colors
the colors
Definition: MWAWPictBitmap.hxx:440
MWAWPictBitmapBW::size
MWAWVec2i const & size() const
the picture size
Definition: MWAWPictBitmap.hxx:289
MWAWPictBitmapIndexed::getSubType
virtual SubType getSubType() const
return the picture subtype
Definition: MWAWPictBitmap.hxx:347
MWAWPictBitmapContainerBool::MWAWPictBitmapContainerBool
MWAWPictBitmapContainerBool(MWAWVec2i const &sz)
constructor
Definition: MWAWPictBitmap.hxx:168
MWAWPictBitmap::getType
virtual Type getType() const
returns the picture type
Definition: MWAWPictBitmap.hxx:209
MWAWPictBitmapColor::getSubType
virtual SubType getSubType() const
return the picture subtype
Definition: MWAWPictBitmap.hxx:454
MWAWPictBitmapBW::setRowPacked
void setRowPacked(int j, unsigned char const *val)
sets all cell contents of a row given packed m_data
Definition: MWAWPictBitmap.hxx:324
MWAWPictBitmapIndexed::numColumns
int numColumns() const
the number of columns
Definition: MWAWPictBitmap.hxx:391
MWAWPictBitmapColor::m_data
MWAWPictBitmapContainer< MWAWColor > m_data
the data
Definition: MWAWPictBitmap.hxx:526
MWAWPictBitmapColor::size
MWAWVec2i const & size() const
the picture size
Definition: MWAWPictBitmap.hxx:480
MWAWPict
Generic function used to define/store a picture.
Definition: MWAWPict.hxx:52
MWAWVec2< int >
MWAWPictBitmapBW::m_data
MWAWPictBitmapContainerBool m_data
the data
Definition: MWAWPictBitmap.hxx:339
MWAWPictBitmapIndexed::cmp
virtual int cmp(MWAWPict const &a) const
a virtual function used to obtain a strict order, must be redefined in the subs class ...
Definition: MWAWPictBitmap.hxx:354