VirtualBox

Ignore:
Timestamp:
Oct 10, 2023 6:12:40 PM (14 months ago)
Author:
vboxsync
Message:

ValKit: Simple algorithm for basic screenshot validation of a Windows VM (pylint fix)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r101406 r101407  
    54985498        cDesktopPixels = 0
    54995499        cDesktopPixelsBlue = 0
    5500         threshold = 20
     5500        iThreshold = 20
    55015501        for i in range(0, cPixels, 4) :
    5502             r = aRGBData[i]
    5503             g = aRGBData[i + 1]
    5504             b = aRGBData[i + 2]
    5505             v = (3 * r + 6 * g + b) / 10
    5506             if v > threshold and v < (255 - threshold) :
     5502            iRed = aRGBData[i]
     5503            iGreen = aRGBData[i + 1]
     5504            iBlue = aRGBData[i + 2]
     5505            iBright = (3 * iRed + 6 * iGreen + iBlue) / 10
     5506            if iThreshold < iBright < 255 - iThreshold :
    55075507                cDesktopPixels += 1;
    5508                 cDesktopPixelsBlue += int(b > g and b > r);
     5508                cDesktopPixelsBlue += int(iBlue > iRed and iBlue > iGreen);
    55095509
    55105510        fpRatioDesktop = cDesktopPixels / cPixels;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette