// Functions for loading/saving standard 24 bit uncompressed RGB BMP files using planar RGB as native format.
// Written by Nils Liaaen Corneliusen 2013.
// License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication license
// Read the 2023 article here: https://www.ignorantus.com/pages/neon_scaler/
// Read the 2018 article here: https://www.ignorantus.com/pages/image_transformation/

#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
