rgd 0.4.1a-x86-mingw32 → 0.4.2-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +67 -48
- data/ext/rgd/gd_playground/bmp.h +114 -114
- data/ext/rgd/gd_playground/gd_bmp.c +1130 -1130
- data/ext/rgd/gd_playground/gdhelpers.h +61 -61
- data/ext/rgd/rgd.c +1 -0
- data/lib/rgd/1.8/rgd.so +0 -0
- data/lib/rgd/1.9/rgd.so +0 -0
- data/lib/rgd/version.rb +5 -0
- data/lib/rgd.rb +1 -0
- data/test/main.rb +8 -3
- data/test/test_copy_rotated.rb +0 -1
- metadata +12 -13
- /data/{COPYING → COPYING.rdoc} +0 -0
- /data/{README → README.rdoc} +0 -0
data/Rakefile
CHANGED
@@ -1,48 +1,67 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'rake'
|
5
|
-
require 'rake/clean'
|
6
|
-
require 'rake/gempackagetask'
|
7
|
-
require 'rake/rdoctask'
|
8
|
-
require 'rake/testtask'
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
s.
|
14
|
-
s.
|
15
|
-
s.
|
16
|
-
s.
|
17
|
-
s.
|
18
|
-
s.
|
19
|
-
s.
|
20
|
-
|
21
|
-
s.
|
22
|
-
s.
|
23
|
-
s.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
s.
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rake'
|
5
|
+
require 'rake/clean'
|
6
|
+
require 'rake/gempackagetask'
|
7
|
+
require 'rake/rdoctask'
|
8
|
+
require 'rake/testtask'
|
9
|
+
|
10
|
+
require File.join(File.dirname(File.expand_path(__FILE__)), 'lib/rgd/version')
|
11
|
+
|
12
|
+
spec = Gem::Specification.new do |s|
|
13
|
+
s.name = 'rgd'
|
14
|
+
s.version = RGD::VERSION
|
15
|
+
s.has_rdoc = true
|
16
|
+
s.extra_rdoc_files = ['README.rdoc', 'COPYING.rdoc']
|
17
|
+
s.summary = 'libgd binding for Ruby'
|
18
|
+
s.description = s.summary
|
19
|
+
s.author = 'oCameLo'
|
20
|
+
s.email = ''
|
21
|
+
s.homepage = 'https://github.com/oTnTh/rgd'
|
22
|
+
# s.executables = ['your_executable_here']
|
23
|
+
s.files = %w(BSDL COPYING.rdoc Rakefile README.rdoc) + Dir.glob("{bin,ext,lib,test}/**/*")
|
24
|
+
s.require_path = "lib"
|
25
|
+
s.bindir = "bin"
|
26
|
+
if $WIN32 then
|
27
|
+
s.platform = Gem::Platform::CURRENT
|
28
|
+
else
|
29
|
+
s.extensions = 'ext/rgd/extconf.rb'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
CLEAN.include ['pkg', '**/*.o', '**/*.log', '**/*.def', '**/Makefile', 'ext/**/*.so']
|
34
|
+
task :build => :clean do
|
35
|
+
spec.extensions.each do |extconf|
|
36
|
+
Dir.chdir(File.dirname(File.expand_path(extconf))) do
|
37
|
+
unless sh "ruby #{File.basename(extconf)}"
|
38
|
+
$stderr.puts "Failed to run extconf"
|
39
|
+
break
|
40
|
+
end
|
41
|
+
|
42
|
+
unless sh "make"
|
43
|
+
$stderr.puts "Failed to make"
|
44
|
+
break
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
51
|
+
pkg.gem_spec = spec
|
52
|
+
pkg.need_tar = true
|
53
|
+
pkg.need_zip = true
|
54
|
+
end
|
55
|
+
|
56
|
+
Rake::RDocTask.new do |rdoc|
|
57
|
+
files =['README.rdoc', 'COPYING.rdoc', 'lib/**/*.rb'] + Dir.glob("ext/**/*.c")
|
58
|
+
rdoc.rdoc_files.add(files)
|
59
|
+
rdoc.main = "README.rdoc" # page to start on
|
60
|
+
rdoc.title = "RGD Docs"
|
61
|
+
rdoc.rdoc_dir = 'doc' # rdoc output folder
|
62
|
+
rdoc.options << '--line-numbers'
|
63
|
+
end
|
64
|
+
|
65
|
+
Rake::TestTask.new do |t|
|
66
|
+
t.test_files = FileList['test/main.rb']
|
67
|
+
end
|
data/ext/rgd/gd_playground/bmp.h
CHANGED
@@ -1,114 +1,114 @@
|
|
1
|
-
/* $Id$ */
|
2
|
-
#ifdef __cplusplus
|
3
|
-
extern "C" {
|
4
|
-
#endif
|
5
|
-
|
6
|
-
/*
|
7
|
-
gd_bmp.c
|
8
|
-
|
9
|
-
Bitmap format support for libgd
|
10
|
-
|
11
|
-
* Written 2007, Scott MacVicar
|
12
|
-
---------------------------------------------------------------------------
|
13
|
-
|
14
|
-
Todo:
|
15
|
-
|
16
|
-
RLE4, RLE8 and Bitfield encoding
|
17
|
-
Add full support for Windows v4 and Windows v5 header formats
|
18
|
-
|
19
|
-
----------------------------------------------------------------------------
|
20
|
-
*/
|
21
|
-
|
22
|
-
#ifndef BMP_H
|
23
|
-
#define BMP_H 1
|
24
|
-
|
25
|
-
#define BMP_PALETTE_3 1
|
26
|
-
#define BMP_PALETTE_4 2
|
27
|
-
|
28
|
-
#define BMP_WINDOWS_V3 40
|
29
|
-
#define BMP_OS2_V1 12
|
30
|
-
#define BMP_OS2_V2 64
|
31
|
-
#define BMP_WINDOWS_V4 108
|
32
|
-
#define BMP_WINDOWS_V5 124
|
33
|
-
|
34
|
-
#define BMP_BI_RGB 0
|
35
|
-
#define BMP_BI_RLE8 1
|
36
|
-
#define BMP_BI_RLE4 2
|
37
|
-
#define BMP_BI_BITFIELDS 3
|
38
|
-
#define BMP_BI_JPEG 4
|
39
|
-
#define BMP_BI_PNG 5
|
40
|
-
|
41
|
-
#define BMP_RLE_COMMAND 0
|
42
|
-
#define BMP_RLE_ENDOFLINE 0
|
43
|
-
#define BMP_RLE_ENDOFBITMAP 1
|
44
|
-
#define BMP_RLE_DELTA 2
|
45
|
-
|
46
|
-
#define BMP_RLE_TYPE_RAW 0
|
47
|
-
#define BMP_RLE_TYPE_RLE 1
|
48
|
-
|
49
|
-
/* BMP header. */
|
50
|
-
typedef struct
|
51
|
-
{
|
52
|
-
/* 16 bit - header identifying the type */
|
53
|
-
signed short int magic;
|
54
|
-
|
55
|
-
/* 32bit - size of the file */
|
56
|
-
int size;
|
57
|
-
|
58
|
-
/* 16bit - these two are in the spec but "reserved" */
|
59
|
-
signed short int reserved1;
|
60
|
-
signed short int reserved2;
|
61
|
-
|
62
|
-
/* 32 bit - offset of the bitmap header from data in bytes */
|
63
|
-
signed int off;
|
64
|
-
|
65
|
-
} bmp_hdr_t;
|
66
|
-
|
67
|
-
/* BMP info. */
|
68
|
-
typedef struct
|
69
|
-
{
|
70
|
-
/* 16bit - Type, ie Windows or OS/2 for the palette info */
|
71
|
-
signed short int type;
|
72
|
-
/* 32bit - The length of the bitmap information header in bytes. */
|
73
|
-
signed int len;
|
74
|
-
|
75
|
-
/* 32bit - The width of the bitmap in pixels. */
|
76
|
-
signed int width;
|
77
|
-
|
78
|
-
/* 32bit - The height of the bitmap in pixels. */
|
79
|
-
signed int height;
|
80
|
-
|
81
|
-
/* 8 bit - The bitmap data is specified in top-down order. */
|
82
|
-
signed char topdown;
|
83
|
-
|
84
|
-
/* 16 bit - The number of planes. This must be set to a value of one. */
|
85
|
-
signed short int numplanes;
|
86
|
-
|
87
|
-
/* 16 bit - The number of bits per pixel. */
|
88
|
-
signed short int depth;
|
89
|
-
|
90
|
-
/* 32bit - The type of compression used. */
|
91
|
-
signed int enctype;
|
92
|
-
|
93
|
-
/* 32bit - The size of the image in bytes. */
|
94
|
-
signed int size;
|
95
|
-
|
96
|
-
/* 32bit - The horizontal resolution in pixels/metre. */
|
97
|
-
signed int hres;
|
98
|
-
|
99
|
-
/* 32bit - The vertical resolution in pixels/metre. */
|
100
|
-
signed int vres;
|
101
|
-
|
102
|
-
/* 32bit - The number of color indices used by the bitmap. */
|
103
|
-
signed int numcolors;
|
104
|
-
|
105
|
-
/* 32bit - The number of color indices important for displaying the bitmap. */
|
106
|
-
signed int mincolors;
|
107
|
-
|
108
|
-
} bmp_info_t;
|
109
|
-
|
110
|
-
#endif
|
111
|
-
|
112
|
-
#ifdef __cplusplus
|
113
|
-
}
|
114
|
-
#endif
|
1
|
+
/* $Id$ */
|
2
|
+
#ifdef __cplusplus
|
3
|
+
extern "C" {
|
4
|
+
#endif
|
5
|
+
|
6
|
+
/*
|
7
|
+
gd_bmp.c
|
8
|
+
|
9
|
+
Bitmap format support for libgd
|
10
|
+
|
11
|
+
* Written 2007, Scott MacVicar
|
12
|
+
---------------------------------------------------------------------------
|
13
|
+
|
14
|
+
Todo:
|
15
|
+
|
16
|
+
RLE4, RLE8 and Bitfield encoding
|
17
|
+
Add full support for Windows v4 and Windows v5 header formats
|
18
|
+
|
19
|
+
----------------------------------------------------------------------------
|
20
|
+
*/
|
21
|
+
|
22
|
+
#ifndef BMP_H
|
23
|
+
#define BMP_H 1
|
24
|
+
|
25
|
+
#define BMP_PALETTE_3 1
|
26
|
+
#define BMP_PALETTE_4 2
|
27
|
+
|
28
|
+
#define BMP_WINDOWS_V3 40
|
29
|
+
#define BMP_OS2_V1 12
|
30
|
+
#define BMP_OS2_V2 64
|
31
|
+
#define BMP_WINDOWS_V4 108
|
32
|
+
#define BMP_WINDOWS_V5 124
|
33
|
+
|
34
|
+
#define BMP_BI_RGB 0
|
35
|
+
#define BMP_BI_RLE8 1
|
36
|
+
#define BMP_BI_RLE4 2
|
37
|
+
#define BMP_BI_BITFIELDS 3
|
38
|
+
#define BMP_BI_JPEG 4
|
39
|
+
#define BMP_BI_PNG 5
|
40
|
+
|
41
|
+
#define BMP_RLE_COMMAND 0
|
42
|
+
#define BMP_RLE_ENDOFLINE 0
|
43
|
+
#define BMP_RLE_ENDOFBITMAP 1
|
44
|
+
#define BMP_RLE_DELTA 2
|
45
|
+
|
46
|
+
#define BMP_RLE_TYPE_RAW 0
|
47
|
+
#define BMP_RLE_TYPE_RLE 1
|
48
|
+
|
49
|
+
/* BMP header. */
|
50
|
+
typedef struct
|
51
|
+
{
|
52
|
+
/* 16 bit - header identifying the type */
|
53
|
+
signed short int magic;
|
54
|
+
|
55
|
+
/* 32bit - size of the file */
|
56
|
+
int size;
|
57
|
+
|
58
|
+
/* 16bit - these two are in the spec but "reserved" */
|
59
|
+
signed short int reserved1;
|
60
|
+
signed short int reserved2;
|
61
|
+
|
62
|
+
/* 32 bit - offset of the bitmap header from data in bytes */
|
63
|
+
signed int off;
|
64
|
+
|
65
|
+
} bmp_hdr_t;
|
66
|
+
|
67
|
+
/* BMP info. */
|
68
|
+
typedef struct
|
69
|
+
{
|
70
|
+
/* 16bit - Type, ie Windows or OS/2 for the palette info */
|
71
|
+
signed short int type;
|
72
|
+
/* 32bit - The length of the bitmap information header in bytes. */
|
73
|
+
signed int len;
|
74
|
+
|
75
|
+
/* 32bit - The width of the bitmap in pixels. */
|
76
|
+
signed int width;
|
77
|
+
|
78
|
+
/* 32bit - The height of the bitmap in pixels. */
|
79
|
+
signed int height;
|
80
|
+
|
81
|
+
/* 8 bit - The bitmap data is specified in top-down order. */
|
82
|
+
signed char topdown;
|
83
|
+
|
84
|
+
/* 16 bit - The number of planes. This must be set to a value of one. */
|
85
|
+
signed short int numplanes;
|
86
|
+
|
87
|
+
/* 16 bit - The number of bits per pixel. */
|
88
|
+
signed short int depth;
|
89
|
+
|
90
|
+
/* 32bit - The type of compression used. */
|
91
|
+
signed int enctype;
|
92
|
+
|
93
|
+
/* 32bit - The size of the image in bytes. */
|
94
|
+
signed int size;
|
95
|
+
|
96
|
+
/* 32bit - The horizontal resolution in pixels/metre. */
|
97
|
+
signed int hres;
|
98
|
+
|
99
|
+
/* 32bit - The vertical resolution in pixels/metre. */
|
100
|
+
signed int vres;
|
101
|
+
|
102
|
+
/* 32bit - The number of color indices used by the bitmap. */
|
103
|
+
signed int numcolors;
|
104
|
+
|
105
|
+
/* 32bit - The number of color indices important for displaying the bitmap. */
|
106
|
+
signed int mincolors;
|
107
|
+
|
108
|
+
} bmp_info_t;
|
109
|
+
|
110
|
+
#endif
|
111
|
+
|
112
|
+
#ifdef __cplusplus
|
113
|
+
}
|
114
|
+
#endif
|