- Regions
- Masks
- Any
This class handles defining, getting and removing such regions. It is used by class PagedImage, but it can also be used by other code to handle regions in other tables.
Another function performed by this class for PagedImage is the definition of the default region to be used with an image.
Define the possible group types (regions or masks).
Set the object pointer (for RegionHandlerTable's callback). Default implementation does nothing.
Can the class indeed define and handle regions? The default implementation returns False.
Set the default mask to the mask with the given name. It constructs a ImageRegion object for the new default mask. If the table is writable, the setting is persistent by writing the name as a keyword. If the given maskName is the empty string, the default mask is unset.
Get the name of the default mask. An empty string is returned if no default mask.
Define a region belonging to the table.
The group type determines if it stored as a region or mask.
If overwrite=False, an exception will be thrown if the region
already exists in the "regions" or "masks" keyword.
Otherwise the region will be removed first.
A False status is returned if the table is not writable
Does the table have a region with the given name?
Get a region belonging to the table.
A zero pointer is returned if the region does not exist.
The caller has to delete the ImageRegion object created.
No exception is thrown if the region does not exist.
Rename a region.
If a region with the new name already exists, it is deleted or
an exception is thrown (depending on overwrite).
The region name is looked up in the given group(s).
An exception is thrown if the old region name does not exist.
Remove a region belonging to the table.
Optionally an exception is thrown if the region does not exist.
A False status is returned if the table is not writable
Get the names of all regions/masks.
Make a unique region name from the given root name, thus make it such that the name is not already in use for a region or mask. The root name is returned if it is already unique. Otherwise a number is appended to the root name to make it unique. The number starts at the given number and is incremented until the name is unique.
Make a mask for a lattice (e.g. a PagedImage or TempImage). It creates it with the shape and tile shape of the lattice.