A basic graphics package for the LPC4088 Display Module.
Dependents: lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI lpc4088_displaymodule_fs_aid ... more
Fork of DMBasicGUI by
Diff: lpc_swim/lpc_swim_image.c
- Revision:
- 11:265884fa7fdd
- Parent:
- 7:4ba7bd9d32ef
--- a/lpc_swim/lpc_swim_image.c Mon Jan 26 10:06:58 2015 +0100 +++ b/lpc_swim/lpc_swim_image.c Tue Feb 17 10:34:13 2015 +0100 @@ -116,6 +116,44 @@ } } +/* Puts a raw image into a window at a specific position, skipping all transparent pixels */ +void swim_put_transparent_image_xy(SWIM_WINDOW_T *win, + const COLOR_T *image, + int32_t xsize, + int32_t ysize, + int32_t x1, + int32_t y1, + COLOR_T tColor) +{ + int32_t x, y; + + /* Unknown values of rtype will do no rotation */ + y = win->ypvmin + y1; + + xsize = xsize + win->xpvmin + x1; + ysize = ysize + win->ypvmin + y1; + + /* Move image to window pixel by pixel */ + while ((y <= win->ypvmax) && (y < ysize)) { + /* Set physical frame buffer address */ + x = win->xpvmin + x1; + + /* Render a single line */ + while ((x <= win->xpvmax) && (x < xsize)) { + if (*image != tColor) { + swim_put_pixel_physical(win, x, y, *image); + } + image++; + x++; + } + + /* Adjust to end of line if the image was clipped */ + image = image + (xsize - x); + + y++; + } +} + /* Puts a raw image into a window inverted */ void swim_put_invert_image(SWIM_WINDOW_T *win, const COLOR_T *image,