diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-08-09 00:58:30 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-08-09 00:58:30 +0200 |
commit | 16ebd58f0c56f4a8491debc5af29848d7fe6fa60 (patch) | |
tree | 0b6fca42cb0d9c971f61641fa5b9c8e51d78f990 /src/framebuffer.h | |
parent | m + gamma correction (diff) | |
download | crt-calibrator-16ebd58f0c56f4a8491debc5af29848d7fe6fa60.tar.gz crt-calibrator-16ebd58f0c56f4a8491debc5af29848d7fe6fa60.tar.bz2 crt-calibrator-16ebd58f0c56f4a8491debc5af29848d7fe6fa60.tar.xz |
output file + convergence + moiré
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/framebuffer.h')
-rw-r--r-- | src/framebuffer.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 |