コード例 #1
0
 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();
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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();
            }
        }