void image_draw_rect_outline(GdkPixbuf *img, int x, int y, int w, int h, guint32 color) { image_draw_hline(img, x, y, w, color); image_draw_hline(img, x, y+h-1, w, color); image_draw_vline(img, x, y, h, color); image_draw_vline(img, x+w-1, y, h, color); }
int image_draw_fillrect(image *i, uint32_t x, uint32_t y, uint32_t w, uint32_t h, colour *c) { uint32_t n; for(n = 0; n < h; n++) { if(image_draw_hline(i, x, y + n, w, c) < 0) { return -1; } } return 0; }
void image_add_thumbnail_frame(GdkPixbuf *img) { guint32 outline = IMAGEFU_COLOR(0xFF, 0x55, 0x55, 0x55); guint32 transparent = IMAGEFU_COLOR(0x00, 0xFF, 0xFF, 0xFF); guint32 shadow = IMAGEFU_COLOR(0x22, 0x00, 0x00, 0x00); int width = gdk_pixbuf_get_width(img); int height = gdk_pixbuf_get_height(img); if (width <= 2) return; if (height <= 2) return; image_draw_rect_outline(img, 0, 0, width, height, transparent); image_draw_rect_outline(img, 1, 1, width-2, height-2, outline); image_draw_hline(img, 2, height-1, width-2, shadow); image_draw_vline(img, width-1, 2, height-2, shadow); }