libopenraw  0.3.7
unpack.hpp
1 /*
2  * libopenraw - unpack.hpp
3  *
4  * Copyright (C) 2008-2022 Hubert Figuiere
5  * Copyright (C) 2008 Novell, Inc.
6  *
7  * This library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 #include <stdint.h>
25 #include <stddef.h>
26 
27 #include <libopenraw/consts.h>
28 
29 namespace OpenRaw {
30 namespace Internals {
31 
33 class Unpack
34 {
35 public:
36  Unpack(uint32_t w, uint32_t t);
37  // noncopyable
38  Unpack(const Unpack&) = delete;
39  Unpack & operator=(const Unpack&) = delete;
40 
41  size_t block_size() const;
42  or_error unpack_be12to16(uint16_t *dest, size_t destsize, const uint8_t *src, size_t size, size_t & outsize) const;
43  or_error unpack_le12to16(uint16_t *dest, size_t destsize, const uint8_t *src, size_t size, size_t & out) const;
44 private:
45  uint32_t m_w;
46  uint32_t m_type;
47 };
48 
49 }
50 }
or_error unpack_le12to16(uint16_t *dest, size_t destsize, const uint8_t *src, size_t size, size_t &out) const
Definition: unpack.cpp:117
or_error unpack_be12to16(uint16_t *dest, size_t destsize, const uint8_t *src, size_t size, size_t &outsize) const
Definition: unpack.cpp:58
or_error
Error codes returned by libopenraw.
Definition: consts.h:42
Global namespace for libopenraw.
Definition: arwfile.cpp:29