-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDC6Frame.h
More file actions
39 lines (33 loc) · 1.16 KB
/
DC6Frame.h
File metadata and controls
39 lines (33 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include "Abyss/Streams/StreamReader.h"
#include <cstddef>
#include <cstdint>
#include <vector>
namespace Abyss::DataTypes {
inline constexpr std::byte DC6EndOfScanline = static_cast<const std::byte>(0x80);
inline constexpr std::byte DC6MaxRunLength = static_cast<const std::byte>(0x7F);
inline constexpr int DC6TerminationSize = 4;
inline constexpr int DC6TerminatorSize = 3;
class DC6Frame {
uint32_t _flipped{};
uint32_t _width{};
uint32_t _height{};
int32_t _xOffset{};
int32_t _yOffset{};
uint32_t _unknown{};
uint32_t _nextBlock{};
uint32_t _length{};
std::vector<std::byte> _frameData{};
public:
explicit DC6Frame(Streams::StreamReader& stream);
[[nodiscard]] uint32_t getFlipped() const;
[[nodiscard]] uint32_t getWidth() const;
[[nodiscard]] uint32_t getHeight() const;
[[nodiscard]] int32_t getXOffset() const;
[[nodiscard]] int32_t getYOffset() const;
[[nodiscard]] uint32_t getUnknown() const;
[[nodiscard]] uint32_t getNextBlock() const;
[[nodiscard]] uint32_t getLength() const;
[[nodiscard]] const std::vector<std::byte>& getFrameData() const;
};
} // namespace Abyss::DataTypes