Skip to content

Update some docs and fix lint issue #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ This program can be used to automatically start, split, and reset your preferred
## DOWNLOAD AND OPEN

- Download the [latest version](/../../releases/latest)
- You can also check out the [latest dev builds](/../../actions/workflows/lint-and-build.yml?query=event%3Apush+is%3Asuccess) (requires a GitHub account)
<!-- (If you don't have a GitHub account, you can try [nightly.link](https://nightly.link/Toufool/AutoSplit/workflows/lint-and-build/dev)) -->

### Compatibility

Expand Down Expand Up @@ -64,7 +66,7 @@ Refer to the [build instructions](build%20instructions.md) if you'd like to buil
- L2 Norm: This method should be fine to use for most cases. It finds the difference between each pixel, squares it, sums it over the entire image and takes the square root. This is very fast but is a problem if your image is high frequency. Any translational movement or rotation can cause similarity to be very different.
- Histograms: An explanation on Histograms comparison can be found [here](https://mpatacchiola.github.io/blog/2016/11/12/the-simplest-classifier-histogram-intersection.html). This is a great method to use if you are using several masked images.
> This algorithm is particular reliable when the colour is a strong predictor of the object identity. The histogram intersection [...] is robust to occluding objects in the foreground.
- Perceptual Hash: An explanation on pHash comparison can be found [here](http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html). It is highly recommended to NOT use pHash if you use masked images. It is very inaccurate.
- Perceptual Hash: An explanation on pHash comparison can be found [here](http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html). It is highly recommended to NOT use pHash if you use masked images, or it'll be very inaccurate.

#### Capture Method

Expand All @@ -82,12 +84,11 @@ Refer to the [build instructions](build%20instructions.md) if you'd like to buil
It can record OpenGL and Hardware Accelerated windows.
About 10-15x slower than BitBlt. Not affected by window size.
overlapping windows will show up and can't record across displays.
- **Force Full Content Rendering** (very slow, can affect rendering pipeline)
- **Force Full Content Rendering** (very slow, can affect rendering)
Uses BitBlt behind the scene, but passes a special flag to PrintWindow to force rendering the entire desktop.
About 10-15x slower than BitBlt based on original window size and can mess up some applications' rendering pipelines.
- **Video Capture Device**
Uses a Video Capture Device, like a webcam, virtual cam, or capture card.
There are currently performance issues, but it might be more convenient.
If you want to use this with OBS' Virtual Camera, use the [Virtualcam plugin](https://github.com/Avasam/obs-virtual-cam/releases) instead.

#### Capture Device
Expand Down Expand Up @@ -173,7 +174,7 @@ If this option is disabled, when the reset hotkey is hit, the reset button is pr

### How to Create a Masked Image

Masked images are very useful if only a certain part of the capture region is consistent (for example, consistent text on the screen, but the background is always different). Histogram or L2 norm comparison is recommended if you use any masked images. It is highly recommended that you do NOT use pHash comparison if you use any masked images, as it is very inaccurate.
Masked images are very useful if only a certain part of the capture region is consistent (for example, consistent text on the screen, but the background is always different). Histogram or L2 norm comparison is recommended if you use any masked images. It is highly recommended that you do NOT use pHash comparison if you use any masked images, or it'll be very inaccurate.

The best way to create a masked image is to set your capture region as the entire game screen, take a screenshot, and use a program like [paint.net](https://www.getpaint.net/) to "erase" (make transparent) everything you don't want the program to compare. More on creating images with transparency using paint.net can be found in [this tutorial](https://www.youtube.com/watch?v=v53kkUYFVn8). For visualization, here is what the capture region compared to a masked split image looks like if you would want to split on "Shine Get!" text in Super Mario Sunshine:

Expand Down Expand Up @@ -230,7 +231,8 @@ The AutoSplit LiveSplit Component will directly connect AutoSplit with LiveSplit
Still need help?

- [Open an issue](../../issues)
- Join the [AutoSplit Discord](https://discord.gg/Qcbxv9y)
- Join the [AutoSplit Discord
![AutoSplit Discord](https://badgen.net/discord/members/Qcbxv9y)](https://discord.gg/Qcbxv9y)

## Credits

Expand Down
2 changes: 1 addition & 1 deletion res/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ This is a great method to use if you are using several masked images.
Perceptual Hash:
An explanation on pHash comparison can be found here
http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
It is highly recommended to NOT use pHash if you use masked images. It is very inaccurate.</string>
It is highly recommended to NOT use pHash if you use masked images, or it'll be very inaccurate.</string>
</property>
<item>
<property name="text">
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ $arguments = @(
'--icon=res/icon.ico',
'--splash=res/splash.png')

Start-Process pyinstaller -Wait -ArgumentList "$arguments `"$PSScriptRoot/../src/AutoSplit.py`""
pyinstaller $arguments "$PSScriptRoot/../src/AutoSplit.py"
1 change: 1 addition & 0 deletions scripts/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ flake8-bugbear
flake8-class-attributes-order
flake8-comprehensions>=3.8 # flake8 v5 support
flake8-datetimez
flake8-noqa>=1.3.0 # flake8 v6 support
flake8-pyi>=22.11.0 # flake8 v6 support
flake8-simplify
pep8-naming
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ toml
# Build and compile resources
pyinstaller>=5.5 # Python 3.11 support
pyinstaller-hooks-contrib>=2022.9 # opencv-python 4.6 support. Changes for pywintypes and comtypes
PySide6>=6.4.0.1 # Python 3.11 support
PySide6-Essentials>=6.4.0.1 # Python 3.11 support
#
# https://peps.python.org/pep-0508/#environment-markers
#
Expand Down
9 changes: 7 additions & 2 deletions src/AutoSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,13 @@ def __init__(self, parent: QWidget | None = None): # pylint: disable=too-many-s
self.action_about_qt_for_python.triggered.connect(about_qt_for_python)
self.action_check_for_updates.triggered.connect(lambda: check_for_updates(self))
self.action_settings.triggered.connect(lambda: open_settings(self))
self.action_save_profile.triggered.connect(lambda: user_profile.save_settings(self))
self.action_save_profile_as.triggered.connect(lambda: user_profile.save_settings_as(self))
# PyQt6 typing is wrong
self.action_save_profile.triggered.connect(
lambda: user_profile.save_settings(self), # pyright: ignore[reportGeneralTypeIssues]
)
self.action_save_profile_as.triggered.connect(
lambda: user_profile.save_settings_as(self), # pyright: ignore[reportGeneralTypeIssues]
)
self.action_load_profile.triggered.connect(lambda: user_profile.load_settings(self))

# Shortcut context can't be set through the designer because of a bug in pyuic6 that generates invalid code
Expand Down
2 changes: 1 addition & 1 deletion src/capture_method/WindowsGraphicsCaptureMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def close(self, autosplit: AutoSplit):
# OSError: The application called an interface that was marshalled for a different thread
# This still seems to close the session and prevent the following hard crash in LiveSplit
# pylint: disable=line-too-long
# "AutoSplit.exe <process started at 00:05:37.020 has terminated with 0xc0000409 (EXCEPTION_STACK_BUFFER_OVERRUN)>" # noqa E501
# "AutoSplit.exe <process started at 00:05:37.020 has terminated with 0xc0000409 (EXCEPTION_STACK_BUFFER_OVERRUN)>" # noqa: E501
pass
self.session = None

Expand Down
6 changes: 3 additions & 3 deletions src/capture_method/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def get(self, __key: CaptureMethodEnum):
)
CAPTURE_METHODS[CaptureMethodEnum.PRINTWINDOW_RENDERFULLCONTENT] = CaptureMethodInfo(
name="Force Full Content Rendering",
short_description="very slow, can affect rendering pipeline",
short_description="very slow, can affect rendering",
description=(
"\nUses BitBlt behind the scene, but passes a special flag "
"\nto PrintWindow to force rendering the entire desktop. "
Expand All @@ -175,7 +175,6 @@ def get(self, __key: CaptureMethodEnum):
description=(
"\nUses a Video Capture Device, like a webcam, virtual cam, or capture card. "
"\nYou can select one below. "
"\nThere are currently performance issues, but it might be more convenient. "
"\nIf you want to use this with OBS' Virtual Camera, use the Virtualcam plugin instead "
"\nhttps://github.com/Avasam/obs-virtual-cam/releases"
),
Expand Down Expand Up @@ -212,7 +211,8 @@ def get_input_device_resolution(index: int):


async def get_all_video_capture_devices() -> list[CameraInfo]:
named_video_inputs = FilterGraph().get_input_devices()
# TODO: Fix partially Unknown list upstream
named_video_inputs: list[str] = FilterGraph().get_input_devices()

async def get_camera_info(index: int, device_name: str):
backend = ""
Expand Down
7 changes: 5 additions & 2 deletions src/menu_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from capture_method import (
CAPTURE_METHODS, CameraInfo, CaptureMethodEnum, change_capture_method, get_all_video_capture_devices,
)
from gen import about, design, resources_rc, settings as settings_ui, update_checker # noqa F401
from gen import about, design, resources_rc, settings as settings_ui, update_checker # noqa: F401
from hotkeys import HOTKEYS, Hotkey, set_hotkey
from utils import (
AUTOSPLIT_VERSION, FIRST_WIN_11_BUILD, GITHUB_REPOSITORY, WINDOWS_BUILD_NUMBER, decimal, fire_and_forget,
Expand Down Expand Up @@ -211,7 +211,10 @@ def __set_readme_link(self):
# HACK: This is a workaround because custom_image_settings_info_label
# simply will not open links with a left click no matter what we tried.
self.readme_link_button.clicked.connect(
lambda: webbrowser.open(f"https://github.com/{GITHUB_REPOSITORY}#readme"),
# PyQt6 typing is wrong
lambda: webbrowser.open( # pyright: ignore[reportGeneralTypeIssues]
f"https://github.com/{GITHUB_REPOSITORY}#readme",
),
)
self.readme_link_button.setStyleSheet("border: 0px; background-color:rgba(0,0,0,0%);")

Expand Down
2 changes: 1 addition & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ def title(self):

# Shared strings
# Check `excludeBuildNumber` during workflow dispatch build generate a clean version number
AUTOSPLIT_VERSION = "2.0.0-beta.1" + (f"-{AUTOSPLIT_BUILD_NUMBER}" if AUTOSPLIT_BUILD_NUMBER else "")
AUTOSPLIT_VERSION = "2.0.0-beta.3" + (f"-{AUTOSPLIT_BUILD_NUMBER}" if AUTOSPLIT_BUILD_NUMBER else "")
GITHUB_REPOSITORY = AUTOSPLIT_GITHUB_REPOSITORY
Loading