Class ColorInfo (3.7.0)

public final class ColorInfo extends GeneratedMessageV3 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 Fields

COLOR_FIELD_NUMBER

public static final int COLOR_FIELD_NUMBER
Field Value
TypeDescription
int

PIXEL_FRACTION_FIELD_NUMBER

public static final int PIXEL_FRACTION_FIELD_NUMBER
Field Value
TypeDescription
int

SCORE_FIELD_NUMBER

public static final int SCORE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static ColorInfo getDefaultInstance()
Returns
TypeDescription
ColorInfo

getDescriptor()

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

newBuilder()

public static ColorInfo.Builder newBuilder()
Returns
TypeDescription
ColorInfo.Builder

newBuilder(ColorInfo prototype)

public static ColorInfo.Builder newBuilder(ColorInfo prototype)
Parameter
NameDescription
prototypeColorInfo
Returns
TypeDescription
ColorInfo.Builder

parseDelimitedFrom(InputStream input)

public static ColorInfo parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ColorInfo parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static ColorInfo parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ColorInfo parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ColorInfo parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ColorInfo parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ColorInfo parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ColorInfo parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static ColorInfo parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ColorInfo parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static ColorInfo parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ColorInfo parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ColorInfo
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<ColorInfo> parser()
Returns
TypeDescription
Parser<ColorInfo>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getColor()

public Color getColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
TypeDescription
com.google.type.Color

The color.

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

getParserForType()

public Parser<ColorInfo> getParserForType()
Returns
TypeDescription
Parser<ColorInfo>
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.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hasColor()

public boolean hasColor()

RGB components of the color.

.google.type.Color color = 1;

Returns
TypeDescription
boolean

Whether the color field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public ColorInfo.Builder newBuilderForType()
Returns
TypeDescription
ColorInfo.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ColorInfo.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
ColorInfo.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public ColorInfo.Builder toBuilder()
Returns
TypeDescription
ColorInfo.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException