FastLED 3.9.3
Loading...
Searching...
No Matches
bytestream.h
1#pragma once
2
3#include <stddef.h>
4#include <stdint.h>
5
6#include "namespace.h"
7#include "ref.h"
8
9#include "crgb.h"
10
11FASTLED_NAMESPACE_BEGIN
12
13FASTLED_SMART_REF(ByteStream);
14
15// An abstract class that represents a file handle.
16// Devices like the SD card will return one of these.
17class ByteStream : public Referent {
18 public:
19 virtual ~ByteStream() {}
20 virtual bool available(size_t) const = 0;
21 virtual size_t read(uint8_t *dst, size_t bytesToRead) = 0;
22 virtual const char *path() const = 0;
23 virtual void close() {} // default is do nothing on close.
24
25 // convenience functions
26 size_t read(CRGB *dst, size_t n) { return read((uint8_t *)dst, n * 3); }
27};
28
29
30
31FASTLED_NAMESPACE_END
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:39