ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
buffer_impl.cpp
Go to the documentation of this file.
1#include "buffer_impl.h"
2
3namespace esphome::camera {
4
6 RAMAllocator<uint8_t> allocator;
7 this->data_ = allocator.allocate(size);
8 this->size_ = size;
9}
10
12 RAMAllocator<uint8_t> allocator;
13 this->data_ = allocator.allocate(spec->bytes_per_image());
14 this->size_ = spec->bytes_per_image();
15}
16
18 if (this->data_ != nullptr) {
19 RAMAllocator<uint8_t> allocator;
20 allocator.deallocate(this->data_, this->size_);
21 }
22}
23
24} // namespace esphome::camera
An STL allocator that uses SPI or internal RAM.
Definition helpers.h:1794
void deallocate(T *p, size_t n)
Definition helpers.h:1849
T * allocate(size_t n)
Definition helpers.h:1811
size_t size
Definition helpers.h:854
Specification of a caputured camera image.
Definition camera.h:84