RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
BitStreamJPEGUtils.h
Go to the documentation of this file.
1/*
2 RawSpeed - RAW file decoder.
3
4 Copyright (C) 2024 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 "adt/Array1DRef.h"
22#include "adt/Casts.h"
24#include "adt/Invariant.h"
25#include <cstddef>
26#include <cstdint>
27#include <memory>
28#include <vector>
29
30namespace rawspeed {
31
33 std::vector<uint8_t,
37
38 [[nodiscard]] Array1DRef<const uint8_t> getInput() const {
39 return {dataStorage.data(), implicit_cast<int>(dataStorage.size())};
40 }
41
42 explicit JPEGStuffedByteStreamGenerator(int64_t numBytesMax,
43 bool AppendStuffingByte);
44};
45
47 std::vector<uint8_t,
51
52 [[nodiscard]] Array1DRef<const uint8_t> getInput() const {
53 return {dataStorage.data(), implicit_cast<int>(dataStorage.size())};
54 }
55
57 const int64_t numBytesMax)
58 : numBytesGenerated(numBytesMax) {
61 }
62};
63
64} // namespace rawspeed
#define invariant(expr)
Definition Invariant.h:27
constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value)
Definition Casts.h:32
std::vector< uint8_t, DefaultInitAllocatorAdaptor< uint8_t, std::allocator< uint8_t > > > dataStorage
Array1DRef< const uint8_t > getInput() const
JPEGStuffedByteStreamGenerator(int64_t numBytesMax, bool AppendStuffingByte)
__attribute__((noinline)) explicit NonJPEGByteStreamGenerator(const int64_t numBytesMax)
Array1DRef< const uint8_t > getInput() const
std::vector< uint8_t, DefaultInitAllocatorAdaptor< uint8_t, std::allocator< uint8_t > > > dataStorage