// Functions for loading/saving standard 24 bit packed RGB BMP files using planar RGB as native format.
// Written by Nils Liaaen Corneliusen.
// License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication license
// https://www.ignorantus.com/
#ifndef BMPPLANARH
#define BMPPLANARH

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

typedef struct {
    int w, h;
    int stride;
    uint8_t *r, *g, *b;
} bmp_planar;

bmp_planar *bmp_planar_alloc( int w, int h );
void bmp_planar_free( bmp_planar *src );

bmp_planar *bmp_planar_load( const char *fname );
bool bmp_planar_save( bmp_planar *bp, const char *fname );

#endif
