public KeyframeChangeInterpModeAction(Layer l, Frameset f, Keyframe frame, EntityInterpolationMode target) { LayerIndex = Program.ActiveProject.Layers.IndexOf(l); FramesetIndex = l.Framesets.IndexOf(f); KeyframeIndex = f.Keyframes.IndexOf(frame); TargetMode = target; }
public static float Interpolate(float t, float a, float b, EntityInterpolationMode mode) { switch (mode) { case EntityInterpolationMode.None: return(None(t, a, b)); case EntityInterpolationMode.Linear: return(Linear(t, a, b)); case EntityInterpolationMode.QuadInOut: return(QuadInOut(t, a, b)); case EntityInterpolationMode.ExpoInOut: return(ExpoInOut(t, a, b)); case EntityInterpolationMode.BounceOut: return(BounceOut(t, a, b)); case EntityInterpolationMode.BackOut: return(BackOut(t, a, b)); default: throw new System.ArgumentException("EntityInterpolationmode not valid."); } }
public void ChangeInterpolationMode(EntityInterpolationMode mode) { if (SelectedKeyframe != null) { Program.Form_Main.Do(new KeyframeChangeInterpModeAction(SelectedLayer, SelectedFrameset, SelectedKeyframe, mode)); } }
public static Color Interpolate(float t, Color a, Color b, EntityInterpolationMode mode) { return(Color.FromArgb( (int)Interpolate(t, a.A, b.A, mode), (int)Interpolate(t, a.R, b.R, mode), (int)Interpolate(t, a.G, b.G, mode), (int)Interpolate(t, a.B, b.B, mode))); }
public static Color Interpolate(float t, Color a, Color b, EntityInterpolationMode mode) { return Color.FromArgb( (int)Interpolate(t, a.A, b.A, mode), (int)Interpolate(t, a.R, b.R, mode), (int)Interpolate(t, a.G, b.G, mode), (int)Interpolate(t, a.B, b.B, mode)); }
public static RectangleF Interpolate(float t, RectangleF a, RectangleF b, EntityInterpolationMode mode) { return new RectangleF( Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode), Interpolate(t, a.Width, b.Width, mode), Interpolate(t, a.Height, b.Height, mode)); }
public static RectangleF Interpolate(float t, RectangleF a, RectangleF b, EntityInterpolationMode mode) { return(new RectangleF( Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode), Interpolate(t, a.Width, b.Width, mode), Interpolate(t, a.Height, b.Height, mode))); }
public bool Do() { PrevMode = Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode; Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode = TargetMode; Program.MainTimeline.GLContext.Invalidate(); return(true); }
public void Read(BinaryReader reader, UInt16 version) { Time = reader.ReadUInt32(); Type type = FileFormat.ResolveEntityStateID(reader.ReadUInt16()); InterpMode = version >= 2 ? (EntityInterpolationMode)Enum.Parse(typeof(EntityInterpolationMode), reader.ReadString()) : EntityInterpolationMode.Linear; Type[] args = { }; object[] values = { }; State = (IEntityState)type.GetConstructor(args).Invoke(values); State.Read(reader, version); }
public static State Interpolate(float t, State current, State target, EntityInterpolationMode mode) { State state = new State(current.Parent); state.BitmapIndex = current.BitmapIndex; state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode); state.JointColor = Interpolation.Interpolate(t, current.JointColor, target.JointColor, mode); state.Thickness = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode); for (var i = 0; i < current.Children.Count; i++) { state.Children.Add(Interpolate(t, current.Children[i], target.Children[i], mode)); } return state; }
public static float Interpolate(float t, float a, float b, EntityInterpolationMode mode) { switch (mode) { case EntityInterpolationMode.None: return None(t, a, b); case EntityInterpolationMode.Linear: return Linear(t, a, b); case EntityInterpolationMode.QuadInOut: return QuadInOut(t, a, b); case EntityInterpolationMode.ExpoInOut: return ExpoInOut(t, a, b); case EntityInterpolationMode.BounceOut: return BounceOut(t, a, b); case EntityInterpolationMode.BackOut: return BackOut(t, a, b); default: throw new System.ArgumentException("EntityInterpolationmode not valid."); } }
public static Vector3 Interpolate(float t, Vector3 a, Vector3 b, EntityInterpolationMode mode) { return new Vector3(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode), Interpolate(t, a.Z, b.Z, mode)); }
public Keyframe(UInt32 time, IEntityState state, EntityInterpolationMode interpMode) { Time = time; State = state; InterpMode = interpMode; }
public static PointF Interpolate(float t, PointF a, PointF b, EntityInterpolationMode mode) { return(new PointF(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode))); }
public static State Interpolate(float t, State current, State target, EntityInterpolationMode mode) { State state = new State(current.Parent); state.BitmapIndex = current.BitmapIndex; state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode); state.JointColor = Interpolation.Interpolate(t, current.JointColor, target.JointColor, mode); state.Thickness = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode); for (var i = 0; i < current.Children.Count; i++) { state.Children.Add(Interpolate(t, current.Children[i], target.Children[i], mode)); } return(state); }
public Keyframe() { Time = 0; State = null; InterpMode = EntityInterpolationMode.Linear; }
public static PointF Interpolate(float t, PointF a, PointF b, EntityInterpolationMode mode) { return new PointF(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode)); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Bounds = Interpolation.Interpolate(t, current.Bounds, target.Bounds, mode); state.Text = current.Text; state.TextAlignment = current.TextAlignment; state.TextFont = current.TextFont; state.TextColor = Interpolation.Interpolate(t, current.TextColor, target.TextColor, mode); return state; }
public IEntityState Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { return(_Interpolate(t, _current, _target, mode)); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Points = new List<Joint>(); for (int i = 0; i < current.Points.Count; i++) { state.Points.Add(current.Points[i].Copy()); state.Points[i].Location = Interpolation.Interpolate(t, current.Points[i].Location, target.Points[i].Location, mode); } state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode); return state; }
public void ChangeInterpolationMode(EntityInterpolationMode mode) { if (SelectedKeyframe != null) Program.Form_Main.Do(new KeyframeChangeInterpModeAction(SelectedLayer, SelectedFrameset, SelectedKeyframe, mode)); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Handle1 = Interpolation.Interpolate(t, current.Handle1, target.Handle1, mode); state.Handle2 = Interpolation.Interpolate(t, current.Handle2, target.Handle2, mode); state.Thickness = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode); state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode); return state; }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Root = Joint.State.Interpolate(t, current.Root, target.Root, mode); return(state); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Handle1 = Interpolation.Interpolate(t, current.Handle1, target.Handle1, mode); state.Handle2 = Interpolation.Interpolate(t, current.Handle2, target.Handle2, mode); state.Thickness = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode); state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode); return(state); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode); state.Size = Interpolation.Interpolate(t, current.Size, target.Size, mode); state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode); return(state); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode); state.LightRadius = Interpolation.Interpolate(t, current.LightRadius, target.LightRadius, mode); state.LightColor = Interpolation.Interpolate(t, current.LightColor, target.LightColor, mode); state.LightAttenuation = Interpolation.Interpolate(t, current.LightAttenuation, target.LightAttenuation, mode); return(state); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Points = new List <Joint>(); for (int i = 0; i < current.Points.Count; i++) { state.Points.Add(current.Points[i].Copy()); state.Points[i].Location = Interpolation.Interpolate(t, current.Points[i].Location, target.Points[i].Location, mode); } state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode); return(state); }
public IEntityState Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { return _Interpolate(t, _current, _target, mode); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode); state.LightRadius = Interpolation.Interpolate(t, current.LightRadius, target.LightRadius, mode); state.LightColor = Interpolation.Interpolate(t, current.LightColor, target.LightColor, mode); state.LightAttenuation = Interpolation.Interpolate(t, current.LightAttenuation, target.LightAttenuation, mode); return state; }
public bool Do() { PrevMode = Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode; Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode = TargetMode; Program.MainTimeline.GLContext.Invalidate(); return true; }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Bounds = Interpolation.Interpolate(t, current.Bounds, target.Bounds, mode); state.Rotation = Interpolation.Interpolate(t, current.Rotation, target.Rotation, mode); state.BitmapAlpha = (int)Interpolation.Interpolate(t, current.BitmapAlpha, target.BitmapAlpha, mode); return(state); }
public static Vector3 Interpolate(float t, Vector3 a, Vector3 b, EntityInterpolationMode mode) { return(new Vector3(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode), Interpolate(t, a.Z, b.Z, mode))); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Bounds = Interpolation.Interpolate(t, current.Bounds, target.Bounds, mode); state.Text = current.Text; state.TextAlignment = current.TextAlignment; state.TextFont = current.TextFont; state.TextColor = Interpolation.Interpolate(t, current.TextColor, target.TextColor, mode); return(state); }
private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode) { State current = _current as State; State target = _target as State; State state = new State(); state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode); state.Size = Interpolation.Interpolate(t, current.Size, target.Size, mode); state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode); return state; }