// A library to allocate, load and save 24 bit bitmap files.
// Written by Nils Liaaen Corneliusen 2014.
// License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication license
// Please refer to the article at https://www.ignorantus.com/pages/tilegx_bilinear/ for more information.

#ifndef BMPH
#define BMPH

#include <stdint.h>
#include <stdbool.h>

typedef struct {
    unsigned int w, h;
    unsigned int stride;
    uint8_t *argb;
} bmp_argb;

bmp_argb *bmp_alloc( unsigned int w, unsigned int h );

void bmp_free( bmp_argb *bp );

bmp_argb *bmp_load( const char *fname, bool flip );

bool bmp_save( bmp_argb *bp, const char *fname, bool flip );

#endif
