~ruther/CTU-FEE-B0B35APO-Semestral-project

ref: a7da48b6ab870a0b6110b17953839e2b0601a6b3 CTU-FEE-B0B35APO-Semestral-project/image-viewer/include/cursor.h -rw-r--r-- 695 bytes
a7da48b6 — František Boháček fix: image region move within to not set wrong x, y 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef __CURSOR_H__
#define __CURSOR_H__

#include "display_utils.h"
#include "image.h"
#include "direction.h"
#include <time.h>
#include <stdint.h>

#define CURSOR_SIZE 9

typedef struct {
  uint16_t x;
  uint16_t y;

  bool shown;
  time_t shown_at;

  display_pixel_t previous_display_data[CURSOR_SIZE * 2 - 1];
} cursor_t;

extern const display_pixel_t CURSOR_COLOR;

cursor_t cursor_create();
void cursor_center(cursor_t *cursor, image_region_t region);
bool cursor_move(cursor_t *cursor, image_region_t region, direction_t direction, int16_t amount);

void cursor_show(cursor_t *cursor, display_t *display);
void cursor_hide(cursor_t *cursor, display_t *display);

#endif // __CURSOR_H__
Do not follow this link