config: configure downsampling; remove config generator

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I43c5821edc0e121962bee76e39cb32816a6a6964
This commit is contained in:
raf 2025-11-02 12:41:10 +03:00
commit e5931e3910
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
2 changed files with 51 additions and 34 deletions

12
include/chroma.h vendored
View file

@ -99,6 +99,7 @@ typedef struct {
GLuint ebo;
bool gl_resources_initialized;
bool texture_uploaded;
bool vbo_dirty; // track VBO needs update
} chroma_output_t;
// Config mapping structure
@ -119,6 +120,12 @@ typedef struct {
// Global scaling and filtering settings (used as defaults)
chroma_scale_mode_t default_scale_mode;
chroma_filter_quality_t default_filter_quality;
// Image downsampling settings
bool enable_downsampling; // enable automatic downsampling
int max_output_width; // maximum expected output width
int max_output_height; // maximum expected output height
float min_scale_factor; // minimum scale factor (don't scale below this)
} chroma_config_t;
// Main application state
@ -205,7 +212,8 @@ void chroma_layer_surface_closed(void *data,
// Image loading
void chroma_image_init_stb(void);
int chroma_image_load(chroma_image_t *image, const char *path);
int chroma_image_load(chroma_image_t *image, const char *path,
const chroma_config_t *config);
void chroma_image_free(chroma_image_t *image);
chroma_image_t *chroma_image_find_by_path(chroma_state_t *state,
const char *path);
@ -224,7 +232,7 @@ const char *chroma_config_get_image_for_output(chroma_config_t *config,
int chroma_config_get_mapping_for_output(
chroma_config_t *config, const char *output_name,
chroma_scale_mode_t *scale_mode, chroma_filter_quality_t *filter_quality);
int chroma_config_create_sample(const char *config_file);
void chroma_config_print(const chroma_config_t *config);
// Main loop and events