#pragma once
#include <stdint.h>

typedef void (*mimg_FunctionSetPixel)(uint16_t x, uint16_t y, uint16_t color);
typedef struct mimg_Area
{
    uint8_t x;
    uint8_t y;
    uint8_t w;
    uint8_t h;
} mimg_Area;


/** get a pixel from img, return 1 or 0 */
uint8_t mimg_get_pixel(const uint8_t *img, uint16_t x, uint16_t y);
/** draw a part of img {ix, iy, iw, ih} , at (x, y) with color */
void mimg_draw(mimg_FunctionSetPixel set_pixel, uint16_t x, uint16_t y, uint16_t color, const uint8_t *img, mimg_Area area);
/** calc tile area */
mimg_Area mimg_get_tile_area(const uint8_t *img, uint8_t cols, uint8_t rows, uint8_t index);
