ESPHome
2025.9.0-dev
Loading...
Searching...
No Matches
esphome
components
camera
buffer_impl.cpp
Go to the documentation of this file.
1
#include "
buffer_impl.h
"
2
3
namespace
esphome::camera
{
4
5
BufferImpl::BufferImpl
(
size_t
size) {
6
this->
data_
= this->
allocator_
.
allocate
(size);
7
this->
size_
= size;
8
}
9
10
BufferImpl::BufferImpl
(
CameraImageSpec
*spec) {
11
this->
data_
= this->
allocator_
.
allocate
(spec->
bytes_per_image
());
12
this->
size_
= spec->
bytes_per_image
();
13
}
14
15
BufferImpl::~BufferImpl
() {
16
if
(this->
data_
!=
nullptr
)
17
this->
allocator_
.
deallocate
(this->
data_
, this->
size_
);
18
}
19
20
}
// namespace esphome::camera
buffer_impl.h
esphome::RAMAllocator::deallocate
void deallocate(T *p, size_t n)
Definition
helpers.h:877
esphome::RAMAllocator::allocate
T * allocate(size_t n)
Definition
helpers.h:839
esphome::camera::BufferImpl::BufferImpl
BufferImpl(size_t size)
Definition
buffer_impl.cpp:5
esphome::camera::BufferImpl::size_
size_t size_
Definition
buffer_impl.h:22
esphome::camera::BufferImpl::allocator_
RAMAllocator< uint8_t > allocator_
Definition
buffer_impl.h:21
esphome::camera::BufferImpl::~BufferImpl
~BufferImpl() override
Definition
buffer_impl.cpp:15
esphome::camera::BufferImpl::data_
uint8_t * data_
Definition
buffer_impl.h:23
esphome::camera
Definition
buffer.h:6
esphome::camera::CameraImageSpec
Specification of a caputured camera image.
Definition
camera.h:69
esphome::camera::CameraImageSpec::bytes_per_image
size_t bytes_per_image()
Definition
camera.h:86
Generated by
1.12.0