Class Presentation

  • All Implemented Interfaces:
    GlEffect, GlMatrixTransformation, MatrixTransformation

    public final class Presentation
    extends Object
    implements MatrixTransformation
    Controls how a frame is presented with options to set the output resolution, crop the input, and choose how to map the input pixels onto the output frame geometry (for example, by stretching the input frame to match the specified output frame, or fitting the input frame using letterboxing).

    Cropping or aspect ratio is applied before setting resolution.

    The background color of the output frame will be black.

    • Field Detail

      • LAYOUT_SCALE_TO_FIT

        public static final int LAYOUT_SCALE_TO_FIT
        Empty pixels added above and below the input frame (for letterboxing), or to the left and right of the input frame (for pillarboxing), until the desired aspect ratio is achieved. All input frame pixels will be within the output frame.

        When applying:

        • letterboxing, the output width will default to the input width, and the output height will be scaled appropriately.
        • pillarboxing, the output height will default to the input height, and the output width will be scaled appropriately.
        See Also:
        Constant Field Values
      • LAYOUT_SCALE_TO_FIT_WITH_CROP

        public static final int LAYOUT_SCALE_TO_FIT_WITH_CROP
        Pixels cropped from the input frame, until the desired aspect ratio is achieved. Pixels may be cropped either from the bottom and top, or from the left and right sides, of the input frame.

        When cropping from the:

        • bottom and top, the output width will default to the input width, and the output height will be scaled appropriately.
        • left and right, the output height will default to the input height, and the output width will be scaled appropriately.
        See Also:
        Constant Field Values
      • LAYOUT_STRETCH_TO_FIT

        public static final int LAYOUT_STRETCH_TO_FIT
        Frame stretched larger on the x or y axes to fit the desired aspect ratio.

        When stretching to a:

        • taller aspect ratio, the output width will default to the input width, and the output height will be scaled appropriately.
        • narrower aspect ratio, the output height will default to the input height, and the output width will be scaled appropriately.
        See Also:
        Constant Field Values