2020-09-21 18:43:37 +03:00
|
|
|
#ifndef __LIB__IMAGE_H__
|
|
|
|
#define __LIB__IMAGE_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <fs/file.h>
|
|
|
|
|
|
|
|
struct image {
|
2021-10-21 03:37:05 +03:00
|
|
|
size_t allocated_size;
|
2021-08-16 19:02:28 +03:00
|
|
|
size_t x_size;
|
|
|
|
size_t y_size;
|
2021-04-09 02:26:39 +03:00
|
|
|
int type;
|
2021-07-11 08:28:09 +03:00
|
|
|
uint8_t *img;
|
|
|
|
int bpp;
|
|
|
|
int pitch;
|
2021-08-16 19:02:28 +03:00
|
|
|
size_t img_width; // x_size = scaled size, img_width = bitmap size
|
|
|
|
size_t img_height;
|
|
|
|
size_t x_displacement;
|
|
|
|
size_t y_displacement;
|
2021-04-09 02:26:39 +03:00
|
|
|
uint32_t back_colour;
|
2020-09-21 18:43:37 +03:00
|
|
|
};
|
|
|
|
|
2021-04-09 02:26:39 +03:00
|
|
|
enum {
|
|
|
|
IMAGE_TILED,
|
2021-07-07 03:46:40 +03:00
|
|
|
IMAGE_CENTERED,
|
|
|
|
IMAGE_STRETCHED
|
2021-04-09 02:26:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
void image_make_centered(struct image *image, int frame_x_size, int frame_y_size, uint32_t back_colour);
|
2021-07-07 03:46:40 +03:00
|
|
|
void image_make_stretched(struct image *image, int new_x_size, int new_y_size);
|
2021-10-21 03:37:05 +03:00
|
|
|
struct image *image_open(struct file_handle *file);
|
|
|
|
void image_close(struct image *image);
|
2020-09-21 18:43:37 +03:00
|
|
|
|
|
|
|
#endif
|