mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-21 23:58:51 -05:00
50ee0f5be8
Based on feedback from interested parties
34 lines
1.3 KiB
C
34 lines
1.3 KiB
C
// Copyright (c) 2018-2019, Salvatore Sanfilippo <antirez at gmail dot com>
|
|
// SPDX-FileCopyrightText: 2024 Redict Contributors
|
|
// SPDX-FileCopyrightText: 2024 Salvatore Sanfilippo <antirez at gmail dot com>
|
|
//
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
|
|
/* This structure represents our canvas. Drawing functions will take a pointer
|
|
* to a canvas to write to it. Later the canvas can be rendered to a string
|
|
* suitable to be printed on the screen, using unicode Braille characters. */
|
|
|
|
/* This represents a very simple generic canvas in order to draw stuff.
|
|
* It's up to each LOLWUT versions to translate what they draw to the
|
|
* screen, depending on the result to accomplish. */
|
|
|
|
#ifndef __LOLWUT_H
|
|
#define __LOLWUT_H
|
|
|
|
typedef struct lwCanvas {
|
|
int width;
|
|
int height;
|
|
char *pixels;
|
|
} lwCanvas;
|
|
|
|
/* Drawing functions implemented inside lolwut.c. */
|
|
lwCanvas *lwCreateCanvas(int width, int height, int bgcolor);
|
|
void lwFreeCanvas(lwCanvas *canvas);
|
|
void lwDrawPixel(lwCanvas *canvas, int x, int y, int color);
|
|
int lwGetPixel(lwCanvas *canvas, int x, int y);
|
|
void lwDrawLine(lwCanvas *canvas, int x1, int y1, int x2, int y2, int color);
|
|
void lwDrawSquare(lwCanvas *canvas, int x, int y, float size, float angle, int color);
|
|
|
|
#endif
|