Skip to content

Remove internal DemandStyle enum #540

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

Merged
merged 1 commit into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/gen-enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def add_nickname(gtype, a, b):

type_map(type_from_name('GEnum'), add_nickname)

# Filter internal enums
blacklist = ['VipsDemandStyle']
all_nicknames = [name for name in all_nicknames if name not in blacklist]

for name in all_nicknames:
gtype = type_from_name(name)
python_name = remove_prefix(name)
Expand Down
52 changes: 0 additions & 52 deletions pyvips/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,58 +246,6 @@ class Interpretation(object):
HSV = 'hsv'


class DemandStyle(object):
"""DemandStyle.

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,
:meth:`.Image.generate`
will use the most general style requested by the operations
in the pipeline.

:class:`.enums.DemandStyle.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.

:class:`.enums.DemandStyle.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 :meth:`.Image.conv`.

:class:`.enums.DemandStyle.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.

:class:`.enums.DemandStyle.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
:meth:`.Image.black` where the pixels are calculated.

::: seealso
:meth:`.Image.pipelinev`.

Attributes:

SMALLTILE (str): demand in small (typically 128x128 pixel) tiles

FATSTRIP (str): demand in fat (typically 16 pixel high) strips

THINSTRIP (str): demand in thin (typically 1 pixel high) strips

ANY (str): demand geometry does not matter

"""

ERROR = 'error'
SMALLTILE = 'smalltile'
FATSTRIP = 'fatstrip'
THINSTRIP = 'thinstrip'
ANY = 'any'


class OperationRelational(object):
"""OperationRelational.

Expand Down