<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: graphicsData.proto

namespace Rv\Data\Media\VideoProperties;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.Media.VideoProperties.FieldType</code>
 */
class FieldType
{
    /**
     * Generated from protobuf enum <code>FIELD_TYPE_UNKNOWN = 0;</code>
     */
    const FIELD_TYPE_UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>FIELD_TYPE_PROGRESSIVE = 1;</code>
     */
    const FIELD_TYPE_PROGRESSIVE = 1;
    /**
     * Generated from protobuf enum <code>FIELD_TYPE_INTERLACED_UPPER_FIRST = 2;</code>
     */
    const FIELD_TYPE_INTERLACED_UPPER_FIRST = 2;
    /**
     * Generated from protobuf enum <code>FIELD_TYPE_INTERLACED_LOWER_FIRST = 3;</code>
     */
    const FIELD_TYPE_INTERLACED_LOWER_FIRST = 3;

    private static $valueToName = [
        self::FIELD_TYPE_UNKNOWN => 'FIELD_TYPE_UNKNOWN',
        self::FIELD_TYPE_PROGRESSIVE => 'FIELD_TYPE_PROGRESSIVE',
        self::FIELD_TYPE_INTERLACED_UPPER_FIRST => 'FIELD_TYPE_INTERLACED_UPPER_FIRST',
        self::FIELD_TYPE_INTERLACED_LOWER_FIRST => 'FIELD_TYPE_INTERLACED_LOWER_FIRST',
    ];

    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);
    }
}

