cdl 0.0.2 → 0.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11b9f9bd0f96541bc25ac2abee5a14e864daed96
4
- data.tar.gz: f1b358c1130e6e2437ed836d26fd4c4e3b7f8bc9
3
+ metadata.gz: 3e7d9e23c0b41ee7073bee72a67ce2a58cc71f08
4
+ data.tar.gz: 4ef74af708ccd424ff1f20282c968c332c8bddd5
5
5
  SHA512:
6
- metadata.gz: a0d7a6ba0d1564906ab6dbdb8a4df47c98a9c7677813f209d99aa9522fc9958cd8c6f43ec33fdcdc08427f23e9e413055ee8b397ad984104e90c6780e08642cf
7
- data.tar.gz: 88cd676d364d7c77e2679568f37e573650c9015eb8dbe0ab008a9c7c34192ea4958fd4fcdf2c2434b06eed1adf8fa52ad4f02908093e07ff3e4f2deac4a42e32
6
+ metadata.gz: a01688588205953dac78da46ec72aa9f4c3b0c38159ea6e46d3fb88d566024a2070563387984b397dfef521a576edaa1e41d2aab896aba4783dc51eacccbfdbe
7
+ data.tar.gz: 12ddc9167d03119ec4d6873ec14bbbfbbfa2ef571506ec6a250d6af5c6365d204cedc54e02f388714e368a7fa90824319dffcf036cb713d230ec8ec5a1b0d84d
@@ -1 +1 @@
1
- TITLE: CDL CONFORM TEST_V1_092612
1
+ TITLE: CDL CONFORM TEST_V1_092612
data/lib/cdl.rb CHANGED
@@ -1,11 +1,11 @@
1
-
2
1
  require_relative "cdl/version.rb"
3
2
  require_relative "cdl/edl.rb"
4
3
 
5
- cdl = Cdl::Edl.new("../fixtures/CDL_V1_092612.edl")
4
+ # cdl = Cdl::Edl.new("fixtures/CDL_V1_092612.edl")
5
+
6
6
  # cdl.read_file
7
7
  # cdl.to_hash
8
-
9
8
  # cdl.slope
10
9
  # cdl.offset
11
10
  # cdl.power
11
+ # cdl.sat
@@ -2,7 +2,10 @@ module Cdl
2
2
 
3
3
  COLORVALUE = /(-?\d{1,}\.\d{1,})\s(-?\d{1,}\.\d{1,})\s(-?\d{1,}\.\d{1,})/
4
4
  VALUE = /\((-?\d{1}\.\d{1,}\s*-?\d{1}\.\d{1,}\s*-?\d{1}\.\d{1,})\)/
5
- SOP = /#{VALUE}#{VALUE}#{VALUE}/
5
+ SAT = /\*ASC_SAT\s*(-?\d{1}\.\d{1,})/
6
+ SOP = /#{VALUE}#{VALUE}#{VALUE}\s*\r?/
7
+ TAPE = /^\d{1,}\s*(\w*)\s*/
8
+ CLIP = /^\*FROM CLIP NAME:\s*(\w*)\s*/
6
9
 
7
10
  class Edl
8
11
 
@@ -17,12 +20,17 @@ module Cdl
17
20
 
18
21
  def to_hash
19
22
  store = []
23
+ hash = {}
20
24
  read_file.each do |line|
21
- store << {
22
- :slope => $1,
23
- :offset => $2,
24
- :power => $3
25
- } if line =~ SOP
25
+
26
+ store << hash = {
27
+ :slope => $1,
28
+ :offset => $2,
29
+ :power => $3
30
+ } if line =~ SOP
31
+
32
+ hash[:sat] = $1 if line =~ SAT
33
+
26
34
  end
27
35
  store
28
36
  end
@@ -31,7 +39,6 @@ module Cdl
31
39
  parse_rgb(:slope)
32
40
  end
33
41
 
34
-
35
42
  def offset
36
43
  parse_rgb(:offset)
37
44
  end
@@ -40,8 +47,20 @@ module Cdl
40
47
  parse_rgb(:power)
41
48
  end
42
49
 
50
+ def sat
51
+ parse(:sat)
52
+ end
53
+
43
54
  private
44
55
 
56
+ def parse(attributes)
57
+ arr = []
58
+ to_hash.each do |i|
59
+ arr << i[attributes]
60
+ end
61
+ arr
62
+ end
63
+
45
64
  def parse_rgb(attributes)
46
65
 
47
66
  red = []
@@ -49,9 +68,9 @@ module Cdl
49
68
  blue = []
50
69
 
51
70
  to_hash.each do |r|
52
- red << $1 if r[attributes] =~ COLORVALUE
53
- green << $2 if r[attributes] =~ COLORVALUE
54
- blue << $3 if r[attributes] =~ COLORVALUE
71
+ red << $1 if r[attributes] =~ COLORVALUE
72
+ green << $2 if r[attributes] =~ COLORVALUE
73
+ blue << $3 if r[attributes] =~ COLORVALUE
55
74
  end
56
75
 
57
76
  result = { :red => red, :green => green, :blue => blue }
@@ -1,3 +1,3 @@
1
1
  module Cdl
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Duval
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-14 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,9 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.0.0
78
+ rubygems_version: 2.2.1
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Color Decision List (ASC CDL) parser
82
82
  test_files: []
83
- has_rdoc: