Skip to content
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

Minor improvements across render styles #67

Merged
merged 9 commits into from Sep 6, 2022
Merged

Conversation

AnonymouX47
Copy link
Owner

@AnonymouX47 AnonymouX47 commented Aug 2, 2022

  • Improves kitty term BG color workaround
  • Improves alpha auto BG tests
  • Adds clear() method to each of KittyImage and Iterm2Image.
  • Adds render style metaclass .image.ImageMeta.
  • Adds ImageMeta.style property.
  • str(ImageClass) now returns the name of the render style [category].
  • Fixes render style force condition

- Add: Added tests for the workaround.
- Change: Moved `_is_on_kitty()` from `BlockImage` to `TextImage`.
- Change: Reduced function calls.
- Change: Only the red band is modified to reduced the amount of possible comparisons.
@AnonymouX47 AnonymouX47 added lib Related to the library (Not to be used anymore) improvement Implementation of improvement to an existing feature labels Aug 2, 2022
@AnonymouX47 AnonymouX47 added this to the 0.5.0 milestone Aug 2, 2022
- Change: Now explicitly testing multiple colors and `None` (no query response).
- Change: No longer terminal-dependent.
@AnonymouX47 AnonymouX47 added the test Related to the test suite label Aug 3, 2022
- Add: Added `_TERM` and `_TERM_VERSION` to `KittyImage`.
- Change: Removed `KittyImage._KONSOLE_VERSION` since it's unused.
- Change: Modified `KittyImage.is_supported()`.
  - Konsole is now always supported as long as it responds to the graphics query.
- Change: Improved buffer handling in `Iterm2Image._render_image()` and `.kitty.Transmission.get_chunks()`.
- Change: Cleaned up `KittyImage._render_image()`.
  - Removed `else` after an early return.
  - Removed unnecessary `dict` instantiation.
- Change: Refactored code for style attribute export and import in `.logging_multi.Process`.
- Add: Added a `clear()` method to each of `KittyImage` and `Iterm2Image`.
  - Added `.image.kitty.DELETE_CURSOR_IMAGES`.
  - Now, only styles that require image clearing have a method for such.
- Change: Removed all `_clear_images()` methods.
- Change: Updated the docstrings of `_clear_frame()` methods.
- Change: Updated affected aspects of the TUI.
- Add: Added render style metaclass `.image.ImageMeta`.
  - Changed the metaclass of `BaseImage`.
- Add: Added `ImageMeta.style` property.
- Add: Added tests for `ImageMeta.style` and str(ImageClass).
- Change: `str(ImageClass)` not returns the name of the render style [category].
- Change: Now using `ImageClass.style` instead of `.cli.args.style`.
- Change: `.cli.args.style` is no longer updated after parsing/processing CL args.
- Fix: The render style is no longer forced when `--style` is specified and the value is the same that of the "style" config option.
  - Now, the style is forced only when `--style` is not specified and "style" != "auto"... as specified in the docs.
Conflicts:
	src/term_image/cli.py
	src/term_image/tui/widgets.py
@AnonymouX47 AnonymouX47 added fix Fixes a bug cli Related to the image viewer's CLI (Not to be used anymore) config Related to the viewer configuration (Not to be used anymore) new New feature implementation labels Sep 6, 2022
@AnonymouX47 AnonymouX47 merged commit 5f452c5 into main Sep 6, 2022
@AnonymouX47 AnonymouX47 deleted the render-style-updates branch September 6, 2022 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the image viewer's CLI (Not to be used anymore) config Related to the viewer configuration (Not to be used anymore) fix Fixes a bug improvement Implementation of improvement to an existing feature lib Related to the library (Not to be used anymore) new New feature implementation test Related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant