Class ImageCropStyle (0.1.0)

public final class ImageCropStyle extends GeneratedMessageV3 implements ImageCropStyleOrBuilder

Represents the crop style applied to an image.

Google Workspace Add-ons and Chat apps:

For example, here's how to apply a 16:9 aspect ratio:

<code><code> cropStyle { "type": "RECTANGLE_CUSTOM", "aspectRatio": 16/9 } </code></code>

Protobuf type google.apps.card.v1.ImageCropStyle

Static Fields

ASPECT_RATIO_FIELD_NUMBER

public static final int ASPECT_RATIO_FIELD_NUMBER
Field Value
TypeDescription
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static ImageCropStyle getDefaultInstance()
Returns
TypeDescription
ImageCropStyle

getDescriptor()

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

newBuilder()

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

newBuilder(ImageCropStyle prototype)

public static ImageCropStyle.Builder newBuilder(ImageCropStyle prototype)
Parameter
NameDescription
prototypeImageCropStyle
Returns
TypeDescription
ImageCropStyle.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getAspectRatio()

public double getAspectRatio()

The aspect ratio to use if the crop type is RECTANGLE_CUSTOM.

For example, here's how to apply a 16:9 aspect ratio:

<code><code> cropStyle { "type": "RECTANGLE_CUSTOM", "aspectRatio": 16/9 } </code></code>

double aspect_ratio = 2;

Returns
TypeDescription
double

The aspectRatio.

getDefaultInstanceForType()

public ImageCropStyle getDefaultInstanceForType()
Returns
TypeDescription
ImageCropStyle

getParserForType()

public Parser<ImageCropStyle> getParserForType()
Returns
TypeDescription
Parser<ImageCropStyle>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getType()

public ImageCropStyle.ImageCropType getType()

The crop type.

.google.apps.card.v1.ImageCropStyle.ImageCropType type = 1;

Returns
TypeDescription
ImageCropStyle.ImageCropType

The type.

getTypeValue()

public int getTypeValue()

The crop type.

.google.apps.card.v1.ImageCropStyle.ImageCropType type = 1;

Returns
TypeDescription
int

The enum numeric value on the wire for type.

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 ImageCropStyle.Builder newBuilderForType()
Returns
TypeDescription
ImageCropStyle.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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