blob: 7245e7c54db1dafc964ed253cfcacfd9b0c2ebab [file] [log] [blame]
/*
* Copyright 2016 Google Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but without any warranty; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __BASE_GRAPHICS_GRAPHICS_H__
#define __BASE_GRAPHICS_GRAPHICS_H__
#include <stddef.h>
#include <stdint.h>
typedef struct {
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t _pad;
} DcColor;
typedef struct {
size_t height;
size_t width;
DcColor *pixels;
} DcBitmap;
typedef struct {
uint8_t width;
uint8_t height;
uint8_t *glyph_bytes;
} DcFont;
int graphics_load_bitmap_file(DcBitmap *bitmap, void *file);
int graphics_render_char(DcBitmap *bitmap, const DcFont *font,
const DcColor *fg, const DcColor *bg, uint8_t c);
#endif /* __BASE_GRAPHICS_GRAPHICS_H__ */