Skip to content

Current Adapters and their Configs

Gabe Rundlett edited this page Feb 15, 2023 · 3 revisions

Input Adapter Configs

Byte Buffer

typedef struct {
    uint8_t const *data;
    size_t size;
} GvoxByteBufferInputAdapterConfig;

File

typedef struct {
    char const *filepath;
    size_t byte_offset;
} GvoxFileInputAdapterConfig;

Output Adapter Configs

Byte Buffer

typedef struct {
    size_t *out_size;
    uint8_t **out_byte_buffer_ptr;
    void *(*allocate)(size_t size);
} GvoxByteBufferOutputAdapterConfig;

File

typedef struct {
    char const *filepath;
} GvoxFileOutputAdapterConfig;

Standard Out

// This adapter has no config

Parse Adapter Configs

Gvox Palette

// This adapter has no config

Gvox Raw

// This adapter has no config

Magicavoxel

// This adapter has no config

Voxlap

typedef struct {
    // If the config is null, or the value is -1, the default will be used.

    // By default, the size of the map is 1024x1024x256
    uint32_t size_x;
    uint32_t size_y;
    uint32_t size_z;

    // This determines whether to make the insides of the map hollow or solid
    // By default, this is set to 1.
    uint8_t make_solid;

    // This designates whether the data should be parsed as Ace of Spades,
    // since Ace of Spades maps have no file header.
    // By default, this is set to 0.
    uint8_t is_ace_of_spades;
} GvoxVoxlapParseAdapterConfig;

Serialize Adapter Configs

Colored Text

typedef enum {
    GVOX_COLORED_TEXT_SERIALIZE_ADAPTER_DOWNSCALE_MODE_NEAREST,
    GVOX_COLORED_TEXT_SERIALIZE_ADAPTER_DOWNSCALE_MODE_LINEAR,
} GvoxColoredTextSerializeAdapterDownscaleMode;

typedef struct {
    // By default, this should be 1.
    // If set to n, then each 'pixel' will represent n*n*n voxels
    uint32_t downscale_factor;
    // By default, this is ..._NEAREST.
    GvoxColoredTextSerializeAdapterDownscaleMode downscale_mode;
    // Doesn't make sense to have a default for this, when the default channel is color data
    uint32_t non_color_max_value;
} GvoxColoredTextSerializeAdapterConfig;

Gvox Palette

// This adapter has no config

Gvox Raw

// This adapter has no config