~ubuntu-branches/ubuntu/vivid/fyre/vivid

« back to all changes in this revision

Viewing changes to src/image-fu.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Haas
  • Date: 2005-05-25 21:59:19 UTC
  • Revision ID: james.westby@ubuntu.com-20050525215919-jawtso5ic23qb401
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c; c-basic-offset: 4; -*-
 
2
 *
 
3
 * image-fu.h - Imaging utilities for manipulating GdkPixbufs
 
4
 *
 
5
 * Fyre - rendering and interactive exploration of chaotic functions
 
6
 * Copyright (C) 2004-2005 David Trowbridge and Micah Dowty
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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.
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef __IMAGE_FU_H__
 
25
#define __IMAGE_FU_H__
 
26
 
 
27
#include <gtk/gtk.h>
 
28
 
 
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)))
 
31
 
 
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.
 
34
 */
 
35
#define CHECKERBOARD_TILE_SIZE 8
 
36
 
 
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);
 
39
 
 
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);
 
44
 
 
45
/* Modify an image in-place to include a thin frame */
 
46
void  image_add_thumbnail_frame(GdkPixbuf *img);
 
47
 
 
48
/* Adjust an image's levels automatically, to make faint images more visible.
 
49
 * This runs on RGBA images, but ignores the alpha channel.
 
50
 */
 
51
void  image_adjust_levels(GdkPixbuf *img);
 
52
 
 
53
#endif /* __IMAGE_FU_H__ */
 
54
 
 
55
/* The End */