diff --git a/documentation/reference/MODULES.md b/documentation/reference/MODULES.md deleted file mode 100644 index 48de098..0000000 --- a/documentation/reference/MODULES.md +++ /dev/null @@ -1,8 +0,0 @@ -# Pylsr Modules - -> Auto-generated documentation modules index. - -Full list of [Pylsr](README.md#pylsr-index) project modules. - -- [Pylsr Index](README.md#pylsr-index) -- [Pylsr](pylsr/index.md#pylsr) diff --git a/documentation/reference/README.md b/documentation/reference/README.md index 48de098..fa4f79d 100644 --- a/documentation/reference/README.md +++ b/documentation/reference/README.md @@ -1,8 +1,7 @@ -# Pylsr Modules +# Pylsr Index -> Auto-generated documentation modules index. +> Auto-generated documentation index. -Full list of [Pylsr](README.md#pylsr-index) project modules. +A full list of `Pylsr` project modules. -- [Pylsr Index](README.md#pylsr-index) - [Pylsr](pylsr/index.md#pylsr) diff --git a/documentation/reference/pylsr/index.md b/documentation/reference/pylsr/index.md index 9102641..2e8d96c 100644 --- a/documentation/reference/pylsr/index.md +++ b/documentation/reference/pylsr/index.md @@ -1,73 +1,80 @@ # Pylsr +[Pylsr Index](../README.md#pylsr-index) / +Pylsr + > Auto-generated documentation for [pylsr](../../../pylsr/__init__.py) module. -Read an LSR image. - -- [Pylsr](../README.md#pylsr-index) / [Modules](../MODULES.md#pylsr-modules) / Pylsr - - [LSRImage](#lsrimage) - - [LSRImage().flatten](#lsrimageflatten) - - [LSRImageData](#lsrimagedata) - - [LSRImageData().scaledImage](#lsrimagedatascaledimage) - - [LSRLayer](#lsrlayer) - - [LSRLayer().flatten](#lsrlayerflatten) - - [LSRLayer().offsets](#lsrlayeroffsets) - - [flattenAll](#flattenall) - - [flattenTwoLayers](#flattentwolayers) - - [rasterImageOffset](#rasterimageoffset) - - [read](#read) - - [renderImageOffset](#renderimageoffset) - - [write](#write) +- [Pylsr](#pylsr) + - [LSRImage](#lsrimage) + - [LSRImage().flatten](#lsrimage()flatten) + - [LSRImageData](#lsrimagedata) + - [LSRImageData().scaledImage](#lsrimagedata()scaledimage) + - [LSRLayer](#lsrlayer) + - [LSRLayer().flatten](#lsrlayer()flatten) + - [LSRLayer().offsets](#lsrlayer()offsets) + - [flattenAll](#flattenall) + - [flattenTwoLayers](#flattentwolayers) + - [rasterImageOffset](#rasterimageoffset) + - [read](#read) + - [renderImageOffset](#renderimageoffset) + - [write](#write) ## LSRImage -[[find in source code]](../../../pylsr/__init__.py#L15) +[Show source in __init__.py:15](../../../pylsr/__init__.py#L15) + +LSRImage contains data on the overall size, the layers and the name of the lsr image. + +#### Signature ```python -class LSRImage(): +class LSRImage: def __init__( - size: tuple[int, int], - name: str, - layers: list[LSRLayer] | None = None, + self, size: tuple[int, int], name: str, layers: list[LSRLayer] | None = None ): + ... ``` -LSRImage contains data on the overall size, the layers and the name of the lsr image. - ### LSRImage().flatten -[[find in source code]](../../../pylsr/__init__.py#L23) +[Show source in __init__.py:23](../../../pylsr/__init__.py#L23) + +Flatten all of the layers. + +#### Signature ```python -def flatten() -> Image.Image: +def flatten(self) -> Image.Image: + ... ``` -Flatten all of the layers. + ## LSRImageData -[[find in source code]](../../../pylsr/__init__.py#L58) +[Show source in __init__.py:58](../../../pylsr/__init__.py#L58) + +LSRImageData stores the PIL Image along with the name, scale of the image and the idiom. + +#### Signature ```python -class LSRImageData(): +class LSRImageData: def __init__( + self, image: Image.Image, name: str, - scale: str = '1x', - idiom: str = 'universal', + scale: str = "1x", + idiom: str = "universal", offsets: tuple[int, int] = (0, 0), ): + ... ``` -LSRImageData stores the PIL Image along with the name, scale of the image and the idiom. - ### LSRImageData().scaledImage -[[find in source code]](../../../pylsr/__init__.py#L75) - -```python -def scaledImage(): -``` +[Show source in __init__.py:75](../../../pylsr/__init__.py#L75) Get the scaled image. @@ -75,62 +82,76 @@ Get the scaled image. - `Image.Image` - The image to scale +#### Signature + +```python +def scaledImage(self): + ... +``` + + + ## LSRLayer -[[find in source code]](../../../pylsr/__init__.py#L31) +[Show source in __init__.py:31](../../../pylsr/__init__.py#L31) + +LSRLayer contains data on the layer such as the list of images, the name, +the size and the centre offset. + +#### Signature ```python -class LSRLayer(): +class LSRLayer: def __init__( + self, images: list[LSRImageData], name: str, size: tuple[int, int], center: tuple[int, int], ): + ... ``` -LSRLayer contains data on the layer such as the list of images, the name, -the size and the centre offset. - #### See also - [LSRImageData](#lsrimagedata) ### LSRLayer().flatten -[[find in source code]](../../../pylsr/__init__.py#L53) - -```python -def flatten() -> Image.Image: -``` +[Show source in __init__.py:53](../../../pylsr/__init__.py#L53) Flatten all of the layers. -### LSRLayer().offsets - -[[find in source code]](../../../pylsr/__init__.py#L44) +#### Signature ```python -def offsets() -> tuple[int, int]: +def flatten(self) -> Image.Image: + ... ``` +### LSRLayer().offsets + +[Show source in __init__.py:44](../../../pylsr/__init__.py#L44) + Calculate the x, y offset for the top left corner. #### Returns - `tuple[int,` *int]* - tuple for x, y offset -## flattenAll - -[[find in source code]](../../../pylsr/__init__.py#L219) +#### Signature ```python -def flattenAll( - layers: list[LSRImageData], - imageDimensions: tuple[int, int], -) -> Image.Image: +def offsets(self) -> tuple[int, int]: + ... ``` + + +## flattenAll + +[Show source in __init__.py:219](../../../pylsr/__init__.py#L219) + Flatten a list of layers and groups. #### Arguments @@ -143,21 +164,24 @@ been flattened. Defaults to None. - `Image.Image` - Flattened image +#### Signature + +```python +def flattenAll( + layers: list[LSRImageData], imageDimensions: tuple[int, int] +) -> Image.Image: + ... +``` + #### See also - [LSRImageData](#lsrimagedata) -## flattenTwoLayers -[[find in source code]](../../../pylsr/__init__.py#L197) -```python -def flattenTwoLayers( - layer: LSRImageData, - imageDimensions: tuple[int, int], - flattenedSoFar: Image.Image | None = None, -) -> Image.Image: -``` +## flattenTwoLayers + +[Show source in __init__.py:197](../../../pylsr/__init__.py#L197) Flatten two layers of an image. @@ -172,36 +196,44 @@ flattened. Defaults to None. - `Image.Image` - Flattened image +#### Signature + +```python +def flattenTwoLayers( + layer: LSRImageData, + imageDimensions: tuple[int, int], + flattenedSoFar: Image.Image | None = None, +) -> Image.Image: + ... +``` + #### See also - [LSRImageData](#lsrimagedata) + + ## rasterImageOffset -[[find in source code]](../../../pylsr/__init__.py#L238) +[Show source in __init__.py:238](../../../pylsr/__init__.py#L238) + +Render an image with offset to a given size. (deprecated, use renderImageOffset) + +#### Signature ```python -@deprecated( - deprecated_in='2022', - removed_in='2023', - details='Use renderImageOffset', -) +@deprecated(deprecated_in="2022", removed_in="2023", details="Use renderImageOffset") def rasterImageOffset( - image: Image.Image, - size: tuple[int, int], - offsets: tuple[int, int] = (0, 0), + image: Image.Image, size: tuple[int, int], offsets: tuple[int, int] = (0, 0) ) -> Image.Image: + ... ``` -Render an image with offset to a given size. (deprecated, use renderImageOffset) -## read -[[find in source code]](../../../pylsr/__init__.py#L85) +## read -```python -def read(filename: str) -> LSRImage: -``` +[Show source in __init__.py:85](../../../pylsr/__init__.py#L85) Read an lsr file. @@ -211,33 +243,41 @@ Read an lsr file. #### Returns -- `LSRImage` - An lsr image representation +- [LSRImage](#lsrimage) - An lsr image representation + +#### Signature + +```python +def read(filename: str) -> LSRImage: + ... +``` #### See also - [LSRImage](#lsrimage) + + ## renderImageOffset -[[find in source code]](../../../pylsr/__init__.py#L246) +[Show source in __init__.py:246](../../../pylsr/__init__.py#L246) + +Render an image with offset to a given size. + +#### Signature ```python def renderImageOffset( - image: Image.Image, - size: tuple[int, int], - offsets: tuple[int, int] = (0, 0), + image: Image.Image, size: tuple[int, int], offsets: tuple[int, int] = (0, 0) ) -> Image.Image: + ... ``` -Render an image with offset to a given size. + ## write -[[find in source code]](../../../pylsr/__init__.py#L139) - -```python -def write(filename: str, lsrImage: LSRImage): -``` +[Show source in __init__.py:139](../../../pylsr/__init__.py#L139) Write an lsr image to disk. @@ -246,6 +286,15 @@ Write an lsr image to disk. - `filename` *str* - filename and extension - `lsrImage` *LSRImage* - the lsr image representation to save +#### Signature + +```python +def write(filename: str, lsrImage: LSRImage): + ... +``` + #### See also - [LSRImage](#lsrimage) + +