-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: #11145
- Loading branch information
Showing
15 changed files
with
300 additions
and
59 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from _typeshed import Incomplete | ||
from dataclasses import dataclass | ||
from typing import Any | ||
from typing_extensions import Literal, TypeAlias | ||
|
||
from fpdf.enums import Align | ||
from fpdf.fpdf import FPDF | ||
|
||
from .image_parsing import _ImageFilter | ||
|
||
_AlignLiteral: TypeAlias = Literal[ | ||
"", | ||
"CENTER", | ||
"X_CENTER", | ||
"LEFT", | ||
"RIGHT", | ||
"JUSTIFY", | ||
"center", | ||
"x_center", | ||
"left", | ||
"right", | ||
"justify", | ||
"C", | ||
"X", | ||
"L", | ||
"R", | ||
"J", | ||
"c", | ||
"x", | ||
"l", | ||
"r", | ||
"j", | ||
] | ||
|
||
class ImageInfo(dict[str, Any]): | ||
@property | ||
def width(self) -> int: ... | ||
@property | ||
def height(self) -> int: ... | ||
@property | ||
def rendered_width(self) -> int: ... | ||
@property | ||
def rendered_height(self) -> int: ... | ||
def scale_inside_box(self, x: float, y: float, w: float, h: float) -> tuple[float, float, float, float]: ... | ||
@staticmethod | ||
def x_by_align(x: Align | _AlignLiteral, w: float, pdf: FPDF, keep_aspect_ratio: Literal[False]) -> float: ... | ||
|
||
class RasterImageInfo(ImageInfo): | ||
def size_in_document_units(self, w: float, h: float, scale=1) -> tuple[float, float]: ... | ||
|
||
class VectorImageInfo(ImageInfo): ... | ||
|
||
@dataclass | ||
class ImageCache: | ||
images: dict[str, dict[Incomplete, Incomplete]] = ... | ||
icc_profiles: dict[bytes, int] = ... | ||
image_filter: _ImageFilter = "AUTO" | ||
|
||
def reset_usages(self) -> None: ... |
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
Oops, something went wrong.