Ejemplo n.º 1
0
        public override Frame transition_frame(Frame from_frame, Frame to_frame)
        {
            Frame frame = from_frame.copy();
            int dst_x = 0;
            int dst_y = 0;

            double prog = this.progress;
            if (this.in_out == true)
            {
                prog = 1.0 - prog;
            }

            if (this.direction == SlideOverTransitionDirection.North)
            {
                dst_x = 0;
                dst_y = (int)(prog * frame.height);
            }
            else if (this.direction == SlideOverTransitionDirection.South)
            {
                dst_x = 0;
                dst_y = (int)(-prog * frame.height);
            }
            else if (this.direction == SlideOverTransitionDirection.East)
            {
                dst_x = (int)(-prog * frame.width);
                dst_y = 0;
            }
            else if (this.direction == SlideOverTransitionDirection.West)
            {
                dst_x = (int)(prog * frame.width);
                dst_y = 0;
            }
            Frame.copy_rect(frame, dst_x, dst_y, to_frame, 0, 0, from_frame.width, from_frame.height, DMDBlendMode.DMDBlendModeCopy);
            return frame;
        }
Ejemplo n.º 2
0
        public override Frame transition_frame(Frame from_frame, Frame to_frame)
        {
            // Calculate the frame index
            int index = 0;
            if (this.in_out == true)
                index = (int)(this.progress * (frames.Count - 1));
            else
                index = (int)((1.0 - this.progress) * (frames.Count - 1));

            // Subtract the respective reference frame from each of the input frames
            from_frame = from_frame.copy();
            Frame.copy_rect(from_frame, 0, 0, this.frames[index], 0, 0, this.width, this.height, DMDBlendMode.DMDBlendModeSubtract);
            to_frame = to_frame.copy();
            Frame.copy_rect(to_frame, 0, 0, this.frames[frames.Count - (index + 1)], 0, 0, this.width, this.height, DMDBlendMode.DMDBlendModeSubtract);
            // Add the results together
            Frame.copy_rect(from_frame, 0, 0, to_frame, 0, 0, this.width, this.height, DMDBlendMode.DMDBlendModeAdd);
            return from_frame;
        }
Ejemplo n.º 3
0
        public override Frame transition_frame(Frame from_frame, Frame to_frame)
        {
            // Calculate the frame index
            int index = 0;

            if (this.in_out == true)
            {
                index = (int)(this.progress * (frames.Count - 1));
            }
            else
            {
                index = (int)((1.0 - this.progress) * (frames.Count - 1));
            }

            // Subtract the respective reference frame from each of the input frames
            from_frame = from_frame.copy();
            Frame.copy_rect(from_frame, 0, 0, this.frames[index], 0, 0, this.width, this.height, DMDBlendMode.DMDBlendModeSubtract);
            to_frame = to_frame.copy();
            Frame.copy_rect(to_frame, 0, 0, this.frames[frames.Count - (index + 1)], 0, 0, this.width, this.height, DMDBlendMode.DMDBlendModeSubtract);
            // Add the results together
            Frame.copy_rect(from_frame, 0, 0, to_frame, 0, 0, this.width, this.height, DMDBlendMode.DMDBlendModeAdd);
            return(from_frame);
        }
Ejemplo n.º 4
0
        public override Frame transition_frame(Frame from_frame, Frame to_frame)
        {
            Frame frame = from_frame.copy();
            int   dst_x = 0;
            int   dst_y = 0;

            double prog = this.progress;

            if (this.in_out == true)
            {
                prog = 1.0 - prog;
            }

            if (this.direction == SlideOverTransitionDirection.North)
            {
                dst_x = 0;
                dst_y = (int)(prog * frame.height);
            }
            else if (this.direction == SlideOverTransitionDirection.South)
            {
                dst_x = 0;
                dst_y = (int)(-prog * frame.height);
            }
            else if (this.direction == SlideOverTransitionDirection.East)
            {
                dst_x = (int)(-prog * frame.width);
                dst_y = 0;
            }
            else if (this.direction == SlideOverTransitionDirection.West)
            {
                dst_x = (int)(prog * frame.width);
                dst_y = 0;
            }
            Frame.copy_rect(frame, dst_x, dst_y, to_frame, 0, 0, from_frame.width, from_frame.height, DMDBlendMode.DMDBlendModeCopy);
            return(frame);
        }