OCR Project
Loading...
Searching...
No Matches
GuiState Struct Reference

Complete application state passed to every GUI function. More...

Collaboration diagram for GuiState:

Public Attributes

SDL_Window * window
SDL_Renderer * renderer
TTF_Font * font
TTF_Font * font_sm
char image_buf [512]
char model_buf [512]
char words_buf [2048]
int focused
Imageorig_img
SDL_Texture * orig_tex
CNNnet
BoundingBoxcells
size_t n_cells
int grid_rows
int grid_cols
int cell_pitch
char result_words [MAX_RESULTS][64]
WordResult results [MAX_RESULTS]
int n_results
int disp_x
int disp_y
float disp_scale
char status [256]
int status_ok
int hovered_btn
int running
int busy

Detailed Description

Complete application state passed to every GUI function.

All mutable state lives here so that every helper function receives only a single pointer instead of a growing parameter list.

Member Data Documentation

◆ busy

int GuiState::busy

Non-zero while OCR pipeline is running.

◆ cell_pitch

int GuiState::cell_pitch

Average grid pitch in image pixels.

◆ cells

BoundingBox* GuiState::cells

Sorted letter bounding boxes (image coords).

◆ disp_scale

float GuiState::disp_scale

Factor: image_pixel × disp_scale = screen_pixel.

◆ disp_x

int GuiState::disp_x

X pixel of the image top-left corner on screen.

◆ disp_y

int GuiState::disp_y

Y pixel of the image top-left corner on screen.

◆ focused

int GuiState::focused

Which field has keyboard focus (FOCUS_*).

◆ font

TTF_Font* GuiState::font

Primary font (FONT_SIZE pt).

◆ font_sm

TTF_Font* GuiState::font_sm

Smaller font for labels/status (FONT_SIZE_SM pt).

◆ grid_cols

int GuiState::grid_cols

Number of grid columns inferred by OCR.

◆ grid_rows

int GuiState::grid_rows

Number of grid rows inferred by OCR.

◆ hovered_btn

int GuiState::hovered_btn

Button under the mouse: 0=none, 1–3=row index.

◆ image_buf

char GuiState::image_buf[512]

Editable image-path field content.

◆ model_buf

char GuiState::model_buf[512]

Editable model-path field content.

◆ n_cells

size_t GuiState::n_cells

Number of entries in cells.

◆ n_results

int GuiState::n_results

Number of entries in results[].

◆ net

CNN* GuiState::net

Loaded CNN model.

◆ orig_img

Image* GuiState::orig_img

Original RGBA image — never modified.

◆ orig_tex

SDL_Texture* GuiState::orig_tex

GPU texture built once from orig_img.

◆ renderer

SDL_Renderer* GuiState::renderer

Hardware-accelerated renderer.

◆ result_words

char GuiState::result_words[MAX_RESULTS][64]

Words that were searched.

◆ results

WordResult GuiState::results[MAX_RESULTS]

Corresponding solver results.

◆ running

int GuiState::running

Set to 0 to exit the event loop.

◆ status

char GuiState::status[256]

Status-bar message.

◆ status_ok

int GuiState::status_ok

Colour hint: 1=green, 0=red, -1=neutral grey.

◆ window

SDL_Window* GuiState::window

Main application window.

◆ words_buf

char GuiState::words_buf[2048]

Comma-separated words to search for.


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