Class CommonAspectRatio


  • public final class CommonAspectRatio
    extends Object
    Enumeration for common types of aspect ratios. Certain task types such as image generation produce image files. Some prompt services allow the user to select the aspect ratio of that image file. Implementations are encouraged to use these constants to increase interoperability between different prompt service implementations, but are not required to do so.
    Since:
    8.5.0
    See Also:
    IPromptQueryConfig_AspectRatio
    • Field Detail

      • RATIO_16_9

        public static final String RATIO_16_9
        Aspect ratio 16:9 (landscape), i.e. width/height = 16/9.
        See Also:
        Constant Field Values
      • RATIO_27_64

        public static final String RATIO_27_64
        Aspect ratio 27:64, i.e. width/height = 27/64. Sometimes also referred to as "9:21" (an approximation).
        See Also:
        Constant Field Values
      • RATIO_2_3

        public static final String RATIO_2_3
        Aspect ratio 2:3 (portrait), i.e. width/height = 2/3.
        See Also:
        Constant Field Values
      • RATIO_3_2

        public static final String RATIO_3_2
        Aspect ratio 3:2 (landscape), i.e. width/height = 3/2.
        See Also:
        Constant Field Values
      • RATIO_3_4

        public static final String RATIO_3_4
        Aspect ratio 3:4 (portrait), i.e. width/height = 3/4.
        See Also:
        Constant Field Values
      • RATIO_4_3

        public static final String RATIO_4_3
        Aspect ratio 4:3 (landscape), i.e. width/height = 4/3.
        See Also:
        Constant Field Values
      • RATIO_43_18

        public static final String RATIO_43_18
        Aspect ratio 43:18 (landscape), i.e. width/height = 43/18.
        See Also:
        Constant Field Values
      • RATIO_18_43

        public static final String RATIO_18_43
        Aspect ratio 18:43 (portrait), i.e. width/height = 18/43.
        See Also:
        Constant Field Values
      • RATIO_21_9

        public static final String RATIO_21_9
        Aspect ratio 21:9 (landscape), i.e. width/height = 21/9.
        See Also:
        Constant Field Values
      • RATIO_9_21

        public static final String RATIO_9_21
        Aspect ratio 9:21 (portrait), i.e. width/height = 9/21.
        See Also:
        Constant Field Values
      • RATIO_64_27

        public static final String RATIO_64_27
        Aspect ratio 64:27 (landscape), i.e. width/height = 64/27. Sometimes also referred to as "21:9" (an approximation).
        See Also:
        Constant Field Values
      • RATIO_9_16

        public static final String RATIO_9_16
        Aspect ratio 9:16 (portrait), i.e. width/height = 9/16.
        See Also:
        Constant Field Values
    • Method Detail

      • localizedDescription

        public static String localizedDescription​(Locale locale,
                                                  String commonAspectRatio)
        Gets the localized description for the given common aspect ratio. The value should be one of the constants defined in this class. When an unknown value is given, returns an implementation-defined default description.
        Parameters:
        locale - The locale for which to localize the description.
        commonAspectRatio - The common aspect ratio constant, must be one of the constants defined in this class.
        Returns:
        The localized description for the given common aspect ratio.
      • localizedLabel

        public static String localizedLabel​(Locale locale,
                                            String commonAspectRatio)
        Gets the localized label for the given common aspect ratio. The value should be one of the constants defined in this class. When an unknown value is given, returns an implementation-defined default label.
        Parameters:
        locale - The locale for which to localize the label.
        commonAspectRatio - The common aspect ratio constant, must be one of the constants defined in this class.
        Returns:
        The localized label for the given common aspect ratio.