RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
BitStreamerMSB16Test.cpp
Go to the documentation of this file.
1
/*
2
RawSpeed - RAW file decoder.
3
4
Copyright (C) 2018 Roman Lebedev
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
10
11
This library 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 GNU
14
Lesser General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#include "
bitstreams/BitStreamerMSB16.h
"
22
#include "
bitstreams/BitStreamerTest.h
"
23
#include <array>
24
#include <cstdint>
25
#include <gtest/gtest.h>
26
27
using
rawspeed::BitStreamerMSB16
;
28
29
namespace
rawspeed_test
{
30
31
namespace
{
32
33
struct
InvOnesTag;
34
struct
OnesTag;
35
36
template
<>
37
const
std::array<uint8_t, 8> Pattern<BitStreamerMSB16, OnesTag>::Data = {
38
{
/* [Byte1 Byte0 Byte3 Byte2] */
39
/* Byte: [Bit0 .. Bit7] */
40
0b01000010, 0b10100100, 0b00011111, 0b00001000}};
41
template
<>
uint32_t
Pattern<BitStreamerMSB16, OnesTag>::data(
int
index) {
42
const
auto
set = GenOnesBE(1, 0);
43
return
set[index];
44
}
45
46
template
<>
47
const
std::array<uint8_t, 8> Pattern<BitStreamerMSB16, InvOnesTag>::Data = {
48
{0b00100001, 0b11010010, 0b00001111, 0b00000100}};
49
template
<>
uint32_t
Pattern<BitStreamerMSB16, InvOnesTag>::data(
int
index) {
50
const
auto
set = GenOnesBE(0, -1);
51
return
set[index];
52
}
53
54
INSTANTIATE_TYPED_TEST_SUITE_P
(MSB16, BitStreamerTest,
55
Patterns<BitStreamerMSB16>);
56
57
}
// namespace
58
59
}
// namespace rawspeed_test
BitStreamerMSB16.h
BitStreamerTest.h
rawspeed::BitStreamerMSB16
Definition
BitStreamerMSB16.h:42
uint32_t
rawspeed_test::anonymous_namespace{BitStreamerMSB16Test.cpp}::INSTANTIATE_TYPED_TEST_SUITE_P
INSTANTIATE_TYPED_TEST_SUITE_P(MSB16, BitStreamerTest, Patterns< BitStreamerMSB16 >)
rawspeed_test
Definition
BitTest.cpp:38
test
librawspeed
bitstreams
BitStreamerMSB16Test.cpp
Generated by
1.15.0