OCRudoku
v1.0
Resolve word grid with ease
|
#include <SDL2/SDL.h>
Go to the source code of this file.
Data Structures | |
struct | pixel_cluster |
Functions | |
void | spilt_grid_vertical (SDL_Surface *surface, SDL_Rect rect) |
int * | get_grid_vertical_split (SDL_Surface *surface, SDL_Rect rect, int *nb_splits) |
Calculates the vertical split positions in a given SDL surface. | |
int * | get_grid_horizontal_split (SDL_Surface *surface, SDL_Rect rect, int *nb_splits) |
Calculates the horizontal split positions in a given SDL surface. | |
SDL_Rect ** | get_grid_split (SDL_Surface *surface, SDL_Rect rect, int *first_dim, int *second_dim) |
Splits a given SDL surface into a grid of rectangles. | |
SDL_Rect ** | get_word_list_split (SDL_Surface *surface, SDL_Rect rect, int *word_nb) |
Splits a given SDL surface into a list of words. | |
void | export_split_word_list (SDL_Surface *surface, SDL_Rect rect, const char *save_dir) |
Exports the split word list of a given SDL surface to a specified directory. | |
void | export_split_grid (SDL_Surface *surface, SDL_Rect rect, const char *save_dir) |
Exports the split grid of a given SDL surface to a specified directory. | |
void | export_word_cluster (SDL_Surface *surface, pixel_cluster *clusters, size_t cluster_nb, size_t word_nb, char *word_dir) |
void | export_grid_cluster (SDL_Surface *surface, pixel_cluster *clusters, size_t cluster_nb, char *grid_dir, int *sx, int *sy) |
pixel_cluster ** | get_main_linkages (SDL_Surface *surface, size_t *nb_linkages, size_t **linkages_len) |
void | export_main_linkages (SDL_Surface *surface, pixel_cluster **linkages, size_t nb_linkages, size_t *linkages_len, char *res_dir, int *sx, int *sy) |
SDL_Rect | get_grid_rect (pixel_cluster *linkages, size_t nb_linkages) |
size_t | get_grid_cluster (size_t nb_linkages, size_t *linkage_len) |
void export_grid_cluster | ( | SDL_Surface * | surface, |
pixel_cluster * | clusters, | ||
size_t | cluster_nb, | ||
char * | grid_dir, | ||
int * | sx, | ||
int * | sy ) |
void export_main_linkages | ( | SDL_Surface * | surface, |
pixel_cluster ** | linkages, | ||
size_t | nb_linkages, | ||
size_t * | linkages_len, | ||
char * | res_dir, | ||
int * | sx, | ||
int * | sy ) |
void export_split_grid | ( | SDL_Surface * | surface, |
SDL_Rect | rect, | ||
const char * | save_dir ) |
Exports the split grid of a given SDL surface to a specified directory.
This function splits the specified rectangular area of the SDL surface into a grid based on the brightness threshold defined by split_margin
. It then exports each split area as a PNG image to the specified directory.
surface | The SDL_Surface to analyze and split. |
rect | The SDL_Rect defining the area of the surface to analyze and split. |
save_dir | The directory where the split images will be saved. |
void export_split_word_list | ( | SDL_Surface * | surface, |
SDL_Rect | rect, | ||
const char * | save_dir ) |
Exports the split word list of a given SDL surface to a specified directory.
This function splits the specified rectangular area of the SDL surface into a list of words based on the brightness threshold defined by split_margin
. It then exports each split word as a PNG image to the specified directory.
surface | The SDL_Surface to analyze and split. |
rect | The SDL_Rect defining the area of the surface to analyze and split. |
save_dir | The directory where the split images will be saved. |
void export_word_cluster | ( | SDL_Surface * | surface, |
pixel_cluster * | clusters, | ||
size_t | cluster_nb, | ||
size_t | word_nb, | ||
char * | word_dir ) |
size_t get_grid_cluster | ( | size_t | nb_linkages, |
size_t * | linkage_len ) |
int * get_grid_horizontal_split | ( | SDL_Surface * | surface, |
SDL_Rect | rect, | ||
int * | nb_splits ) |
Calculates the horizontal split positions in a given SDL surface.
This function analyzes the brightness of pixels in the specified rectangular area of the SDL surface and determines the positions of horizontal splits based on the brightness threshold defined by split_margin
.
surface | The SDL_Surface to analyze. |
rect | The SDL_Rect defining the area of the surface to analyze. |
nb_splits | Pointer to an integer where the number of splits will be stored. |
SDL_Rect get_grid_rect | ( | pixel_cluster * | linkages, |
size_t | nb_linkages ) |
SDL_Rect ** get_grid_split | ( | SDL_Surface * | surface, |
SDL_Rect | rect, | ||
int * | first_dim, | ||
int * | second_dim ) |
Splits a given SDL surface into a grid of rectangles.
This function analyzes the brightness of pixels in the specified rectangular area of the SDL surface and determines the positions of vertical and horizontal splits based on the brightness threshold defined by split_margin
. It then creates a grid of SDL_Rect structures representing the split areas.
surface | The SDL_Surface to analyze. |
rect | The SDL_Rect defining the area of the surface to analyze. |
first_dim | Pointer to an integer where the number of horizontal splits will be stored. |
second_dim | Pointer to an integer where the number of vertical splits will be stored. |
int * get_grid_vertical_split | ( | SDL_Surface * | surface, |
SDL_Rect | rect, | ||
int * | nb_splits ) |
Calculates the vertical split positions in a given SDL surface.
This function analyzes the brightness of pixels in the specified rectangular area of the SDL surface and determines the positions of vertical splits based on the brightness threshold defined by split_margin
.
surface | The SDL_Surface to analyze. |
rect | The SDL_Rect defining the area of the surface to analyze. |
nb_splits | Pointer to an integer where the number of splits will be stored. |
pixel_cluster ** get_main_linkages | ( | SDL_Surface * | surface, |
size_t * | nb_linkages, | ||
size_t ** | linkages_len ) |
SDL_Rect ** get_word_list_split | ( | SDL_Surface * | surface, |
SDL_Rect | rect, | ||
int * | word_nb ) |
Splits a given SDL surface into a list of words.
This function analyzes the brightness of pixels in the specified rectangular area of the SDL surface and determines the positions of vertical splits based on the brightness threshold defined by split_margin
. It then creates a list of SDL_Rect structures representing the split words.
surface | The SDL_Surface to analyze. |
rect | The SDL_Rect defining the area of the surface to analyze. |
word_nb | Pointer to an integer where the number of words will be stored. |
void spilt_grid_vertical | ( | SDL_Surface * | surface, |
SDL_Rect | rect ) |