aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-04 14:09:45 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-04 14:09:45 +0200
commit565e48de649d3d14e6b82012b6aa2e3819a3c82c (patch)
tree16e766f6bd45e62c48d6046a21841526aafaed73 /Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs
parentb0ccae10fa6025838195c42fa6c9dd72b4321579 (diff)
downloadTango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.tar.gz
Tango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.zip
Improved BitmapCliper.
Implemented auto throw when max differences reached. Implemented fallback TurboJpeg encoder. Fixed issue with UpdateMachine.xml script removing DISPENSERS before IDS_PACKS. Added GlobalHost.Configuration.MaxIncomingWebSocketMessageSize for WebSockets support for large messages on SignalR.
Diffstat (limited to 'Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs')
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs
index b1b186065..7aa6a07a0 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs
@@ -16,6 +16,12 @@ namespace Tango.RemoteDesktop.Comparers
public class RasterBitmapComparer : IBitmapComparer<RasterFrame>
{
/// <summary>
+ /// When max number of differences reached, the comparer will immediately return the current difference frame.
+ /// This should enforce the screen capture engine to report 'No Difference Available'.
+ /// </summary>
+ public long? MaxDifferencesThrow { get; set; }
+
+ /// <summary>
/// Creates the difference as <see cref="RasterFrame"/>.
/// </summary>
/// <param name="previousBitmap">The previous bitmap.</param>
@@ -94,6 +100,15 @@ namespace Tango.RemoteDesktop.Comparers
if (same != 4)
{
count++;
+
+ if (MaxDifferencesThrow != null && count > MaxDifferencesThrow.Value)
+ {
+ previousBitmap.UnlockBits(data1);
+ currentBitmap.UnlockBits(data2);
+ diffImage.UnlockBits(diffData);
+ diffImage.Dispose();
+ throw new MaxDifferencesReachedException();
+ }
}
}