#ifndef ka_drawer_h
#define ka_drawer_h

#include "inttypes.h"

typedef struct
{
  uint8_t* y;
  uint8_t* cb;
  uint8_t* cr;
} ka_vplanes_t;

typedef struct
{
  ka_vplanes_t base;        // pointer to 3 planes (y,u,v)
  int yc_bpr;               // bytes per row of lum table
  uint8_t* dst;             // start of screen + 0 line
  int dst_bpr;              // bytes per row
  int yc_height;            // nr of lum lines shown
  int yc_width;             // nr of lum pixels shown
  int dst_skip;             // increment from last displayed pixel to
                            // the start of next line
  int yc_skip;              // increment but in lum table
  int uv_skip;              // increment but in chroma tables
  int dst_byte_width;       // nr of bytes displayed
  int dst_height;           // nr of lines displayed
  void* params;             // Extra params (conversion constants)
  // Extra output planes (overlays)
  uint8_t* dst_u;           // U/UV plane of screen
  int dst_u_bpr;
  uint8_t* dst_v;           // V plane of screen
  int dst_v_bpr;
  // unsused by conversion, helpers for player
  uint8_t* dst_base;        // start of screen, 0 if multiple banks
  int dst_offset;           // offset from start of screen
  int dst_pix_width;        // nr of pixels displayed
  int yc_offset;            // position to start from in lum table
  int uv_offset;            // position to start from in chroma table
} ka_paint_t;

typedef void (*ka_drawer_f)(const ka_paint_t*);

#endif
