tracksperanto 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,4 @@
1
- === 1.6.1 / 2009-11-15
1
+ === 1.6.2 / 2009-11-15
2
2
 
3
3
  * Fixes the Reformat middleware to not suppress the end_export call. Crucial for exporters that
4
4
  use end_export to finalize output
data/Manifest.txt CHANGED
@@ -47,6 +47,7 @@ lib/tracksperanto/keyframe.rb
47
47
  lib/tracksperanto/safety.rb
48
48
  lib/tracksperanto/simple_export.rb
49
49
  lib/tracksperanto/tracker.rb
50
+ lib/tracksperanto/uv_coordinates.rb
50
51
  lib/tracksperanto/zip_tuples.rb
51
52
  test/.DS_Store
52
53
  test/export/.DS_Store
data/lib/tracksperanto.rb CHANGED
@@ -4,7 +4,7 @@ require 'tempfile'
4
4
 
5
5
  module Tracksperanto
6
6
  PATH = File.expand_path(File.dirname(__FILE__))
7
- VERSION = '1.6.1'
7
+ VERSION = '1.6.2'
8
8
 
9
9
  module Import; end
10
10
  module Export; end
@@ -0,0 +1,20 @@
1
+ # Y down X right, 0 is center and values are UV float -1 to 1, doubled
2
+ module Tracksperanto::UVCoordinates
3
+
4
+ # UV coords used by Syntheyes and it's lens distortion algos.
5
+ def absolute_to_uv(abs_x, abs_y, w, h)
6
+ [convert_to_uv(abs_x, w), convert_to_uv(abs_y, h) * -1]
7
+ end
8
+
9
+ def convert_to_uv(absolute_value, absolute_side)
10
+ x = (absolute_value / absolute_side.to_f) - 0.5
11
+ # .2 to -.3, y is reversed and coords are double
12
+ x * 2
13
+ end
14
+
15
+ def convert_from_uv(absolute_side, uv_value)
16
+ # First, start from zero (-.1 becomes .4)
17
+ value_off_corner = (uv_value.to_f / 2) + 0.5
18
+ absolute_side * value_off_corner
19
+ end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracksperanto
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -93,6 +93,7 @@ files:
93
93
  - lib/tracksperanto/safety.rb
94
94
  - lib/tracksperanto/simple_export.rb
95
95
  - lib/tracksperanto/tracker.rb
96
+ - lib/tracksperanto/uv_coordinates.rb
96
97
  - lib/tracksperanto/zip_tuples.rb
97
98
  - test/.DS_Store
98
99
  - test/export/.DS_Store