diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 226aad9..b090751 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,10 +1,10 @@ -## Version 3.0.0 (release date TBD) +## Version 3.0.0 (released 26 April 2025) - drop support for Python 2.7, require Python >= 3.7 [kleisauke] - migrate to `pyproject.toml` [kleisauke] - fix a small memleak in `write_to_buffer()` [kleisauke] - add `[binary]` install option [kleisauke] -- add `shutdown()` +- add `shutdown()` [jcupitt] ## Version 2.2.3 (released 28 April 2024) diff --git a/README.rst b/README.rst index ab5b3d1..6888d2a 100644 --- a/README.rst +++ b/README.rst @@ -195,7 +195,6 @@ Local user install: .. code-block:: shell $ pip install -e .[binary] - $ pypy -m pip --user -e . Run all tests: diff --git a/doc/vimage.rst b/doc/vimage.rst index 3806112..a412a2c 100644 --- a/doc/vimage.rst +++ b/doc/vimage.rst @@ -274,6 +274,7 @@ Autogenerated methods ~matrixinvert ~matrixload ~matrixload_source + ~matrixmultiply ~matrixprint ~matrixsave ~matrixsave_target @@ -2058,12 +2059,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) Save as gif. Example: - in.gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int, profile=str) + in.gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str @@ -2081,6 +2082,8 @@ Autogenerated methods :type interpalette_maxerror: float :param interlace: Generate an interlaced (progressive) GIF :type interlace: bool + :param keep_duplicate_frames: Keep duplicate frames in the output instead of combining them + :type keep_duplicate_frames: bool :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -2092,12 +2095,12 @@ Autogenerated methods :rtype: list[] :raises Error: - .. method:: gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) Save as gif. Example: - buffer = in.gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) :param dither: Amount of dithering :type dither: float @@ -2113,6 +2116,8 @@ Autogenerated methods :type interpalette_maxerror: float :param interlace: Generate an interlaced (progressive) GIF :type interlace: bool + :param keep_duplicate_frames: Keep duplicate frames in the output instead of combining them + :type keep_duplicate_frames: bool :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -2124,12 +2129,12 @@ Autogenerated methods :rtype: str :raises Error: - .. method:: gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) Save as gif. Example: - in.gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int, profile=str) + in.gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target @@ -2147,6 +2152,8 @@ Autogenerated methods :type interpalette_maxerror: float :param interlace: Generate an interlaced (progressive) GIF :type interlace: bool + :param keep_duplicate_frames: Keep duplicate frames in the output instead of combining them + :type keep_duplicate_frames: bool :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -2728,17 +2735,19 @@ Autogenerated methods :rtype: Image :raises Error: - .. staticmethod:: jp2kload(filename, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: jp2kload(filename, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load JPEG2000 image. Example: - out = pyvips.Image.jp2kload(filename, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.jp2kload(filename, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from :type filename: str :param page: Load this page from the image :type page: int + :param oneshot: Load images a frame at a time + :type oneshot: bool :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -2752,17 +2761,19 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: jp2kload_buffer(buffer, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: jp2kload_buffer(buffer, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load JPEG2000 image. Example: - out = pyvips.Image.jp2kload_buffer(buffer, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.jp2kload_buffer(buffer, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param buffer: Buffer to load from :type buffer: str :param page: Load this page from the image :type page: int + :param oneshot: Load images a frame at a time + :type oneshot: bool :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -2776,17 +2787,19 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: jp2kload_source(source, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: jp2kload_source(source, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load JPEG2000 image. Example: - out = pyvips.Image.jp2kload_source(source, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.jp2kload_source(source, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param source: Source to load from :type source: Source :param page: Load this page from the image :type page: int + :param oneshot: Load images a frame at a time + :type oneshot: bool :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -3874,7 +3887,7 @@ Autogenerated methods .. method:: matrixinvert() - Invert an matrix. + Invert a matrix. Example: out = in.matrixinvert() @@ -3926,6 +3939,18 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: + .. method:: matrixmultiply(right) + + Multiply two matrices. + + Example: + out = left.matrixmultiply(right) + + :param right: Second matrix to multiply + :type right: Image + :rtype: Image + :raises Error: + .. method:: matrixprint(keep=int, background=list[float], page_height=int, profile=str) Print matrix. @@ -5344,7 +5369,7 @@ Autogenerated methods .. method:: scRGB2sRGB(depth=int) - Convert an scRGB image to sRGB. + Convert scRGB to sRGB. Example: out = in.scRGB2sRGB(depth=int) @@ -5648,12 +5673,12 @@ Autogenerated methods :rtype: Image :raises Error: - .. staticmethod:: svgload(filename, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: svgload(filename, dpi=float, scale=float, unlimited=bool, stylesheet=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load SVG with rsvg. Example: - out = pyvips.Image.svgload(filename, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.svgload(filename, dpi=float, scale=float, unlimited=bool, stylesheet=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from :type filename: str @@ -5663,6 +5688,8 @@ Autogenerated methods :type scale: float :param unlimited: Allow SVG of any size :type unlimited: bool + :param stylesheet: Custom CSS + :type stylesheet: str :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -5676,12 +5703,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, stylesheet=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load SVG with rsvg. Example: - out = pyvips.Image.svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, stylesheet=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param buffer: Buffer to load from :type buffer: str @@ -5691,6 +5718,8 @@ Autogenerated methods :type scale: float :param unlimited: Allow SVG of any size :type unlimited: bool + :param stylesheet: Custom CSS + :type stylesheet: str :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -5704,12 +5733,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: svgload_source(source, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: svgload_source(source, dpi=float, scale=float, unlimited=bool, stylesheet=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load svg from source. Example: - out = pyvips.Image.svgload_source(source, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.svgload_source(source, dpi=float, scale=float, unlimited=bool, stylesheet=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param source: Source to load from :type source: Source @@ -5719,6 +5748,8 @@ Autogenerated methods :type scale: float :param unlimited: Allow SVG of any size :type unlimited: bool + :param stylesheet: Custom CSS + :type stylesheet: str :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -5930,23 +5961,25 @@ Autogenerated methods :rtype: Image :raises Error: - .. staticmethod:: tiffload(filename, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: tiffload(filename, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load tiff from file. Example: - out = pyvips.Image.tiffload(filename, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.tiffload(filename, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from :type filename: str :param page: First page to load :type page: int - :param subifd: Subifd index - :type subifd: int :param n: Number of pages to load, -1 for all :type n: int :param autorotate: Rotate image using orientation tag :type autorotate: bool + :param subifd: Subifd index + :type subifd: int + :param unlimited: Remove all denial of service limits + :type unlimited: bool :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -5960,23 +5993,25 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: tiffload_buffer(buffer, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: tiffload_buffer(buffer, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load tiff from buffer. Example: - out = pyvips.Image.tiffload_buffer(buffer, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.tiffload_buffer(buffer, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param buffer: Buffer to load from :type buffer: str :param page: First page to load :type page: int - :param subifd: Subifd index - :type subifd: int :param n: Number of pages to load, -1 for all :type n: int :param autorotate: Rotate image using orientation tag :type autorotate: bool + :param subifd: Subifd index + :type subifd: int + :param unlimited: Remove all denial of service limits + :type unlimited: bool :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -5990,23 +6025,25 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: tiffload_source(source, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: tiffload_source(source, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load tiff from source. Example: - out = pyvips.Image.tiffload_source(source, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.tiffload_source(source, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param source: Source to load from :type source: Source :param page: First page to load :type page: int - :param subifd: Subifd index - :type subifd: int :param n: Number of pages to load, -1 for all :type n: int :param autorotate: Rotate image using orientation tag :type autorotate: bool + :param subifd: Subifd index + :type subifd: int + :param unlimited: Remove all denial of service limits + :type unlimited: bool :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file diff --git a/examples/gen-enums.py b/examples/gen-enums.py index ec2d9fb..a778aae 100755 --- a/examples/gen-enums.py +++ b/examples/gen-enums.py @@ -37,6 +37,59 @@ def remove_prefix(enum_str): return enum_str +def rewrite_references(string): + """Rewrite a gi-docgen references to RST style. + + gi-docgen references look like this: + + [func@version] + [class@Image] + [func@Image.bandjoin] + [meth@Image.add] + [ctor@Image.new_from_file] + [enum@SdfShape] + [enum@Vips.SdfShape.CIRCLE] + + we look for the approximate patterns and rewrite in RST style, so: + + :meth:`.version` + :class:`.Image` + :meth:`.Image.bandjoin` + :meth:`.Image.new_from_file` + :class:`.enums.SdfShape` + :class:`.enums.SdfShape.CIRCLE` + """ + + import re + while True: + match = re.search(r"\[(.*?)@(.*?)\]", string) + if not match: + break + + before = string[0:match.span(0)[0]] + type = match[1] + target = match[2] + after = string[match.span(0)[1]:] + + if type in ["ctor", "meth", "method", "func"]: + python_type = "meth" + elif type in ["class", "enum", "flags"]: + python_type = "class" + else: + raise Exception(f'type "{type}" is unknown') + + match = re.match("Vips.(.*)", target) + if match: + target = match[1] + + if type == "enum": + target = f"enums.{target}" + + string = f"{before}:{python_type}:`.{target}`{after}" + + return string + + def generate_enums(): all_nicknames = [] @@ -70,7 +123,7 @@ def add_nickname(gtype, a, b): print(f' """{python_name}.') if enum_doc is not None: print('') - print(f'{enum_doc.text}') + print(f'{rewrite_references(enum_doc.text)}') print('') print('Attributes:') print('') @@ -79,7 +132,7 @@ def add_nickname(gtype, a, b): member = node.find(f"goi:member[@name='{python_name}']", namespace) member_doc = member.find("goi:doc", namespace) if member_doc is not None: - text = member_doc.text + text = rewrite_references(member_doc.text) print(f' {python_name.upper()} (str): {text}') print('') print(' """') @@ -123,7 +176,7 @@ def add_nickname(gtype, a, b): print(f' """{python_name}.') if enum_doc is not None: print('') - print(f'{enum_doc.text}') + print(f'{rewrite_references(enum_doc.text)}') print('') print('Attributes:') print('') @@ -133,7 +186,8 @@ def add_nickname(gtype, a, b): member_doc = member.find("goi:doc", namespace) if member_doc is not None: text = member_doc.text - print(f' {python_name.upper()} (int): {text}') + print(f' {python_name.upper()} (int): ' + f'{rewrite_references(text)}') print('') print(' """') print('') diff --git a/pyvips/enums.py b/pyvips/enums.py index 1f125a8..6ce2792 100644 --- a/pyvips/enums.py +++ b/pyvips/enums.py @@ -8,7 +8,7 @@ class BandFormat(object): The format used for each band element. Each corresponds to a native C type for the current machine. For example, -#VIPS_FORMAT_USHORT is unsigned short. +:class:`.enums.BandFormat.USHORT` is `unsigned short`. Attributes: @@ -52,7 +52,7 @@ class BandFormat(object): class BlendMode(object): """BlendMode. -The various Porter-Duff and PDF blend modes. See vips_composite(), +The various Porter-Duff and PDF blend modes. See :meth:`.Image.composite`, for example. The Cairo docs have a nice explanation of all the blend modes: @@ -174,7 +174,7 @@ class Interpretation(object): """Interpretation. How the values in an image should be interpreted. For example, a -three-band float image of type #VIPS_INTERPRETATION_LAB should have its +three-band float image of type @VIPS_INTERPRETATION_LAB should have its pixels interpreted as coordinates in CIE Lab space. RGB and sRGB are treated in the same way. Use the colourspace functions if @@ -197,7 +197,7 @@ class Interpretation(object): CMYK (str): the first four bands are in CMYK space - LABQ (str): implies #VIPS_CODING_LABQ + LABQ (str): implies @VIPS_CODING_LABQ RGB (str): generic RGB space @@ -250,34 +250,35 @@ class Interpretation(object): class DemandStyle(object): """DemandStyle. -See vips_image_pipelinev(). Operations can hint +See :meth:`.Image.pipelinev`. Operations can hint the kind of demand geometry they prefer to the VIPS image IO system. These demand styles are given below in order of increasing specialisation. When demanding output from a pipeline, -vips_image_generate() +:meth:`.Image.generate` will use the most general style requested by the operations in the pipeline. -#VIPS_DEMAND_STYLE_SMALLTILE --- This is the most general demand format. +@VIPS_DEMAND_STYLE_SMALLTILE -- This is the most general demand format. Output is demanded in small (around 100x100 pel) sections. This style works reasonably efficiently, even for bizarre operations like 45 degree rotate. -#VIPS_DEMAND_STYLE_FATSTRIP --- This operation would like to output strips +@VIPS_DEMAND_STYLE_FATSTRIP -- This operation would like to output strips the width of the image and as high as possible. This option is suitable for area operations which do not violently transform coordinates, such -as vips_conv(). +as :meth:`.Image.conv`. -#VIPS_DEMAND_STYLE_THINSTRIP --- This operation would like to output strips +@VIPS_DEMAND_STYLE_THINSTRIP -- This operation would like to output strips the width of the image and a few pels high. This option is suitable for point-to-point operations, such as those in the arithmetic package. -#VIPS_DEMAND_STYLE_ANY --- This image is not being demand-read from a disc +@VIPS_DEMAND_STYLE_ANY -- This image is not being demand-read from a disc file (even indirectly) so any demand style is OK. It's used for things like -vips_black() where the pixels are calculated. +:meth:`.Image.black` where the pixels are calculated. -See also: vips_image_pipelinev(). +::: seealso + :meth:`.Image.pipelinev`. Attributes: @@ -503,7 +504,7 @@ class OperationComplexget(object): class Combine(object): """Combine. -How to combine values. See vips_compass(), for example. +How to combine values. See :meth:`.Image.compass`, for example. Attributes: @@ -523,8 +524,8 @@ class Combine(object): class Access(object): """Access. -The type of access an operation has to supply. See vips_tilecache() -and #VipsForeign. +The type of access an operation has to supply. See :meth:`.Image.tilecache` +and :class:`.Foreign`. @VIPS_ACCESS_RANDOM means requests can come in any order. @@ -547,7 +548,7 @@ class Access(object): class Extend(object): """Extend. -See vips_embed(), vips_conv(), vips_affine() and so on. +See :meth:`.Image.embed`, :meth:`.Image.conv`, :meth:`.Image.affine` and so on. When the edges of an image are extended, you can specify how you want the extension done. @@ -569,7 +570,8 @@ class Extend(object): We have to specify the exact value of each enum member since we have to keep these frozen for back compat with vips7. -See also: vips_embed(). +::: seealso + :meth:`.Image.embed`. Attributes: @@ -598,7 +600,7 @@ class Extend(object): class CompassDirection(object): """CompassDirection. -A direction on a compass. Used for vips_gravity(), for example. +A direction on a compass. Used for :meth:`.Image.gravity`, for example. Attributes: @@ -636,12 +638,13 @@ class CompassDirection(object): class Direction(object): """Direction. -See vips_flip(), vips_join() and so on. +See :meth:`.Image.flip`, :meth:`.Image.join` and so on. -Operations like vips_flip() need to be told whether to flip left-right or +Operations like :meth:`.Image.flip` need to be told whether to flip left-right or top-bottom. -See also: vips_flip(), vips_join(). +::: seealso + :meth:`.Image.flip`, :meth:`.Image.join`. Attributes: @@ -658,12 +661,13 @@ class Direction(object): class Align(object): """Align. -See vips_join() and so on. +See :meth:`.Image.join` and so on. -Operations like vips_join() need to be told whether to align images on the +Operations like :meth:`.Image.join` need to be told whether to align images on the low or high coordinate edge, or centre. -See also: vips_join(). +::: seealso + :meth:`.Image.join`. Attributes: @@ -684,14 +688,15 @@ class Interesting(object): """Interesting. Pick the algorithm vips uses to decide image "interestingness". This is used -by vips_smartcrop(), for example, to decide what parts of the image to +by :meth:`.Image.smartcrop`, for example, to decide what parts of the image to keep. #VIPS_INTERESTING_NONE and #VIPS_INTERESTING_LOW mean the same -- the crop is positioned at the top or left. #VIPS_INTERESTING_HIGH positions at the bottom or right. -See also: vips_smartcrop(). +::: seealso + :meth:`.Image.smartcrop`. Attributes: @@ -723,11 +728,12 @@ class Interesting(object): class Angle(object): """Angle. -See vips_rot() and so on. +See :meth:`.Image.rot` and so on. Fixed rotate angles. -See also: vips_rot(). +::: seealso + :meth:`.Image.rot`. Attributes: @@ -750,11 +756,12 @@ class Angle(object): class Angle45(object): """Angle45. -See vips_rot45() and so on. +See :meth:`.Image.rot45` and so on. Fixed rotate angles. -See also: vips_rot45(). +::: seealso + :meth:`.Image.rot45`. Attributes: @@ -809,10 +816,11 @@ class Precision(object): class TextWrap(object): """TextWrap. -Sets the word wrapping style for vips_text() when used with a maximum +Sets the word wrapping style for :meth:`.Image.text` when used with a maximum width. -See also: vips_text(). +::: seealso + :meth:`.Image.text`. Attributes: @@ -837,7 +845,8 @@ class SdfShape(object): The SDF to generate, -See also: vips_sdf(). +::: seealso + :meth:`.Image.sdf`. Attributes: @@ -1245,12 +1254,15 @@ class Intent(object): ABSOLUTE (str): absolute colorimetric rendering intent + AUTO (str): the rendering intent that the profile suggests + """ PERCEPTUAL = 'perceptual' RELATIVE = 'relative' SATURATION = 'saturation' ABSOLUTE = 'absolute' + AUTO = 'auto' class Kernel(object): @@ -1272,6 +1284,10 @@ class Kernel(object): LANCZOS3 (str): Convolve with a three-lobe Lanczos kernel. + MKS2013 (str): Convolve with Magic Kernel Sharp 2013. + + MKS2021 (str): Convolve with Magic Kernel Sharp 2021. + """ NEAREST = 'nearest' @@ -1280,13 +1296,15 @@ class Kernel(object): MITCHELL = 'mitchell' LANCZOS2 = 'lanczos2' LANCZOS3 = 'lanczos3' + MKS2013 = 'mks2013' + MKS2021 = 'mks2021' class PCS(object): """PCS. -Pick a Profile Connection Space for vips_icc_import() and -vips_icc_export(). LAB is usually best, XYZ can be more convenient in some +Pick a Profile Connection Space for :meth:`.Image.icc_import` and +:meth:`.Image.icc_export`. LAB is usually best, XYZ can be more convenient in some cases. Attributes: @@ -1323,12 +1341,13 @@ class OperationMorphology(object): class CombineMode(object): """CombineMode. -See vips_draw_image() and so on. +See :meth:`.Image.draw_image` and so on. -Operations like vips_draw_image() need to be told how to combine images +Operations like :meth:`.Image.draw_image` need to be told how to combine images from two sources. -See also: vips_join(). +::: seealso + :meth:`.Image.join`. Attributes: