gray_scott_gtk3 0.5.1 → 0.5.6
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.
- checksums.yaml +4 -4
- data/.gitignore +0 -48
- data/.travis.yml +14 -0
- data/Gemfile +2 -0
- data/README.md +19 -31
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/exe/grayscott +7 -8
- data/gray_scott_gtk3.gemspec +4 -4
- data/lib/gray_scott.rb +7 -5
- data/lib/gray_scott/color.rb +95 -0
- data/lib/gray_scott/controller.rb +9 -54
- data/lib/gray_scott/controller/aboutdialog.rb +14 -7
- data/lib/gray_scott/model.rb +13 -1
- data/lib/gray_scott/{laplacian.rb → utils/math.rb} +2 -0
- data/lib/gray_scott/version.rb +3 -1
- data/resources/gray_scott.glade +29 -26
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29d8ff376e95aff2c77e30e15ba230413677c076ad1038c32eb1e20f260698b9
|
4
|
+
data.tar.gz: 4bc65069599f84d94ea987e756d5dc29a88bdacd27b10bf4f6ed9228aaf69d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2826a66e3db9d15ebc0cfa3fe199b77ceb28c241bd0807b2c730836316199994c7f67c6df57bc10920e313feded2ba1c4830cab1d9a7e69b8c5b7ef3052ba830
|
7
|
+
data.tar.gz: 3a27424b1e0d0127903e54778b975906c4176a882223c913ac80639c449b8a1de7f44d1f1d0fb62447af52c28ca6b1fe63efb187de3e0b67175db94228c59352
|
data/.gitignore
CHANGED
@@ -1,55 +1,7 @@
|
|
1
1
|
*.gem
|
2
2
|
*.rbc
|
3
3
|
*.glade~
|
4
|
-
/.config
|
5
4
|
/coverage/
|
6
|
-
/InstalledFiles
|
7
|
-
/pkg/
|
8
|
-
/spec/reports/
|
9
|
-
/spec/examples.txt
|
10
|
-
/test/tmp/
|
11
|
-
/test/version_tmp/
|
12
5
|
/tmp/
|
13
|
-
|
14
|
-
# Used by dotenv library to load environment variables.
|
15
|
-
# .env
|
16
|
-
|
17
|
-
## Specific to RubyMotion:
|
18
|
-
.dat*
|
19
|
-
.repl_history
|
20
|
-
build/
|
21
|
-
*.bridgesupport
|
22
|
-
build-iPhoneOS/
|
23
|
-
build-iPhoneSimulator/
|
24
|
-
|
25
|
-
## Specific to RubyMotion (use of CocoaPods):
|
26
|
-
#
|
27
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
28
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
29
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
30
|
-
#
|
31
|
-
# vendor/Pods/
|
32
|
-
|
33
|
-
## Documentation cache and generated files:
|
34
|
-
/.yardoc/
|
35
|
-
/_yardoc/
|
36
|
-
/doc/
|
37
|
-
/rdoc/
|
38
|
-
|
39
|
-
## Environment normalization:
|
40
|
-
/.bundle/
|
41
|
-
/vendor/bundle
|
42
|
-
/lib/bundler/man/
|
43
|
-
|
44
|
-
# for a library or gem, you might want to ignore these files since the code is
|
45
|
-
# intended to run in multiple environments; otherwise, check them in:
|
46
6
|
Gemfile.lock
|
47
|
-
# .ruby-version
|
48
|
-
# .ruby-gemset
|
49
|
-
|
50
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
51
|
-
.rvmrc
|
52
|
-
|
53
|
-
# rspec
|
54
|
-
/spec/reports/
|
55
7
|
.rspec_status
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,52 +1,40 @@
|
|
1
1
|
# Gray-Scott
|
2
2
|
|
3
|
-

|
4
|
+

|
4
5
|
|
5
|
-
|
6
|
+
Ruby implementation of the Reaction diffusion system (Gray-Scott model).
|
6
7
|
|
7
|
-
|
8
|
-
* Numo/NArray (CPU)
|
9
|
-
* Cumo/NArray (GPU)
|
10
|
-
* Ruby/Gtk3
|
8
|
+

|
11
9
|
|
12
10
|
## Installation
|
13
11
|
|
14
|
-
|
12
|
+
```bash
|
13
|
+
gem install gray_scott_gtk3
|
14
|
+
```
|
15
15
|
|
16
16
|
## Usage
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
## Usage with terminal(example)
|
23
|
-
|
24
|
-
$ bundle install
|
25
|
-
|
26
|
-
$ bundle exec bin/console
|
27
|
-
|
28
|
-
```ruby
|
29
|
-
c = GrayScott::Controller.new 'resources/', width:1024, height:1024
|
18
|
+
```bash
|
19
|
+
grayscott
|
20
|
+
```
|
30
21
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
c.model.f = f
|
38
|
-
c.model.k = k
|
39
|
-
c.model.v.rand(0.0, 0.15)
|
40
|
-
c.color = 'reverse_green' # colorful is slow.
|
41
|
-
Gtk.main
|
22
|
+
```bash
|
23
|
+
grayscott --help
|
24
|
+
# Usage: grayscott [options]
|
25
|
+
# -h, --height val height of the model
|
26
|
+
# -w, --width val width of the model
|
27
|
+
# -g, --gpu use GPU(Cumo)
|
42
28
|
```
|
43
29
|
|
30
|
+
NOTE : You can set the width and height of the model, but the width and height of the window is fixed at 512 x 512 pixels.
|
31
|
+
|
44
32
|

|
45
33
|
|
46
34
|
## Known issue
|
47
35
|
|
48
36
|
Glib::Timeout.add(number_of_seconds)
|
49
|
-
If processing can not be completed within the time, it will not be displayed.
|
37
|
+
If processing can not be completed within the time, it will not be displayed.
|
50
38
|
In this case, you should increase the number of seconds.
|
51
39
|
|
52
40
|
## Contributing
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/exe/grayscott
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'optparse'
|
4
5
|
|
5
|
-
opt = {}
|
6
|
+
opt = { width: 256, height: 256 }
|
6
7
|
OptionParser.new do |op|
|
7
|
-
op.on('-h val', '--height', 'height of the model') { |v| opt[:height] = v
|
8
|
-
op.on('-w val', '--width', 'width of the model') { |v| opt[:width] = v
|
9
|
-
op.on('-g', '--gpu', 'use GPU(Cumo)'){ |v| opt[:gpu] = v }
|
8
|
+
op.on('-h val', '--height', 'height of the model', Integer) { |v| opt[:height] = v }
|
9
|
+
op.on('-w val', '--width', 'width of the model', Integer) { |v| opt[:width] = v }
|
10
|
+
op.on('-g', '--gpu', 'use GPU(Cumo)') { |v| opt[:gpu] = v }
|
10
11
|
op.parse!(ARGV)
|
11
12
|
end
|
12
13
|
|
13
|
-
if opt[:gpu]
|
14
|
-
require 'cumo/narray'
|
15
|
-
end
|
14
|
+
require 'cumo/narray' if opt[:gpu]
|
16
15
|
opt.delete(:gpu)
|
17
16
|
|
18
17
|
require 'gray_scott'
|
@@ -21,7 +20,7 @@ module GrayScott
|
|
21
20
|
class << self
|
22
21
|
def run(opt)
|
23
22
|
xml_path = File.expand_path('../resources/', __dir__)
|
24
|
-
Controller.new(xml_path, opt)
|
23
|
+
Controller.new(xml_path, height: opt[:height], width: opt[:width])
|
25
24
|
Gtk.main
|
26
25
|
end
|
27
26
|
end
|
data/gray_scott_gtk3.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'gray_scott/version'
|
@@ -12,8 +14,6 @@ Gem::Specification.new do |spec|
|
|
12
14
|
spec.description = 'Reaction diffusion system (Gray-Scott model).'
|
13
15
|
spec.homepage = 'https://github.com/kojix2/Gray-Scott'
|
14
16
|
|
15
|
-
# Specify which files should be added to the gem when it is released.
|
16
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
17
17
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
18
18
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
19
|
end
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'gtk3'
|
25
25
|
spec.add_dependency 'numo-narray'
|
26
26
|
|
27
|
-
spec.add_development_dependency 'bundler', '~>
|
28
|
-
spec.add_development_dependency 'rake', '
|
27
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
28
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
29
29
|
spec.add_development_dependency 'rspec'
|
30
30
|
end
|
data/lib/gray_scott.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'gtk3'
|
2
4
|
|
3
|
-
|
5
|
+
if Object.const_defined? :Cumo
|
6
|
+
Xumo = Cumo
|
7
|
+
else
|
4
8
|
require 'numo/narray'
|
5
9
|
Xumo = Numo
|
6
|
-
else
|
7
|
-
Xumo = Cumo
|
8
10
|
end
|
9
11
|
|
10
12
|
module XumoShortHand
|
@@ -16,11 +18,11 @@ module XumoShortHand
|
|
16
18
|
end
|
17
19
|
|
18
20
|
require 'gray_scott/model'
|
21
|
+
require 'gray_scott/color'
|
19
22
|
require 'gray_scott/controller'
|
20
|
-
require 'gray_scott/
|
23
|
+
require 'gray_scott/utils/math'
|
21
24
|
require 'gray_scott/version'
|
22
25
|
|
23
26
|
module GrayScott
|
24
27
|
class Error < StandardError; end
|
25
|
-
# Your code goes here...
|
26
28
|
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GrayScott
|
4
|
+
module Color
|
5
|
+
include XumoShortHand
|
6
|
+
|
7
|
+
def colorize(ar, color_type)
|
8
|
+
case color_type
|
9
|
+
when 'colorful'
|
10
|
+
hsv2rgb(ar)
|
11
|
+
when 'reverse-colorful'
|
12
|
+
hsv2rgb(1.0 - ar)
|
13
|
+
when 'red'
|
14
|
+
red(ar)
|
15
|
+
when 'green'
|
16
|
+
green(ar)
|
17
|
+
when 'blue'
|
18
|
+
blue(ar)
|
19
|
+
when 'reverse-red'
|
20
|
+
reverse_red(ar)
|
21
|
+
when 'reverse-green'
|
22
|
+
reverse_green(ar)
|
23
|
+
when 'reverse-blue'
|
24
|
+
reverse_blue(ar)
|
25
|
+
when 'grayscale'
|
26
|
+
grayscale(ar)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# speed
|
31
|
+
def uInt8_dstack(ar)
|
32
|
+
x = UInt8.zeros(*ar[0].shape, 3)
|
33
|
+
x[true, true, 0] = ar[0]
|
34
|
+
x[true, true, 1] = ar[1]
|
35
|
+
x[true, true, 2] = ar[2]
|
36
|
+
x
|
37
|
+
end
|
38
|
+
|
39
|
+
def hsv2rgb(h)
|
40
|
+
i = UInt8.cast(h * 6)
|
41
|
+
f = (h * 6.0) - i
|
42
|
+
p = UInt8.zeros(*h.shape)
|
43
|
+
v = UInt8.new(*h.shape).fill 255
|
44
|
+
q = (1.0 - f) * 256
|
45
|
+
t = f * 256
|
46
|
+
rgb = UInt8.zeros(*h.shape, 3)
|
47
|
+
t = UInt8.cast(t)
|
48
|
+
i = uInt8_dstack([i, i, i])
|
49
|
+
rgb[i.eq 0] = uInt8_dstack([v, t, p])[i.eq 0]
|
50
|
+
rgb[i.eq 1] = uInt8_dstack([q, v, p])[i.eq 1]
|
51
|
+
rgb[i.eq 2] = uInt8_dstack([p, v, t])[i.eq 2]
|
52
|
+
rgb[i.eq 3] = uInt8_dstack([p, q, v])[i.eq 3]
|
53
|
+
rgb[i.eq 4] = uInt8_dstack([t, p, v])[i.eq 4]
|
54
|
+
rgb[i.eq 5] = uInt8_dstack([v, p, q])[i.eq 5]
|
55
|
+
rgb
|
56
|
+
end
|
57
|
+
|
58
|
+
def red(ar)
|
59
|
+
uint8_zeros_256(0, ar)
|
60
|
+
end
|
61
|
+
|
62
|
+
def green(ar)
|
63
|
+
uint8_zeros_256(1, ar)
|
64
|
+
end
|
65
|
+
|
66
|
+
def blue(ar)
|
67
|
+
uint8_zeros_256(2, ar)
|
68
|
+
end
|
69
|
+
|
70
|
+
def reverse_red(ar)
|
71
|
+
uint8_zeros_256(0, (1.0 - ar))
|
72
|
+
end
|
73
|
+
|
74
|
+
def reverse_green(ar)
|
75
|
+
uint8_zeros_256(1, (1.0 - ar))
|
76
|
+
end
|
77
|
+
|
78
|
+
def reverse_blue(ar)
|
79
|
+
uint8_zeros_256(2, (1.0 - ar))
|
80
|
+
end
|
81
|
+
|
82
|
+
def grayscale(ar)
|
83
|
+
d = ar * 255
|
84
|
+
uInt8_dstack([d, d, d])
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
def uint8_zeros_256(ch, ar)
|
90
|
+
d = UInt8.zeros(*ar.shape, 3)
|
91
|
+
d[true, true, ch] = UInt8.cast(ar * 256)
|
92
|
+
d
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -1,7 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'controller/aboutdialog'
|
2
4
|
|
3
5
|
module GrayScott
|
4
6
|
class Controller
|
7
|
+
include Color
|
5
8
|
include XumoShortHand
|
6
9
|
attr_accessor :resource_dir, :height, :width, :model, :color
|
7
10
|
|
@@ -12,7 +15,7 @@ module GrayScott
|
|
12
15
|
@model = Model.new(height: height, width: width)
|
13
16
|
@show_u = false
|
14
17
|
@color = 'colorful'
|
15
|
-
@frames =
|
18
|
+
@frames = 5
|
16
19
|
@msec = 40
|
17
20
|
|
18
21
|
builder = Gtk::Builder.new
|
@@ -48,13 +51,12 @@ module GrayScott
|
|
48
51
|
@msec = msec.value.to_i
|
49
52
|
end
|
50
53
|
|
51
|
-
|
52
54
|
def display
|
53
|
-
@gimage.pixbuf =
|
55
|
+
@gimage.pixbuf = create_pixbuf(colorize((@show_u ? model.u : model.v), @color))
|
54
56
|
end
|
55
57
|
|
56
58
|
def display_legend
|
57
|
-
legend = (SFloat.new(1, 512).seq * SFloat.ones(16, 1)) / 512
|
59
|
+
legend = (SFloat.new(1, 512).seq * SFloat.ones(16, 1)) / 512.0
|
58
60
|
data = colorize(legend, @color)
|
59
61
|
string = data.to_string
|
60
62
|
pixbuf = GdkPixbuf::Pixbuf.new data: string, width: 512, height: 16
|
@@ -93,7 +95,7 @@ module GrayScott
|
|
93
95
|
if dialog.run == :accept
|
94
96
|
filename = dialog.filename
|
95
97
|
str = File.read(filename)
|
96
|
-
#
|
98
|
+
# TODO: check model
|
97
99
|
@model = Marshal.load(str)
|
98
100
|
display
|
99
101
|
end
|
@@ -158,60 +160,13 @@ module GrayScott
|
|
158
160
|
display unless doing_now?
|
159
161
|
end
|
160
162
|
|
161
|
-
def
|
162
|
-
|
163
|
-
when 'colorful'
|
164
|
-
hsv2rgb(ar)
|
165
|
-
when 'reverse-colorful'
|
166
|
-
hsv2rgb(1.0 - ar)
|
167
|
-
when 'red'
|
168
|
-
uint8_zeros_256(0, ar)
|
169
|
-
when 'green'
|
170
|
-
uint8_zeros_256(1, ar)
|
171
|
-
when 'blue'
|
172
|
-
uint8_zeros_256(2, ar)
|
173
|
-
when 'reverse-red'
|
174
|
-
uint8_zeros_256(0, (1.0 - ar))
|
175
|
-
when 'reverse-green'
|
176
|
-
uint8_zeros_256(1, (1.0 - ar))
|
177
|
-
when 'reverse-blue'
|
178
|
-
uint8_zeros_256(2, (1.0 - ar))
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
def uint8_zeros_256(ch, ar)
|
183
|
-
d = UInt8.zeros(*ar.shape, 3)
|
184
|
-
d[true, true, ch] = UInt8.cast(ar * 256)
|
185
|
-
d
|
186
|
-
end
|
187
|
-
|
188
|
-
def to_pixbuf(ar, color_type = @color)
|
189
|
-
data = colorize(ar, color_type).to_string
|
163
|
+
def create_pixbuf(ar)
|
164
|
+
data = ar.to_string
|
190
165
|
height, width = ar.shape
|
191
166
|
pixbuf = GdkPixbuf::Pixbuf.new data: data, width: width, height: height
|
192
167
|
pixbuf.scale_simple 512, 512, :bilinear
|
193
168
|
end
|
194
169
|
|
195
|
-
def hsv2rgb(h)
|
196
|
-
height, width = h.shape
|
197
|
-
i = UInt8.cast(h * 6)
|
198
|
-
f = (h * 6.0) - i
|
199
|
-
p = UInt8.zeros height, width, 1
|
200
|
-
v = UInt8.new(height, width, 1).fill 255
|
201
|
-
q = (1.0 - f) * 256
|
202
|
-
t = f * 256
|
203
|
-
rgb = UInt8.zeros height, width, 3
|
204
|
-
t = UInt8.cast(t).expand_dims(2)
|
205
|
-
i = UInt8.dstack([i, i, i])
|
206
|
-
rgb[i.eq 0] = UInt8.dstack([v, t, p])[i.eq 0]
|
207
|
-
rgb[i.eq 1] = UInt8.dstack([q, v, p])[i.eq 1]
|
208
|
-
rgb[i.eq 2] = UInt8.dstack([p, v, t])[i.eq 2]
|
209
|
-
rgb[i.eq 3] = UInt8.dstack([p, q, v])[i.eq 3]
|
210
|
-
rgb[i.eq 4] = UInt8.dstack([t, p, v])[i.eq 4]
|
211
|
-
rgb[i.eq 5] = UInt8.dstack([v, p, q])[i.eq 5]
|
212
|
-
rgb
|
213
|
-
end
|
214
|
-
|
215
170
|
def doing_now?
|
216
171
|
@doing_now
|
217
172
|
end
|
@@ -1,14 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module GrayScott
|
2
4
|
class Controller
|
3
5
|
class AboutDialog
|
4
6
|
def initialize(resource_dir)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
Gtk::AboutDialog.new.tap do |d|
|
8
|
+
d.program_name = 'Gray-Scott'
|
9
|
+
d.comments = 'Reaction diffusion system'
|
10
|
+
d.logo = GdkPixbuf::Pixbuf.new(file: File.join(resource_dir, 'about_icon.png'))
|
11
|
+
d.copyright = 'Copyright (C) kojix2'
|
12
|
+
d.authors = ['kojix2']
|
13
|
+
d.version = GrayScott::VERSION
|
14
|
+
d.website = 'https://github.com/kojix2/Gray-Scott'
|
15
|
+
d.website_label = 'Github kojix2/Gray-Scott'
|
16
|
+
d.run
|
17
|
+
d.destroy
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|
14
21
|
end
|
data/lib/gray_scott/model.rb
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module GrayScott
|
4
|
+
# Gray-Scott model
|
2
5
|
class Model
|
3
|
-
include XumoShortHand
|
6
|
+
include XumoShortHand
|
4
7
|
|
5
8
|
Dx = 0.01
|
9
|
+
|
10
|
+
# Delta t is the change in time for each iteration
|
6
11
|
Dt = 1
|
7
12
|
|
13
|
+
# diffusion rate for U
|
8
14
|
Du = 2e-5
|
15
|
+
|
16
|
+
# diffusion rate for V
|
9
17
|
Dv = 1e-5
|
10
18
|
|
11
19
|
attr_accessor :f, :k, :u, :v
|
@@ -13,10 +21,14 @@ module GrayScott
|
|
13
21
|
def initialize(width: 256, height: 256)
|
14
22
|
# Feed rate
|
15
23
|
@f = 0.04
|
24
|
+
|
16
25
|
# Kill rate
|
17
26
|
@k = 0.06
|
18
27
|
|
28
|
+
# concentration of U
|
19
29
|
@u = SFloat.ones height, width
|
30
|
+
|
31
|
+
# concentration of V
|
20
32
|
@v = SFloat.zeros height, width
|
21
33
|
end
|
22
34
|
|
data/lib/gray_scott/version.rb
CHANGED
data/resources/gray_scott.glade
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- Generated with glade 3.
|
2
|
+
<!-- Generated with glade 3.36.0 -->
|
3
3
|
<interface>
|
4
4
|
<requires lib="gtk+" version="3.16"/>
|
5
5
|
<object class="GtkAdjustment" id="f">
|
6
|
-
<property name="upper">0.
|
7
|
-
<property name="value">0.
|
6
|
+
<property name="upper">0.1</property>
|
7
|
+
<property name="value">0.04</property>
|
8
8
|
<property name="step_increment">0.01</property>
|
9
9
|
<property name="page_increment">0.01</property>
|
10
10
|
<signal name="value-changed" handler="on_f_changed" swapped="no"/>
|
11
11
|
</object>
|
12
12
|
<object class="GtkAdjustment" id="frames">
|
13
|
+
<property name="lower">1</property>
|
13
14
|
<property name="upper">1000</property>
|
14
|
-
<property name="value">
|
15
|
+
<property name="value">5</property>
|
15
16
|
<property name="step_increment">1</property>
|
16
17
|
<property name="page_increment">10</property>
|
17
18
|
<signal name="value-changed" handler="on_frames_changed" swapped="no"/>
|
18
19
|
</object>
|
19
20
|
<object class="GtkAdjustment" id="k">
|
20
|
-
<property name="upper">0.
|
21
|
-
<property name="value">0.
|
21
|
+
<property name="upper">0.1</property>
|
22
|
+
<property name="value">0.06</property>
|
22
23
|
<property name="step_increment">0.01</property>
|
23
24
|
<property name="page_increment">0.01</property>
|
24
25
|
<signal name="value-changed" handler="on_k_changed" swapped="no"/>
|
@@ -34,7 +35,7 @@
|
|
34
35
|
<property name="upper">1</property>
|
35
36
|
<property name="value">0.5</property>
|
36
37
|
<property name="step_increment">0.01</property>
|
37
|
-
<property name="page_increment">0.
|
38
|
+
<property name="page_increment">0.1</property>
|
38
39
|
</object>
|
39
40
|
<object class="GtkAdjustment" id="pen_radius">
|
40
41
|
<property name="lower">1</property>
|
@@ -49,9 +50,6 @@
|
|
49
50
|
<property name="title" translatable="yes">Gray-Scott model</property>
|
50
51
|
<property name="resizable">False</property>
|
51
52
|
<signal name="destroy" handler="main_quit" swapped="no"/>
|
52
|
-
<child>
|
53
|
-
<placeholder/>
|
54
|
-
</child>
|
55
53
|
<child>
|
56
54
|
<object class="GtkBox">
|
57
55
|
<property name="visible">True</property>
|
@@ -254,6 +252,7 @@
|
|
254
252
|
<property name="label" translatable="yes">save</property>
|
255
253
|
<property name="use_underline">True</property>
|
256
254
|
<property name="stock_id">gtk-save</property>
|
255
|
+
<signal name="clicked" handler="on_save_clicked" swapped="no"/>
|
257
256
|
</object>
|
258
257
|
<packing>
|
259
258
|
<property name="expand">False</property>
|
@@ -276,7 +275,7 @@
|
|
276
275
|
</packing>
|
277
276
|
</child>
|
278
277
|
<child>
|
279
|
-
<object class="GtkToggleToolButton">
|
278
|
+
<object class="GtkToggleToolButton" id="execute_button">
|
280
279
|
<property name="visible">True</property>
|
281
280
|
<property name="can_focus">False</property>
|
282
281
|
<property name="tooltip_text" translatable="yes">execute</property>
|
@@ -478,6 +477,21 @@ applications-graphics
|
|
478
477
|
<property name="position">0</property>
|
479
478
|
</packing>
|
480
479
|
</child>
|
480
|
+
<child>
|
481
|
+
<object class="GtkComboBoxText" id="uv_combobox">
|
482
|
+
<property name="visible">True</property>
|
483
|
+
<property name="can_focus">False</property>
|
484
|
+
<property name="active">1</property>
|
485
|
+
<items>
|
486
|
+
<item translatable="yes">U</item>
|
487
|
+
<item translatable="yes">V</item>
|
488
|
+
</items>
|
489
|
+
<signal name="changed" handler="on_uv_combobox_changed" swapped="no"/>
|
490
|
+
</object>
|
491
|
+
<packing>
|
492
|
+
<property name="position">0</property>
|
493
|
+
</packing>
|
494
|
+
</child>
|
481
495
|
<child>
|
482
496
|
<object class="GtkComboBoxText">
|
483
497
|
<property name="visible">True</property>
|
@@ -492,6 +506,7 @@ applications-graphics
|
|
492
506
|
<item translatable="yes">reverse-red</item>
|
493
507
|
<item translatable="yes">reverse-green</item>
|
494
508
|
<item translatable="yes">reverse-blue</item>
|
509
|
+
<item translatable="yes">grayscale</item>
|
495
510
|
</items>
|
496
511
|
<signal name="changed" handler="on_color_combobox_changed" swapped="no"/>
|
497
512
|
</object>
|
@@ -499,21 +514,6 @@ applications-graphics
|
|
499
514
|
<property name="position">0</property>
|
500
515
|
</packing>
|
501
516
|
</child>
|
502
|
-
<child>
|
503
|
-
<object class="GtkComboBoxText" id="uv_combobox">
|
504
|
-
<property name="visible">True</property>
|
505
|
-
<property name="can_focus">False</property>
|
506
|
-
<property name="active">1</property>
|
507
|
-
<items>
|
508
|
-
<item translatable="yes">U</item>
|
509
|
-
<item translatable="yes">V</item>
|
510
|
-
</items>
|
511
|
-
<signal name="changed" handler="on_uv_combobox_changed" swapped="no"/>
|
512
|
-
</object>
|
513
|
-
<packing>
|
514
|
-
<property name="position">0</property>
|
515
|
-
</packing>
|
516
|
-
</child>
|
517
517
|
<child>
|
518
518
|
<object class="GtkSpinButton">
|
519
519
|
<property name="visible">True</property>
|
@@ -635,5 +635,8 @@ applications-graphics
|
|
635
635
|
</child>
|
636
636
|
</object>
|
637
637
|
</child>
|
638
|
+
<child type="titlebar">
|
639
|
+
<placeholder/>
|
640
|
+
</child>
|
638
641
|
</object>
|
639
642
|
</interface>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gray_scott_gtk3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gtk3
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 12.3.3
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 12.3.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,6 +90,7 @@ extra_rdoc_files: []
|
|
90
90
|
files:
|
91
91
|
- ".gitignore"
|
92
92
|
- ".rspec"
|
93
|
+
- ".travis.yml"
|
93
94
|
- Gemfile
|
94
95
|
- README.md
|
95
96
|
- Rakefile
|
@@ -98,10 +99,11 @@ files:
|
|
98
99
|
- exe/grayscott
|
99
100
|
- gray_scott_gtk3.gemspec
|
100
101
|
- lib/gray_scott.rb
|
102
|
+
- lib/gray_scott/color.rb
|
101
103
|
- lib/gray_scott/controller.rb
|
102
104
|
- lib/gray_scott/controller/aboutdialog.rb
|
103
|
-
- lib/gray_scott/laplacian.rb
|
104
105
|
- lib/gray_scott/model.rb
|
106
|
+
- lib/gray_scott/utils/math.rb
|
105
107
|
- lib/gray_scott/version.rb
|
106
108
|
- resources/about_icon.png
|
107
109
|
- resources/gray_scott.glade
|
@@ -123,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
125
|
- !ruby/object:Gem::Version
|
124
126
|
version: '0'
|
125
127
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
128
|
+
rubygems_version: 3.1.2
|
127
129
|
signing_key:
|
128
130
|
specification_version: 4
|
129
131
|
summary: Gray-Scott model.
|