-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Common image class interface #34
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add: Added `.image` subpackage. - Change: Moved `.image` module to `.image.common`.
- Add: Added submodule `.image.term`. - Add: Redefined `TermImage` in `.image.term` as a subclass of `BaseImage`. - Change: Renamed `TermImage` to `BaseImage` in `.image.common`. - Change: Updated docs config.
- Change: Turned `BaseImage` into an abstract baseclass. - Change: Turned common render-style-dependent methods into abstract methods in `BaseImage`. - Change: Moved the implementation of some render-style-dependent methods into `TermImage`.
- Add: Added `BaseImage._get_render_data()`. - Change: Extracted the render-style-independent parts of `BaseImage._render_image()` into `BaseImage._get_render_data()`. - Change: Changed all typehint and docstring references to `PIL.Image.Image` to the fully-qualified name. - Change: Renamed references to PIL image instances from `image` -> `img`.
- Change: Moved render-style-dependent `_render_image()` from `BaseImage` into `TermInage`. - Change: Moved constants `_LOWER_PIXEL` and `_UPPER_PIXEL` from `.image.common` to `.image.term`.
- Add: Added `.image.common._close_validated()` method decorator for detection of finalized instances. - Add: Added `BaseImage._get_image()`. - Change: Cleaned up `n_frames` and `_renderer()` in `BaseImage`.
- Add: Added `BaseImage._pixel_ratio` property. - Change: "font ratio" now applies to only text-based render styles. - Change: `.set_font_ratio()` no longer sets the pixel ratio. - Change: Modified `BaseImage._valid_size()` to use class-specific pixel ratio. - Change: Updated docstrings.
- Add: Added `BaseImage._supported`. - Add: Added `BaseImage.is_supported()` abstract method. - Add: Added `TermImage.is_supported()`. - Add: Added a test for `.is_supported()`. - Change: Updated docstrings.
- Change: Modified `.image.common._close_validated()` to prevent re-decoration of methods. - If the given method is already close-validated, it is returned as is.
- Add: Added `.image.utils` submodule. - Change: Moved `_FG_FMT`, `_BG_FMT`, `_RESET` and `_color()` from `.image.common` into `.image.utils`.
- Add: Added the *size* parameter for alternative sizing. - Change: Updated docstring.
98be7f3
to
78ee082
Compare
- Add: Added tests/__init__.py to allow relative imports. - Add: Added tests/test_term.py. - Change: Moved tests/test_image.py -> tests/common.py.
- Change: The test module for each render style can now import from `tests.common` and run the tests successfully for its render style.
- Change: Image seek position is now initialized to the current seek position of the given PIL image. - Change: Updated the corresponding tests.
- Add: Added provision for variable-length lenght keyword arguments. - Intended to be used in subclasses for for style-specific parameters.
- Change Updated image format specification documentation. - Change: Updated library docstrings and comments.
- Add: Added `pytest-order` as a devolopment requirement. - Change: Marked `test.test_term.test_setup_common` to always run first.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation
enhancement
New feature / Improvement suggestion or request
lib
Related to the library (Not to be used anymore)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #30 in preparation for #23.
BaseImage
, the baseclass of all image classes.TermImage
a subclass ofBaseImage
.is_supported()
class method for render style support detection.draw()
method to allow for render-style-specific parameters.