public ActorCollection(AnimationProperties properties, IEnumerable <ActorEntry> actors) { _actors = actors.Select(tuple => new ValueType { Actor = tuple.Actor, Start = tuple.Start.GetFrameNumber(properties), Finish = tuple.Finish.GetFrameNumber(properties) }).ToArray(); }
public Animation(AnimationProperties properties, SKColor backgroundColor, IVideoOutput output) { _properties = properties; _backgroundColor = backgroundColor; _output = output; _frame = new Frame(properties.Width, properties.Height); _frameCount = properties.FrameCount; _imageInfo = new SKImageInfo(properties.Width, properties.Height, SKColorType.Bgra8888); }
public static int GetFrameNumber(this AnimationTimePoint timePoint, AnimationProperties properties) { switch (timePoint.Type) { case AnimationTimePoint.ValueType.Start: return(0); case AnimationTimePoint.ValueType.Finish: return(int.MaxValue); case AnimationTimePoint.ValueType.FrameNumber: return((int)timePoint.Value); case AnimationTimePoint.ValueType.Time: return((int)(((TimeSpan)timePoint.Value).TotalSeconds * properties.Fps)); default: throw new ArgumentOutOfRangeException(); } }