/* See LICENSE for license details. */

#ifndef RENDER_H
#define RENDER_H

#include <stdint.h>
#include "st.h"

/* A glyph ready to be rasterized.  font is an FT_Face owned by wl.c. */
typedef struct {
	void *font;
	uint32_t glyph;
	short x;	/* buffer pixel, left edge of the cell run */
	short y;	/* buffer pixel, baseline */
} GlyphSpec;

/* Replace a rectangle (used for backgrounds; alpha is preserved). */
void clearrect(int, int, int, int, uint32_t);

/* Alpha-blend a rectangle (text decorations, box drawing, cursor). */
void blendrect(int, int, int, int, uint32_t);

int isboxdraw(Rune);
ushort boxdrawindex(const Glyph *);
void drawboxes(int, int, int, int, uint32_t, uint32_t,
               const GlyphSpec *, int);

#endif
