/// <summary>
 /// Gets a human-readable name for a given ProRes color definition.
 /// </summary>
 /// <param name="colorDefinition">The requested ProRes color definition value.</param>
 /// <returns>The name of the color definition.</returns>
 public static string GetDisplayName(this ProResColorDefinition colorDefinition)
 {
     switch (colorDefinition)
     {
     case ProResColorDefinition.HD_Rec709: return("HD Rec. 709");
     }
     return("N/A");
 }
Exemple #2
0
        /// <summary>
        /// Gets the matching color definition for the dropdown UI index. The return value must match the
        /// ProResCommon::ColorDescription enum in ProResCommon.h in the ProRes wrapper libraries.
        /// <summary>
        static internal ProResColorDefinition GetProResColorDefinitionFromExposedIndex(int exposedIndex)
        {
            ProResColorDefinition result = ProResColorDefinition.HD_Rec709;

            switch (exposedIndex)
            {
            case 0:
                return(ProResColorDefinition.HD_Rec709);

            default:
                Debug.LogWarning(
                    $"Color definition value {exposedIndex} is not recognized. Falling back to {result}");
                return(result);
            }
        }
Exemple #3
0
        /// <summary>
        /// Gets the matching color definition for the dropdown UI index. The return value must match the
        /// ProResCommon::ColorDescription enum in ProResCommon.h in the ProRes wrapper libraries.
        /// <summary>
        static internal int GetProResWrapperColorDefinition(ProResColorDefinition colorDefinition)
        {
            bool found  = false;
            int  result = 0;

            foreach (var v in ProResColorDefinition.GetValues(typeof(ProResColorDefinition)))
            {
                var currEnum = (ProResColorDefinition)v;
                if (currEnum == colorDefinition)
                {
                    result = (int)v;
                    found  = true;
                    break;
                }
            }

            return(found ? result : 0);
        }