module Depix::Synthetics

Offers convenience access to a number of interesting fields of the DPX object already decoded into the most usable form (and pulled from a field that you won't expect)

Constants

DEFAULT_DPX_FPS

Public Instance Methods

aspect() click to toggle source

Aspect in it's traditional representation (1.77 for 16x9 and so on)

# File lib/depix/synthetics.rb, line 61
def aspect
  "%.2f" % (image.pixels_per_line / image.lines_per_element.to_f * pixel_aspect)
end
colorimetric() click to toggle source

Get the name of the transfer function (Linear, Logarithmic, …)

# File lib/depix/synthetics.rb, line 46
def colorimetric
  Depix::COLORIMETRIC.invert[image.image_elements[0].colorimetric]
end
component_type() click to toggle source

Get the name of the compnent type (RGB, YCbCr, …)

# File lib/depix/synthetics.rb, line 51
def component_type
  Depix::COMPONENT_TYPE.invert[image.image_elements[0].descriptor]
end
flame_reel() click to toggle source

Return the flame reel name. The data after the first null byte is not meant to be seen and is used by Flame internally as it seems

# File lib/depix/synthetics.rb, line 16
def flame_reel
  return nil unless orientation.device
  orientation.device.split(0x00.chr).shift
end
flame_reel=(new_reel) click to toggle source

Assign reel name

# File lib/depix/synthetics.rb, line 22
def flame_reel=(new_reel)
  orientation.device = new_reel
end
keycode() click to toggle source

Get formatted keycode as string, empty elements are omitted

# File lib/depix/synthetics.rb, line 9
def keycode
  [film.id, film.type, film.offset, film.prefix, film.count].compact.join(' ')
end
le?() click to toggle source
# File lib/depix/synthetics.rb, line 70
def le?
  # $stderr.puts "Depix::Synthetics.le? is deprecated, use little_endian? instead"
  little_endian?
end
little_endian?() click to toggle source

Is this DPX file little-endian?

# File lib/depix/synthetics.rb, line 66
def little_endian?
  file.magic == 'XPDS'
end
pixel_aspect() click to toggle source

Returns the pixel aspect

# File lib/depix/synthetics.rb, line 56
def pixel_aspect
  (orientation.aspect_ratio[0].to_f / orientation.aspect_ratio[1].to_f)
end
time_code() click to toggle source

Get television.time_code as a Timecode object with a framerate. We explicitly use the television frame rate since Northlight writes different rates for television and film time code

# File lib/depix/synthetics.rb, line 29
def time_code
  framerates = [television.frame_rate, film.frame_rate, DEFAULT_DPX_FPS]
  framerate = framerates.find{|e| !e.nil? && !e.zero? }
  if television.time_code
    Timecode.from_uint(television.time_code, framerate)
  else
    # Assume frame position
    Timecode.new(film.frame_position, framerate)
  end
end
time_code=(new_tc) click to toggle source

Assign frame rate and timecode from a Timecode object

# File lib/depix/synthetics.rb, line 41
def time_code=(new_tc)
  television.time_code, television.frame_rate = new_tc.to_uint, new_tc.fps
end