Class: Hornetseye::OpenEXROutput

Inherits:
Object
  • Object
show all
Defined in:
lib/hornetseye-openexr/openexroutput.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(file) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/hornetseye-openexr/openexroutput.rb', line 26

def new( file )
  if file.is_a? File
    retval = orig_new file
  else
    file = File.new file, 'wb'
    retval = orig_new file
  end
  class << retval
    def file=( file )
      @file = file
    end
  end
  retval.file = file
  retval
end

.orig_newObject



24
# File 'lib/hornetseye-openexr/openexroutput.rb', line 24

alias_method :orig_new, :new

Instance Method Details

#closeObject



51
52
53
54
# File 'lib/hornetseye-openexr/openexroutput.rb', line 51

def close
  @file.close if @file
  @file = nil
end

#orig_writeObject



44
# File 'lib/hornetseye-openexr/openexroutput.rb', line 44

alias_method :orig_write, :write

#write(frame) ⇒ Object



46
47
48
49
# File 'lib/hornetseye-openexr/openexroutput.rb', line 46

def write( frame )
  target = frame.rgb? ? SFLOATRGB : SFLOAT
  orig_write frame.to_type( target ).memorise
end