2 Copyright 2008 Mark Calderbank
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 u4 windowx, windowy, windoww, windowh;
32 u4 framewidth,frameheight;
39 u1 getBpp() const { return bpp; }
40 void reset() { numColours = 0; }
42 u4 getColour(u1 index) const { return index < maxColours ? colour[index] : 0; }
43 void setColour(u1 index, u4 tColour);
44 void setYCrCbA(u1 index, u1 tY, u1 tCr, u1 tCb, u1 tA);
45 const std::vector<u4>& getColourVector() const { return colour; }
46 const std::vector<u1>& getYVector() const { return Y; }
47 const std::vector<u1>& getCrVector() const { return Cr; }
48 const std::vector<u1>& getCbVector() const { return Cb; }
49 const std::vector<u1>& getAVector() const { return A; }
50 u4 getNumColours() const { return numColours; }
52 const static u4 MAX_DEPTH = 8;
53 std::vector<u4> colour;
59 u4 maxColours, numColours;
60 void argb2yrba(u4 argb, u1& y, u1& cr, u1& cb, u1& a);
61 u4 yrba2argb(u1 y, u1 cr, u1 cb, u1 a);
67 std::vector<u1> bitmap;
70 Bitmap(u4 tWidth = 0, u4 tHeight = 0, u1 tBpp = 8);
72 u4 getWidth() const { return width; }
73 u4 getHeight() const { return height; }
74 u1 getIndex(u4 x, u4 y) const;
75 u4 getColour(u4 x, u4 y) const;
76 const std::vector<u1> & rawData() const { return bitmap; }
77 void setSize(u4 tWidth, u4 tHeight);
78 bool setIndex(u4 x, u4 y, u1 index);
79 void setAllIndices(u1 index);