1
/* -*- mode: c; c-basic-offset: 4; -*-
3
* image-fu.h - Imaging utilities for manipulating GdkPixbufs
5
* Fyre - rendering and interactive exploration of chaotic functions
6
* Copyright (C) 2004-2005 David Trowbridge and Micah Dowty
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License
10
* as published by the Free Software Foundation; either version 2
11
* of the License, or (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
#ifndef __IMAGE_FU_H__
25
#define __IMAGE_FU_H__
29
/* Convert an ARGB color to a packed guint32 */
30
#define IMAGEFU_COLOR(a,r,g,b) (GUINT32_TO_LE(((a)<<24) | ((b)<<16) | ((g)<<8) | (r)))
32
/* This must be a power of two. It's hardcoded in image_add_checkerboard
33
* for speed, but it might be needed for calculations elsewhere.
35
#define CHECKERBOARD_TILE_SIZE 8
37
/* Do an in-place composite on a GdkPixbuf to render it in front of a checkerboard pattern */
38
void image_add_checkerboard(GdkPixbuf *img);
40
/* Orthogonal line drawing */
41
void image_draw_hline(GdkPixbuf *img, int x, int y, int width, guint32 color);
42
void image_draw_vline(GdkPixbuf *img, int x, int y, int height, guint32 color);
43
void image_draw_rect_outline(GdkPixbuf *img, int x, int y, int w, int h, guint32 color);
45
/* Modify an image in-place to include a thin frame */
46
void image_add_thumbnail_frame(GdkPixbuf *img);
48
/* Adjust an image's levels automatically, to make faint images more visible.
49
* This runs on RGBA images, but ignores the alpha channel.
51
void image_adjust_levels(GdkPixbuf *img);
53
#endif /* __IMAGE_FU_H__ */