ascii-chat 0.11.33
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}
@ ASCIICHAT_OK
Definition error_codes.h:51
@ ERROR_INVALID_PARAM

References ASCIICHAT_OK, and ERROR_INVALID_PARAM.

Referenced by handle_image_frame_packet(), and image_new().