{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ElasticTranscoder.Types.PresetWatermark
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticTranscoder.Types.PresetWatermark where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Settings for the size, location, and opacity of graphics that you want
-- Elastic Transcoder to overlay over videos that are transcoded using this
-- preset. You can specify settings for up to four watermarks. Watermarks
-- appear in the specified size and location, and with the specified
-- opacity for the duration of the transcoded video.
--
-- Watermarks can be in .png or .jpg format. If you want to display a
-- watermark that is not rectangular, use the .png format, which supports
-- transparency.
--
-- When you create a job that uses this preset, you specify the .png or
-- .jpg graphics that you want Elastic Transcoder to include in the
-- transcoded videos. You can specify fewer graphics in the job than you
-- specify watermark settings in the preset, which allows you to use the
-- same preset for up to four watermarks that have different dimensions.
--
-- /See:/ 'newPresetWatermark' smart constructor.
data PresetWatermark = PresetWatermark'
  { -- | The vertical position of the watermark unless you specify a non-zero
    -- value for @VerticalOffset@:
    --
    -- -   __Top__: The top edge of the watermark is aligned with the top
    --     border of the video.
    --
    -- -   __Bottom__: The bottom edge of the watermark is aligned with the
    --     bottom border of the video.
    --
    -- -   __Center__: The watermark is centered between the top and bottom
    --     borders.
    PresetWatermark -> Maybe Text
verticalAlign :: Prelude.Maybe Prelude.Text,
    -- | A value that controls scaling of the watermark:
    --
    -- -   __Fit__: Elastic Transcoder scales the watermark so it matches the
    --     value that you specified in either @MaxWidth@ or @MaxHeight@ without
    --     exceeding the other value.
    --
    -- -   __Stretch__: Elastic Transcoder stretches the watermark to match the
    --     values that you specified for @MaxWidth@ and @MaxHeight@. If the
    --     relative proportions of the watermark and the values of @MaxWidth@
    --     and @MaxHeight@ are different, the watermark will be distorted.
    --
    -- -   __ShrinkToFit__: Elastic Transcoder scales the watermark down so
    --     that its dimensions match the values that you specified for at least
    --     one of @MaxWidth@ and @MaxHeight@ without exceeding either value. If
    --     you specify this option, Elastic Transcoder does not scale the
    --     watermark up.
    PresetWatermark -> Maybe Text
sizingPolicy :: Prelude.Maybe Prelude.Text,
    -- | The amount by which you want the horizontal position of the watermark to
    -- be offset from the position specified by HorizontalAlign:
    --
    -- -   number of pixels (px): The minimum value is 0 pixels, and the
    --     maximum value is the value of MaxWidth.
    --
    -- -   integer percentage (%): The range of valid values is 0 to 100.
    --
    -- For example, if you specify Left for @HorizontalAlign@ and 5px for
    -- @HorizontalOffset@, the left side of the watermark appears 5 pixels from
    -- the left border of the output video.
    --
    -- @HorizontalOffset@ is only valid when the value of @HorizontalAlign@ is
    -- @Left@ or @Right@. If you specify an offset that causes the watermark to
    -- extend beyond the left or right border and Elastic Transcoder has not
    -- added black bars, the watermark is cropped. If Elastic Transcoder has
    -- added black bars, the watermark extends into the black bars. If the
    -- watermark extends beyond the black bars, it is cropped.
    --
    -- Use the value of @Target@ to specify whether you want to include the
    -- black bars that are added by Elastic Transcoder, if any, in the offset
    -- calculation.
    PresetWatermark -> Maybe Text
horizontalOffset :: Prelude.Maybe Prelude.Text,
    -- | The maximum height of the watermark in one of the following formats:
    --
    -- -   number of pixels (px): The minimum value is 16 pixels, and the
    --     maximum value is the value of @MaxHeight@.
    --
    -- -   integer percentage (%): The range of valid values is 0 to 100. Use
    --     the value of @Target@ to specify whether you want Elastic Transcoder
    --     to include the black bars that are added by Elastic Transcoder, if
    --     any, in the calculation.
    --
    -- If you specify the value in pixels, it must be less than or equal to the
    -- value of @MaxHeight@.
    PresetWatermark -> Maybe Text
maxHeight :: Prelude.Maybe Prelude.Text,
    -- | A percentage that indicates how much you want a watermark to obscure the
    -- video in the location where it appears. Valid values are 0 (the
    -- watermark is invisible) to 100 (the watermark completely obscures the
    -- video in the specified location). The datatype of @Opacity@ is float.
    --
    -- Elastic Transcoder supports transparent .png graphics. If you use a
    -- transparent .png, the transparent portion of the video appears as if you
    -- had specified a value of 0 for @Opacity@. The .jpg file format doesn\'t
    -- support transparency.
    PresetWatermark -> Maybe Text
opacity :: Prelude.Maybe Prelude.Text,
    -- | @VerticalOffset@
    --
    -- The amount by which you want the vertical position of the watermark to
    -- be offset from the position specified by VerticalAlign:
    --
    -- -   number of pixels (px): The minimum value is 0 pixels, and the
    --     maximum value is the value of @MaxHeight@.
    --
    -- -   integer percentage (%): The range of valid values is 0 to 100.
    --
    -- For example, if you specify @Top@ for @VerticalAlign@ and @5px@ for
    -- @VerticalOffset@, the top of the watermark appears 5 pixels from the top
    -- border of the output video.
    --
    -- @VerticalOffset@ is only valid when the value of VerticalAlign is Top or
    -- Bottom.
    --
    -- If you specify an offset that causes the watermark to extend beyond the
    -- top or bottom border and Elastic Transcoder has not added black bars,
    -- the watermark is cropped. If Elastic Transcoder has added black bars,
    -- the watermark extends into the black bars. If the watermark extends
    -- beyond the black bars, it is cropped.
    --
    -- Use the value of @Target@ to specify whether you want Elastic Transcoder
    -- to include the black bars that are added by Elastic Transcoder, if any,
    -- in the offset calculation.
    PresetWatermark -> Maybe Text
verticalOffset :: Prelude.Maybe Prelude.Text,
    -- | The maximum width of the watermark in one of the following formats:
    --
    -- -   number of pixels (px): The minimum value is 16 pixels, and the
    --     maximum value is the value of @MaxWidth@.
    --
    -- -   integer percentage (%): The range of valid values is 0 to 100. Use
    --     the value of @Target@ to specify whether you want Elastic Transcoder
    --     to include the black bars that are added by Elastic Transcoder, if
    --     any, in the calculation.
    --
    --     If you specify the value in pixels, it must be less than or equal to
    --     the value of @MaxWidth@.
    PresetWatermark -> Maybe Text
maxWidth :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the settings for one watermark. The value of
    -- @Id@ can be up to 40 characters long.
    PresetWatermark -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The horizontal position of the watermark unless you specify a non-zero
    -- value for @HorizontalOffset@:
    --
    -- -   __Left__: The left edge of the watermark is aligned with the left
    --     border of the video.
    --
    -- -   __Right__: The right edge of the watermark is aligned with the right
    --     border of the video.
    --
    -- -   __Center__: The watermark is centered between the left and right
    --     borders.
    PresetWatermark -> Maybe Text
horizontalAlign :: Prelude.Maybe Prelude.Text,
    -- | A value that determines how Elastic Transcoder interprets values that
    -- you specified for @HorizontalOffset@, @VerticalOffset@, @MaxWidth@, and
    -- @MaxHeight@:
    --
    -- -   __Content__: @HorizontalOffset@ and @VerticalOffset@ values are
    --     calculated based on the borders of the video excluding black bars
    --     added by Elastic Transcoder, if any. In addition, @MaxWidth@ and
    --     @MaxHeight@, if specified as a percentage, are calculated based on
    --     the borders of the video excluding black bars added by Elastic
    --     Transcoder, if any.
    --
    -- -   __Frame__: @HorizontalOffset@ and @VerticalOffset@ values are
    --     calculated based on the borders of the video including black bars
    --     added by Elastic Transcoder, if any. In addition, @MaxWidth@ and
    --     @MaxHeight@, if specified as a percentage, are calculated based on
    --     the borders of the video including black bars added by Elastic
    --     Transcoder, if any.
    PresetWatermark -> Maybe Text
target :: Prelude.Maybe Prelude.Text
  }
  deriving (PresetWatermark -> PresetWatermark -> Bool
(PresetWatermark -> PresetWatermark -> Bool)
-> (PresetWatermark -> PresetWatermark -> Bool)
-> Eq PresetWatermark
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PresetWatermark -> PresetWatermark -> Bool
$c/= :: PresetWatermark -> PresetWatermark -> Bool
== :: PresetWatermark -> PresetWatermark -> Bool
$c== :: PresetWatermark -> PresetWatermark -> Bool
Prelude.Eq, ReadPrec [PresetWatermark]
ReadPrec PresetWatermark
Int -> ReadS PresetWatermark
ReadS [PresetWatermark]
(Int -> ReadS PresetWatermark)
-> ReadS [PresetWatermark]
-> ReadPrec PresetWatermark
-> ReadPrec [PresetWatermark]
-> Read PresetWatermark
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PresetWatermark]
$creadListPrec :: ReadPrec [PresetWatermark]
readPrec :: ReadPrec PresetWatermark
$creadPrec :: ReadPrec PresetWatermark
readList :: ReadS [PresetWatermark]
$creadList :: ReadS [PresetWatermark]
readsPrec :: Int -> ReadS PresetWatermark
$creadsPrec :: Int -> ReadS PresetWatermark
Prelude.Read, Int -> PresetWatermark -> ShowS
[PresetWatermark] -> ShowS
PresetWatermark -> String
(Int -> PresetWatermark -> ShowS)
-> (PresetWatermark -> String)
-> ([PresetWatermark] -> ShowS)
-> Show PresetWatermark
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PresetWatermark] -> ShowS
$cshowList :: [PresetWatermark] -> ShowS
show :: PresetWatermark -> String
$cshow :: PresetWatermark -> String
showsPrec :: Int -> PresetWatermark -> ShowS
$cshowsPrec :: Int -> PresetWatermark -> ShowS
Prelude.Show, (forall x. PresetWatermark -> Rep PresetWatermark x)
-> (forall x. Rep PresetWatermark x -> PresetWatermark)
-> Generic PresetWatermark
forall x. Rep PresetWatermark x -> PresetWatermark
forall x. PresetWatermark -> Rep PresetWatermark x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PresetWatermark x -> PresetWatermark
$cfrom :: forall x. PresetWatermark -> Rep PresetWatermark x
Prelude.Generic)

-- |
-- Create a value of 'PresetWatermark' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'verticalAlign', 'presetWatermark_verticalAlign' - The vertical position of the watermark unless you specify a non-zero
-- value for @VerticalOffset@:
--
-- -   __Top__: The top edge of the watermark is aligned with the top
--     border of the video.
--
-- -   __Bottom__: The bottom edge of the watermark is aligned with the
--     bottom border of the video.
--
-- -   __Center__: The watermark is centered between the top and bottom
--     borders.
--
-- 'sizingPolicy', 'presetWatermark_sizingPolicy' - A value that controls scaling of the watermark:
--
-- -   __Fit__: Elastic Transcoder scales the watermark so it matches the
--     value that you specified in either @MaxWidth@ or @MaxHeight@ without
--     exceeding the other value.
--
-- -   __Stretch__: Elastic Transcoder stretches the watermark to match the
--     values that you specified for @MaxWidth@ and @MaxHeight@. If the
--     relative proportions of the watermark and the values of @MaxWidth@
--     and @MaxHeight@ are different, the watermark will be distorted.
--
-- -   __ShrinkToFit__: Elastic Transcoder scales the watermark down so
--     that its dimensions match the values that you specified for at least
--     one of @MaxWidth@ and @MaxHeight@ without exceeding either value. If
--     you specify this option, Elastic Transcoder does not scale the
--     watermark up.
--
-- 'horizontalOffset', 'presetWatermark_horizontalOffset' - The amount by which you want the horizontal position of the watermark to
-- be offset from the position specified by HorizontalAlign:
--
-- -   number of pixels (px): The minimum value is 0 pixels, and the
--     maximum value is the value of MaxWidth.
--
-- -   integer percentage (%): The range of valid values is 0 to 100.
--
-- For example, if you specify Left for @HorizontalAlign@ and 5px for
-- @HorizontalOffset@, the left side of the watermark appears 5 pixels from
-- the left border of the output video.
--
-- @HorizontalOffset@ is only valid when the value of @HorizontalAlign@ is
-- @Left@ or @Right@. If you specify an offset that causes the watermark to
-- extend beyond the left or right border and Elastic Transcoder has not
-- added black bars, the watermark is cropped. If Elastic Transcoder has
-- added black bars, the watermark extends into the black bars. If the
-- watermark extends beyond the black bars, it is cropped.
--
-- Use the value of @Target@ to specify whether you want to include the
-- black bars that are added by Elastic Transcoder, if any, in the offset
-- calculation.
--
-- 'maxHeight', 'presetWatermark_maxHeight' - The maximum height of the watermark in one of the following formats:
--
-- -   number of pixels (px): The minimum value is 16 pixels, and the
--     maximum value is the value of @MaxHeight@.
--
-- -   integer percentage (%): The range of valid values is 0 to 100. Use
--     the value of @Target@ to specify whether you want Elastic Transcoder
--     to include the black bars that are added by Elastic Transcoder, if
--     any, in the calculation.
--
-- If you specify the value in pixels, it must be less than or equal to the
-- value of @MaxHeight@.
--
-- 'opacity', 'presetWatermark_opacity' - A percentage that indicates how much you want a watermark to obscure the
-- video in the location where it appears. Valid values are 0 (the
-- watermark is invisible) to 100 (the watermark completely obscures the
-- video in the specified location). The datatype of @Opacity@ is float.
--
-- Elastic Transcoder supports transparent .png graphics. If you use a
-- transparent .png, the transparent portion of the video appears as if you
-- had specified a value of 0 for @Opacity@. The .jpg file format doesn\'t
-- support transparency.
--
-- 'verticalOffset', 'presetWatermark_verticalOffset' - @VerticalOffset@
--
-- The amount by which you want the vertical position of the watermark to
-- be offset from the position specified by VerticalAlign:
--
-- -   number of pixels (px): The minimum value is 0 pixels, and the
--     maximum value is the value of @MaxHeight@.
--
-- -   integer percentage (%): The range of valid values is 0 to 100.
--
-- For example, if you specify @Top@ for @VerticalAlign@ and @5px@ for
-- @VerticalOffset@, the top of the watermark appears 5 pixels from the top
-- border of the output video.
--
-- @VerticalOffset@ is only valid when the value of VerticalAlign is Top or
-- Bottom.
--
-- If you specify an offset that causes the watermark to extend beyond the
-- top or bottom border and Elastic Transcoder has not added black bars,
-- the watermark is cropped. If Elastic Transcoder has added black bars,
-- the watermark extends into the black bars. If the watermark extends
-- beyond the black bars, it is cropped.
--
-- Use the value of @Target@ to specify whether you want Elastic Transcoder
-- to include the black bars that are added by Elastic Transcoder, if any,
-- in the offset calculation.
--
-- 'maxWidth', 'presetWatermark_maxWidth' - The maximum width of the watermark in one of the following formats:
--
-- -   number of pixels (px): The minimum value is 16 pixels, and the
--     maximum value is the value of @MaxWidth@.
--
-- -   integer percentage (%): The range of valid values is 0 to 100. Use
--     the value of @Target@ to specify whether you want Elastic Transcoder
--     to include the black bars that are added by Elastic Transcoder, if
--     any, in the calculation.
--
--     If you specify the value in pixels, it must be less than or equal to
--     the value of @MaxWidth@.
--
-- 'id', 'presetWatermark_id' - A unique identifier for the settings for one watermark. The value of
-- @Id@ can be up to 40 characters long.
--
-- 'horizontalAlign', 'presetWatermark_horizontalAlign' - The horizontal position of the watermark unless you specify a non-zero
-- value for @HorizontalOffset@:
--
-- -   __Left__: The left edge of the watermark is aligned with the left
--     border of the video.
--
-- -   __Right__: The right edge of the watermark is aligned with the right
--     border of the video.
--
-- -   __Center__: The watermark is centered between the left and right
--     borders.
--
-- 'target', 'presetWatermark_target' - A value that determines how Elastic Transcoder interprets values that
-- you specified for @HorizontalOffset@, @VerticalOffset@, @MaxWidth@, and
-- @MaxHeight@:
--
-- -   __Content__: @HorizontalOffset@ and @VerticalOffset@ values are
--     calculated based on the borders of the video excluding black bars
--     added by Elastic Transcoder, if any. In addition, @MaxWidth@ and
--     @MaxHeight@, if specified as a percentage, are calculated based on
--     the borders of the video excluding black bars added by Elastic
--     Transcoder, if any.
--
-- -   __Frame__: @HorizontalOffset@ and @VerticalOffset@ values are
--     calculated based on the borders of the video including black bars
--     added by Elastic Transcoder, if any. In addition, @MaxWidth@ and
--     @MaxHeight@, if specified as a percentage, are calculated based on
--     the borders of the video including black bars added by Elastic
--     Transcoder, if any.
newPresetWatermark ::
  PresetWatermark
newPresetWatermark :: PresetWatermark
newPresetWatermark =
  PresetWatermark' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PresetWatermark
PresetWatermark'
    { $sel:verticalAlign:PresetWatermark' :: Maybe Text
verticalAlign = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sizingPolicy:PresetWatermark' :: Maybe Text
sizingPolicy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:horizontalOffset:PresetWatermark' :: Maybe Text
horizontalOffset = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxHeight:PresetWatermark' :: Maybe Text
maxHeight = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:opacity:PresetWatermark' :: Maybe Text
opacity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:verticalOffset:PresetWatermark' :: Maybe Text
verticalOffset = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxWidth:PresetWatermark' :: Maybe Text
maxWidth = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:PresetWatermark' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:horizontalAlign:PresetWatermark' :: Maybe Text
horizontalAlign = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:target:PresetWatermark' :: Maybe Text
target = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The vertical position of the watermark unless you specify a non-zero
-- value for @VerticalOffset@:
--
-- -   __Top__: The top edge of the watermark is aligned with the top
--     border of the video.
--
-- -   __Bottom__: The bottom edge of the watermark is aligned with the
--     bottom border of the video.
--
-- -   __Center__: The watermark is centered between the top and bottom
--     borders.
presetWatermark_verticalAlign :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_verticalAlign :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_verticalAlign = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
verticalAlign :: Maybe Text
$sel:verticalAlign:PresetWatermark' :: PresetWatermark -> Maybe Text
verticalAlign} -> Maybe Text
verticalAlign) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:verticalAlign:PresetWatermark' :: Maybe Text
verticalAlign = Maybe Text
a} :: PresetWatermark)

-- | A value that controls scaling of the watermark:
--
-- -   __Fit__: Elastic Transcoder scales the watermark so it matches the
--     value that you specified in either @MaxWidth@ or @MaxHeight@ without
--     exceeding the other value.
--
-- -   __Stretch__: Elastic Transcoder stretches the watermark to match the
--     values that you specified for @MaxWidth@ and @MaxHeight@. If the
--     relative proportions of the watermark and the values of @MaxWidth@
--     and @MaxHeight@ are different, the watermark will be distorted.
--
-- -   __ShrinkToFit__: Elastic Transcoder scales the watermark down so
--     that its dimensions match the values that you specified for at least
--     one of @MaxWidth@ and @MaxHeight@ without exceeding either value. If
--     you specify this option, Elastic Transcoder does not scale the
--     watermark up.
presetWatermark_sizingPolicy :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_sizingPolicy :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_sizingPolicy = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
sizingPolicy :: Maybe Text
$sel:sizingPolicy:PresetWatermark' :: PresetWatermark -> Maybe Text
sizingPolicy} -> Maybe Text
sizingPolicy) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:sizingPolicy:PresetWatermark' :: Maybe Text
sizingPolicy = Maybe Text
a} :: PresetWatermark)

-- | The amount by which you want the horizontal position of the watermark to
-- be offset from the position specified by HorizontalAlign:
--
-- -   number of pixels (px): The minimum value is 0 pixels, and the
--     maximum value is the value of MaxWidth.
--
-- -   integer percentage (%): The range of valid values is 0 to 100.
--
-- For example, if you specify Left for @HorizontalAlign@ and 5px for
-- @HorizontalOffset@, the left side of the watermark appears 5 pixels from
-- the left border of the output video.
--
-- @HorizontalOffset@ is only valid when the value of @HorizontalAlign@ is
-- @Left@ or @Right@. If you specify an offset that causes the watermark to
-- extend beyond the left or right border and Elastic Transcoder has not
-- added black bars, the watermark is cropped. If Elastic Transcoder has
-- added black bars, the watermark extends into the black bars. If the
-- watermark extends beyond the black bars, it is cropped.
--
-- Use the value of @Target@ to specify whether you want to include the
-- black bars that are added by Elastic Transcoder, if any, in the offset
-- calculation.
presetWatermark_horizontalOffset :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_horizontalOffset :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_horizontalOffset = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
horizontalOffset :: Maybe Text
$sel:horizontalOffset:PresetWatermark' :: PresetWatermark -> Maybe Text
horizontalOffset} -> Maybe Text
horizontalOffset) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:horizontalOffset:PresetWatermark' :: Maybe Text
horizontalOffset = Maybe Text
a} :: PresetWatermark)

-- | The maximum height of the watermark in one of the following formats:
--
-- -   number of pixels (px): The minimum value is 16 pixels, and the
--     maximum value is the value of @MaxHeight@.
--
-- -   integer percentage (%): The range of valid values is 0 to 100. Use
--     the value of @Target@ to specify whether you want Elastic Transcoder
--     to include the black bars that are added by Elastic Transcoder, if
--     any, in the calculation.
--
-- If you specify the value in pixels, it must be less than or equal to the
-- value of @MaxHeight@.
presetWatermark_maxHeight :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_maxHeight :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_maxHeight = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
maxHeight :: Maybe Text
$sel:maxHeight:PresetWatermark' :: PresetWatermark -> Maybe Text
maxHeight} -> Maybe Text
maxHeight) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:maxHeight:PresetWatermark' :: Maybe Text
maxHeight = Maybe Text
a} :: PresetWatermark)

-- | A percentage that indicates how much you want a watermark to obscure the
-- video in the location where it appears. Valid values are 0 (the
-- watermark is invisible) to 100 (the watermark completely obscures the
-- video in the specified location). The datatype of @Opacity@ is float.
--
-- Elastic Transcoder supports transparent .png graphics. If you use a
-- transparent .png, the transparent portion of the video appears as if you
-- had specified a value of 0 for @Opacity@. The .jpg file format doesn\'t
-- support transparency.
presetWatermark_opacity :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_opacity :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_opacity = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
opacity :: Maybe Text
$sel:opacity:PresetWatermark' :: PresetWatermark -> Maybe Text
opacity} -> Maybe Text
opacity) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:opacity:PresetWatermark' :: Maybe Text
opacity = Maybe Text
a} :: PresetWatermark)

-- | @VerticalOffset@
--
-- The amount by which you want the vertical position of the watermark to
-- be offset from the position specified by VerticalAlign:
--
-- -   number of pixels (px): The minimum value is 0 pixels, and the
--     maximum value is the value of @MaxHeight@.
--
-- -   integer percentage (%): The range of valid values is 0 to 100.
--
-- For example, if you specify @Top@ for @VerticalAlign@ and @5px@ for
-- @VerticalOffset@, the top of the watermark appears 5 pixels from the top
-- border of the output video.
--
-- @VerticalOffset@ is only valid when the value of VerticalAlign is Top or
-- Bottom.
--
-- If you specify an offset that causes the watermark to extend beyond the
-- top or bottom border and Elastic Transcoder has not added black bars,
-- the watermark is cropped. If Elastic Transcoder has added black bars,
-- the watermark extends into the black bars. If the watermark extends
-- beyond the black bars, it is cropped.
--
-- Use the value of @Target@ to specify whether you want Elastic Transcoder
-- to include the black bars that are added by Elastic Transcoder, if any,
-- in the offset calculation.
presetWatermark_verticalOffset :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_verticalOffset :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_verticalOffset = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
verticalOffset :: Maybe Text
$sel:verticalOffset:PresetWatermark' :: PresetWatermark -> Maybe Text
verticalOffset} -> Maybe Text
verticalOffset) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:verticalOffset:PresetWatermark' :: Maybe Text
verticalOffset = Maybe Text
a} :: PresetWatermark)

-- | The maximum width of the watermark in one of the following formats:
--
-- -   number of pixels (px): The minimum value is 16 pixels, and the
--     maximum value is the value of @MaxWidth@.
--
-- -   integer percentage (%): The range of valid values is 0 to 100. Use
--     the value of @Target@ to specify whether you want Elastic Transcoder
--     to include the black bars that are added by Elastic Transcoder, if
--     any, in the calculation.
--
--     If you specify the value in pixels, it must be less than or equal to
--     the value of @MaxWidth@.
presetWatermark_maxWidth :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_maxWidth :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_maxWidth = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
maxWidth :: Maybe Text
$sel:maxWidth:PresetWatermark' :: PresetWatermark -> Maybe Text
maxWidth} -> Maybe Text
maxWidth) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:maxWidth:PresetWatermark' :: Maybe Text
maxWidth = Maybe Text
a} :: PresetWatermark)

-- | A unique identifier for the settings for one watermark. The value of
-- @Id@ can be up to 40 characters long.
presetWatermark_id :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_id :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_id = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
id :: Maybe Text
$sel:id:PresetWatermark' :: PresetWatermark -> Maybe Text
id} -> Maybe Text
id) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:id:PresetWatermark' :: Maybe Text
id = Maybe Text
a} :: PresetWatermark)

-- | The horizontal position of the watermark unless you specify a non-zero
-- value for @HorizontalOffset@:
--
-- -   __Left__: The left edge of the watermark is aligned with the left
--     border of the video.
--
-- -   __Right__: The right edge of the watermark is aligned with the right
--     border of the video.
--
-- -   __Center__: The watermark is centered between the left and right
--     borders.
presetWatermark_horizontalAlign :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_horizontalAlign :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_horizontalAlign = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
horizontalAlign :: Maybe Text
$sel:horizontalAlign:PresetWatermark' :: PresetWatermark -> Maybe Text
horizontalAlign} -> Maybe Text
horizontalAlign) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:horizontalAlign:PresetWatermark' :: Maybe Text
horizontalAlign = Maybe Text
a} :: PresetWatermark)

-- | A value that determines how Elastic Transcoder interprets values that
-- you specified for @HorizontalOffset@, @VerticalOffset@, @MaxWidth@, and
-- @MaxHeight@:
--
-- -   __Content__: @HorizontalOffset@ and @VerticalOffset@ values are
--     calculated based on the borders of the video excluding black bars
--     added by Elastic Transcoder, if any. In addition, @MaxWidth@ and
--     @MaxHeight@, if specified as a percentage, are calculated based on
--     the borders of the video excluding black bars added by Elastic
--     Transcoder, if any.
--
-- -   __Frame__: @HorizontalOffset@ and @VerticalOffset@ values are
--     calculated based on the borders of the video including black bars
--     added by Elastic Transcoder, if any. In addition, @MaxWidth@ and
--     @MaxHeight@, if specified as a percentage, are calculated based on
--     the borders of the video including black bars added by Elastic
--     Transcoder, if any.
presetWatermark_target :: Lens.Lens' PresetWatermark (Prelude.Maybe Prelude.Text)
presetWatermark_target :: (Maybe Text -> f (Maybe Text))
-> PresetWatermark -> f PresetWatermark
presetWatermark_target = (PresetWatermark -> Maybe Text)
-> (PresetWatermark -> Maybe Text -> PresetWatermark)
-> Lens PresetWatermark PresetWatermark (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PresetWatermark' {Maybe Text
target :: Maybe Text
$sel:target:PresetWatermark' :: PresetWatermark -> Maybe Text
target} -> Maybe Text
target) (\s :: PresetWatermark
s@PresetWatermark' {} Maybe Text
a -> PresetWatermark
s {$sel:target:PresetWatermark' :: Maybe Text
target = Maybe Text
a} :: PresetWatermark)

instance Core.FromJSON PresetWatermark where
  parseJSON :: Value -> Parser PresetWatermark
parseJSON =
    String
-> (Object -> Parser PresetWatermark)
-> Value
-> Parser PresetWatermark
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PresetWatermark"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PresetWatermark
PresetWatermark'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PresetWatermark)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VerticalAlign")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizingPolicy")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HorizontalOffset")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxHeight")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Opacity")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VerticalOffset")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxWidth")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> PresetWatermark)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe Text -> Maybe Text -> PresetWatermark)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PresetWatermark)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HorizontalAlign")
            Parser (Maybe Text -> PresetWatermark)
-> Parser (Maybe Text) -> Parser PresetWatermark
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Target")
      )

instance Prelude.Hashable PresetWatermark

instance Prelude.NFData PresetWatermark

instance Core.ToJSON PresetWatermark where
  toJSON :: PresetWatermark -> Value
toJSON PresetWatermark' {Maybe Text
target :: Maybe Text
horizontalAlign :: Maybe Text
id :: Maybe Text
maxWidth :: Maybe Text
verticalOffset :: Maybe Text
opacity :: Maybe Text
maxHeight :: Maybe Text
horizontalOffset :: Maybe Text
sizingPolicy :: Maybe Text
verticalAlign :: Maybe Text
$sel:target:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:horizontalAlign:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:id:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:maxWidth:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:verticalOffset:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:opacity:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:maxHeight:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:horizontalOffset:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:sizingPolicy:PresetWatermark' :: PresetWatermark -> Maybe Text
$sel:verticalAlign:PresetWatermark' :: PresetWatermark -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"VerticalAlign" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
verticalAlign,
            (Text
"SizingPolicy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sizingPolicy,
            (Text
"HorizontalOffset" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
horizontalOffset,
            (Text
"MaxHeight" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maxHeight,
            (Text
"Opacity" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
opacity,
            (Text
"VerticalOffset" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
verticalOffset,
            (Text
"MaxWidth" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maxWidth,
            (Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id,
            (Text
"HorizontalAlign" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
horizontalAlign,
            (Text
"Target" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
target
          ]
      )