1 //
2 // Copyright (c) 2010-2021 Antmicro
3 // Copyright (c) 2011-2015 Realtime Embedded
4 // Copyright (c) 2020-2021 Microsoft
5 //
6 // This file is licensed under the MIT License.
7 // Full license text is available in 'licenses/MIT.txt'.
8 //
9 namespace Antmicro.Renode.Backends.Display
10 {
11     public interface IPixelConverter
12     {
13         /// <summary>
14         /// Converts pixels stored in <paramref name="inBuffer"/> and having the <see cref="Input"/> format, into pixels having the <see cref="Output"/> format, and stores the result in <paramref name="outBuffer"/>.
15         /// </summary>
16         /// <param name="inBuffer">input buffer</param>
17         /// <param name="clutBuffer">buffer containing the LUT for each input pixel. Used if Input uses indexed colors (L mode)</param>
18         /// <param name="alpha">fixed alpha value</param>
19         /// <param name="alphaReplaceMode">controls how <paramref name="alpha"/> gets used to compute the alpha of output pixels</param>
20         /// <param name="outBuffer">output buffer</param>
Convert(byte[] inBuffer, byte[] clutBuffer, byte alpha, PixelBlendingMode alphaReplaceMode, ref byte[] outBuffer)21         void Convert(byte[] inBuffer, byte[] clutBuffer, byte alpha, PixelBlendingMode alphaReplaceMode, ref byte[] outBuffer);
22 
23         /// <summary>
24         /// Converts pixels stored in <paramref name="inBuffer"/> and having the <see cref="Input"/> format, into pixels having the <see cref="Output"/> format, and stores the result in <paramref name="outBuffer"/>.
25         /// </summary>
26         /// <param name="inBuffer">input buffer</param>
27         /// <param name="outBuffer">output buffer</param>
Convert(byte[] inBuffer, ref byte[] outBuffer)28         void Convert(byte[] inBuffer, ref byte[] outBuffer);
29 
30         /// <summary>
31         /// Pixel format of the conversion input
32         /// </summary>
33         PixelFormat Input { get; }
34 
35         /// <summary>
36         /// Pixel format of the conversion output
37         /// </summary>
38         PixelFormat Output { get; }
39     }
40 }
41 
42