ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
webcam.h
Go to the documentation of this file.
1#pragma once
2
11
63
64#include <stdint.h>
66
67/* ============================================================================
68 * Device Information
69 * @{
70 */
71
76#define WEBCAM_DEVICE_NAME_MAX 256
77
88typedef struct {
89 unsigned int index;
92
121asciichat_error_t webcam_list_devices(webcam_device_info_t **devices, unsigned int *count);
122
133
135
136/* ============================================================================
137 * High-Level Webcam Interface
138 * @{
139 */
140
153
154/* ============================================================================
155 * Error Handling Helpers
156 * @{
157 */
158
173
175
176/* ============================================================================
177 * Context-Based Webcam Interface
178 * @{
179 */
180
201asciichat_error_t webcam_init_context(webcam_context_t **ctx, unsigned short int device_index);
202
216
226
244
267
285
288
unsigned int height
Definition fft.c:23
unsigned int width
Definition fft.c:23
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
asciichat_error_t webcam_init_context(webcam_context_t **ctx, unsigned short int device_index)
Initialize webcam context for advanced operations.
asciichat_error_t webcam_list_devices(webcam_device_info_t **devices, unsigned int *count)
Enumerate available webcam devices.
image_t * webcam_read_async(webcam_context_t *ctx)
Get the most recent frame from async camera thread (non-blocking).
void webcam_free_device_list(webcam_device_info_t *devices)
Free device list returned by webcam_list_devices().
void webcam_flush_context(webcam_context_t *ctx)
Flush/interrupt pending read operations on webcam context.
void webcam_print_init_error_help(asciichat_error_t error_code)
Print helpful error diagnostics for webcam initialization failures.
struct webcam_context_t webcam_context_t
Opaque webcam context structure.
Definition webcam.h:152
asciichat_error_t webcam_get_dimensions(webcam_context_t *ctx, int *width, int *height)
Get webcam frame dimensions.
#define WEBCAM_DEVICE_NAME_MAX
Maximum length of webcam device name.
Definition webcam.h:76
image_t * webcam_read_context(webcam_context_t *ctx)
Capture a frame from webcam context.
void webcam_cleanup_context(webcam_context_t *ctx)
Clean up webcam context and release resources.
SIMD-friendly storage for one RGB pixel. r, g, and b hold the color channels and padding keeps the la...
Webcam device information structure.
Definition webcam.h:88
char name[256]
Human-readable device name.
Definition webcam.h:90
unsigned int index
Device index (use with webcam_init_context).
Definition webcam.h:89
double webcam_get_fps(webcam_context_t *ctx)