OCRudoku  v1.0
Resolve word grid with ease
Loading...
Searching...
No Matches
RenderingUtils.h
Go to the documentation of this file.
1#include <SDL2/SDL.h>
2
3#ifndef RENDERING_UTILS_H
4#define RENDERING_UTILS_H
5
6typedef struct anchore_point
7{
8 double min_x;
9 double max_x;
10 double min_y;
11 double max_y;
16 double aspect_ratio; //Ratio: w/h
18
19SDL_Rect anchore_to_rect(SDL_Window* window, anchore_point anchore);
20
21void render_full_anchored_image_file(const char* file, SDL_Renderer* renderer, SDL_Window* window, anchore_point anchore);
22
23anchore_point rect_to_anchore(SDL_Rect rect);
24
25SDL_Rect to_positive_rect(SDL_Rect rect);
26
28
29SDL_Rect get_surface_full_rect(SDL_Surface* surface);
30
31#endif
struct anchore_point anchore_point
void render_full_anchored_image_file(const char *file, SDL_Renderer *renderer, SDL_Window *window, anchore_point anchore)
Renders an image file to the renderer using an anchore_point for positioning.
Definition RenderingUtils.c:49
SDL_Rect anchore_to_rect(SDL_Window *window, anchore_point anchore)
Converts an anchore_point to an SDL_Rect based on the window size.
Definition RenderingUtils.c:4
SDL_Rect get_surface_full_rect(SDL_Surface *surface)
Gets the full rectangle of an SDL_Surface.
Definition RenderingUtils.c:190
anchore_point rect_to_anchore(SDL_Rect rect)
Converts an SDL_Rect to an anchore_point.
Definition RenderingUtils.c:103
SDL_Rect to_positive_rect(SDL_Rect rect)
Converts an SDL_Rect to a positive SDL_Rect.
Definition RenderingUtils.c:131
anchore_point pixel_to_pourcent_anchore(SDL_Window *window, anchore_point anch)
Converts pixel-based anchore_point offsets to percentage-based offsets.
Definition RenderingUtils.c:158
Definition RenderingUtils.h:7
int down_offset
Definition RenderingUtils.h:15
double min_x
Definition RenderingUtils.h:8
double max_y
Definition RenderingUtils.h:11
int right_offset
Definition RenderingUtils.h:13
int up_offset
Definition RenderingUtils.h:14
int left_offset
Definition RenderingUtils.h:12
double min_y
Definition RenderingUtils.h:10
double aspect_ratio
Definition RenderingUtils.h:16
double max_x
Definition RenderingUtils.h:9