From 16ebd58f0c56f4a8491debc5af29848d7fe6fa60 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 9 Aug 2014 00:58:30 +0200 Subject: output file + convergence + moiré MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/framebuffer.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/framebuffer.h') diff --git a/src/framebuffer.h b/src/framebuffer.h index 872ff78..11102ff 100644 --- a/src/framebuffer.h +++ b/src/framebuffer.h @@ -133,5 +133,22 @@ void fb_draw_vertical_line(framebuffer_t* restrict fb, uint32_t colour, uint32_t x, uint32_t y, uint32_t length); +/** + * Draw a single on a framebuffer + * + * @param fb The framebuffer + * @param colour The colour to use when drawing the rectangle + * @param x The pixel's position on the X axis + * @param y The pixel's position on the Y axis + */ +static inline void fb_draw_pixel(framebuffer_t* restrict fb, uint32_t colour, + uint32_t x, uint32_t y) +{ + int8_t* mem = fb->mem + y * fb->line_length + x * fb->bytes_per_pixel; + *(uint32_t*)mem = colour; +} + + + #endif -- cgit v1.2.3-70-g09d2