MWAWPictBitmap.hxx Source File documentation

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
41 #include <vector>
42
43 #include "libmwaw_internal.hxx"
44 #include "MWAWDebug.hxx"
45 #include "MWAWPict.hxx"
46
48 //
49 // Some container
50 //
52
54 template <class T> class MWAWPictBitmapContainer
55 {
56 public:
58 explicit MWAWPictBitmapContainer(MWAWVec2i const &sz)
59 : m_size(sz)
60 , m_data(nullptr)
61 {
62 if (m_size[0]*m_size[1] == 0) return;
63 m_data = new T[size_t(m_size[0]*m_size[1])];
64 std::uninitialized_fill_n(m_data, m_size[0] * m_size[1], T());
65 }
67 virtual ~MWAWPictBitmapContainer()
68 {
69 if (m_data) delete [] m_data;
70 }
71
73 bool ok() const
74 {
75 return (m_data != nullptr);
76 }
77
79 int cmp(MWAWPictBitmapContainer<T> const &orig) const
80 {
81 int diff = m_size.cmpY(orig.m_size);
82 if (diff) return diff;
83 if (!m_data) return orig.m_data ? 1 : 0;
84 if (!orig.m_data) return -1;
85 for (int i=0; i < m_size[0]*m_size[1]; i++) {
86 if (m_data[i] < orig.m_data[i]) return -1;
87 if (m_data[i] > orig.m_data[i]) return 1;
88 }
89 return 0;
90 }
92 MWAWVec2i const &size() const
93 {
94 return m_size;
95 }
97 int numRows() const
98 {
99 return m_size[0];
100 }
102 int numColumns() const
103 {
104 return m_size[1];
105 }
106
108 T const &get(int i, int j) const
109 {
110 if (m_data == nullptr || i<0 || i >= m_size[0] || j<0 || j >= m_size[1])
111 throw libmwaw::GenericException();
112 return m_data[i+m_size[0]*j];
113 }
115 T const *getRow(int j) const
116 {
117 if (m_data == nullptr || j<0 || j >= m_size[1])
118 throw libmwaw::GenericException();
119 return m_data+m_size[0]*j;
120 }
121
123 void set(int i, int j, T const &v)
124 {
125 if (m_data == nullptr || i<0 || i >= m_size[0] || j<0 || j >= m_size[1]) {
126 MWAW_DEBUG_MSG(("MWAWPictBitmapContainer::set: call with bad coordinate %d %d\n", i, j));
127 return;
128 }
129 m_data[i+j*m_size[0]] = v;
130 }
131
133 template <class U>
134 void setRow(int j, U const *val)
135 {
136 if (m_data == nullptr || j<0 || j >= m_size[1]) {
137 MWAW_DEBUG_MSG(("MWAWPictBitmapContainer::setRow: call with bad coordinate %d\n", j));
138 return;
139 }
140 for (int i = 0, ind=j*m_size[0]; i < m_size[0]; i++, ind++) m_data[ind] = T(val[i]);
141 }
142
144 template <class U>
145 void setColumn(int i, U const *val)
146 {
147 if (m_data == nullptr || i<0 || i >= m_size[0]) {
148 MWAW_DEBUG_MSG(("MWAWPictBitmapContainer::setColumn: call with bad coordinate %d\n", i));
149 return;
150 }
151 for (int j = 0, ind=i; j < m_size[1]; j++, ind+=m_size[0]) m_data[ind] = T(val[i]);
152 }
153
154 private:
155 MWAWPictBitmapContainer(MWAWPictBitmapContainer const &orig) = delete;
156 MWAWPictBitmapContainer &operator=(MWAWPictBitmapContainer const &orig) = delete;
157 protected:
159 MWAWVec2i m_size;
161 T *m_data;
162 };
163
165 class MWAWPictBitmapContainerBool final : public MWAWPictBitmapContainer<bool>
166 {
167 public:
169 explicit MWAWPictBitmapContainerBool(MWAWVec2i const &sz)
170 : MWAWPictBitmapContainer<bool>(sz)
171 {
172 }
174 ~MWAWPictBitmapContainerBool() final;
176 int cmp(MWAWPictBitmapContainerBool const &orig) const
177 {
178 int diff = m_size.cmpY(orig.m_size);
179 if (diff) return diff;
180 if (!m_data) return orig.m_data ? 1 : 0;
181 if (!orig.m_data) return -1;
182 for (int i=0; i < m_size[0]*m_size[1]; i++) {
183 if (m_data[i] == orig.m_data[i]) continue;
184 return m_data[i] ? 1 : -1;
185 }
186 return 0;
187 }
188
190 void setRowPacked(int j, unsigned char const *val, unsigned char const *end)
191 {
192 if (m_data == nullptr || j<0 || j >= m_size[1] || val >= end) {
193 MWAW_DEBUG_MSG(("MWAWPictBitmapContainerBool::setRowPacked: call with bad coordinate %d\n", j));
194 return;
195 }
196 for (int i = 0, ind = j*m_size[0]; i < m_size[0];) {
197 unsigned char v = (val < end) ? *(val++) : 0;
198 unsigned char mask = 0x80;
199 for (int p = 0; p < 8 && i < m_size[0]; i++, p++, ind++) {
200 m_data[ind] = ((v&mask) != 0);
201 mask = static_cast<unsigned char>(mask >> 1);
202 }
203 }
204 }
205 };
206
208 class MWAWPictBitmap : public MWAWPict
209 {
210 public:
212 ~MWAWPictBitmap() override;
213
215 enum SubType { BW, Indexed, Color };
217 Type getType() const override
218 {
219 return MWAWPict::Bitmap;
220 }
222 virtual SubType getSubType() const = 0;
223
225 bool getBinary(MWAWEmbeddedObject &picture) const override
226 {
227 if (!valid()) return false;
228
229 librevenge::RVNGBinaryData data;
230 createFileData(data);
231 picture=MWAWEmbeddedObject(data, "image/pict");
232 return true;
233 }
234
236 virtual bool valid() const
237 {
238 return false;
239 }
240
242 virtual MWAWColor getAverageColor() const = 0;
245 int cmp(MWAWPict const &a) const override
246 {
247 int diff = MWAWPict::cmp(a);
248 if (diff) return diff;
249 auto const &aPict = static_cast<MWAWPictBitmap const &>(a);
250
251 // the type
252 diff = getSubType() - aPict.getSubType();
253 if (diff) return (diff < 0) ? -1 : 1;
254
255 return 0;
256 }
257
258 protected:
260 virtual bool createFileData(librevenge::RVNGBinaryData &result) const = 0;
261
263 explicit MWAWPictBitmap(MWAWVec2i const &sz)
264 {
265 setBdBox(MWAWBox2f(MWAWVec2f(0,0), MWAWVec2f(sz)));
266 }
267 };
268
270 class MWAWPictBitmapBW final : public MWAWPictBitmap
271 {
272 public:
274 SubType getSubType() const final
275 {
276 return BW;
277 }
278
281 int cmp(MWAWPict const &a) const final
282 {
283 int diff = MWAWPictBitmap::cmp(a);
284 if (diff) return diff;
285 auto const &aPict = static_cast<MWAWPictBitmapBW const &>(a);
286
287 return m_data.cmp(aPict.m_data);
288 }
289
291 bool valid() const final
292 {
293 return m_data.ok();
294 }
295
297 explicit MWAWPictBitmapBW(MWAWVec2i const &sz)
298 : MWAWPictBitmap(sz)
299 , m_data(sz)
300 {
301 }
302
304 MWAWVec2i const &size() const
305 {
306 return m_data.size();
307 }
309 int numRows() const
310 {
311 return m_data.numRows();
312 }
314 int numColumns() const
315 {
316 return m_data.numColumns();
317 }
319 bool get(int i, int j) const
320 {
321 return m_data.get(i,j);
322 }
324 bool const *getRow(int j) const
325 {
326 return m_data.getRow(j);
327 }
329 void set(int i, int j, bool v)
330 {
331 m_data.set(i,j, v);
332 }
334 void setRow(int j, bool const *val)
335 {
336 m_data.setRow(j, val);
337 }
339 void setRowPacked(int j, unsigned char const *val, unsigned char const *end)
340 {
341 m_data.setRowPacked(j, val, end);
342 }
344 void setColumn(int i, bool const *val)
345 {
346 m_data.setColumn(i, val);
347 }
349 MWAWColor getAverageColor() const final;
350
351 protected:
353 bool createFileData(librevenge::RVNGBinaryData &result) const final;
354
356 MWAWPictBitmapContainerBool m_data;
357 };
358
360 class MWAWPictBitmapIndexed final : public MWAWPictBitmap
361 {
362 public:
364 SubType getSubType() const final
365 {
366 return Indexed;
367 }
368
371 int cmp(MWAWPict const &a) const final
372 {
373 int diff = MWAWPictBitmap::cmp(a);
374 if (diff) return diff;
375 auto const &aPict = static_cast<MWAWPictBitmapIndexed const &>(a);
376
377 diff=int(m_colors.size())-int(aPict.m_colors.size());
378 if (diff) return (diff < 0) ? -1 : 1;
379 for (size_t c=0; c < m_colors.size(); c++) {
380 if (m_colors[c] < aPict.m_colors[c])
381 return 1;
382 if (m_colors[c] > aPict.m_colors[c])
383 return -1;
384 }
385 return m_data.cmp(aPict.m_data);
386 }
387
389 bool valid() const final
390 {
391 return m_data.ok();
392 }
394 MWAWColor getAverageColor() const final;
395
397 explicit MWAWPictBitmapIndexed(MWAWVec2i const &sz)
398 : MWAWPictBitmap(sz)
399 , m_data(sz)
400 , m_colors()
401 {
402 }
403
405 MWAWVec2i const &size() const
406 {
407 return m_data.size();
408 }
410 int numRows() const
411 {
412 return m_data.numRows();
413 }
415 int numColumns() const
416 {
417 return m_data.numColumns();
418 }
420 int get(int i, int j) const
421 {
422 return m_data.get(i,j);
423 }
425 int const *getRow(int j) const
426 {
427 return m_data.getRow(j);
428 }
429
431 void set(int i, int j, int v)
432 {
433 m_data.set(i,j, v);
434 }
436 template <class U> void setRow(int j, U const *val)
437 {
438 m_data.setRow(j, val);
439 }
441 template <class U> void setColumn(int i, U const *val)
442 {
443 m_data.setColumn(i, val);
444 }
445
447 std::vector<MWAWColor> const &getColors() const
448 {
449 return m_colors;
450 }
452 void setColors(std::vector<MWAWColor> const &cols)
453 {
454 m_colors = cols;
455 }
456
457 protected:
459 bool createFileData(librevenge::RVNGBinaryData &result) const final;
460
462 MWAWPictBitmapContainer<int> m_data;
464 std::vector<MWAWColor> m_colors;
465 };
466
474 class MWAWPictBitmapColor final : public MWAWPictBitmap
475 {
476 public:
478 SubType getSubType() const final
479 {
480 return Color;
481 }
482
485 int cmp(MWAWPict const &a) const final
486 {
487 int diff = MWAWPictBitmap::cmp(a);
488 if (diff) return diff;
489 auto const &aPict = static_cast<MWAWPictBitmapColor const &>(a);
490
491 return m_data.cmp(aPict.m_data);
492 }
493
495 bool valid() const final
496 {
497 return m_data.ok();
498 }
500 MWAWColor getAverageColor() const final;
501
503 MWAWPictBitmapColor(MWAWVec2i const &sz, bool useAlphaChannel=false)
504 : MWAWPictBitmap(sz)
505 , m_data(sz)
506 , m_hasAlpha(useAlphaChannel)
507 {
508 }
509
511 MWAWVec2i const &size() const
512 {
513 return m_data.size();
514 }
516 int numRows() const
517 {
518 return m_data.numRows();
519 }
521 int numColumns() const
522 {
523 return m_data.numColumns();
524 }
526 MWAWColor get(int i, int j) const
527 {
528 return m_data.get(i,j);
529 }
531 MWAWColor const *getRow(int j) const
532 {
533 return m_data.getRow(j);
534 }
535
537 void set(int i, int j, MWAWColor const &v)
538 {
539 m_data.set(i,j, v);
540 }
542 void setRow(int j, MWAWColor const *val)
543 {
544 m_data.setRow(j, val);
545 }
547 void setColumn(int i, MWAWColor const *val)
548 {
549 m_data.setColumn(i, val);
550 }
551
552 protected:
554 bool createFileData(librevenge::RVNGBinaryData &result) const final;
555
557 MWAWPictBitmapContainer<MWAWColor> m_data;
558
560 bool m_hasAlpha;
561 };
562 #endif
563 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWPict.hxx
MWAWPictBitmapBW
a bitmap of bool to store black-white bitmap
Definition: MWAWPictBitmap.hxx:271
MWAWPictBitmapBW::setColumn
void setColumn(int i, bool const *val)
sets all cell contents of a column
Definition: MWAWPictBitmap.hxx:344
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:339
MWAWPictBitmapBW::set
void set(int i, int j, bool v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:329
MWAWPictBitmapBW::numRows
int numRows() const
the number of rows
Definition: MWAWPictBitmap.hxx:309
MWAWPictBitmapBW::get
bool get(int i, int j) const
returns a cell content
Definition: MWAWPictBitmap.hxx:319
MWAWPictBitmapBW::getSubType
SubType getSubType() const final
returns the picture subtype
Definition: MWAWPictBitmap.hxx:274
MWAWPictBitmapBW::getRow
bool const * getRow(int j) const
returns the cells content of a row
Definition: MWAWPictBitmap.hxx:324
MWAWPictBitmapBW::MWAWPictBitmapBW
MWAWPictBitmapBW(MWAWVec2i const &sz)
the constructor
Definition: MWAWPictBitmap.hxx:297
MWAWPictBitmapBW::cmp
int cmp(MWAWPict const &a) const final
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictBitmap.hxx:281
MWAWPictBitmapBW::numColumns
int numColumns() const
the number of columns
Definition: MWAWPictBitmap.hxx:314
MWAWPictBitmapBW::getAverageColor
MWAWColor getAverageColor() const final
returns the average color
Definition: MWAWPictBitmap.cxx:512
MWAWPictBitmapBW::createFileData
bool createFileData(librevenge::RVNGBinaryData &result) const final
function which creates the result file
Definition: MWAWPictBitmap.cxx:503
MWAWPictBitmapBW::m_data
MWAWPictBitmapContainerBool m_data
the data
Definition: MWAWPictBitmap.hxx:356
MWAWPictBitmapBW::setRow
void setRow(int j, bool const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:334
MWAWPictBitmapBW::size
MWAWVec2i const & size() const
the picture size
Definition: MWAWPictBitmap.hxx:304
MWAWPictBitmapBW::valid
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:291
MWAWPictBitmapColor
a bitmap of MWAWColor to store true color bitmap
Definition: MWAWPictBitmap.hxx:475
MWAWPictBitmapColor::getSubType
SubType getSubType() const final
return the picture subtype
Definition: MWAWPictBitmap.hxx:478
MWAWPictBitmapColor::set
void set(int i, int j, MWAWColor const &v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:537
MWAWPictBitmapColor::getRow
MWAWColor const * getRow(int j) const
returns the cells content of a row
Definition: MWAWPictBitmap.hxx:531
MWAWPictBitmapColor::m_hasAlpha
bool m_hasAlpha
true if the bitmap has alpha color
Definition: MWAWPictBitmap.hxx:560
MWAWPictBitmapColor::cmp
int cmp(MWAWPict const &a) const final
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictBitmap.hxx:485
MWAWPictBitmapColor::setColumn
void setColumn(int i, MWAWColor const *val)
sets all cell contents of a column
Definition: MWAWPictBitmap.hxx:547
MWAWPictBitmapColor::valid
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:495
MWAWPictBitmapColor::size
MWAWVec2i const & size() const
the picture size
Definition: MWAWPictBitmap.hxx:511
MWAWPictBitmapColor::numColumns
int numColumns() const
the number of columns
Definition: MWAWPictBitmap.hxx:521
MWAWPictBitmapColor::m_data
MWAWPictBitmapContainer< MWAWColor > m_data
the data
Definition: MWAWPictBitmap.hxx:557
MWAWPictBitmapColor::numRows
int numRows() const
the number of rows
Definition: MWAWPictBitmap.hxx:516
MWAWPictBitmapColor::setRow
void setRow(int j, MWAWColor const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:542
MWAWPictBitmapColor::get
MWAWColor get(int i, int j) const
returns a cell content
Definition: MWAWPictBitmap.hxx:526
MWAWPictBitmapContainerBool
a bool container with a function to put packed row
Definition: MWAWPictBitmap.hxx:166
MWAWPictBitmapContainerBool::~MWAWPictBitmapContainerBool
~MWAWPictBitmapContainerBool() final
destructor
Definition: MWAWPictBitmap.cxx:492
MWAWPictBitmapContainerBool::cmp
int cmp(MWAWPictBitmapContainerBool const &orig) const
a comparison operator
Definition: MWAWPictBitmap.hxx:176
MWAWPictBitmapContainerBool::MWAWPictBitmapContainerBool
MWAWPictBitmapContainerBool(MWAWVec2i const &sz)
constructor
Definition: MWAWPictBitmap.hxx:169
MWAWPictBitmapContainerBool::setRowPacked
void setRowPacked(int j, unsigned char const *val, unsigned char const *end)
allows to use packed m_data
Definition: MWAWPictBitmap.hxx:190
MWAWPictBitmapContainer
a template class to store a 2D array of m_data
Definition: MWAWPictBitmap.hxx:55
MWAWPictBitmapContainer::m_data
T * m_data
the m_data placed by row ie. d_00, d_10, ... , d_{X-1}0, ..
Definition: MWAWPictBitmap.hxx:161
MWAWPictBitmapContainer::MWAWPictBitmapContainer
MWAWPictBitmapContainer(MWAWPictBitmapContainer const &orig)=delete
MWAWPictBitmapContainer::set
void set(int i, int j, T const &v)
sets a cell m_data
Definition: MWAWPictBitmap.hxx:123
MWAWPictBitmapContainer::numRows
int numRows() const
gets the number of row
Definition: MWAWPictBitmap.hxx:97
MWAWPictBitmapContainer::MWAWPictBitmapContainer
MWAWPictBitmapContainer(MWAWVec2i const &sz)
constructor given size
Definition: MWAWPictBitmap.hxx:58
MWAWPictBitmapContainer::setColumn
void setColumn(int i, U const *val)
sets a column of m_data
Definition: MWAWPictBitmap.hxx:145
MWAWPictBitmapContainer::m_size
MWAWVec2i m_size
the size
Definition: MWAWPictBitmap.hxx:159
MWAWPictBitmapContainer::setRow
void setRow(int j, U const *val)
sets a line of m_data
Definition: MWAWPictBitmap.hxx:134
MWAWPictBitmapContainer::size
MWAWVec2i const & size() const
return the array size
Definition: MWAWPictBitmap.hxx:92
MWAWPictBitmapContainer::ok
bool ok() const
returns ok, if the m_data is allocated
Definition: MWAWPictBitmap.hxx:73
MWAWPictBitmapContainer::~MWAWPictBitmapContainer
virtual ~MWAWPictBitmapContainer()
destructor
Definition: MWAWPictBitmap.hxx:67
MWAWPictBitmapContainer::operator=
MWAWPictBitmapContainer & operator=(MWAWPictBitmapContainer const &orig)=delete
MWAWPictBitmapContainer::get
T const & get(int i, int j) const
accessor of a cell m_data
Definition: MWAWPictBitmap.hxx:108
MWAWPictBitmapContainer::cmp
int cmp(MWAWPictBitmapContainer< T > const &orig) const
a comparison operator
Definition: MWAWPictBitmap.hxx:79
MWAWPictBitmapContainer::numColumns
int numColumns() const
gets the number of column
Definition: MWAWPictBitmap.hxx:102
MWAWPictBitmapContainer::getRow
T const * getRow(int j) const
accessor of a row m_data
Definition: MWAWPictBitmap.hxx:115
MWAWPictBitmapIndexed
a bitmap of int to store indexed bitmap
Definition: MWAWPictBitmap.hxx:361
MWAWPictBitmapIndexed::setColumn
void setColumn(int i, U const *val)
sets all cell contents of a column
Definition: MWAWPictBitmap.hxx:441
MWAWPictBitmapIndexed::setColors
void setColors(std::vector< MWAWColor > const &cols)
sets the array of indexed colors
Definition: MWAWPictBitmap.hxx:452
MWAWPictBitmapIndexed::size
MWAWVec2i const & size() const
the picture size
Definition: MWAWPictBitmap.hxx:405
MWAWPictBitmapIndexed::setRow
void setRow(int j, U const *val)
sets all cell contents of a row
Definition: MWAWPictBitmap.hxx:436
MWAWPictBitmapIndexed::get
int get(int i, int j) const
returns a cell content
Definition: MWAWPictBitmap.hxx:420
MWAWPictBitmapIndexed::m_colors
std::vector< MWAWColor > m_colors
the colors
Definition: MWAWPictBitmap.hxx:464
MWAWPictBitmapIndexed::getSubType
SubType getSubType() const final
return the picture subtype
Definition: MWAWPictBitmap.hxx:364
MWAWPictBitmapIndexed::m_data
MWAWPictBitmapContainer< int > m_data
the m_data
Definition: MWAWPictBitmap.hxx:462
MWAWPictBitmapIndexed::getColors
std::vector< MWAWColor > const & getColors() const
returns the array of indexed colors
Definition: MWAWPictBitmap.hxx:447
MWAWPictBitmapIndexed::numRows
int numRows() const
the number of rows
Definition: MWAWPictBitmap.hxx:410
MWAWPictBitmapIndexed::cmp
int cmp(MWAWPict const &a) const final
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictBitmap.hxx:371
MWAWPictBitmapIndexed::getRow
int const * getRow(int j) const
returns the cells content of a row
Definition: MWAWPictBitmap.hxx:425
MWAWPictBitmapIndexed::valid
bool valid() const final
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:389
MWAWPictBitmapIndexed::numColumns
int numColumns() const
the number of columns
Definition: MWAWPictBitmap.hxx:415
MWAWPictBitmapIndexed::set
void set(int i, int j, int v)
sets a cell contents
Definition: MWAWPictBitmap.hxx:431
MWAWPictBitmap
Generic class used to construct bitmap.
Definition: MWAWPictBitmap.hxx:209
MWAWPictBitmap::getAverageColor
virtual MWAWColor getAverageColor() const =0
returns the average color
MWAWPictBitmap::SubType
SubType
the picture subtype: blackwhite, indexed, color
Definition: MWAWPictBitmap.hxx:215
MWAWPictBitmap::BW
@ BW
Definition: MWAWPictBitmap.hxx:215
MWAWPictBitmap::Color
@ Color
Definition: MWAWPictBitmap.hxx:215
MWAWPictBitmap::Indexed
@ Indexed
Definition: MWAWPictBitmap.hxx:215
MWAWPictBitmap::MWAWPictBitmap
MWAWPictBitmap(MWAWVec2i const &sz)
protected constructor: use check to construct a picture
Definition: MWAWPictBitmap.hxx:263
MWAWPictBitmap::getSubType
virtual SubType getSubType() const =0
returns the picture subtype
MWAWPictBitmap::getType
Type getType() const override
returns the picture type
Definition: MWAWPictBitmap.hxx:217
MWAWPictBitmap::createFileData
virtual bool createFileData(librevenge::RVNGBinaryData &result) const =0
abstract function which creates the result file
MWAWPictBitmap::~MWAWPictBitmap
~MWAWPictBitmap() override
destructor
Definition: MWAWPictBitmap.cxx:496
MWAWPictBitmap::cmp
int cmp(MWAWPict const &a) const override
a virtual function used to obtain a strict order, must be redefined in the subs class
Definition: MWAWPictBitmap.hxx:245
MWAWPictBitmap::getBinary
bool getBinary(MWAWEmbeddedObject &picture) const override
returns the final picture
Definition: MWAWPictBitmap.hxx:225
MWAWPictBitmap::valid
virtual bool valid() const
returns true if the picture is valid
Definition: MWAWPictBitmap.hxx:236
MWAWPict
Generic function used to define/store a picture.
Definition: MWAWPict.hxx:52
MWAWPict::Type
Type
the different picture types:
Definition: MWAWPict.hxx:63
MWAWPict::Bitmap
@ Bitmap
Definition: MWAWPict.hxx:63
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:101
MWAWPict::setBdBox
void setBdBox(MWAWBox2f const &box)
sets the bdbox of the picture
Definition: MWAWPict.hxx:84
MWAWVec2< int >
MWAWVec2::cmpY
int cmpY(MWAWVec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:786
libmwaw::GenericException
Definition: libmwaw_internal.hxx:148
libmwaw_internal.hxx
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
librevenge
Definition: MWAWDocument.hxx:57
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