rgd 0.4.1a
Sign up to get free protection for your applications and to get access to all the features.
- data/BSDL +22 -0
- data/COPYING +4 -0
- data/README +3 -0
- data/Rakefile +48 -0
- data/ext/rgd/extconf.rb +15 -0
- data/ext/rgd/gd_playground/bmp.h +114 -0
- data/ext/rgd/gd_playground/gd_bmp.c +1130 -0
- data/ext/rgd/gd_playground/gdhelpers.h +61 -0
- data/ext/rgd/rgd.c +2976 -0
- data/lib/rgd.rb +2 -0
- data/test/main.rb +22 -0
- data/test/mtest_stringft_cn.png +0 -0
- data/test/mtest_stringft_cn.rb +20 -0
- data/test/test_arc.png +0 -0
- data/test/test_arc.rb +10 -0
- data/test/test_color_closest.rb +32 -0
- data/test/test_color_exact.rb +37 -0
- data/test/test_color_resolve.rb +42 -0
- data/test/test_color_transparent.rb +16 -0
- data/test/test_copy.png +0 -0
- data/test/test_copy.rb +13 -0
- data/test/test_copy_rotated.png +0 -0
- data/test/test_copy_rotated.rb +14 -0
- data/test/test_fill_1.png +0 -0
- data/test/test_fill_1.rb +9 -0
- data/test/test_fill_2.png +0 -0
- data/test/test_fill_2.rb +30 -0
- data/test/test_fill_3.png +0 -0
- data/test/test_fill_3.rb +35 -0
- data/test/test_fill_4.png +0 -0
- data/test/test_fill_4.rb +25 -0
- data/test/test_fill_to_border.rb +14 -0
- data/test/test_filled_ellipse.png +0 -0
- data/test/test_filled_ellipse.rb +8 -0
- data/test/test_filled_rectangle.rb +46 -0
- data/test/test_line_1.png +0 -0
- data/test/test_line_1.rb +18 -0
- data/test/test_line_2.rb +18 -0
- data/test/test_line_3.rb +40 -0
- data/test/test_line_3_1.png +0 -0
- data/test/test_line_3_2.png +0 -0
- data/test/test_line_3_3.png +0 -0
- data/test/test_line_3_4.png +0 -0
- data/test/test_line_3_5.png +0 -0
- data/test/test_line_3_6.png +0 -0
- data/test/test_line_3_7.png +0 -0
- data/test/test_line_3_8.png +0 -0
- data/test/test_tiled.png +0 -0
- data/test/test_tiled.rb +15 -0
- metadata +115 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
#ifdef __cplusplus
|
2
|
+
extern "C" {
|
3
|
+
#endif
|
4
|
+
|
5
|
+
#ifndef GDHELPERS_H
|
6
|
+
#define GDHELPERS_H 1
|
7
|
+
|
8
|
+
/* sys/types.h is needed for size_t on Sparc-SunOS-4.1 */
|
9
|
+
#include <sys/types.h>
|
10
|
+
|
11
|
+
/* TBB: strtok_r is not universal; provide an implementation of it. */
|
12
|
+
|
13
|
+
char * gd_strtok_r (char *s, char *sep, char **state);
|
14
|
+
|
15
|
+
/* These functions wrap memory management. gdFree is
|
16
|
+
in gd.h, where callers can utilize it to correctly
|
17
|
+
free memory allocated by these functions with the
|
18
|
+
right version of free(). */
|
19
|
+
void *gdCalloc (size_t nmemb, size_t size);
|
20
|
+
void *gdMalloc (size_t size);
|
21
|
+
void *gdRealloc (void *ptr, size_t size);
|
22
|
+
|
23
|
+
/* Returns nonzero if multiplying the two quantities will
|
24
|
+
result in integer overflow. Also returns nonzero if
|
25
|
+
either quantity is negative. By Phil Knirsch based on
|
26
|
+
netpbm fixes by Alan Cox. */
|
27
|
+
|
28
|
+
int overflow2(int a, int b);
|
29
|
+
|
30
|
+
/* 2.0.16: portable mutex support for thread safety. */
|
31
|
+
|
32
|
+
#ifdef WIN32
|
33
|
+
/* 2.0.18: must include windows.h to get CRITICAL_SECTION. */
|
34
|
+
#include <windows.h>
|
35
|
+
#define gdMutexDeclare(x) CRITICAL_SECTION x
|
36
|
+
#define gdMutexSetup(x) InitializeCriticalSection(&x)
|
37
|
+
#define gdMutexShutdown(x) DeleteCriticalSection(&x)
|
38
|
+
#define gdMutexLock(x) EnterCriticalSection(&x)
|
39
|
+
#define gdMutexUnlock(x) LeaveCriticalSection(&x)
|
40
|
+
#else
|
41
|
+
#ifdef HAVE_PTHREAD
|
42
|
+
#include <pthread.h>
|
43
|
+
#define gdMutexDeclare(x) pthread_mutex_t x
|
44
|
+
#define gdMutexSetup(x) pthread_mutex_init(&x, 0)
|
45
|
+
#define gdMutexShutdown(x) pthread_mutex_destroy(&x)
|
46
|
+
#define gdMutexLock(x) pthread_mutex_lock(&x)
|
47
|
+
#define gdMutexUnlock(x) pthread_mutex_unlock(&x)
|
48
|
+
#else
|
49
|
+
#define gdMutexDeclare(x)
|
50
|
+
#define gdMutexSetup(x)
|
51
|
+
#define gdMutexShutdown(x)
|
52
|
+
#define gdMutexLock(x)
|
53
|
+
#define gdMutexUnlock(x)
|
54
|
+
#endif /* HAVE_PTHREAD */
|
55
|
+
#endif /* WIN32 */
|
56
|
+
|
57
|
+
#endif /* GDHELPERS_H */
|
58
|
+
|
59
|
+
#ifdef __cplusplus
|
60
|
+
}
|
61
|
+
#endif
|