Skip to content

Instantly share code, notes, and snippets.

struct imagebuffer *
new_imagebuffer(size_t width, size_t height)
{
size_t size = width * height * color_type_to_bytes(DEFAULT_COLOR_TYPE);
struct imagebuffer *imagebuffer = malloc(sizeof(struct imagebuffer) + size);
*imagebuffer = (struct imagebuffer)
{
.width = width,
.height = height,
/* This file is part of ASCIIVN.
*
* Copyright (C) 2018 Adrian Parvin D. Ouano
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
/* This file is part of ASCIIVN.
*
* Copyright (C) 2018 Adrian Parvin D. Ouano
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
,$o$t$$$$$$$$$$,,
$$T , , T$x
$| c.!YT| T\/ , /$,
o|x! c , $t
o$| \ $,
o| , /t
$| $oo$$, /\ /$,
| oT| ,ocT$, /| /$,
o$T TT$c | o!| Toc$ / $,
(a, b) <= (a', b')
| a /= a' = error "Incomparable"
| otherwise = b <= b'