SatDump 2.0.0-alpha-520736c72
Loading...
Searching...
No Matches
gk2a_headers.h
Go to the documentation of this file.
1#pragma once
2
7
8#include "common/utils.h"
9#include <cstdint>
10#include <cstring>
11#include <vector>
12
13namespace satdump
14{
15 namespace xrit
16 {
17 namespace gk2a
18 {
19 enum CustomFileParams
20 {
21 JPG_COMPRESSED,
22 J2K_COMPRESSED,
23 IS_ENCRYPTED,
24 KEY_INDEX,
25 };
26
27 struct KeyHeader
28 {
29 static constexpr int TYPE = 7;
30
31 uint8_t type;
32 uint16_t record_length;
33 uint32_t key;
34
35 KeyHeader(uint8_t *data)
36 {
37 type = data[0];
38 record_length = data[1] << 8 | data[2];
39 key = data[3] << 24 | data[4] << 16 | data[5] << 8 | data[6];
40 }
41 };
42
43 struct ImageSegmentationIdentification
44 {
45 static constexpr int TYPE = 128;
46
47 uint8_t type;
48 uint16_t record_length;
49 uint8_t image_seq_nb;
50 uint8_t total_segments_nb;
51 uint16_t line_nb;
52
53 ImageSegmentationIdentification(uint8_t *data)
54 {
55 type = data[0];
56 record_length = data[1] << 8 | data[2];
57 image_seq_nb = data[3];
58 total_segments_nb = data[4];
59 line_nb = data[5] << 8 | data[6];
60 }
61 };
62 } // namespace gk2a
63 } // namespace xrit
64} // namespace satdump