File: image.h

package info (click to toggle)
searchandrescue 0.8.2-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,656 kB
  • ctags: 6,111
  • sloc: ansic: 89,072; cpp: 7,691; sh: 90; makefile: 80
file content (56 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
				     Image

	For OpenGL image rendering.
 */

#ifndef IMAGE_H
#define IMAGE_H

#include <sys/types.h>


/*
 *	Image Types:
 */
typedef enum {
	SAR_IMAGE_TYPE_RGBA,
	SAR_IMAGE_TYPE_RGB,
	SAR_IMAGE_TYPE_LUMINANCE
} sar_image_type;


/*
 *	Image structure:
 */
typedef struct {

	sar_image_type	type;	/* One of SAR_IMAGE_TYPE_* */

	int		width,
			height;

	u_int8_t	*data;

} sar_image_struct;
#define SAR_IMAGE(p)	((sar_image_struct *)(p))


/* In image.c */
extern sar_image_struct *SARImageNew(
	sar_image_type type,
	int width, int height,
	u_int8_t *data
);
extern sar_image_struct *SARImageNewFromFile(const char *filename);
extern void SARImageDelete(sar_image_struct *img);

extern void SARImageDraw(
	gw_display_struct *display,
	const sar_image_struct *img,
	int x, int y,
	int width, int height
);


#endif	/* IMAGE_H */