julik-depix 1.0.3 → 1.0.5
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.
- data/DPX_HEADER_STRUCTURE.txt +7 -7
 - data/History.txt +4 -0
 - data/Manifest.txt +9 -8
 - data/Rakefile +2 -6
 - data/lib/depix.rb +4 -2
 - data/lib/depix/structs.rb +1 -1
 - data/test/test_depix.rb +22 -17
 - metadata +3 -3
 
    
        data/DPX_HEADER_STRUCTURE.txt
    CHANGED
    
    | 
         @@ -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  
     | 
| 
      
 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
    
    
    
        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 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       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 = ' 
     | 
| 
      
 7 
     | 
    
         
            +
              p.rubyforge_name = 'guerilla-di'
         
     | 
| 
       12 
8 
     | 
    
         
             
              p.extra_deps << 'timecode'
         
     | 
| 
       13 
9 
     | 
    
         
             
              p.remote_rdoc_dir = 'depix'
         
     | 
| 
       14 
10 
     | 
    
         
             
            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. 
     | 
| 
      
 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  
     | 
| 
      
 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  
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
      
 23 
     | 
    
         
            +
                
         
     | 
| 
       24 
24 
     | 
    
         
             
                assert_equal 320, parsed.image.pixels_per_line
         
     | 
| 
       25 
25 
     | 
    
         
             
                assert_equal 240, parsed.image.lines_per_element
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
                assert_equal  
     | 
| 
       28 
     | 
    
         
            -
                assert_equal  
     | 
| 
       29 
     | 
    
         
            -
                 
     | 
| 
       30 
     | 
    
         
            -
                 
     | 
| 
      
 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, 
     | 
| 
       33 
     | 
    
         
            -
                assert_equal 2, 
     | 
| 
       34 
     | 
    
         
            -
                assert_equal 2, 
     | 
| 
       35 
     | 
    
         
            -
                assert_equal 10, 
     | 
| 
       36 
     | 
    
         
            -
                assert_equal 1, 
     | 
| 
       37 
     | 
    
         
            -
                assert_equal 0, 
     | 
| 
       38 
     | 
    
         
            -
                assert_equal 8192, 
     | 
| 
       39 
     | 
    
         
            -
                assert_equal 0, 
     | 
| 
       40 
     | 
    
         
            -
                assert_equal 0, 
     | 
| 
       41 
     | 
    
         
            -
                assert_equal "IMAGE DESCRIPTION DATA        \000P",  
     | 
| 
      
 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. 
     | 
| 
      
 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: julik-depix
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.5
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Julik Tarkhanov
         
     | 
| 
         @@ -56,7 +56,7 @@ files: 
     | 
|
| 
       56 
56 
     | 
    
         
             
            - test/samples/E012_P001_L000002_log.0001.dpx
         
     | 
| 
       57 
57 
     | 
    
         
             
            - test/samples/E012_P001_L000002_log.0002.dpx
         
     | 
| 
       58 
58 
     | 
    
         
             
            has_rdoc: true
         
     | 
| 
       59 
     | 
    
         
            -
            homepage: http:// 
     | 
| 
      
 59 
     | 
    
         
            +
            homepage: http://guerilla-di.rubyforge.org/depix
         
     | 
| 
       60 
60 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       61 
61 
     | 
    
         
             
            rdoc_options: 
         
     | 
| 
       62 
62 
     | 
    
         
             
            - --main
         
     | 
| 
         @@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       77 
77 
     | 
    
         
             
              version: 
         
     | 
| 
       78 
78 
     | 
    
         
             
            requirements: []
         
     | 
| 
       79 
79 
     | 
    
         | 
| 
       80 
     | 
    
         
            -
            rubyforge_project:  
     | 
| 
      
 80 
     | 
    
         
            +
            rubyforge_project: guerilla-di
         
     | 
| 
       81 
81 
     | 
    
         
             
            rubygems_version: 1.2.0
         
     | 
| 
       82 
82 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       83 
83 
     | 
    
         
             
            specification_version: 2
         
     |