<code>
.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata image_bounding_poly_details = 11;
</code>
12780
public com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadataOrBuilder
      getImageBoundingPolyDetailsOrBuilder() {
    if (detailsCase_ == 11) {
      return (com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata
        .getDefaultInstance();
  }
727107
public static void boundImage( GrayS16 img , int min , int max ) {
		ImplPixelMath.boundImage(img,min,max);
	}
153990
public com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata
      getAudioTranscriptionDetails() {
    if (detailsCase_ == 10) {
      return (com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata
        .getDefaultInstance();
  }
1163621
private String getDatatypeLabel(DatatypeIdValue datatype) {
		if (datatype.getIri() == null) { // TODO should be redundant once the
											// JSON parsing works
			return "Unknown";
		}

		switch (datatype.getIri()) {
		case DatatypeIdValue.DT_COMMONS_MEDIA:
			return "Commons media";
		case DatatypeIdValue.DT_GLOBE_COORDINATES:
			return "Globe coordinates";
		case DatatypeIdValue.DT_ITEM:
			return "Item";
		case DatatypeIdValue.DT_QUANTITY:
			return "Quantity";
		case DatatypeIdValue.DT_STRING:
			return "String";
		case DatatypeIdValue.DT_TIME:
			return "Time";
		case DatatypeIdValue.DT_URL:
			return "URL";
		case DatatypeIdValue.DT_PROPERTY:
			return "Property";
		case DatatypeIdValue.DT_EXTERNAL_ID:
			return "External identifier";
		case DatatypeIdValue.DT_MATH:
			return "Math";
		case DatatypeIdValue.DT_MONOLINGUAL_TEXT:
			return "Monolingual Text";
		default:
			throw new RuntimeException("Unknown datatype " + datatype.getIri());
		}
	}
2423
@Override
    public MachineImage capture(@Nonnull ImageCreateOptions options, @Nullable AsynchronousTask<MachineImage> task) throws CloudException, InternalException {
        Compute gce = provider.getGoogleCompute();
        ServerSupport server = new ServerSupport(provider);
        Image imageContent = new Image();

        try {
            VirtualMachine vm = server.getVirtualMachine(options.getVirtualMachineId());

            String[] disks = vm.getProviderVolumeIds(provider);
            server.terminateVm(options.getVirtualMachineId());

            Disk disk = gce.disks().get(provider.getContext().getAccountNumber(), vm.getProviderDataCenterId(), disks[0]).execute(); 
            imageContent.setName(getCapabilities().getImageNamingConstraints().convertToValidName(options.getName(), Locale.US));
            imageContent.setKind("compute#disk");
            imageContent.setSourceDisk(disk.getSelfLink());

            String derivedFrom = disk.getSourceImage().replaceAll(".*/", "");
            if (Platform.guess(derivedFrom) == Platform.UNKNOWN) {
                Boolean done = false;
                try {
                    while (!done) {
                        Image imagePrior = gce.images().get(provider.getContext().getAccountNumber(), derivedFrom).execute();
                        if (imagePrior.getDescription().startsWith("Derived from ")) {
                            derivedFrom = imagePrior.getDescription().replaceAll("Derived from ", "");
                            if (Platform.guess(derivedFrom) != Platform.UNKNOWN) {
                                done = true;
                                imageContent.setDescription(imagePrior.getDescription());
                            }
                        }
                    }
                } catch (Exception e) {
                    imageContent.setDescription(derivedFrom);  // best guess.
                }

            } else {
                imageContent.setDescription("Derived from " + derivedFrom);
            }
            Operation job = gce.images().insert(provider.getContext().getAccountNumber(), imageContent).execute();
            GoogleMethod method = new GoogleMethod(provider);
            method.getOperationComplete(provider.getContext(), job, GoogleOperationType.GLOBAL_OPERATION, "", "");

            String zone = disk.getZone();
            zone = zone.substring(zone.lastIndexOf("/") + 1);
            // now delete source disk...
            job = gce.disks().delete(provider.getContext().getAccountNumber(), zone, disk.getName()).execute();
            method.getOperationComplete(provider.getContext(), job, GoogleOperationType.ZONE_OPERATION, "", zone);
        } catch (Exception ex) {
            logger.error(ex.getMessage()); // CloudException: An error occurred: Invalid value for field 'image.hasRawDisk': 'false'.
            if (ex.getClass() == GoogleJsonResponseException.class) {
                GoogleJsonResponseException gjre = (GoogleJsonResponseException)ex;
                throw new GoogleException(CloudErrorType.GENERAL, gjre.getStatusCode(), gjre.getContent(), gjre.getDetails().getMessage());
            } else
                throw new CloudException("An error occurred while deleting the image: " + ex.getMessage());
        }

        return getImage(provider.getContext().getAccountNumber() + "_" + options.getName());
    }
1016745
public Producer<Void> getDecodedImagePrefetchProducerSequence(
      ImageRequest imageRequest) {
    Producer<CloseableReference<CloseableImage>> inputProducer =
        getBasicDecodedImageSequence(imageRequest);

    if (mUseBitmapPrepareToDraw) {
      inputProducer = getBitmapPrepareSequence(inputProducer);
    }

    return getDecodedImagePrefetchSequence(inputProducer);
  }
384084
private void CheckYCbCr(IfdTags metadata, int n) {
    // Samples per pixel
    if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
      validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
    } else {
      long spp = metadata.get(TiffTags.getTagId("SamplesPerPixel")).getFirstNumericValue();
      if (spp != 3) {
        validation.addError("Invalid Samples Per Pixel", "IFD" + n, spp);
      }
    }

    // BitsPerSample
    if (!metadata.containsTagId(TiffTags.getTagId("BitsPerSample"))) {
      validation.addErrorLoc("Missing BitsPerSample", "IFD" + n);
    } else {
      for (abstractTiffType vi : metadata.get(TiffTags.getTagId("BitsPerSample")).getValue()) {
        if (vi.toInt() != 8) {
          validation.addError("Invalid BitsPerSample", "IFD" + n, vi.toInt());
          break;
        }
      }
    }

    // Compression
    // long comp = metadata.get(TiffTags.getTagId("Compression")).getFirstNumericValue();
    // if (comp != 1 && comp != 5 && comp != 6)
    // validation.addError("Invalid Compression", comp);

    // if (!metadata.containsTagId(TiffTags.getTagId("ReferenceBlackWhite")))
    // validation.addError("Missing ReferenceBlackWhite");

    // if (!metadata.containsTagId(TiffTags.getTagId("YCbCrCoefficients")))
    // validation.addError("Missing YCbCr Coefficients");

    // if (!metadata.containsTagId(TiffTags.getTagId("YCbCrSubSampling")))
    // validation.addError("Missing YCbCr SubSampling");

    // if (!metadata.containsTagId(TiffTags.getTagId("YCbCrPositioning")))
    // validation.addError("Missing YCbCr Positioning");
  }
134256
public com.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata
      getVideoObjectDetectionDetails() {
    if (detailsCase_ == 6) {
      return (com.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata
        .getDefaultInstance();
  }
1140139
private void validateIfdBP(IFD ifd, int p) {
    IfdTags metadata = ifd.getMetadata();

    if (p == 1 || p == 2) {
      checkRequiredTag(metadata, "NewSubfileType", 1, new long[]{0});
    }
    checkRequiredTag(metadata, "ImageLength", 1);
    checkRequiredTag(metadata, "ImageWidth", 1);
    checkRequiredTag(metadata, "BitsPerSample", 1, new long[]{1});
    if (p == 0) {
      checkRequiredTag(metadata, "Compression", 1, new long[]{1,4,8});
    } else if (p == 1) {
      checkRequiredTag(metadata, "Compression", 1, new long[]{1});
    } else {
      checkRequiredTag(metadata, "Compression", 1, new long[]{1,4,8});
    }
    if (p == 0) {
      checkRequiredTag(metadata, "PhotometricInterpretation", 1);
    } else {
      checkRequiredTag(metadata, "PhotometricInterpretation", 1, new long[] {0});
    }
    checkRequiredTag(metadata, "StripOffsets", 1);
    if (p == 0) {
      checkRequiredTag(metadata, "Orientation", 1, new long[]{1,4,5,8});
    } else {
      checkRequiredTag(metadata, "Orientation", 1, new long[]{1});
    }
    checkRequiredTag(metadata, "SamplesPerPixel", 1, new long[]{1});
    checkRequiredTag(metadata, "StripBYTECount", 1);
    checkRequiredTag(metadata, "XResolution", 1);
    checkRequiredTag(metadata, "YResolution", 1);
    if (p == 1 || p == 2) {
      checkRequiredTag(metadata, "ResolutionUnit", 1, new long[]{2, 3});
      checkRequiredTag(metadata, "DotRange", 2, new long[]{0, 255});
    }
    checkRequiredTag(metadata, "ImageColorIndicator", 1, new long[]{0, 1, 2});
    checkRequiredTag(metadata, "BackgroundColorIndicator", 1, new long[]{0, 1, 2});
  }
4625
public com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata
      getTextClassificationDetails() {
    if (detailsCase_ == 9) {
      return (com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata
        .getDefaultInstance();
  }
1070975
public com.google.cloud.datalabeling.v1beta1
          .LabelImageOrientedBoundingBoxOperationMetadataOrBuilder
      getImageOrientedBoundingBoxDetailsOrBuilder() {
    if (detailsCase_ == 14) {
      return (com.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata
        .getDefaultInstance();
  }
1180077
public void validateMetadata(IfdTags metadata) {
    int prevTagId = 0;
    try {
      TiffTags.getTiffTags();
    } catch (ReadTagsIOException e) {
    }
    for (TagValue ie : metadata.getTags()) {
      if (!TiffTags.tagMap.containsKey(ie.getId())) {
        validation.addWarning("Ignoring undefined tag id " + ie.getId(), "", "Metadata");
      } else if (!TiffTags.tagTypes.containsKey(ie.getType())) {
        validation.addWarning("Ignoring unknown tag type " + ie.getType(), "", "Metadata");
      }
      else {
        Tag t = TiffTags.getTag(ie.getId());
        String stype = TiffTags.tagTypes.get(ie.getType());
        if (ie.getId() == 320) {
          // Colormap length check
          long bps = 0;
          if (metadata.containsTagId(258))
            bps = metadata.get(258).getFirstNumericValue();
          long calc = 3 * (long) Math.pow(2, bps);
          if (calc != ie.getCardinality()) {
            validation.addError("Invalid cardinality for tag "
                + TiffTags.getTag(ie.getId()).getName() + "[" + ie.getCardinality() + "]",
                "Metadata", stype);
          }
        }
        try {
          // Cardinality check
          int card = Integer.parseInt(t.getCardinality());
          if (card != ie.getCardinality())
            validation.addError("Cardinality for tag " + TiffTags.getTag(ie.getId()).getName()
                + " must be " + card, "Metadata",
                ie.getCardinality());
        } catch (Exception e) {
          // TODO: Deal with formulas?
        }
      }

      if (ie.getId() < prevTagId) {
        if (tagOrderTolerance > 0)
          validation.addWarning("Tags are not in ascending order", "", "Metadata");
        else
          validation.addErrorLoc("Tags are not in ascending order", "Metadata");
      }
      prevTagId = ie.getId();
    }
  }
1050198
private void CheckPalleteImage(IfdTags metadata, int nifd) {
    // Color Map
    if (!metadata.containsTagId(TiffTags.getTagId("ColorMap"))) {
      validation.addErrorLoc("Missing Color Map", "IFD" + nifd);
    } else {
      int n = metadata.get(TiffTags.getTagId("ColorMap")).getCardinality();
      if (n != 3 * (int) Math.pow(2, metadata.get(TiffTags.getTagId("BitsPerSample"))
          .getFirstNumericValue()))
        validation.addError("Incorrect Color Map Cardinality", "IFD" + nifd, metadata.get(320)
            .getCardinality());
    }

    // Bits per Sample
    long bps = metadata.get(TiffTags.getTagId("BitsPerSample")).getFirstNumericValue();
    if (bps != 4 && bps != 8)
      validation.addError("Invalid Bits per Sample", "IFD" + nifd, bps);

    // Compression
    long comp = metadata.get(TiffTags.getTagId("Compression")).getFirstNumericValue();
    // if (comp != 1 && comp != 32773)
    if (comp < 1)
      validation.addError("Invalid Compression", "IFD" + nifd, comp);
  }
1307682
private void CheckStrips(IfdTags metadata, int n) {
    long offset;
    int id;

    // Strip offsets
    id = TiffTags.getTagId("StripOffsets");
    offset = metadata.get(id).getFirstNumericValue();
    int nso = metadata.get(id).getCardinality();
    if (offset <= 0)
      validation.addError("Invalid value for field " + TiffTags.getTag(id).getName(), "IFD" + n,
          offset);

    // Strip Byte Counts
    id = TiffTags.getTagId("StripBYTECount");
    offset = metadata.get(id).getFirstNumericValue();
    int nsc = metadata.get(id).getCardinality();
    if (offset <= 0)
      validation.addError("Invalid value for field " + TiffTags.getTag(id).getName(), "IFD" + n,
          offset);

    if (nso != nsc) {
      validation.addErrorLoc("Inconsistent strip lengths", "IFD" + n);
    }

    int pixelSize = 0;
    for (int i = 0; i < metadata.get("BitsPerSample").getCardinality(); i++) {
      pixelSize += metadata.get("BitsPerSample").getValue().get(i).toInt();
    }
    if (metadata.get("Compression").getFirstNumericValue() == 1
 && pixelSize >= 8) {
      int calculatedImageLength = 0;
      for (int i = 0; i < nsc; i++) {
        calculatedImageLength += metadata.get(id).getValue().get(i).toInt();
      }
      if (calculatedImageLength != metadata.get("ImageLength").getFirstNumericValue()
          * metadata.get("ImageWidth").getFirstNumericValue() * pixelSize / 8) {
        // validation.toString();
        validation.addErrorLoc("Calculated and declared image size do not match", "IFD" + n);
      }
    }

    // Rows per Strip
    id = TiffTags.getTagId("RowsPerStrip");
    if (!metadata.containsTagId(id)) {
      if (rowsPerStripTolerance > 0)
        validation.addWarning("Missing required field", TiffTags.getTag(id).getName(), "IFD" + n);
      else
        validation.addError("Missing required field", "IFD" + n, TiffTags.getTag(id).getName());
    } else {
      offset = metadata.get(id).getFirstNumericValue();
      if (offset <= 0)
        validation.addError("Invalid value for field " + TiffTags.getTag(id).getName(), "IFD" + n,
            offset);
    }
  }
102886
@FindbugsSuppressWarnings("VO_VOLATILE_INCREMENT")
  public MetadataTuple<V> computeWithMetadata(K key, BiFunction<? super K, ? super MetadataTuple<V>, ? extends MetadataTuple<V>> remappingFunction) {
    freePendingTables();

    int hash = key.hashCode();

    IntBuffer originalTable = hashtable;

    int start = indexFor(spread(hash));
    hashtable.position(start);

    int limit = reprobeLimit();

    for (int i = 0; i < limit; i++) {
      if (!hashtable.hasRemaining()) {
        hashtable.rewind();
      }

      IntBuffer entry = (IntBuffer) hashtable.slice().limit(ENTRY_SIZE);

      if (isAvailable(entry)) {
        for (IntBuffer laterEntry = entry; i < limit; i++) {
          if (isTerminating(laterEntry)) {
            break;
          } else if (isPresent(laterEntry) && keyEquals(key, hash, readLong(laterEntry, ENCODING), laterEntry.get(KEY_HASHCODE))) {
            long encoding = readLong(laterEntry, ENCODING);
            @SuppressWarnings("unchecked")
            MetadataTuple<V> existingValue = metadataTuple(
                    (V) storageEngine.readValue(encoding),
                    laterEntry.get(STATUS) & ~RESERVED_STATUS_BITS);
            MetadataTuple<V> result = remappingFunction.apply(key, existingValue);
            if (result == null) {
              storageEngine.freeMapping(readLong(laterEntry, ENCODING), laterEntry.get(KEY_HASHCODE), true);
              laterEntry.put(STATUS, STATUS_REMOVED);
              slotRemoved(laterEntry);
              shrink();
            } else if (result == existingValue) {
              //nop
            } else if (result.value() == existingValue.value()) {
              int previous = laterEntry.get(STATUS);
              laterEntry.put(STATUS, (previous & RESERVED_STATUS_BITS) | (result.metadata() & ~RESERVED_STATUS_BITS));
            } else {
              int [] newEntry = writeEntry(key, hash, result.value(), result.metadata());
              if (hashtable != originalTable || !isPresent(laterEntry)) {
                storageEngine.freeMapping(readLong(newEntry, ENCODING), newEntry[KEY_HASHCODE], false);
                return computeWithMetadata(key, remappingFunction);
              }
              storageEngine.attachedMapping(readLong(newEntry, ENCODING), hash, result.metadata());
              storageEngine.invalidateCache();
              storageEngine.freeMapping(readLong(laterEntry, ENCODING), laterEntry.get(KEY_HASHCODE), false);
              long oldEncoding = readLong(laterEntry, ENCODING);
              laterEntry.put(newEntry);
              slotUpdated((IntBuffer) laterEntry.flip(), oldEncoding);
              hit(laterEntry);
            }
            return result;
          } else {
            hashtable.position(hashtable.position() + ENTRY_SIZE);
          }

          if (!hashtable.hasRemaining()) {
            hashtable.rewind();
          }

          laterEntry = (IntBuffer) hashtable.slice().limit(ENTRY_SIZE);
        }
        MetadataTuple<V> result = remappingFunction.apply(key, null);
        if (result != null) {
          int [] newEntry = writeEntry(key, hash, result.value(), result.metadata());
          if (hashtable != originalTable) {
            storageEngine.freeMapping(readLong(newEntry, ENCODING), newEntry[KEY_HASHCODE], false);
            return computeWithMetadata(key, remappingFunction);
          } else if (!isAvailable(entry)) {
            throw new AssertionError();
          }
          if (isRemoved(entry)) {
            removedSlots--;
          }
          storageEngine.attachedMapping(readLong(newEntry, ENCODING), hash, result.metadata());
          storageEngine.invalidateCache();
          entry.put(newEntry);
          slotAdded(entry);
          hit(entry);
        }
        return result;
      } else if (keyEquals(key, hash, readLong(entry, ENCODING), entry.get(KEY_HASHCODE))) {
        long existingEncoding = readLong(entry, ENCODING);
        int existingStatus = entry.get(STATUS);
        @SuppressWarnings("unchecked")
        MetadataTuple<V> existingTuple = metadataTuple(
                (V) storageEngine.readValue(existingEncoding),
                existingStatus & ~RESERVED_STATUS_BITS);
        MetadataTuple<V> result = remappingFunction.apply(key, existingTuple);
        if (result == null) {
          storageEngine.freeMapping(existingEncoding, hash, true);
          entry.put(STATUS, STATUS_REMOVED);
          slotRemoved(entry);
          shrink();
        } else if (result == existingTuple) {
          //nop
        } else if (result.value() == existingTuple.value()) {
          entry.put(STATUS, (existingStatus & RESERVED_STATUS_BITS) | (result.metadata() & ~RESERVED_STATUS_BITS));
        } else {
          int [] newEntry = writeEntry(key, hash, result.value(), result.metadata());
          if (hashtable != originalTable || !isPresent(entry)) {
            storageEngine.freeMapping(readLong(newEntry, ENCODING), newEntry[KEY_HASHCODE], false);
            return computeWithMetadata(key, remappingFunction);
          }
          storageEngine.attachedMapping(readLong(newEntry, ENCODING), hash, result.metadata());
          storageEngine.invalidateCache();
          storageEngine.freeMapping(readLong(entry, ENCODING), entry.get(KEY_HASHCODE), false);
          entry.put(newEntry);
          slotUpdated((IntBuffer) entry.flip(), existingEncoding);
          hit(entry);
        }
        return result;
      } else {
        hashtable.position(hashtable.position() + ENTRY_SIZE);
      }
    }

    // hit reprobe limit - must rehash
    expand(start, limit);

    return computeWithMetadata(key, remappingFunction);
  }
926314
private void validateIfdBL(IFD ifd, int p) {
    IfdTags metadata = ifd.getMetadata();

    if (p == 1) {
      checkRequiredTag(metadata, "NewSubfileType", 1, new long[]{0});
    }
    checkRequiredTag(metadata, "ImageLength", 1);
    checkRequiredTag(metadata, "ImageWidth", 1);
    checkRequiredTag(metadata, "BitsPerSample", 1, new long[]{1});
    checkRequiredTag(metadata, "Compression", 1, new long[]{32898});
    if (p == 0) {
      checkRequiredTag(metadata, "PhotometricInterpretation", 1, new long[] {0, 1});
    } else {
      checkRequiredTag(metadata, "PhotometricInterpretation", 1, new long[] {0});
    }
    checkRequiredTag(metadata, "StripOffsets", 1);
    if (p == 0) {
      checkRequiredTag(metadata, "Orientation", 1, new long[]{1,4,5,8});
    } else {
      checkRequiredTag(metadata, "Orientation", 1, new long[]{1});
    }
    checkRequiredTag(metadata, "SamplesPerPixel", 1, new long[]{1});
    checkRequiredTag(metadata, "StripBYTECount", 1);
    checkRequiredTag(metadata, "XResolution", 1);
    checkRequiredTag(metadata, "YResolution", 1);
    if (p == 1) {
      checkRequiredTag(metadata, "ResolutionUnit", 1, new long[]{2, 3});
      checkRequiredTag(metadata, "DotRange", 2, new long[]{0, 255});
    }
    checkRequiredTag(metadata, "ImageColorIndicator", 1, new long[]{0, 1, 2});
    checkRequiredTag(metadata, "BackgroundColorIndicator", 1, new long[]{0, 1, 2});
  }
179833
public com.google.cloud.datalabeling.v1beta1.NormalizedPolylineOrBuilder
      getNormalizedPolylineOrBuilder() {
    if (polyCase_ == 3) {
      return (com.google.cloud.datalabeling.v1beta1.NormalizedPolyline) poly_;
    }
    return com.google.cloud.datalabeling.v1beta1.NormalizedPolyline.getDefaultInstance();
  }