Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
jpeg_check.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <cstdint>
9#include <span>
10
11namespace frames
12{
17inline bool is_complete_jpeg(std::span<const uint8_t> data)
18{
19 const size_t length = data.size();
20 if (length < 4)
21 {
22 return false;
23 }
24 return data[0] == 0xFF && data[1] == 0xD8 && data[length - 2] == 0xFF && data[length - 1] == 0xD9;
25}
26} // namespace frames
bool is_complete_jpeg(std::span< const uint8_t > data)
True if the buffer starts with the JPEG SOI marker (FF D8) and ends with the EOI marker (FF D9).
Definition jpeg_check.h:17