// Edgehog: Nvidia Jetson Nano 1080p60 Fractals
// Written by Nils Liaaen Corneliusen 2023.
// License: CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
// Read the 2023 article here: https://www.ignorantus.com/pages/nano_fractals/
#ifndef EDGEHOGH
#define EDGEHOGH

#define MAXITER    256
#define BLOCKWH     32
#define DISPW     1920
#define DISPH     1080
#define DISPW32   ((DISPW+BLOCKWH-1)&~(BLOCKWH-1))
#define DISPH32   ((DISPH+BLOCKWH-1)&~(BLOCKWH-1))
#define BLOCKSX   (DISPW32/BLOCKWH)
#define BLOCKSY   (DISPH32/BLOCKWH)
#define BLOCKCNT  (BLOCKSX*BLOCKSY)

#define ROWS      (BLOCKSY+1)
#define COLS      (BLOCKSX+1)
#define ROWCOLCNT (ROWS*COLS)

void edgehog_setpos( float x, float y, float z );
void edgehog_top_left( int blockid, int *rowdst, int *coldst );
int edgehog_generate( const int *rbuf, const int *cbuf, int *dst, int invert );

#endif
