Class CropHintsParams.Builder (3.81.0)

public static final class CropHintsParams.Builder extends GeneratedMessage.Builder<CropHintsParams.Builder> implements CropHintsParamsOrBuilder

Parameters for crop hints annotation request.

Protobuf type google.cloud.vision.v1.CropHintsParams

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllAspectRatios(Iterable<? extends Float> values)

public CropHintsParams.Builder addAllAspectRatios(Iterable<? extends Float> values)

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

repeated float aspect_ratios = 1;

Parameter
Name Description
values Iterable<? extends java.lang.Float>

The aspectRatios to add.

Returns
Type Description
CropHintsParams.Builder

This builder for chaining.

addAspectRatios(float value)

public CropHintsParams.Builder addAspectRatios(float value)

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

repeated float aspect_ratios = 1;

Parameter
Name Description
value float

The aspectRatios to add.

Returns
Type Description
CropHintsParams.Builder

This builder for chaining.

build()

public CropHintsParams build()
Returns
Type Description
CropHintsParams

buildPartial()

public CropHintsParams buildPartial()
Returns
Type Description
CropHintsParams

clear()

public CropHintsParams.Builder clear()
Returns
Type Description
CropHintsParams.Builder
Overrides

clearAspectRatios()

public CropHintsParams.Builder clearAspectRatios()

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

repeated float aspect_ratios = 1;

Returns
Type Description
CropHintsParams.Builder

This builder for chaining.

getAspectRatios(int index)

public float getAspectRatios(int index)

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

repeated float aspect_ratios = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
float

The aspectRatios at the given index.

getAspectRatiosCount()

public int getAspectRatiosCount()

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

repeated float aspect_ratios = 1;

Returns
Type Description
int

The count of aspectRatios.

getAspectRatiosList()

public List<Float> getAspectRatiosList()

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

repeated float aspect_ratios = 1;

Returns
Type Description
List<Float>

A list containing the aspectRatios.

getDefaultInstanceForType()

public CropHintsParams getDefaultInstanceForType()
Returns
Type Description
CropHintsParams

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CropHintsParams other)

public CropHintsParams.Builder mergeFrom(CropHintsParams other)
Parameter
Name Description
other CropHintsParams
Returns
Type Description
CropHintsParams.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CropHintsParams.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CropHintsParams.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CropHintsParams.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CropHintsParams.Builder
Overrides

setAspectRatios(int index, float value)

public CropHintsParams.Builder setAspectRatios(int index, float value)

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

repeated float aspect_ratios = 1;

Parameters
Name Description
index int

The index to set the value at.

value float

The aspectRatios to set.

Returns
Type Description
CropHintsParams.Builder

This builder for chaining.