Classes | |
| class | TurboJPEGSingleton |
Functions | |
| tuple[int, int]|None | find_supported_scaling_factor (int current_width, int current_height, int target_width, int target_height) |
| bytes | scale_jpeg_camera_image (Image cam_image, int width, int height) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| int | JPEG_QUALITY = 75 |
| list | SUPPORTED_SCALING_FACTORS = [(7, 8), (3, 4), (5, 8), (1, 2), (3, 8), (1, 4), (1, 8)] |
Image processing for cameras.
| tuple[int, int] | None homeassistant.components.camera.img_util.find_supported_scaling_factor | ( | int | current_width, |
| int | current_height, | ||
| int | target_width, | ||
| int | target_height | ||
| ) |
Find a supported scaling factor to scale the image. If there is no exact match, we use one size up to ensure the image remains crisp.
Definition at line 27 of file img_util.py.
| bytes homeassistant.components.camera.img_util.scale_jpeg_camera_image | ( | Image | cam_image, |
| int | width, | ||
| int | height | ||
| ) |
Scale a camera image. Scale as close as possible to one of the supported scaling factors.
Definition at line 48 of file img_util.py.
|
private |
Definition at line 22 of file img_util.py.
| int homeassistant.components.camera.img_util.JPEG_QUALITY = 75 |
Definition at line 24 of file img_util.py.
| list homeassistant.components.camera.img_util.SUPPORTED_SCALING_FACTORS = [(7, 8), (3, 4), (5, 8), (1, 2), (3, 8), (1, 4), (1, 8)] |
Definition at line 20 of file img_util.py.