Open Lighting Architecture: include/ola/dmx/RunLengthEncoder.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
RunLengthEncoder.h
Go to the documentation of this file.
1/*
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 *
16 * RunLengthEncoder.h
17 * Header file for the RunLengthEncoder class
18 * Copyright (C) 2005 Simon Newton
19 */
20
26
27#ifndef INCLUDE_OLA_DMX_RUNLENGTHENCODER_H_
28#define INCLUDE_OLA_DMX_RUNLENGTHENCODER_H_
29
30#include <ola/DmxBuffer.h>
31
32namespace ola {
33namespace dmx {
34
39 class RunLengthEncoder {
40 public :
41 RunLengthEncoder() {}
42 ~RunLengthEncoder() {}
43
52 bool Encode(const DmxBuffer &src,
53 uint8_t *data,
54 unsigned int *size);
55
64 bool Decode(unsigned int start_channel,
65 const uint8_t *data,
66 unsigned int length,
67 DmxBuffer *output);
68
69 private:
70 static const uint8_t REPEAT_FLAG = 0x80;
71};
72} // namespace dmx
73} // namespace ola
74#endif // INCLUDE_OLA_DMX_RUNLENGTHENCODER_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
ola::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::dmx::RunLengthEncoder::Decode
bool Decode(unsigned int start_channel, const uint8_t *data, unsigned int length, DmxBuffer *output)
Definition RunLengthEncoder.cpp:101
ola::dmx::RunLengthEncoder::Encode
bool Encode(const DmxBuffer &src, uint8_t *data, unsigned int *size)
Definition RunLengthEncoder.cpp:27
ola::dmx
DMX512 related code.
Definition RunLengthEncoder.cpp:25
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44