rusty_engine_ffi 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/bin/librusty_engine.dll +0 -0
- data/lib/bin/librusty_engine.dylib +0 -0
- data/lib/bin/librusty_engine.so +0 -0
- data/lib/rusty_engine.rb +65 -0
- metadata +79 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cd5f7a3d09b7dfff021437e8f57829b9542706d48c082f66364a66cdcf175c75
|
4
|
+
data.tar.gz: 9295001fbdf5f8470a944b9c12c6e6b68765580e4ded626e7f952f98e7233d8a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b60991899f14b7e61fa663ca5d52f76a24dc79ae52d758b374a6a7a9e00b391c4c2e973ab33d78402d96c34265c7e71c5681f3e034ea18f463833d04c516e3ff
|
7
|
+
data.tar.gz: ee75b1a011e85951478f689d9e18dbae5f12ae0f70742b185a757774c1d1140a9cba13a7963d52715d93598da7bdeacc4a1a09e8721103c824255305b0a8c11e
|
Binary file
|
Binary file
|
Binary file
|
data/lib/rusty_engine.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ffi'
|
4
|
+
|
5
|
+
# main file for Rusty Engine gem
|
6
|
+
module RustyEngine
|
7
|
+
extend FFI::Library
|
8
|
+
VERSION = '0.0.1'
|
9
|
+
|
10
|
+
lib_name = "bin/librusty_engine.#{FFI::Platform::LIBSUFFIX}"
|
11
|
+
ffi_lib File.expand_path(lib_name, __dir__)
|
12
|
+
|
13
|
+
# Convert png and jpg images
|
14
|
+
# @param input_image [String]
|
15
|
+
# @param output_image [String]
|
16
|
+
attach_function :convert, %i[string string], :void, { blocking: true }
|
17
|
+
|
18
|
+
# Apply brush algorithm to given image
|
19
|
+
# Params : input, output, proba, min, max, direction
|
20
|
+
# @param input_image [String]
|
21
|
+
# @param output_image [String]
|
22
|
+
# @param probability [String] should be between '0' and '100'
|
23
|
+
# @param min [String] should be between '0' and the max param
|
24
|
+
# @param max [String] should be above the min param
|
25
|
+
# @param directions [String] '1' -> horizontal
|
26
|
+
# '2' -> vertical
|
27
|
+
# '3' -> horizontal_inverted
|
28
|
+
# '4' -> vertical_inverted
|
29
|
+
attach_function :brush, %i[string string string string string string], :void, { blocking: true }
|
30
|
+
|
31
|
+
# Apply slim algorithm to given image
|
32
|
+
# Params : input, output, proba, probability_area, direction, colors, colors_proba
|
33
|
+
# @param input_image [String]
|
34
|
+
# @param output_image [String]
|
35
|
+
# @param probability [String] should be between '0' and '100'
|
36
|
+
# @param probability_area [String] either 'global' or 'local'
|
37
|
+
# @param directions [String] '1' -> up_to_down
|
38
|
+
# '2' -> down_to_up
|
39
|
+
# '3' -> left_to_right
|
40
|
+
# '4' -> right_to_left
|
41
|
+
# @param colors [String]
|
42
|
+
# @param colors_proba [String]
|
43
|
+
attach_function :slim, %i[string string string string string string string], :void, { blocking: true }
|
44
|
+
|
45
|
+
# Pixel sort the given image
|
46
|
+
# Params : input, output, direction, smart_sorting, detection_type, min, max, multiple_range, min_2, max_2, sorting_by
|
47
|
+
# @param input_image [String]
|
48
|
+
# @param output_image [String]
|
49
|
+
# @param directions [String] 0 -> up_to_down
|
50
|
+
# 1 -> down_to_up
|
51
|
+
# 2 -> left_to_right
|
52
|
+
# 3 -> right_to_left
|
53
|
+
# @param smart_sorting [String] 'true' or 'false'
|
54
|
+
# @param detection_type [String] 0 -> hues
|
55
|
+
# 1 -> colors
|
56
|
+
# @param min [String] should be between '0' and the max param
|
57
|
+
# @param max [String] should be above the min param
|
58
|
+
# @param multiple_range [String] 'true' or 'false'
|
59
|
+
# @param min_2 [String] should be between '0' and the max param
|
60
|
+
# @param max_2 [String] should be above the min param
|
61
|
+
# @param sorting_by [String] 0 -> hue
|
62
|
+
# 1 -> saturation
|
63
|
+
attach_function :sort, %i[string string string string string string string string string string string],
|
64
|
+
:void, { blocking: true }
|
65
|
+
end
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rusty_engine_ffi
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Flo Girardo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: yard
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.9'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.9'
|
41
|
+
description: |2
|
42
|
+
The Rust Engine is a tiny library written in rust to perform simple images manipulations.
|
43
|
+
For now the library included four functions :
|
44
|
+
- Image converter
|
45
|
+
- Pixel sorting
|
46
|
+
- Brush and Slim : two algorithms that will mess with the given image
|
47
|
+
email: florian@barbrousse.net
|
48
|
+
executables: []
|
49
|
+
extensions: []
|
50
|
+
extra_rdoc_files: []
|
51
|
+
files:
|
52
|
+
- lib/bin/librusty_engine.dll
|
53
|
+
- lib/bin/librusty_engine.dylib
|
54
|
+
- lib/bin/librusty_engine.so
|
55
|
+
- lib/rusty_engine.rb
|
56
|
+
homepage: https://framagit.org/Radoteur/rusty_engine
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubygems_version: 3.1.4
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: Tiny and fast image manipulation library
|
79
|
+
test_files: []
|