Class: Tracksperanto::Import::ShakeScript::Traxtractor

Inherits:
ShakeGrammar::Catcher show all
Includes:
ZipTuples
Defined in:
lib/import/shake_script.rb

Class Attribute Summary collapse

Attributes inherited from ShakeGrammar::Lexer

#stack

Instance Method Summary collapse

Methods included from ZipTuples

#zip_curve_tuples

Methods inherited from ShakeGrammar::Catcher

#push

Methods inherited from ShakeGrammar::Lexer

#initialize

Constructor Details

This class inherits a constructor from Tracksperanto::ShakeGrammar::Lexer

Class Attribute Details

.accumulatorObject

Returns the value of attribute accumulator.



18
19
20
# File 'lib/import/shake_script.rb', line 18

def accumulator
  @accumulator
end

.progress_blockObject

Returns the value of attribute progress_block.



19
20
21
# File 'lib/import/shake_script.rb', line 19

def progress_block
  @progress_block
end

Instance Method Details

#linear(first_arg, *keyframes) ⇒ Object

For Linear() curve calls. If someone selected JSpline or Hermite it’s his problem. We put the frame number at the beginning since it works witih oru tuple zipper



26
27
28
29
30
31
# File 'lib/import/shake_script.rb', line 26

def linear(first_arg, *keyframes)
  report_progress("Translating Linear animation")
  keyframes.map do | kf |
    [kf[1][1], kf[0][1]]
  end
end

#matchmove(bgImage, fgImage, applyTransform, trackType, track1X, track1Y, matchX, matchY, track2X, track2Y, scale, rotation, track3X, track3Y, track4X, track4Y, *others) ⇒ Object

image = MatchMove(

  Background,
  Foreground,
  applyTransform,
  "trackType",
  track1X,
  track1Y,
  matchX,
  matchY,
  track2X,
  track2Y,
  scale,
  rotation,
  track3X,
  track3Y,
  track4X,
  track4Y,
  x1, 
  y1,
  x2,
  y2,
  x3,
  y3,
  x4,
  y4,
  "xFilter",
  "yFilter",
  motionBlur, 
  shutterTiming,
  shutterOffset,
  referenceFrame,
  "compositeType",
  clipMode,
 "trackRange",
  "subPixelRes",
  "matchSpace",
  float referenceTolerance,
  "referenceBehavior",
  float failureTolerance,
  "failureBehavior",
  int limitProcessing,
  ...
);


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/import/shake_script.rb', line 143

def matchmove(bgImage, fgImage, applyTransform,
  trackType,
  track1X,
  track1Y,
  matchX,
  matchY,
  track2X,
  track2Y,
  scale,
  rotation,
  track3X,
  track3Y,
  track4X,
  track4Y, *others)
  
  report_progress("Parsing MatchMove node")
  node_name = get_variable_name
  collect_stabilizer_tracker("#{node_name}_track1", track1X, track1Y)
  collect_stabilizer_tracker("#{node_name}_track2", track2X, track2Y)
  collect_stabilizer_tracker("#{node_name}_track3", track3X, track3Y)
  collect_stabilizer_tracker("#{node_name}_track4", track4X, track4Y)
  
end

#stabilize(imageIn, applyTransform, inverseTransform, trackType, track1X, track1Y, stabilizeX, stabilizeY, track2X, track2Y, matchScale, matchRotation, track3X, track3Y, track4X, track4Y, *useless_args) ⇒ Object

stabilize

image In,
int applyTransform,
int inverseTransform
const char * trackType,
float track1X,
float track1Y,
int stabilizeX,
int stabilizeY,
float track2X,
float track2Y,
int matchScale,
int matchRotation,
float track3X,
float track3Y,
float track4X,
float track4Y,
const char * xFilter,
const char * yFilter,
const char * transformationOrder,
float motionBlur, 
float shutterTiming,
float shutterOffset,
float referenceFrame,
float aspectRatio,
...

;



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/import/shake_script.rb', line 82

def stabilize(imageIn, applyTransform, inverseTransform, trackType,
  track1X, track1Y,
  stabilizeX, stabilizeY,
  track2X, track2Y,
  matchScale,
  matchRotation,
  track3X, track3Y,
  track4X, track4Y,
  *useless_args)
  
  report_progress("Parsing Stabilize node")
  node_name = get_variable_name
  collect_stabilizer_tracker("#{node_name}_track1", track1X, track1Y)
  collect_stabilizer_tracker("#{node_name}_track2", track2X, track2Y)
  collect_stabilizer_tracker("#{node_name}_track3", track3X, track3Y)
  collect_stabilizer_tracker("#{node_name}_track4", track4X, track4Y)
end

#tracker(input, trackRange, subPixelRes, matchSpace, referenceTolerance, referenceBehavior, failureTolerance, failureBehavior, limitProcessing, referencFrame, s1, s2, s3, s4, s5, s6, *trackers) ⇒ Object

image Tracker(

 image In,
 const char * trackRange,
 const char * subPixelRes,
 const char * matchSpace,
 float referenceTolerance,
 const char * referenceBehavior,
 float failureTolerance,
 const char * failureBehavior,
 int limitProcessing,
 float referencFrame 
 ...
);


46
47
48
49
50
51
52
53
# File 'lib/import/shake_script.rb', line 46

def tracker(input, trackRange, subPixelRes, matchSpace,
    referenceTolerance, referenceBehavior, failureTolerance, failureBehavior, limitProcessing, referencFrame, s1, s2,
    s3, s4, s5, s6, *trackers)
  
  report_progress("Parsing Tracker node")
  collect_trackers_from(get_variable_name, trackers)
  true
end