The R Project SVN R

Rev

Rev 76745 | Rev 82658 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 76745 Rev 76910
Line 4... Line 4...
4
 *  Common cross-platform graphics application routines.
4
 *  Common cross-platform graphics application routines.
5
 *  Version 2.4 (c) Lachlan Patrick 1996-1998.
5
 *  Version 2.4 (c) Lachlan Patrick 1996-1998.
6
 *  This header file is designed to be platform-independent.
6
 *  This header file is designed to be platform-independent.
7
 *
7
 *
8
 *  Copyright 2006-8	The R Foundation
8
 *  Copyright 2006-8	The R Foundation
9
 *  Copyrigth 2013	The R Core Team
9
 *  Copyright 2013-19	The R Core Team
10
 *
10
 *
11
 */
11
 */
12
 
12
 
13
/*
13
/*
14
 *  Common cross-platform graphics routines library.
14
 *  Common cross-platform graphics routines library.
Line 40... Line 40...
40
 *  Types.
40
 *  Types.
41
 */
41
 */
42
 
42
 
43
typedef unsigned char GAbyte;
43
typedef unsigned char GAbyte;
44
 
44
 
45
#define byte GAbyte
-
 
46
 
-
 
47
#ifndef objptr
45
#ifndef objptr
48
  typedef struct { int kind; } gui_obj;
46
  typedef struct { int kind; } gui_obj;
49
  typedef gui_obj * objptr;
47
  typedef gui_obj * objptr;
50
#endif
48
#endif
51
 
49
 
Line 112... Line 110...
112
    int     depth;
110
    int     depth;
113
    int     width;
111
    int     width;
114
    int     height;
112
    int     height;
115
    int     cmapsize;
113
    int     cmapsize;
116
    rgb *   cmap;
114
    rgb *   cmap;
117
    byte *  pixels;
115
    GAbyte *  pixels;
118
};
116
};
119
 
117
 
120
/*
118
/*
121
 *  Call-backs.
119
 *  Call-backs.
122
 */
120
 */
Line 914... Line 912...
914
 */
912
 */
915
 
913
 
916
bitmap	newbitmap(int width, int height, int depth);
914
bitmap	newbitmap(int width, int height, int depth);
917
bitmap	loadbitmap(const char *name);
915
bitmap	loadbitmap(const char *name);
918
bitmap	imagetobitmap(image img);
916
bitmap	imagetobitmap(image img);
919
bitmap	createbitmap(int width, int height, int depth, byte *data);
917
bitmap	createbitmap(int width, int height, int depth, GAbyte *data);
920
void	setbitmapdata(bitmap b, byte data[]);
918
void	setbitmapdata(bitmap b, GAbyte data[]);
921
void	getbitmapdata(bitmap b, byte data[]);
919
void	getbitmapdata(bitmap b, GAbyte data[]);
922
void	getbitmapdata2(bitmap b, byte **data);
920
void	getbitmapdata2(bitmap b, GAbyte **data);
923
 
921
 
924
/*
922
/*
925
 *  Images.
923
 *  Images.
926
 */
924
 */
927
 
925
 
Line 931... Line 929...
931
 
929
 
932
int     imagedepth(image img);
930
int     imagedepth(image img);
933
int     imagewidth(image img);
931
int     imagewidth(image img);
934
int     imageheight(image img);
932
int     imageheight(image img);
935
 
933
 
936
void	setpixels(image img, byte pixels[]);
934
void	setpixels(image img, GAbyte pixels[]);
937
byte *	getpixels(image img);
935
GAbyte *	getpixels(image img);
938
 
936
 
939
void	setpalette(image img, int length, rgb cmap[]);
937
void	setpalette(image img, int length, rgb cmap[]);
940
rgb *	getpalette(image img);
938
rgb *	getpalette(image img);
941
int	getpalettesize(image img);
939
int	getpalettesize(image img);
942
 
940
 
Line 1197... Line 1195...
1197
/*
1195
/*
1198
 *  Cursors.
1196
 *  Cursors.
1199
 */
1197
 */
1200
 
1198
 
1201
cursor	newcursor(point hotspot, image img);
1199
cursor	newcursor(point hotspot, image img);
1202
cursor	createcursor(point offset, byte *white_mask, byte *black_shape);
1200
cursor	createcursor(point offset, GAbyte *white_mask, GAbyte *black_shape);
1203
cursor	loadcursor(const char *name);
1201
cursor	loadcursor(const char *name);
1204
void	setcursor(cursor c);
1202
void	setcursor(cursor c);
1205
 
1203
 
1206
/*
1204
/*
1207
 *  Change the drawing state.
1205
 *  Change the drawing state.