<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/datalabeling/v1beta1/data_labeling_service.proto

namespace Google\Cloud\DataLabeling\V1beta1\LabelImageRequest;

use UnexpectedValueException;

/**
 * Image labeling task feature.
 *
 * Protobuf type <code>google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature</code>
 */
class Feature
{
    /**
     * Generated from protobuf enum <code>FEATURE_UNSPECIFIED = 0;</code>
     */
    const FEATURE_UNSPECIFIED = 0;
    /**
     * Label whole image with one or more of labels.
     *
     * Generated from protobuf enum <code>CLASSIFICATION = 1;</code>
     */
    const CLASSIFICATION = 1;
    /**
     * Label image with bounding boxes for labels.
     *
     * Generated from protobuf enum <code>BOUNDING_BOX = 2;</code>
     */
    const BOUNDING_BOX = 2;
    /**
     * Label oriented bounding box. The box does not have to be parallel to
     * horizontal line.
     *
     * Generated from protobuf enum <code>ORIENTED_BOUNDING_BOX = 6;</code>
     */
    const ORIENTED_BOUNDING_BOX = 6;
    /**
     * Label images with bounding poly. A bounding poly is a plane figure that
     * is bounded by a finite chain of straight line segments closing in a loop.
     *
     * Generated from protobuf enum <code>BOUNDING_POLY = 3;</code>
     */
    const BOUNDING_POLY = 3;
    /**
     * Label images with polyline. Polyline is formed by connected line segments
     * which are not in closed form.
     *
     * Generated from protobuf enum <code>POLYLINE = 4;</code>
     */
    const POLYLINE = 4;
    /**
     * Label images with segmentation. Segmentation is different from bounding
     * poly since it is more fine-grained, pixel level annotation.
     *
     * Generated from protobuf enum <code>SEGMENTATION = 5;</code>
     */
    const SEGMENTATION = 5;

    private static $valueToName = [
        self::FEATURE_UNSPECIFIED => 'FEATURE_UNSPECIFIED',
        self::CLASSIFICATION => 'CLASSIFICATION',
        self::BOUNDING_BOX => 'BOUNDING_BOX',
        self::ORIENTED_BOUNDING_BOX => 'ORIENTED_BOUNDING_BOX',
        self::BOUNDING_POLY => 'BOUNDING_POLY',
        self::POLYLINE => 'POLYLINE',
        self::SEGMENTATION => 'SEGMENTATION',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Feature::class, \Google\Cloud\DataLabeling\V1beta1\LabelImageRequest_Feature::class);

