class documentation
class SizeRequirements: (source)
A set of requirements for the size of an input image.
| Method | __post |
Undocumented |
| Method | check |
Returns whether the given width and height satisfy the size requirements. |
| Method | get |
Given an image size, this returns the minimum amount of padding necessary to satisfy the size requirements. The returned padding is in the format (pad_width, pad_height) and is guaranteed to be non-negative. |
| Class Variable | multiple |
The width and height of the image must be a multiple of this value. |
| Class Variable | square |
The image must be square. |
| Instance Variable | minimum |
The minimum size of the input image in pixels. |
| Property | none |
Returns True if no size requirements are specified. |
Given an image size, this returns the minimum amount of padding necessary to satisfy the size requirements. The returned padding is in the format (pad_width, pad_height) and is guaranteed to be non-negative.
The width and height of the image must be a multiple of this value.
multiple_of is guaranteed to be >= 1.
Default/neutral value: 1
The minimum size of the input image in pixels.
minimum is guaranteed to be a multiple of multiple_of and to be >= 0.
On initialization, if minimum is not a multiple of multiple_of, it will be rounded up to the next multiple of multiple_of.
Default/neutral value: 0