aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.RemoteDesktop/IFrame.cs
blob: 1bdfd7650a5193bc290d8f827d8c6d46e32cc130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace Tango.RemoteDesktop
{
    /// <summary>
    /// Represents an image frame.
    /// </summary>
    /// <seealso cref="System.IDisposable" />
    public interface IFrame : IDisposable
    {
        /// <summary>
        /// Gets the frame width.
        /// </summary>
        int Width { get; }

        /// <summary>
        /// Gets the frame height.
        /// </summary>
        int Height { get; }

        /// <summary>
        /// Returns a GDI bitmap representing the frame.
        /// </summary>
        /// <returns></returns>
        Bitmap ToBitmap();

        /// <summary>
        /// Returns a WPF BitmapSource representing the frame.
        /// </summary>
        /// <returns></returns>
        BitmapSource ToBitmapSource();

        /// <summary>
        /// Applies this frame onto an existing bitmap.
        /// </summary>
        /// <param name="bitmap">The bitmap.</param>
        void Apply(Bitmap bitmap);

        /// <summary>
        /// Returns an instance of <see cref="IFrameEncoder"/> ready to encode this frame.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T ToEncoder<T>() where T : IFrameEncoder;
    }
}