use of com.enonic.xp.image.FocalPoint in project xp by enonic.
the class ImageScales method wide.
public ImageScaleFunction wide(FocalPoint focalPoint, Object... args) {
Preconditions.checkArgument(args.length <= 2, "Too many arguments %s", args.length);
final int width = CommandArgumentParser.getIntArg(args, 0, 0);
final int height = CommandArgumentParser.getIntArg(args, 1, 0);
final double offset = focalPoint.yOffset();
Preconditions.checkArgument(width > 0 && width <= maxSideLength, "width value must be between 0 and %s : %s", maxSideLength, width);
Preconditions.checkArgument(height > 0 && height <= maxSideLength, "height value must be between 0 and %s : %s", maxSideLength, height);
return adaptScaleCalculator(ScaleCalculator.wide(width, height, offset));
}
use of com.enonic.xp.image.FocalPoint in project xp by enonic.
the class ImageScales method width.
public ImageScaleFunction width(FocalPoint focalPoint, Object... args) {
Preconditions.checkArgument(args.length <= 1, "Too many arguments %s", args.length);
final int size = CommandArgumentParser.getIntArg(args, 0, 100);
Preconditions.checkArgument(size > 0 && size <= maxSideLength, "size value must be between 0 and %s : %s", maxSideLength, size);
return adaptScaleCalculator(ScaleCalculator.width(size));
}
Aggregations