Class: NumRu::DCLExt::Anim::Source

Inherits:
Object
  • Object
show all
Includes:
NumRu::DCLExt::Anim
Defined in:
lib/numru/dclext/anim/source.rb

Constant Summary

Constants included from NumRu::DCLExt::Anim

PADDING, VERSION

Instance Method Summary collapse

Methods included from NumRu::DCLExt::Anim

height, width

Constructor Details

#initialize(pixmap, pipe) ⇒ Source

Returns a new instance of Source.



9
10
11
12
13
# File 'lib/numru/dclext/anim/source.rb', line 9

def initialize(pixmap, pipe)
  @pixmap = pixmap
  @pipe = pipe
  @first_frame = true
end

Instance Method Details

#closeObject



23
24
25
26
# File 'lib/numru/dclext/anim/source.rb', line 23

def close
  put_data unless @first_frame
  @pipe.close
end

#new_frameObject



15
16
17
18
19
20
21
# File 'lib/numru/dclext/anim/source.rb', line 15

def new_frame
  if @first_frame
    @first_frame = false
  else
    put_data
  end
end