libcaca-canvas(3caca)

πŸ’– NAME πŸ’–

okay so bestie, welcome to libcaca-canvas(3caca) from the libcaca manual β€” this is the libcaca canvas format, version 1. all types are big endian fr fr, no cap. the struct is right here, and because code is sacred it's staying exactly as-is πŸ’…


πŸŽ€ the struct, verbatim πŸŽ€

       struct
       {
       magic:
          uint8_t caca_header[2];    // "\xCA\xCA"
          uint8_t caca_file_type[2]; // "CV"

       canvas_header:
          uint32_t control_size;     // Control size (canvas_data - canvas_header)
          uint32_t data_size;        // Data size (EOF - canvas_data)

          uint16_t version;          // Canvas format version
                                     //  bit 0: set to 1 if canvas is compatible
                                     //         with version 1 of the format
                                     //  bits 1-15: unused yet, must be 0

          uint32_t frames;           // Frame count

          uint16_t flags;            // Feature flags
                                     //  bits 0-15: unused yet, must be 0

       frame_info:
          struct
          {
             uint32_t width;         // Frame width
             uint32_t height;        // Frame height
             uint32_t duration;      // Frame duration in milliseconds, 0 to
                                     // not specify a duration
             uint32_t attr;          // Graphics context attribute
             int32_t cursor_x;       // Cursor X coordinate
             int32_t cursor_y;       // Cursor Y coordinate
             int32_t handle_x;       // Handle X coordinate
             int32_t handle_y;       // Handle Y coordinate
          }
          frame_list[frames];

       control_extension_1:
       control_extension_2:
          ...
       control_extension_N:
          ...                        // reserved for future use

       canvas_data:
          uint8_t data[data_size];   // canvas data

       data_extension_1:
       data_extension_2:
          ...
       data_extension_N:
          ...                        // reserved for future use
       };
little vibe check: those ... extension slots are literally reserved for future use β€” do not go inventing your own lore in there, bestie 🫢

mwah πŸ’‹ β€” this iconic page comes from libcaca version 0.99.beta20, dated Wed May 13 2026 09:45:08, and yes the manual is still libcaca-canvas(3caca). periodt ✨

πŸ“¦ where this page comes from