Class ColorInfo.Builder (3.25.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.v1.ColorInfo

Implements

ColorInfoOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ColorInfo.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ColorInfo.Builder
Overrides

build()

public ColorInfo build()
Returns
TypeDescription
ColorInfo

buildPartial()

public ColorInfo buildPartial()
Returns
TypeDescription
ColorInfo

clear()

public ColorInfo.Builder clear()
Returns
TypeDescription
ColorInfo.Builder
Overrides

clearColor()

public ColorInfo.Builder clearColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
TypeDescription
ColorInfo.Builder

clearField(Descriptors.FieldDescriptor field)

public ColorInfo.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
ColorInfo.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public ColorInfo.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ColorInfo.Builder

This builder for chaining.

clone()

public ColorInfo.Builder clone()
Returns
TypeDescription
ColorInfo.Builder
Overrides

getColor()

public Color getColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
TypeDescription
com.google.type.Color

The color.

getColorBuilder()

public Color.Builder getColorBuilder()

RGB components of the color.

.google.type.Color color = 1;

Returns
TypeDescription
com.google.type.Color.Builder

getColorOrBuilder()

public ColorOrBuilder getColorOrBuilder()

RGB components of the color.

.google.type.Color color = 1;

Returns
TypeDescription
com.google.type.ColorOrBuilder

getDefaultInstanceForType()

public ColorInfo getDefaultInstanceForType()
Returns
TypeDescription
ColorInfo

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
float

The pixelFraction.

getScore()

public float getScore()

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

float score = 2;

Returns
TypeDescription
float

The score.

hasColor()

public boolean hasColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
TypeDescription
boolean

Whether the color field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeColor(Color value)

public ColorInfo.Builder mergeColor(Color value)

RGB components of the color.

.google.type.Color color = 1;

Parameter
NameDescription
valuecom.google.type.Color
Returns
TypeDescription
ColorInfo.Builder

mergeFrom(ColorInfo other)

public ColorInfo.Builder mergeFrom(ColorInfo other)
Parameter
NameDescription
otherColorInfo
Returns
TypeDescription
ColorInfo.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ColorInfo.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ColorInfo.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ColorInfo.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ColorInfo.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ColorInfo.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ColorInfo.Builder
Overrides

setColor(Color value)

public ColorInfo.Builder setColor(Color value)

RGB components of the color.

.google.type.Color color = 1;

Parameter
NameDescription
valuecom.google.type.Color
Returns
TypeDescription
ColorInfo.Builder

setColor(Color.Builder builderForValue)

public ColorInfo.Builder setColor(Color.Builder builderForValue)

RGB components of the color.

.google.type.Color color = 1;

Parameter
NameDescription
builderForValuecom.google.type.Color.Builder
Returns
TypeDescription
ColorInfo.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public ColorInfo.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valuefloat

The pixelFraction to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valuefloat

The score to set.

Returns
TypeDescription
ColorInfo.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ColorInfo.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ColorInfo.Builder
Overrides