ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
image_frame_packet_t Struct Reference

Describes one compressed image sent through ACIP. width, height, and pixel_format tell the decoder how to interpret the payload; compressed_size bounds the following bytes, and checksum plus timestamp support validation and frame ordering. The packet header is fixed-size, but the image bytes are variable-length and owned by the packet buffer. More...

#include <include/ascii-chat/network/packet/packet.h>

Data Fields

uint32_t width
 Image width in pixels.
uint32_t height
 Image height in pixels.
uint32_t pixel_format
 Pixel format enum (1=RGB24, 2=RGBA32, 3=BGR24, 4=BGRA32).
uint32_t compressed_size
 Compressed data size (0 = not compressed, >0 = compressed).
uint32_t checksum
 CRC32 checksum of pixel data.
uint32_t timestamp
 Timestamp when frame was captured (milliseconds since epoch).

Detailed Description

Describes one compressed image sent through ACIP. width, height, and pixel_format tell the decoder how to interpret the payload; compressed_size bounds the following bytes, and checksum plus timestamp support validation and frame ordering. The packet header is fixed-size, but the image bytes are variable-length and owned by the packet buffer.

Image frame packet structure (Packet Type 3)

Contains raw RGB image with dimensions from camera/webcam. Used when client sends camera frames to server for ASCII conversion.

Note
Pixel data follows this header in the packet payload.
Format: rgb_pixel_t pixels[width * height] or compressed data
Pixel formats are defined in common.h

Definition at line 931 of file packet.h.

Field Documentation

◆ checksum

uint32_t image_frame_packet_t::checksum

CRC32 checksum of pixel data.

Definition at line 941 of file packet.h.

Referenced by send_image_frame_packet().

◆ compressed_size

uint32_t image_frame_packet_t::compressed_size

Compressed data size (0 = not compressed, >0 = compressed).

Definition at line 939 of file packet.h.

Referenced by send_image_frame_packet().

◆ height

uint32_t image_frame_packet_t::height

Image height in pixels.

Definition at line 935 of file packet.h.

Referenced by send_image_frame_packet(), and session_host_receive_packet().

◆ pixel_format

uint32_t image_frame_packet_t::pixel_format

Pixel format enum (1=RGB24, 2=RGBA32, 3=BGR24, 4=BGRA32).

Definition at line 937 of file packet.h.

Referenced by send_image_frame_packet(), and session_host_receive_packet().

◆ timestamp

uint32_t image_frame_packet_t::timestamp

Timestamp when frame was captured (milliseconds since epoch).

Definition at line 943 of file packet.h.

Referenced by send_image_frame_packet().

◆ width

uint32_t image_frame_packet_t::width

Image width in pixels.

Definition at line 933 of file packet.h.

Referenced by acip_send_image_frame(), send_image_frame_packet(), and session_host_receive_packet().


The documentation for this struct was generated from the following file: