2020-09-21 17:43:37 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
2020-09-30 17:08:08 -06:00
|
|
|
#include <lib/config.h>
|
|
|
|
#include <lib/blib.h>
|
|
|
|
#include <mm/pmm.h>
|
2020-09-21 17:43:37 +02:00
|
|
|
#include <lib/bmp.h>
|
|
|
|
|
2021-04-09 01:26:39 +02:00
|
|
|
void image_make_centered(struct image *image, int frame_x_size, int frame_y_size, uint32_t back_colour) {
|
|
|
|
image->type = IMAGE_CENTERED;
|
|
|
|
|
|
|
|
image->x_displacement = frame_x_size / 2 - image->x_size / 2;
|
|
|
|
image->y_displacement = frame_y_size / 2 - image->y_size / 2;
|
|
|
|
image->back_colour = back_colour;
|
|
|
|
}
|
|
|
|
|
2020-09-21 17:43:37 +02:00
|
|
|
int open_image(struct image *image, struct file_handle *file) {
|
|
|
|
image->file = file;
|
|
|
|
|
|
|
|
if (!bmp_open_image(image, file))
|
|
|
|
return 0;
|
|
|
|
|
2021-04-09 01:26:39 +02:00
|
|
|
image->type = IMAGE_TILED;
|
|
|
|
|
2020-09-21 17:43:37 +02:00
|
|
|
return -1;
|
|
|
|
}
|