#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "canvas.h"
Go to the source code of this file.
|
| canvas * | canvas_create (int width, int height) |
| |
|
void | canvas_set_point (canvas *c, int x, int y, char character) |
| |
|
int | canvas_get_point (canvas *c, int x, int y) |
| |
|
void | canvas_draw_rect (canvas *c, int x, int y, int width, int height, char ch) |
| |
| void | canvas_clear (canvas *c) |
| |
| void | canvas_print (canvas *c) |
| |
| void | canvas_output (canvas *c, FILE *f) |
| |
| void canvas_clear |
( |
canvas * |
c | ) |
|
vycisti platno
Definition at line 51 of file canvas.c.
55 memset(c->
canvas,
'.', c->height * (c->width+1));
56 for(i=0, end=c->
canvas; i < c->height; i++) {
57 end[c->width]=
'\0'; end += c->width + 1;
| canvas* canvas_create |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
vytvori platno
- Parameters
-
| width | sirka platna |
| height | vyska platna |
- Returns
- ukazatel na strukturu platna
Definition at line 31 of file canvas.c.
33 pcanvas = malloc(
sizeof *pcanvas);
34 pcanvas->width = width;
35 pcanvas->height = height;
36 pcanvas->
canvas = (
char*)malloc(width * height + height);
void canvas_clear(canvas *c)
| void canvas_output |
( |
canvas * |
c, |
|
|
FILE * |
f |
|
) |
| |
vykresli obsah platna do souboru
Definition at line 75 of file canvas.c.
| void canvas_print |
( |
canvas * |
c | ) |
|