RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
BitStreamerLSBTest.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/BitStreamerLSB.h
"
22
#include "
bitstreams/BitStreamerTest.h
"
23
#include <array>
24
#include <cstdint>
25
#include <gtest/gtest.h>
26
27
using
rawspeed::BitStreamerLSB
;
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<BitStreamerLSB, OnesTag>::Data = {
38
{
/* [Byte0 Byte1 Byte2 Byte3] */
39
/* Byte: [Bit7 .. Bit0] */
40
0b01001011, 0b10000100, 0b00100000, 0b11110000}};
41
template
<>
uint32_t
Pattern<BitStreamerLSB, OnesTag>::data(
int
index) {
42
const
auto
set = GenOnesLE(0, -1);
43
return
set[index];
44
}
45
46
template
<>
47
const
std::array<uint8_t, 8> Pattern<BitStreamerLSB, InvOnesTag>::Data = {
48
{0b00100101, 0b01000010, 0b00010000, 0b11111000}};
49
template
<>
uint32_t
Pattern<BitStreamerLSB, InvOnesTag>::data(
int
index) {
50
const
auto
set = GenOnesLE(1, 0);
51
return
set[index];
52
}
53
54
INSTANTIATE_TYPED_TEST_SUITE_P
(LSB, BitStreamerTest, Patterns<BitStreamerLSB>);
55
56
}
// namespace
57
58
}
// namespace rawspeed_test
BitStreamerLSB.h
BitStreamerTest.h
rawspeed::BitStreamerLSB
Definition
BitStreamerLSB.h:42
uint32_t
rawspeed_test::anonymous_namespace{BitStreamerLSBTest.cpp}::INSTANTIATE_TYPED_TEST_SUITE_P
INSTANTIATE_TYPED_TEST_SUITE_P(LSB, BitStreamerTest, Patterns< BitStreamerLSB >)
rawspeed_test
Definition
BitTest.cpp:38
test
librawspeed
bitstreams
BitStreamerLSBTest.cpp
Generated by
1.15.0