Beatmup
bitmap_access.cpp
Go to the documentation of this file.
1 /*
2  Beatmup image and signal processing library
3  Copyright (C) 2019, lnstadrum
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "bitmap_access.h"
20 #include "mask_bitmap_access.h"
21 
22 const int
23  Beatmup::MASK_LUT_1_BIT[2] = { 0, 255 },
24  Beatmup::MASK_LUT_2_BITS[4] = { 0, 85, 170, 255 },
25  Beatmup::MASK_LUT_4_BITS[16] = { 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 };
26 
27 
29  if (bitmap.getPixelFormat() != pf)
31 }
32 
33 
35  if (!bitmap.isMask())
37 }
38 
39 
41  if (!bitmap.isFloat())
43 }
44 
45 
47  if (!bitmap.isInteger())
49 }
A very basic class for any image.
bool isInteger() const
Returns true if the bitmap contains integer values, false otherwise.
bool isMask() const
Returns true if the bitmap is a mask, false otherwise.
bool isFloat() const
Returns true if the bitmap contains floating point values, false otherwise.
const PixelFormat getPixelFormat() const
Pixel format of the bitmap.
An exception to throw if a pixel format is not supported.
UnsupportedPixelFormat(PixelFormat pf)
static void check(AbstractBitmap &bitmap, PixelFormat pf)
static void assertFloat(AbstractBitmap &bitmap)
static void assertInt(AbstractBitmap &bitmap)
static void assertMask(AbstractBitmap &bitmap)
const int MASK_LUT_4_BITS[16]
const int MASK_LUT_2_BITS[4]
const int MASK_LUT_1_BIT[2]
Beatmup::InternalBitmap * bitmap