Class ColorInfo.Builder (3.41.0)

public static final class ColorInfo.Builder extends GeneratedMessageV3.Builder<ColorInfo.Builder> implements ColorInfoOrBuilder

Color information consists of RGB channels, score, and the fraction of the image that the color occupies in the image.

Protobuf type google.cloud.vision.v1p4beta1.ColorInfo

Implements

ColorInfoOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ColorInfo.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ColorInfo.Builder
Overrides

build()

public ColorInfo build()
Returns
Type Description
ColorInfo

buildPartial()

public ColorInfo buildPartial()
Returns
Type Description
ColorInfo

clear()

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

clearColor()

public ColorInfo.Builder clearColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
Type Description
ColorInfo.Builder

clearField(Descriptors.FieldDescriptor field)

public ColorInfo.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ColorInfo.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public ColorInfo.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ColorInfo.Builder
Overrides

clearPixelFraction()

public ColorInfo.Builder clearPixelFraction()

The fraction of pixels the color occupies in the image. Value in range [0, 1].

float pixel_fraction = 3;

Returns
Type Description
ColorInfo.Builder

This builder for chaining.

clearScore()

public ColorInfo.Builder clearScore()

Image-specific score for this color. Value in range [0, 1].

float score = 2;

Returns
Type Description
ColorInfo.Builder

This builder for chaining.

clone()

public ColorInfo.Builder clone()
Returns
Type Description
ColorInfo.Builder
Overrides

getColor()

public Color getColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
Type Description
com.google.type.Color

The color.

getColorBuilder()

public Color.Builder getColorBuilder()

RGB components of the color.

.google.type.Color color = 1;

Returns
Type Description
com.google.type.Color.Builder

getColorOrBuilder()

public ColorOrBuilder getColorOrBuilder()

RGB components of the color.

.google.type.Color color = 1;

Returns
Type Description
com.google.type.ColorOrBuilder

getDefaultInstanceForType()

public ColorInfo getDefaultInstanceForType()
Returns
Type Description
ColorInfo

getDescriptorForType()

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

getPixelFraction()

public float getPixelFraction()

The fraction of pixels the color occupies in the image. Value in range [0, 1].

float pixel_fraction = 3;

Returns
Type Description
float

The pixelFraction.

getScore()

public float getScore()

Image-specific score for this color. Value in range [0, 1].

float score = 2;

Returns
Type Description
float

The score.

hasColor()

public boolean hasColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
Type Description
boolean

Whether the color field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeColor(Color value)

public ColorInfo.Builder mergeColor(Color value)

RGB components of the color.

.google.type.Color color = 1;

Parameter
Name Description
value com.google.type.Color
Returns
Type Description
ColorInfo.Builder

mergeFrom(ColorInfo other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ColorInfo.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ColorInfo.Builder
Overrides

setColor(Color value)

public ColorInfo.Builder setColor(Color value)

RGB components of the color.

.google.type.Color color = 1;

Parameter
Name Description
value com.google.type.Color
Returns
Type Description
ColorInfo.Builder

setColor(Color.Builder builderForValue)

public ColorInfo.Builder setColor(Color.Builder builderForValue)

RGB components of the color.

.google.type.Color color = 1;

Parameter
Name Description
builderForValue com.google.type.Color.Builder
Returns
Type Description
ColorInfo.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public ColorInfo.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ColorInfo.Builder
Overrides

setPixelFraction(float value)

public ColorInfo.Builder setPixelFraction(float value)

The fraction of pixels the color occupies in the image. Value in range [0, 1].

float pixel_fraction = 3;

Parameter
Name Description
value float

The pixelFraction to set.

Returns
Type Description
ColorInfo.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ColorInfo.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ColorInfo.Builder
Overrides

setScore(float value)

public ColorInfo.Builder setScore(float value)

Image-specific score for this color. Value in range [0, 1].

float score = 2;

Parameter
Name Description
value float

The score to set.

Returns
Type Description
ColorInfo.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ColorInfo.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ColorInfo.Builder
Overrides