ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
video.c File Reference

Video utility stubs for WASM. More...

Go to the source code of this file.

Functions

asciichat_error_t image_validate_dimensions (size_t width, size_t height)
 Validate image dimensions (non-zero, within limits).

Detailed Description

Video utility stubs for WASM.

Definition in file video.c.

Function Documentation

◆ image_validate_dimensions()

asciichat_error_t image_validate_dimensions ( size_t width,
size_t height )

Validate image dimensions (non-zero, within limits).

Parameters
widthImage width to validate
heightImage height to validate
Returns
ASCIICHAT_OK if valid, ERROR_INVALID_PARAM if invalid

Checks that:

  • Both width and height are non-zero
  • Dimensions don't exceed IMAGE_MAX_WIDTH and IMAGE_MAX_HEIGHT Sets errno with detailed context if validation fails

Definition at line 12 of file video.c.

12 {
13 if (width > 0 && height > 0 && width <= 10000 && height <= 10000) {
14 return ASCIICHAT_OK;
15 }
17}
unsigned int height
Definition fft.c:24
unsigned int width
Definition fft.c:24
@ ASCIICHAT_OK
Definition error_codes.h:50
@ ERROR_INVALID_PARAM

References ASCIICHAT_OK, ERROR_INVALID_PARAM, height, and width.