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

namespace Rv\Data\Media;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.Media.ScaleAlignment</code>
 */
class ScaleAlignment
{
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_MIDDLE_CENTER = 0;</code>
     */
    const SCALE_ALIGNMENT_MIDDLE_CENTER = 0;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_TOP_LEFT = 1;</code>
     */
    const SCALE_ALIGNMENT_TOP_LEFT = 1;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_TOP_CENTER = 2;</code>
     */
    const SCALE_ALIGNMENT_TOP_CENTER = 2;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_TOP_RIGHT = 3;</code>
     */
    const SCALE_ALIGNMENT_TOP_RIGHT = 3;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_MIDDLE_RIGHT = 4;</code>
     */
    const SCALE_ALIGNMENT_MIDDLE_RIGHT = 4;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_BOTTOM_RIGHT = 5;</code>
     */
    const SCALE_ALIGNMENT_BOTTOM_RIGHT = 5;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_BOTTOM_CENTER = 6;</code>
     */
    const SCALE_ALIGNMENT_BOTTOM_CENTER = 6;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_BOTTOM_LEFT = 7;</code>
     */
    const SCALE_ALIGNMENT_BOTTOM_LEFT = 7;
    /**
     * Generated from protobuf enum <code>SCALE_ALIGNMENT_MIDDLE_LEFT = 8;</code>
     */
    const SCALE_ALIGNMENT_MIDDLE_LEFT = 8;

    private static $valueToName = [
        self::SCALE_ALIGNMENT_MIDDLE_CENTER => 'SCALE_ALIGNMENT_MIDDLE_CENTER',
        self::SCALE_ALIGNMENT_TOP_LEFT => 'SCALE_ALIGNMENT_TOP_LEFT',
        self::SCALE_ALIGNMENT_TOP_CENTER => 'SCALE_ALIGNMENT_TOP_CENTER',
        self::SCALE_ALIGNMENT_TOP_RIGHT => 'SCALE_ALIGNMENT_TOP_RIGHT',
        self::SCALE_ALIGNMENT_MIDDLE_RIGHT => 'SCALE_ALIGNMENT_MIDDLE_RIGHT',
        self::SCALE_ALIGNMENT_BOTTOM_RIGHT => 'SCALE_ALIGNMENT_BOTTOM_RIGHT',
        self::SCALE_ALIGNMENT_BOTTOM_CENTER => 'SCALE_ALIGNMENT_BOTTOM_CENTER',
        self::SCALE_ALIGNMENT_BOTTOM_LEFT => 'SCALE_ALIGNMENT_BOTTOM_LEFT',
        self::SCALE_ALIGNMENT_MIDDLE_LEFT => 'SCALE_ALIGNMENT_MIDDLE_LEFT',
    ];

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

