1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/vision/v1p2beta1/image_annotator.proto 18 19 package com.google.cloud.vision.v1p2beta1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Single crop hint that is used to generate a new crop when serving an image. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.vision.v1p2beta1.CropHint} 29 */ 30 public final class CropHint extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p2beta1.CropHint) 33 CropHintOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use CropHint.newBuilder() to construct. CropHint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private CropHint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 CropHint()40 private CropHint() {} 41 42 @java.lang.Override 43 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)44 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 45 return new CropHint(); 46 } 47 48 @java.lang.Override getUnknownFields()49 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 50 return this.unknownFields; 51 } 52 getDescriptor()53 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 54 return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto 55 .internal_static_google_cloud_vision_v1p2beta1_CropHint_descriptor; 56 } 57 58 @java.lang.Override 59 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()60 internalGetFieldAccessorTable() { 61 return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto 62 .internal_static_google_cloud_vision_v1p2beta1_CropHint_fieldAccessorTable 63 .ensureFieldAccessorsInitialized( 64 com.google.cloud.vision.v1p2beta1.CropHint.class, 65 com.google.cloud.vision.v1p2beta1.CropHint.Builder.class); 66 } 67 68 public static final int BOUNDING_POLY_FIELD_NUMBER = 1; 69 private com.google.cloud.vision.v1p2beta1.BoundingPoly boundingPoly_; 70 /** 71 * 72 * 73 * <pre> 74 * The bounding polygon for the crop region. The coordinates of the bounding 75 * box are in the original image's scale, as returned in `ImageParams`. 76 * </pre> 77 * 78 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 79 * 80 * @return Whether the boundingPoly field is set. 81 */ 82 @java.lang.Override hasBoundingPoly()83 public boolean hasBoundingPoly() { 84 return boundingPoly_ != null; 85 } 86 /** 87 * 88 * 89 * <pre> 90 * The bounding polygon for the crop region. The coordinates of the bounding 91 * box are in the original image's scale, as returned in `ImageParams`. 92 * </pre> 93 * 94 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 95 * 96 * @return The boundingPoly. 97 */ 98 @java.lang.Override getBoundingPoly()99 public com.google.cloud.vision.v1p2beta1.BoundingPoly getBoundingPoly() { 100 return boundingPoly_ == null 101 ? com.google.cloud.vision.v1p2beta1.BoundingPoly.getDefaultInstance() 102 : boundingPoly_; 103 } 104 /** 105 * 106 * 107 * <pre> 108 * The bounding polygon for the crop region. The coordinates of the bounding 109 * box are in the original image's scale, as returned in `ImageParams`. 110 * </pre> 111 * 112 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 113 */ 114 @java.lang.Override getBoundingPolyOrBuilder()115 public com.google.cloud.vision.v1p2beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { 116 return boundingPoly_ == null 117 ? com.google.cloud.vision.v1p2beta1.BoundingPoly.getDefaultInstance() 118 : boundingPoly_; 119 } 120 121 public static final int CONFIDENCE_FIELD_NUMBER = 2; 122 private float confidence_ = 0F; 123 /** 124 * 125 * 126 * <pre> 127 * Confidence of this being a salient region. Range [0, 1]. 128 * </pre> 129 * 130 * <code>float confidence = 2;</code> 131 * 132 * @return The confidence. 133 */ 134 @java.lang.Override getConfidence()135 public float getConfidence() { 136 return confidence_; 137 } 138 139 public static final int IMPORTANCE_FRACTION_FIELD_NUMBER = 3; 140 private float importanceFraction_ = 0F; 141 /** 142 * 143 * 144 * <pre> 145 * Fraction of importance of this salient region with respect to the original 146 * image. 147 * </pre> 148 * 149 * <code>float importance_fraction = 3;</code> 150 * 151 * @return The importanceFraction. 152 */ 153 @java.lang.Override getImportanceFraction()154 public float getImportanceFraction() { 155 return importanceFraction_; 156 } 157 158 private byte memoizedIsInitialized = -1; 159 160 @java.lang.Override isInitialized()161 public final boolean isInitialized() { 162 byte isInitialized = memoizedIsInitialized; 163 if (isInitialized == 1) return true; 164 if (isInitialized == 0) return false; 165 166 memoizedIsInitialized = 1; 167 return true; 168 } 169 170 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)171 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 172 if (boundingPoly_ != null) { 173 output.writeMessage(1, getBoundingPoly()); 174 } 175 if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { 176 output.writeFloat(2, confidence_); 177 } 178 if (java.lang.Float.floatToRawIntBits(importanceFraction_) != 0) { 179 output.writeFloat(3, importanceFraction_); 180 } 181 getUnknownFields().writeTo(output); 182 } 183 184 @java.lang.Override getSerializedSize()185 public int getSerializedSize() { 186 int size = memoizedSize; 187 if (size != -1) return size; 188 189 size = 0; 190 if (boundingPoly_ != null) { 191 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBoundingPoly()); 192 } 193 if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { 194 size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_); 195 } 196 if (java.lang.Float.floatToRawIntBits(importanceFraction_) != 0) { 197 size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, importanceFraction_); 198 } 199 size += getUnknownFields().getSerializedSize(); 200 memoizedSize = size; 201 return size; 202 } 203 204 @java.lang.Override equals(final java.lang.Object obj)205 public boolean equals(final java.lang.Object obj) { 206 if (obj == this) { 207 return true; 208 } 209 if (!(obj instanceof com.google.cloud.vision.v1p2beta1.CropHint)) { 210 return super.equals(obj); 211 } 212 com.google.cloud.vision.v1p2beta1.CropHint other = 213 (com.google.cloud.vision.v1p2beta1.CropHint) obj; 214 215 if (hasBoundingPoly() != other.hasBoundingPoly()) return false; 216 if (hasBoundingPoly()) { 217 if (!getBoundingPoly().equals(other.getBoundingPoly())) return false; 218 } 219 if (java.lang.Float.floatToIntBits(getConfidence()) 220 != java.lang.Float.floatToIntBits(other.getConfidence())) return false; 221 if (java.lang.Float.floatToIntBits(getImportanceFraction()) 222 != java.lang.Float.floatToIntBits(other.getImportanceFraction())) return false; 223 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 224 return true; 225 } 226 227 @java.lang.Override hashCode()228 public int hashCode() { 229 if (memoizedHashCode != 0) { 230 return memoizedHashCode; 231 } 232 int hash = 41; 233 hash = (19 * hash) + getDescriptor().hashCode(); 234 if (hasBoundingPoly()) { 235 hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; 236 hash = (53 * hash) + getBoundingPoly().hashCode(); 237 } 238 hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; 239 hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); 240 hash = (37 * hash) + IMPORTANCE_FRACTION_FIELD_NUMBER; 241 hash = (53 * hash) + java.lang.Float.floatToIntBits(getImportanceFraction()); 242 hash = (29 * hash) + getUnknownFields().hashCode(); 243 memoizedHashCode = hash; 244 return hash; 245 } 246 parseFrom(java.nio.ByteBuffer data)247 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom(java.nio.ByteBuffer data) 248 throws com.google.protobuf.InvalidProtocolBufferException { 249 return PARSER.parseFrom(data); 250 } 251 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)252 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom( 253 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 254 throws com.google.protobuf.InvalidProtocolBufferException { 255 return PARSER.parseFrom(data, extensionRegistry); 256 } 257 parseFrom( com.google.protobuf.ByteString data)258 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom( 259 com.google.protobuf.ByteString data) 260 throws com.google.protobuf.InvalidProtocolBufferException { 261 return PARSER.parseFrom(data); 262 } 263 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)264 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom( 265 com.google.protobuf.ByteString data, 266 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 267 throws com.google.protobuf.InvalidProtocolBufferException { 268 return PARSER.parseFrom(data, extensionRegistry); 269 } 270 parseFrom(byte[] data)271 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom(byte[] data) 272 throws com.google.protobuf.InvalidProtocolBufferException { 273 return PARSER.parseFrom(data); 274 } 275 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)276 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom( 277 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 278 throws com.google.protobuf.InvalidProtocolBufferException { 279 return PARSER.parseFrom(data, extensionRegistry); 280 } 281 parseFrom(java.io.InputStream input)282 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom(java.io.InputStream input) 283 throws java.io.IOException { 284 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 285 } 286 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)287 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom( 288 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 289 throws java.io.IOException { 290 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 291 PARSER, input, extensionRegistry); 292 } 293 parseDelimitedFrom( java.io.InputStream input)294 public static com.google.cloud.vision.v1p2beta1.CropHint parseDelimitedFrom( 295 java.io.InputStream input) throws java.io.IOException { 296 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 297 } 298 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)299 public static com.google.cloud.vision.v1p2beta1.CropHint parseDelimitedFrom( 300 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 301 throws java.io.IOException { 302 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 303 PARSER, input, extensionRegistry); 304 } 305 parseFrom( com.google.protobuf.CodedInputStream input)306 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom( 307 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 308 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 309 } 310 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)311 public static com.google.cloud.vision.v1p2beta1.CropHint parseFrom( 312 com.google.protobuf.CodedInputStream input, 313 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 314 throws java.io.IOException { 315 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 316 PARSER, input, extensionRegistry); 317 } 318 319 @java.lang.Override newBuilderForType()320 public Builder newBuilderForType() { 321 return newBuilder(); 322 } 323 newBuilder()324 public static Builder newBuilder() { 325 return DEFAULT_INSTANCE.toBuilder(); 326 } 327 newBuilder(com.google.cloud.vision.v1p2beta1.CropHint prototype)328 public static Builder newBuilder(com.google.cloud.vision.v1p2beta1.CropHint prototype) { 329 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 330 } 331 332 @java.lang.Override toBuilder()333 public Builder toBuilder() { 334 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 335 } 336 337 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)338 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 339 Builder builder = new Builder(parent); 340 return builder; 341 } 342 /** 343 * 344 * 345 * <pre> 346 * Single crop hint that is used to generate a new crop when serving an image. 347 * </pre> 348 * 349 * Protobuf type {@code google.cloud.vision.v1p2beta1.CropHint} 350 */ 351 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 352 implements 353 // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p2beta1.CropHint) 354 com.google.cloud.vision.v1p2beta1.CropHintOrBuilder { getDescriptor()355 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 356 return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto 357 .internal_static_google_cloud_vision_v1p2beta1_CropHint_descriptor; 358 } 359 360 @java.lang.Override 361 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()362 internalGetFieldAccessorTable() { 363 return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto 364 .internal_static_google_cloud_vision_v1p2beta1_CropHint_fieldAccessorTable 365 .ensureFieldAccessorsInitialized( 366 com.google.cloud.vision.v1p2beta1.CropHint.class, 367 com.google.cloud.vision.v1p2beta1.CropHint.Builder.class); 368 } 369 370 // Construct using com.google.cloud.vision.v1p2beta1.CropHint.newBuilder() Builder()371 private Builder() {} 372 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)373 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 374 super(parent); 375 } 376 377 @java.lang.Override clear()378 public Builder clear() { 379 super.clear(); 380 bitField0_ = 0; 381 boundingPoly_ = null; 382 if (boundingPolyBuilder_ != null) { 383 boundingPolyBuilder_.dispose(); 384 boundingPolyBuilder_ = null; 385 } 386 confidence_ = 0F; 387 importanceFraction_ = 0F; 388 return this; 389 } 390 391 @java.lang.Override getDescriptorForType()392 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 393 return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto 394 .internal_static_google_cloud_vision_v1p2beta1_CropHint_descriptor; 395 } 396 397 @java.lang.Override getDefaultInstanceForType()398 public com.google.cloud.vision.v1p2beta1.CropHint getDefaultInstanceForType() { 399 return com.google.cloud.vision.v1p2beta1.CropHint.getDefaultInstance(); 400 } 401 402 @java.lang.Override build()403 public com.google.cloud.vision.v1p2beta1.CropHint build() { 404 com.google.cloud.vision.v1p2beta1.CropHint result = buildPartial(); 405 if (!result.isInitialized()) { 406 throw newUninitializedMessageException(result); 407 } 408 return result; 409 } 410 411 @java.lang.Override buildPartial()412 public com.google.cloud.vision.v1p2beta1.CropHint buildPartial() { 413 com.google.cloud.vision.v1p2beta1.CropHint result = 414 new com.google.cloud.vision.v1p2beta1.CropHint(this); 415 if (bitField0_ != 0) { 416 buildPartial0(result); 417 } 418 onBuilt(); 419 return result; 420 } 421 buildPartial0(com.google.cloud.vision.v1p2beta1.CropHint result)422 private void buildPartial0(com.google.cloud.vision.v1p2beta1.CropHint result) { 423 int from_bitField0_ = bitField0_; 424 if (((from_bitField0_ & 0x00000001) != 0)) { 425 result.boundingPoly_ = 426 boundingPolyBuilder_ == null ? boundingPoly_ : boundingPolyBuilder_.build(); 427 } 428 if (((from_bitField0_ & 0x00000002) != 0)) { 429 result.confidence_ = confidence_; 430 } 431 if (((from_bitField0_ & 0x00000004) != 0)) { 432 result.importanceFraction_ = importanceFraction_; 433 } 434 } 435 436 @java.lang.Override clone()437 public Builder clone() { 438 return super.clone(); 439 } 440 441 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)442 public Builder setField( 443 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 444 return super.setField(field, value); 445 } 446 447 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)448 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 449 return super.clearField(field); 450 } 451 452 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)453 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 454 return super.clearOneof(oneof); 455 } 456 457 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)458 public Builder setRepeatedField( 459 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 460 return super.setRepeatedField(field, index, value); 461 } 462 463 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)464 public Builder addRepeatedField( 465 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 466 return super.addRepeatedField(field, value); 467 } 468 469 @java.lang.Override mergeFrom(com.google.protobuf.Message other)470 public Builder mergeFrom(com.google.protobuf.Message other) { 471 if (other instanceof com.google.cloud.vision.v1p2beta1.CropHint) { 472 return mergeFrom((com.google.cloud.vision.v1p2beta1.CropHint) other); 473 } else { 474 super.mergeFrom(other); 475 return this; 476 } 477 } 478 mergeFrom(com.google.cloud.vision.v1p2beta1.CropHint other)479 public Builder mergeFrom(com.google.cloud.vision.v1p2beta1.CropHint other) { 480 if (other == com.google.cloud.vision.v1p2beta1.CropHint.getDefaultInstance()) return this; 481 if (other.hasBoundingPoly()) { 482 mergeBoundingPoly(other.getBoundingPoly()); 483 } 484 if (other.getConfidence() != 0F) { 485 setConfidence(other.getConfidence()); 486 } 487 if (other.getImportanceFraction() != 0F) { 488 setImportanceFraction(other.getImportanceFraction()); 489 } 490 this.mergeUnknownFields(other.getUnknownFields()); 491 onChanged(); 492 return this; 493 } 494 495 @java.lang.Override isInitialized()496 public final boolean isInitialized() { 497 return true; 498 } 499 500 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)501 public Builder mergeFrom( 502 com.google.protobuf.CodedInputStream input, 503 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 504 throws java.io.IOException { 505 if (extensionRegistry == null) { 506 throw new java.lang.NullPointerException(); 507 } 508 try { 509 boolean done = false; 510 while (!done) { 511 int tag = input.readTag(); 512 switch (tag) { 513 case 0: 514 done = true; 515 break; 516 case 10: 517 { 518 input.readMessage(getBoundingPolyFieldBuilder().getBuilder(), extensionRegistry); 519 bitField0_ |= 0x00000001; 520 break; 521 } // case 10 522 case 21: 523 { 524 confidence_ = input.readFloat(); 525 bitField0_ |= 0x00000002; 526 break; 527 } // case 21 528 case 29: 529 { 530 importanceFraction_ = input.readFloat(); 531 bitField0_ |= 0x00000004; 532 break; 533 } // case 29 534 default: 535 { 536 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 537 done = true; // was an endgroup tag 538 } 539 break; 540 } // default: 541 } // switch (tag) 542 } // while (!done) 543 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 544 throw e.unwrapIOException(); 545 } finally { 546 onChanged(); 547 } // finally 548 return this; 549 } 550 551 private int bitField0_; 552 553 private com.google.cloud.vision.v1p2beta1.BoundingPoly boundingPoly_; 554 private com.google.protobuf.SingleFieldBuilderV3< 555 com.google.cloud.vision.v1p2beta1.BoundingPoly, 556 com.google.cloud.vision.v1p2beta1.BoundingPoly.Builder, 557 com.google.cloud.vision.v1p2beta1.BoundingPolyOrBuilder> 558 boundingPolyBuilder_; 559 /** 560 * 561 * 562 * <pre> 563 * The bounding polygon for the crop region. The coordinates of the bounding 564 * box are in the original image's scale, as returned in `ImageParams`. 565 * </pre> 566 * 567 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 568 * 569 * @return Whether the boundingPoly field is set. 570 */ hasBoundingPoly()571 public boolean hasBoundingPoly() { 572 return ((bitField0_ & 0x00000001) != 0); 573 } 574 /** 575 * 576 * 577 * <pre> 578 * The bounding polygon for the crop region. The coordinates of the bounding 579 * box are in the original image's scale, as returned in `ImageParams`. 580 * </pre> 581 * 582 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 583 * 584 * @return The boundingPoly. 585 */ getBoundingPoly()586 public com.google.cloud.vision.v1p2beta1.BoundingPoly getBoundingPoly() { 587 if (boundingPolyBuilder_ == null) { 588 return boundingPoly_ == null 589 ? com.google.cloud.vision.v1p2beta1.BoundingPoly.getDefaultInstance() 590 : boundingPoly_; 591 } else { 592 return boundingPolyBuilder_.getMessage(); 593 } 594 } 595 /** 596 * 597 * 598 * <pre> 599 * The bounding polygon for the crop region. The coordinates of the bounding 600 * box are in the original image's scale, as returned in `ImageParams`. 601 * </pre> 602 * 603 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 604 */ setBoundingPoly(com.google.cloud.vision.v1p2beta1.BoundingPoly value)605 public Builder setBoundingPoly(com.google.cloud.vision.v1p2beta1.BoundingPoly value) { 606 if (boundingPolyBuilder_ == null) { 607 if (value == null) { 608 throw new NullPointerException(); 609 } 610 boundingPoly_ = value; 611 } else { 612 boundingPolyBuilder_.setMessage(value); 613 } 614 bitField0_ |= 0x00000001; 615 onChanged(); 616 return this; 617 } 618 /** 619 * 620 * 621 * <pre> 622 * The bounding polygon for the crop region. The coordinates of the bounding 623 * box are in the original image's scale, as returned in `ImageParams`. 624 * </pre> 625 * 626 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 627 */ setBoundingPoly( com.google.cloud.vision.v1p2beta1.BoundingPoly.Builder builderForValue)628 public Builder setBoundingPoly( 629 com.google.cloud.vision.v1p2beta1.BoundingPoly.Builder builderForValue) { 630 if (boundingPolyBuilder_ == null) { 631 boundingPoly_ = builderForValue.build(); 632 } else { 633 boundingPolyBuilder_.setMessage(builderForValue.build()); 634 } 635 bitField0_ |= 0x00000001; 636 onChanged(); 637 return this; 638 } 639 /** 640 * 641 * 642 * <pre> 643 * The bounding polygon for the crop region. The coordinates of the bounding 644 * box are in the original image's scale, as returned in `ImageParams`. 645 * </pre> 646 * 647 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 648 */ mergeBoundingPoly(com.google.cloud.vision.v1p2beta1.BoundingPoly value)649 public Builder mergeBoundingPoly(com.google.cloud.vision.v1p2beta1.BoundingPoly value) { 650 if (boundingPolyBuilder_ == null) { 651 if (((bitField0_ & 0x00000001) != 0) 652 && boundingPoly_ != null 653 && boundingPoly_ 654 != com.google.cloud.vision.v1p2beta1.BoundingPoly.getDefaultInstance()) { 655 getBoundingPolyBuilder().mergeFrom(value); 656 } else { 657 boundingPoly_ = value; 658 } 659 } else { 660 boundingPolyBuilder_.mergeFrom(value); 661 } 662 bitField0_ |= 0x00000001; 663 onChanged(); 664 return this; 665 } 666 /** 667 * 668 * 669 * <pre> 670 * The bounding polygon for the crop region. The coordinates of the bounding 671 * box are in the original image's scale, as returned in `ImageParams`. 672 * </pre> 673 * 674 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 675 */ clearBoundingPoly()676 public Builder clearBoundingPoly() { 677 bitField0_ = (bitField0_ & ~0x00000001); 678 boundingPoly_ = null; 679 if (boundingPolyBuilder_ != null) { 680 boundingPolyBuilder_.dispose(); 681 boundingPolyBuilder_ = null; 682 } 683 onChanged(); 684 return this; 685 } 686 /** 687 * 688 * 689 * <pre> 690 * The bounding polygon for the crop region. The coordinates of the bounding 691 * box are in the original image's scale, as returned in `ImageParams`. 692 * </pre> 693 * 694 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 695 */ getBoundingPolyBuilder()696 public com.google.cloud.vision.v1p2beta1.BoundingPoly.Builder getBoundingPolyBuilder() { 697 bitField0_ |= 0x00000001; 698 onChanged(); 699 return getBoundingPolyFieldBuilder().getBuilder(); 700 } 701 /** 702 * 703 * 704 * <pre> 705 * The bounding polygon for the crop region. The coordinates of the bounding 706 * box are in the original image's scale, as returned in `ImageParams`. 707 * </pre> 708 * 709 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 710 */ getBoundingPolyOrBuilder()711 public com.google.cloud.vision.v1p2beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { 712 if (boundingPolyBuilder_ != null) { 713 return boundingPolyBuilder_.getMessageOrBuilder(); 714 } else { 715 return boundingPoly_ == null 716 ? com.google.cloud.vision.v1p2beta1.BoundingPoly.getDefaultInstance() 717 : boundingPoly_; 718 } 719 } 720 /** 721 * 722 * 723 * <pre> 724 * The bounding polygon for the crop region. The coordinates of the bounding 725 * box are in the original image's scale, as returned in `ImageParams`. 726 * </pre> 727 * 728 * <code>.google.cloud.vision.v1p2beta1.BoundingPoly bounding_poly = 1;</code> 729 */ 730 private com.google.protobuf.SingleFieldBuilderV3< 731 com.google.cloud.vision.v1p2beta1.BoundingPoly, 732 com.google.cloud.vision.v1p2beta1.BoundingPoly.Builder, 733 com.google.cloud.vision.v1p2beta1.BoundingPolyOrBuilder> getBoundingPolyFieldBuilder()734 getBoundingPolyFieldBuilder() { 735 if (boundingPolyBuilder_ == null) { 736 boundingPolyBuilder_ = 737 new com.google.protobuf.SingleFieldBuilderV3< 738 com.google.cloud.vision.v1p2beta1.BoundingPoly, 739 com.google.cloud.vision.v1p2beta1.BoundingPoly.Builder, 740 com.google.cloud.vision.v1p2beta1.BoundingPolyOrBuilder>( 741 getBoundingPoly(), getParentForChildren(), isClean()); 742 boundingPoly_ = null; 743 } 744 return boundingPolyBuilder_; 745 } 746 747 private float confidence_; 748 /** 749 * 750 * 751 * <pre> 752 * Confidence of this being a salient region. Range [0, 1]. 753 * </pre> 754 * 755 * <code>float confidence = 2;</code> 756 * 757 * @return The confidence. 758 */ 759 @java.lang.Override getConfidence()760 public float getConfidence() { 761 return confidence_; 762 } 763 /** 764 * 765 * 766 * <pre> 767 * Confidence of this being a salient region. Range [0, 1]. 768 * </pre> 769 * 770 * <code>float confidence = 2;</code> 771 * 772 * @param value The confidence to set. 773 * @return This builder for chaining. 774 */ setConfidence(float value)775 public Builder setConfidence(float value) { 776 777 confidence_ = value; 778 bitField0_ |= 0x00000002; 779 onChanged(); 780 return this; 781 } 782 /** 783 * 784 * 785 * <pre> 786 * Confidence of this being a salient region. Range [0, 1]. 787 * </pre> 788 * 789 * <code>float confidence = 2;</code> 790 * 791 * @return This builder for chaining. 792 */ clearConfidence()793 public Builder clearConfidence() { 794 bitField0_ = (bitField0_ & ~0x00000002); 795 confidence_ = 0F; 796 onChanged(); 797 return this; 798 } 799 800 private float importanceFraction_; 801 /** 802 * 803 * 804 * <pre> 805 * Fraction of importance of this salient region with respect to the original 806 * image. 807 * </pre> 808 * 809 * <code>float importance_fraction = 3;</code> 810 * 811 * @return The importanceFraction. 812 */ 813 @java.lang.Override getImportanceFraction()814 public float getImportanceFraction() { 815 return importanceFraction_; 816 } 817 /** 818 * 819 * 820 * <pre> 821 * Fraction of importance of this salient region with respect to the original 822 * image. 823 * </pre> 824 * 825 * <code>float importance_fraction = 3;</code> 826 * 827 * @param value The importanceFraction to set. 828 * @return This builder for chaining. 829 */ setImportanceFraction(float value)830 public Builder setImportanceFraction(float value) { 831 832 importanceFraction_ = value; 833 bitField0_ |= 0x00000004; 834 onChanged(); 835 return this; 836 } 837 /** 838 * 839 * 840 * <pre> 841 * Fraction of importance of this salient region with respect to the original 842 * image. 843 * </pre> 844 * 845 * <code>float importance_fraction = 3;</code> 846 * 847 * @return This builder for chaining. 848 */ clearImportanceFraction()849 public Builder clearImportanceFraction() { 850 bitField0_ = (bitField0_ & ~0x00000004); 851 importanceFraction_ = 0F; 852 onChanged(); 853 return this; 854 } 855 856 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)857 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 858 return super.setUnknownFields(unknownFields); 859 } 860 861 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)862 public final Builder mergeUnknownFields( 863 final com.google.protobuf.UnknownFieldSet unknownFields) { 864 return super.mergeUnknownFields(unknownFields); 865 } 866 867 // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p2beta1.CropHint) 868 } 869 870 // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.CropHint) 871 private static final com.google.cloud.vision.v1p2beta1.CropHint DEFAULT_INSTANCE; 872 873 static { 874 DEFAULT_INSTANCE = new com.google.cloud.vision.v1p2beta1.CropHint(); 875 } 876 getDefaultInstance()877 public static com.google.cloud.vision.v1p2beta1.CropHint getDefaultInstance() { 878 return DEFAULT_INSTANCE; 879 } 880 881 private static final com.google.protobuf.Parser<CropHint> PARSER = 882 new com.google.protobuf.AbstractParser<CropHint>() { 883 @java.lang.Override 884 public CropHint parsePartialFrom( 885 com.google.protobuf.CodedInputStream input, 886 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 887 throws com.google.protobuf.InvalidProtocolBufferException { 888 Builder builder = newBuilder(); 889 try { 890 builder.mergeFrom(input, extensionRegistry); 891 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 892 throw e.setUnfinishedMessage(builder.buildPartial()); 893 } catch (com.google.protobuf.UninitializedMessageException e) { 894 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 895 } catch (java.io.IOException e) { 896 throw new com.google.protobuf.InvalidProtocolBufferException(e) 897 .setUnfinishedMessage(builder.buildPartial()); 898 } 899 return builder.buildPartial(); 900 } 901 }; 902 parser()903 public static com.google.protobuf.Parser<CropHint> parser() { 904 return PARSER; 905 } 906 907 @java.lang.Override getParserForType()908 public com.google.protobuf.Parser<CropHint> getParserForType() { 909 return PARSER; 910 } 911 912 @java.lang.Override getDefaultInstanceForType()913 public com.google.cloud.vision.v1p2beta1.CropHint getDefaultInstanceForType() { 914 return DEFAULT_INSTANCE; 915 } 916 } 917