depix 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ DPX metadata gets returned as a Depix::DPX object with nested properties.
6
6
 
7
7
  == Metadata structure
8
8
 
9
- * <tt>file</tt> (Depix::FileInfo) File information:
9
+ * <tt>file</tt> (Depix::FileInfo) File information - required:
10
10
  * <tt>magic</tt> (String) Endianness (SDPX is big endian) - required
11
11
  * <tt>image_offset</tt> Offset to image data in bytes - required
12
12
  * <tt>version</tt> (String) Version of header format - required
@@ -16,13 +16,13 @@ DPX metadata gets returned as a Depix::DPX object with nested properties.
16
16
  * <tt>industry_size</tt> Industry header length
17
17
  * <tt>user_size</tt> User header length
18
18
  * <tt>filename</tt> (String) Original filename
19
- * <tt>timestamp</tt> (String) Creation 15
19
+ * <tt>timestamp</tt> (String) Creation timestamp
20
20
  * <tt>creator</tt> (String) Creator application
21
21
  * <tt>roject</tt> (String) Project name
22
22
  * <tt>copyright</tt> (String) Copyright
23
23
  * <tt>encrypt_key</tt> Encryption key
24
24
  * <tt>reserve</tt> (String)
25
- * <tt>image</tt> (Depix::ImageInfo) Image information:
25
+ * <tt>image</tt> (Depix::ImageInfo) Image information - required:
26
26
  * <tt>orientation</tt> (Integer) Orientation descriptor - required
27
27
  * <tt>number_elements</tt> (Integer) How many elements to scan - required
28
28
  * <tt>pixels_per_line</tt> Pixels per horizontal line - required
@@ -44,7 +44,7 @@ DPX metadata gets returned as a Depix::DPX object with nested properties.
44
44
  * <tt>end_of_image_padding</tt> End-of-line padding for this image element
45
45
  * <tt>description</tt> (String)
46
46
  * <tt>reserve</tt> (String)
47
- * <tt>orientation</tt> (Depix::OrientationInfo) Orientation:
47
+ * <tt>orientation</tt> (Depix::OrientationInfo) Orientation - required:
48
48
  * <tt>x_offset</tt>
49
49
  * <tt>y_offset</tt>
50
50
  * <tt>x_center</tt> (Float)
@@ -58,7 +58,7 @@ DPX metadata gets returned as a Depix::DPX object with nested properties.
58
58
  * <tt>border</tt> (Array of 4 Integer fields) Border validity: XL, XR, YT, YB:
59
59
  * <tt>aspect_ratio</tt> (Array of 2 fields) Aspect (H:V):
60
60
  * <tt>reserve</tt> (String)
61
- * <tt>film</tt> (Depix::FilmInfo) Film industry info:
61
+ * <tt>film</tt> (Depix::FilmInfo) Film industry info - required:
62
62
  * <tt>id</tt> (String) Film mfg. ID code (2 digits from film edge code)
63
63
  * <tt>type</tt> (String) Film type (2 digits from film edge code)
64
64
  * <tt>offset</tt> (String) Offset in perfs (2 digits from film edge code)
@@ -73,7 +73,7 @@ DPX metadata gets returned as a Depix::DPX object with nested properties.
73
73
  * <tt>frame_id</tt> (String) Frame identification (keyframe)
74
74
  * <tt>slate</tt> (String) Slate information
75
75
  * <tt>reserve</tt> (String)
76
- * <tt>television</tt> (Depix::TelevisionInfo) TV industry info:
76
+ * <tt>television</tt> (Depix::TelevisionInfo) TV industry info - required:
77
77
  * <tt>time_code</tt> Timecode, formatted as HH:MM:SS:FF in the 4 higher bits of each 8bit group
78
78
  * <tt>user_bits</tt> Timecode UBITs
79
79
  * <tt>interlace</tt> (Integer) Interlace (0 = noninterlaced; 1 = 2:1 interlace
@@ -91,7 +91,7 @@ DPX metadata gets returned as a Depix::DPX object with nested properties.
91
91
  * <tt>white_level</tt> (Float) White level
92
92
  * <tt>integration_times</tt> (Float) Integration times (S)
93
93
  * <tt>reserve</tt> (Float)
94
- * <tt>user</tt> (Depix::UserInfo) User info:
94
+ * <tt>user</tt> (Depix::UserInfo) User info - required:
95
95
  * <tt>id</tt> (String) Name of the user data tag
96
96
  * <tt>user_data_ptr</tt>
97
97
 
data/History.txt CHANGED
@@ -1,6 +1,11 @@
1
- === 1.0.4 / 2008-12-23
1
+ === 1.0.5 / 2009-01-18
2
+
3
+ * Switch project to guerilla-di
4
+
5
+ === 1.0.4 / 2008-12-25
2
6
 
3
7
  * Add brief inspect
8
+ * Add metadata editing
4
9
 
5
10
  === 1.0.3 / 2008-12-23
6
11
 
data/Manifest.txt CHANGED
@@ -1,21 +1,22 @@
1
+ DPX_HEADER_STRUCTURE.txt
1
2
  History.txt
2
3
  Manifest.txt
3
4
  README.txt
4
- DPX_HEADER_STRUCTURE.txt
5
5
  Rakefile
6
6
  bin/depix-describe
7
+ depix.gemspec
7
8
  lib/depix.rb
8
- lib/depix/struct_explainer.rb
9
- lib/depix/structs.rb
10
9
  lib/depix/benchmark.rb
11
10
  lib/depix/compact_structs.rb
12
- lib/depix/enums.rb
13
11
  lib/depix/dict.rb
14
- lib/depix/reader.rb
15
12
  lib/depix/editor.rb
16
- test/test_dict.rb
17
- test/test_depix.rb
13
+ lib/depix/enums.rb
14
+ lib/depix/reader.rb
15
+ lib/depix/struct_explainer.rb
16
+ lib/depix/structs.rb
18
17
  test/samples/E012_P001_L000002_lin.0001.dpx
19
18
  test/samples/E012_P001_L000002_lin.0002.dpx
20
19
  test/samples/E012_P001_L000002_log.0001.dpx
21
- test/samples/E012_P001_L000002_log.0002.dpx
20
+ test/samples/E012_P001_L000002_log.0002.dpx
21
+ test/test_depix.rb
22
+ test/test_dict.rb
data/Rakefile CHANGED
@@ -2,13 +2,9 @@ require 'rubygems'
2
2
  require 'hoe'
3
3
  require './lib/depix'
4
4
 
5
- Class.new(Hoe) do
6
- def extra_deps
7
- super.reject {|e| e[0] == 'hoe' }
8
- end
9
- end.new('depix', Depix::VERSION) do |p|
5
+ Hoe.new('depix', Depix::VERSION) do |p|
10
6
  p.developer('Julik Tarkhanov', 'me@julik.nl')
11
- p.rubyforge_name = 'wiretap'
7
+ p.rubyforge_name = 'guerilla-di'
12
8
  p.extra_deps << 'timecode'
13
9
  p.remote_rdoc_dir = 'depix'
14
10
  end
data/depix.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{depix}
3
+ s.version = "1.0.5"
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["Julik Tarkhanov"]
7
+ s.date = %q{2008-12-26}
8
+ s.default_executable = %q{depix-describe}
9
+ s.description = %q{Read DPX file metadata}
10
+ s.email = ["me@julik.nl"]
11
+ s.executables = ["depix-describe"]
12
+ s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt", "DPX_HEADER_STRUCTURE.txt"]
13
+ s.files = ["History.txt", "Manifest.txt", "README.txt", "DPX_HEADER_STRUCTURE.txt", "Rakefile", "bin/depix-describe", "lib/depix.rb", "lib/depix/struct_explainer.rb", "lib/depix/structs.rb", "lib/depix/benchmark.rb", "lib/depix/compact_structs.rb", "lib/depix/enums.rb", "lib/depix/dict.rb", "lib/depix/reader.rb", "lib/depix/editor.rb", "test/test_dict.rb", "test/test_depix.rb", "test/samples/E012_P001_L000002_lin.0001.dpx", "test/samples/E012_P001_L000002_lin.0002.dpx", "test/samples/E012_P001_L000002_log.0001.dpx", "test/samples/E012_P001_L000002_log.0002.dpx"]
14
+ s.has_rdoc = true
15
+ s.homepage = %q{http://guerilla-di.rubyforge.org/depix}
16
+ s.rdoc_options = ["--main", "README.txt"]
17
+ s.require_paths = ["lib"]
18
+ s.rubyforge_project = %q{guerilla-di}
19
+ s.rubygems_version = %q{1.3.1}
20
+ s.summary = %q{Read DPX file metadata}
21
+ s.test_files = ["test/test_depix.rb", "test/test_dict.rb"]
22
+
23
+ if s.respond_to? :specification_version then
24
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
+ s.specification_version = 2
26
+
27
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
+ s.add_development_dependency(%q<hoe>, [">= 1.8.2"])
29
+ else
30
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
34
+ end
35
+ end
data/lib/depix.rb CHANGED
@@ -10,13 +10,14 @@ require File.dirname(__FILE__) + '/depix/editor'
10
10
 
11
11
 
12
12
  module Depix
13
- VERSION = '1.0.4'
13
+ VERSION = '1.0.5'
14
14
 
15
15
  class InvalidHeader < RuntimeError; end
16
16
 
17
17
  # Offers convenience access to a few common attributes bypassing the piecemeal structs
18
18
  module Synthetics
19
19
 
20
+ # Get formatted keycode as string, empty elements are omitted
20
21
  def keycode
21
22
  [film.id, film.type, film.offset, film.prefix, film.count].compact.join(' ')
22
23
  end
@@ -32,6 +33,7 @@ module Depix
32
33
  orientation.device = new_reel
33
34
  end
34
35
 
36
+ # Get television.time_code as a Timecode object with a framerate
35
37
  def time_code
36
38
  Timecode.from_uint(television.time_code) #, film.frame_rate)
37
39
  end
@@ -51,7 +53,7 @@ module Depix
51
53
  COMPONENT_TYPE.invert[image.image_elements[0].descriptor]
52
54
  end
53
55
 
54
- # Aspect in it's traditional repr
56
+ # Aspect in it's traditional representation (1.77 for 16x9 and so on)
55
57
  def aspect
56
58
  "%.2f" % (orientation.aspect_ratio[0].to_f / orientation.aspect_ratio[1].to_f)
57
59
  end
data/lib/depix/structs.rb CHANGED
@@ -15,7 +15,7 @@ module Depix
15
15
  u32 :user_size, :desc => 'User header length'
16
16
 
17
17
  char :filename, 100, :desc => 'Original filename'
18
- char :timestamp, 24, :desc => 'Creation 15'
18
+ char :timestamp, 24, :desc => 'Creation timestamp'
19
19
  char :creator, 100, :desc => 'Creator application'
20
20
  char :roject, 200, :desc => 'Project name'
21
21
  char :copyright, 200, :desc => 'Copyright'
data/test/test_depix.rb CHANGED
@@ -20,25 +20,30 @@ class ReaderTest < Test::Unit::TestCase
20
20
  assert_equal "2008:12:19:01:18:37:CEST", parsed.file.timestamp
21
21
  assert_equal "UTODESK", parsed.file.creator
22
22
  assert_equal 0, parsed.image.orientation
23
- assert_equal 1, parsed.image.number_elements
23
+
24
24
  assert_equal 320, parsed.image.pixels_per_line
25
25
  assert_equal 240, parsed.image.lines_per_element
26
- assert_equal 0, parsed.image.image_elements[0].data_sign
27
- assert_equal 0, parsed.image.image_elements[0].low_data
28
- assert_equal 0.0, parsed.image.image_elements[0].low_quantity
29
- assert_equal 1023, parsed.image.image_elements[0].high_data
30
- assert_in_delta 2.04699993133545, parsed.image.image_elements[0].high_quantity, 1.0 ** -10
26
+
27
+ assert_equal 1, parsed.image.number_elements
28
+ assert_equal 1, parsed.image.image_elements.length
29
+ ie = parsed.image.image_elements[0]
30
+
31
+ assert_equal 0, ie.data_sign
32
+ assert_equal 0, ie.low_data
33
+ assert_equal 0.0, ie.low_quantity
34
+ assert_equal 1023, ie.high_data
35
+ assert_in_delta 2.04699993133545, ie.high_quantity, 1.0 ** -10
31
36
 
32
- assert_equal 50, parsed.image.image_elements[0].descriptor # RGB :-)
33
- assert_equal 2, parsed.image.image_elements[0].transfer
34
- assert_equal 2, parsed.image.image_elements[0].colorimetric
35
- assert_equal 10, parsed.image.image_elements[0].bit_size
36
- assert_equal 1, parsed.image.image_elements[0].packing
37
- assert_equal 0, parsed.image.image_elements[0].encoding
38
- assert_equal 8192, parsed.image.image_elements[0].data_offset
39
- assert_equal 0, parsed.image.image_elements[0].end_of_line_padding
40
- assert_equal 0, parsed.image.image_elements[0].end_of_image_padding
41
- assert_equal "IMAGE DESCRIPTION DATA \000P", parsed.image.image_elements[0].description
37
+ assert_equal 50, ie.descriptor # RGB :-)
38
+ assert_equal 2, ie.transfer
39
+ assert_equal 2, ie.colorimetric
40
+ assert_equal 10, ie.bit_size
41
+ assert_equal 1, ie.packing
42
+ assert_equal 0, ie.encoding
43
+ assert_equal 8192, ie.data_offset
44
+ assert_equal 0, ie.end_of_line_padding
45
+ assert_equal 0, ie.end_of_image_padding
46
+ assert_equal "IMAGE DESCRIPTION DATA \000P", ie.description
42
47
  assert_equal "E012\000\000\000\000x\340\264\020\000\000\000\000\005",
43
48
  parsed.orientation.device #- this is where Flame writes the reel
44
49
 
@@ -122,7 +127,7 @@ class EditorTest < Test::Unit::TestCase
122
127
  begin
123
128
  FileUtils.cp(SAMPLE_DPX, temp_path)
124
129
  e = Depix::Editor.new(temp_path)
125
- e.headers.orientation.device = "E013"
130
+ e.headers.flame_reel = "E013"
126
131
 
127
132
  assert_nothing_raised { e.commit! }
128
133
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: depix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -9,9 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-26 00:00:00 +01:00
12
+ date: 2009-01-18 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: timecode
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
15
25
  - !ruby/object:Gem::Dependency
16
26
  name: hoe
17
27
  type: :development
@@ -30,32 +40,33 @@ executables:
30
40
  extensions: []
31
41
 
32
42
  extra_rdoc_files:
43
+ - DPX_HEADER_STRUCTURE.txt
33
44
  - History.txt
34
45
  - Manifest.txt
35
46
  - README.txt
36
- - DPX_HEADER_STRUCTURE.txt
37
47
  files:
48
+ - DPX_HEADER_STRUCTURE.txt
38
49
  - History.txt
39
50
  - Manifest.txt
40
51
  - README.txt
41
- - DPX_HEADER_STRUCTURE.txt
42
52
  - Rakefile
43
53
  - bin/depix-describe
54
+ - depix.gemspec
44
55
  - lib/depix.rb
45
- - lib/depix/struct_explainer.rb
46
- - lib/depix/structs.rb
47
56
  - lib/depix/benchmark.rb
48
57
  - lib/depix/compact_structs.rb
49
- - lib/depix/enums.rb
50
58
  - lib/depix/dict.rb
51
- - lib/depix/reader.rb
52
59
  - lib/depix/editor.rb
53
- - test/test_dict.rb
54
- - test/test_depix.rb
60
+ - lib/depix/enums.rb
61
+ - lib/depix/reader.rb
62
+ - lib/depix/struct_explainer.rb
63
+ - lib/depix/structs.rb
55
64
  - test/samples/E012_P001_L000002_lin.0001.dpx
56
65
  - test/samples/E012_P001_L000002_lin.0002.dpx
57
66
  - test/samples/E012_P001_L000002_log.0001.dpx
58
67
  - test/samples/E012_P001_L000002_log.0002.dpx
68
+ - test/test_depix.rb
69
+ - test/test_dict.rb
59
70
  has_rdoc: true
60
71
  homepage: http://wiretap.rubyforge.org/depix
61
72
  post_install_message:
@@ -78,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
89
  version:
79
90
  requirements: []
80
91
 
81
- rubyforge_project: wiretap
92
+ rubyforge_project: guerilla-di
82
93
  rubygems_version: 1.3.1
83
94
  signing_key:
84
95
  specification_version: 2