Class ImageResizeOptions
At the moment only ratio-preserving resizing is supported.
-
Constructor Summary
ConstructorsConstructorDescriptionImageResizeOptions(ImageChannelConfiguration channelConfiguration, int targetWidth, int targetHeight) Creates image resize options.ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int minWidth, int minHeight, int maxWidth, int maxHeight) Creates image resize options.ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int minWidth, int minHeight, int maxWidth, int maxHeight, int widthMultiple, int heightMultiple, PaddingStrategy paddingStrategy) Creates image resize options.ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int minWidth, int minHeight, int maxWidth, int maxHeight, PaddingStrategy paddingStrategy) Creates image resize options.ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int targetWidth, int targetHeight, PaddingStrategy paddingStrategy) Creates image resize options. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the image channel configuration, that will be used when passing the image to the ML model.intReturns the height multiple.intReturns the maximum height the image should be after resizing.intReturns the maximum width the image should be after resizing.intReturns the minimum height the image should be after resizing.intReturns the minimum width the image should be after resizing.Returns the padding strategy.intReturns the width multiple.inthashCode()booleanReturns whether the target size is fixed.toString()
-
Constructor Details
-
ImageResizeOptions
public ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int minWidth, int minHeight, int maxWidth, int maxHeight, int widthMultiple, int heightMultiple, PaddingStrategy paddingStrategy) Creates image resize options.- Parameters:
-
channelConfiguration- channel configuration, that will be used, when passing the image to the ML model -
minWidth- minimum width the image should be after resizing. Should be a positive value -
minHeight- minimum height the image should be after resizing. Should be a positive value -
maxWidth- maximum width the image should be after resizing. Should not be less thanminWidth. Should be a multiple ofwidthMultiple -
maxHeight- maximum height the image should be after resizing. Should not be less thanminHeight. Should be a multiple ofheightMultiple -
widthMultiple- after resizing, the width of the image should be a multiple of this value -
heightMultiple- after resizing, the height of the image should be a multiple of this value -
paddingStrategy- padding strategy to be used
-
ImageResizeOptions
public ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int minWidth, int minHeight, int maxWidth, int maxHeight, PaddingStrategy paddingStrategy) Creates image resize options.With this constructor variant output image dimensions are not bumped up to be a multiple of some integer value.
- Parameters:
-
channelConfiguration- channel configuration, that will be used, when passing the image to the ML model -
minWidth- minimum width the image should be after resizing. Should be a positive value -
minHeight- minimum height the image should be after resizing. Should be a positive value -
maxWidth- maximum width the image should be after resizing. Should not be less thanminWidth -
maxHeight- maximum height the image should be after resizing. Should not be less thanminHeight -
paddingStrategy- padding strategy to be used
-
ImageResizeOptions
public ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int minWidth, int minHeight, int maxWidth, int maxHeight) Creates image resize options.With this constructor variant output image dimensions are not bumped up to be a multiple of some integer value and a default black padding is added at the bottom-right of the image.
- Parameters:
-
channelConfiguration- channel configuration, that will be used, when passing the image to the ML model -
minWidth- minimum width the image should be after resizing. Should be a positive value -
minHeight- minimum height the image should be after resizing. Should be a positive value -
maxWidth- maximum width the image should be after resizing. Should not be less thanminWidth -
maxHeight- maximum height the image should be after resizing. Should not be less thanminHeight
-
ImageResizeOptions
public ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int targetWidth, int targetHeight, PaddingStrategy paddingStrategy) Creates image resize options.With this constructor variant output image dimensions are fixed to the provided values.
- Parameters:
-
channelConfiguration- channel configuration, that will be used, when passing the image to the ML model -
targetWidth- width the image should be after resizing. Should be a positive value -
targetHeight- height the image should be after resizing. Should be a positive value -
paddingStrategy- padding strategy to be used
-
ImageResizeOptions
public ImageResizeOptions(ImageChannelConfiguration channelConfiguration, int targetWidth, int targetHeight) Creates image resize options.With this constructor variant output image dimensions are fixed to the provided values and a default black padding is added at the bottom-right of the image.
- Parameters:
-
channelConfiguration- channel configuration, that will be used, when passing the image to the ML model -
targetWidth- width the image should be after resizing. Should be a positive value -
targetHeight- height the image should be after resizing. Should be a positive value
-
-
Method Details
-
getChannelConfiguration
Returns the image channel configuration, that will be used when passing the image to the ML model.- Returns:
- the image channel configuration
-
getMinWidth
public int getMinWidth()Returns the minimum width the image should be after resizing.- Returns:
- the minimum width the image should be after resizing
-
getMinHeight
public int getMinHeight()Returns the minimum height the image should be after resizing.- Returns:
- the minimum height the image should be after resizing
-
getMaxWidth
public int getMaxWidth()Returns the maximum width the image should be after resizing.- Returns:
- the maximum width the image should be after resizing
-
getMaxHeight
public int getMaxHeight()Returns the maximum height the image should be after resizing.- Returns:
- the maximum height the image should be after resizing
-
getWidthMultiple
public int getWidthMultiple()Returns the width multiple.After resizing, the width of the image should be a multiple of this value.
- Returns:
- the width multiple
-
getHeightMultiple
public int getHeightMultiple()Returns the height multiple.After resizing, the height of the image should be a multiple of this value.
- Returns:
- the height multiple
-
getPaddingStrategy
Returns the padding strategy.- Returns:
- the padding strategy
-
isFixedSize
public boolean isFixedSize()Returns whether the target size is fixed.- Returns:
- whether the target size is fixed.
-
equals
-
hashCode
public int hashCode() -
toString
-