BEEP-8 Helper Lib 1.0.0
Loading...
Searching...
No Matches
rle.h
Go to the documentation of this file.
1// MIT License
2//
3// Copyright (c) 2022 ZooK
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
87#pragma once
88
89#include <memory>
90#include <b8/type.h>
91#include <pipe.h>
92
97namespace Rle {
98
106 std::shared_ptr< Pipe::CPipe > _pipe_in = std::make_shared< Pipe::CNullPipe >();
107 std::shared_ptr< Pipe::CPipe > _pipe_out = std::make_shared< Pipe::CNullPipe >();
108public:
113 void SetIn(std::shared_ptr< Pipe::CPipe > pipe_in_);
114
119 void SetOut(std::shared_ptr< Pipe::CPipe > pipe_out_);
120
128
134};
135
143 std::shared_ptr< Pipe::CPipe > _pipe_in = std::make_shared< Pipe::CNullPipe >();
144 std::shared_ptr< Pipe::CPipe > _pipe_out = std::make_shared< Pipe::CNullPipe >();
145
146public:
151 void SetIn(std::shared_ptr< Pipe::CPipe > pipe_in_);
152
157 void SetOut(std::shared_ptr< Pipe::CPipe > pipe_out_);
158
168
174};
175
176} // namespace Rle
Class for decoding data using run-length encoding (RLE).
Definition rle.h:142
void SetIn(std::shared_ptr< Pipe::CPipe > pipe_in_)
Sets the input pipe for the decoder.
Definition rle.cpp:115
CRleDecoder::DecodeResult Decode()
Performs the RLE decoding process.
Definition rle.cpp:128
void SetOut(std::shared_ptr< Pipe::CPipe > pipe_out_)
Sets the output pipe for the decoder.
Definition rle.cpp:119
DecodeResult
Enum representing the result of the decoding process.
Definition rle.h:162
@ DECODE_ERR_INVALID_DATA
Invalid compressed data.
Definition rle.h:166
@ DECODE_OK
Decoding completed successfully.
Definition rle.h:163
@ DECODE_ERR_INVALID_SIGNATURE
Invalid RLE signature.
Definition rle.h:164
@ DECODE_ERR_INVALID_PIPE
Invalid input or output pipe.
Definition rle.h:165
Class for encoding data using run-length encoding (RLE).
Definition rle.h:105
EncodeResult
Enum representing the result of the encoding process.
Definition rle.h:124
@ ENCODE_ERR_INVALID_PIPE
Invalid input or output pipe.
Definition rle.h:126
@ ENCODE_OK
Encoding completed successfully.
Definition rle.h:125
void SetIn(std::shared_ptr< Pipe::CPipe > pipe_in_)
Sets the input pipe for the encoder.
Definition rle.cpp:104
void SetOut(std::shared_ptr< Pipe::CPipe > pipe_out_)
Sets the output pipe for the encoder.
Definition rle.cpp:108
CRleEncoder::EncodeResult Encode()
Performs the RLE encoding process.
Definition rle.cpp:36
The Rle namespace provides classes for run-length encoding (RLE) compression and decompression.
Module for data pipeline processing using pipes.