5#ifndef CSCORE_CSCORE_RAW_H_
6#define CSCORE_CSCORE_RAW_H_
45 void (*processFrame)(
void*
data,
86 std::function<
void(
uint64_t time)> processFrame,
100class RawSource :
public ImageSource {
102 RawSource() =
default;
122 int width,
int height,
int fps);
130 void PutFrame(RawFrame& image);
138class RawSink :
public ImageSink {
165 std::function<
void(
uint64_t time)> processFrame);
177 [[nodiscard]]
uint64_t GrabFrame(RawFrame& image,
178 double timeout = 0.225)
const;
188 [[nodiscard]]
uint64_t GrabFrameNoTimeout(RawFrame& image)
const;
192 m_handle = CreateRawSource(name, mode, &m_status);
197 int height,
int fps) {
199 CreateRawSource(name, VideoMode{
format, width, height,
fps}, &m_status);
202inline void RawSource::PutFrame(RawFrame& image) {
204 PutSourceFrame(m_handle, image, &m_status);
208 m_handle = CreateRawSink(name, &m_status);
212 std::function<
void(
uint64_t time)> processFrame) {
213 m_handle = CreateRawSinkCallback(name, processFrame, &m_status);
216inline uint64_t RawSink::GrabFrame(RawFrame& image,
double timeout)
const {
218 return GrabSinkFrameTimeout(m_handle, image, timeout, &m_status);
221inline uint64_t RawSink::GrabFrameNoTimeout(RawFrame& image)
const {
223 return GrabSinkFrame(m_handle, image, &m_status);
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation source
Definition: ThirdPartyNotices.txt:114
basic_string_view< char > string_view
Definition: core.h:520
struct CS_RawFrame CS_RawFrame
Raw Frame.
@ CS_PIXFMT_UNKNOWN
Definition: cscore_c.h:91
uint64_t CS_GrabRawSinkFrame(CS_Sink sink, struct CS_RawFrame *rawImage, CS_Status *status)
CS_Sink CS_CreateRawSinkCallback(const char *name, void *data, void(*processFrame)(void *data, uint64_t time), CS_Status *status)
uint64_t CS_GrabRawSinkFrameTimeout(CS_Sink sink, struct CS_RawFrame *rawImage, double timeout, CS_Status *status)
void CS_PutRawSourceFrame(CS_Source source, const struct CS_RawFrame *image, CS_Status *status)
CS_Sink CS_CreateRawSink(const char *name, CS_Status *status)
void CS_AllocateRawFrameData(CS_RawFrame *frame, int requestedSize)
CS_Source CS_CreateRawSource(const char *name, const CS_VideoMode *mode, CS_Status *status)
void CS_FreeRawFrameData(CS_RawFrame *frame)
CS_Handle CS_Source
Definition: cscore_c.h:51
int CS_Status
Definition: cscore_c.h:44
CS_Handle CS_Sink
Definition: cscore_c.h:50
::uint64_t uint64_t
Definition: Meta.h:58
CameraServer (cscore) namespace.
Definition: cscore_cpp.h:31
GHC_FS_API file_status status(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4892
fps
Definition: velocity.h:46
Raw Frame.
Definition: cscore_raw.h:17
int totalData
Definition: cscore_raw.h:23
int dataLength
Definition: cscore_raw.h:19
int width
Definition: cscore_raw.h:21
int pixelFormat
Definition: cscore_raw.h:20
char * data
Definition: cscore_raw.h:18
int height
Definition: cscore_raw.h:22
Video mode.
Definition: cscore_c.h:104
PixelFormat
Definition: cscore_cpp.h:65
Definition: format.h:1544
auto format(wformat_string< T... > fmt, T &&... args) -> std::wstring
Definition: xchar.h:87