Image.downscale Method¶
Module: Image
Definition¶
Downscales the image in-place so that its maximum dimension is equal to the given maximum size, while preserving the aspect ratio.
Note
If the maximum dimension is already smaller than the given maximum size, the function does nothing and the scaling ration returned is 1.
downscale(self, max_size: int) -> float
Parameters
max_sizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
floatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Face Library execution.
double downscale(int maxSize)
Parameters
maxSizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
doubleThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Face Library execution.
public float Downscale(int maxSize)
Parameters
maxSizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
floatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Face Library execution.
public float downscale(int maxSize) throws FaceException
Parameters
maxSizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
floatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Face Library execution.
public func downscale(maxSize: Int32) throws -> Float
Parameters
maxSizeInt32in Maximum image size, in pixels. The value must be greater than 0.
Returns
FloatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Face Library execution.
int id3FaceImage_Downscale (
ID3_FACE_IMAGE hImage,
int maxSize,
float * scaleRatio)
Parameters
hImageID3_FACE_IMAGEin Handle to the Image object.maxSizeintin Maximum image size, in pixels. The value must be greater than 0.scaleRatiofloat *out The scaling ratio applied to the image. Range is ]0:1].
Returns