{-# 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.MediaConvert.Types.Hdr10Plus
-- 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.MediaConvert.Types.Hdr10Plus where

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

-- | Setting for HDR10+ metadata insertion
--
-- /See:/ 'newHdr10Plus' smart constructor.
data Hdr10Plus = Hdr10Plus'
  { -- | Specify the HDR10+ mastering display normalized peak luminance, in nits.
    -- This is the normalized actual peak luminance of the mastering display,
    -- as defined by ST 2094-40.
    Hdr10Plus -> Maybe Natural
masteringMonitorNits :: Prelude.Maybe Prelude.Natural,
    -- | Specify the HDR10+ target display nominal peak luminance, in nits. This
    -- is the nominal maximum luminance of the target display as defined by ST
    -- 2094-40.
    Hdr10Plus -> Maybe Natural
targetMonitorNits :: Prelude.Maybe Prelude.Natural
  }
  deriving (Hdr10Plus -> Hdr10Plus -> Bool
(Hdr10Plus -> Hdr10Plus -> Bool)
-> (Hdr10Plus -> Hdr10Plus -> Bool) -> Eq Hdr10Plus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Hdr10Plus -> Hdr10Plus -> Bool
$c/= :: Hdr10Plus -> Hdr10Plus -> Bool
== :: Hdr10Plus -> Hdr10Plus -> Bool
$c== :: Hdr10Plus -> Hdr10Plus -> Bool
Prelude.Eq, ReadPrec [Hdr10Plus]
ReadPrec Hdr10Plus
Int -> ReadS Hdr10Plus
ReadS [Hdr10Plus]
(Int -> ReadS Hdr10Plus)
-> ReadS [Hdr10Plus]
-> ReadPrec Hdr10Plus
-> ReadPrec [Hdr10Plus]
-> Read Hdr10Plus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Hdr10Plus]
$creadListPrec :: ReadPrec [Hdr10Plus]
readPrec :: ReadPrec Hdr10Plus
$creadPrec :: ReadPrec Hdr10Plus
readList :: ReadS [Hdr10Plus]
$creadList :: ReadS [Hdr10Plus]
readsPrec :: Int -> ReadS Hdr10Plus
$creadsPrec :: Int -> ReadS Hdr10Plus
Prelude.Read, Int -> Hdr10Plus -> ShowS
[Hdr10Plus] -> ShowS
Hdr10Plus -> String
(Int -> Hdr10Plus -> ShowS)
-> (Hdr10Plus -> String)
-> ([Hdr10Plus] -> ShowS)
-> Show Hdr10Plus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Hdr10Plus] -> ShowS
$cshowList :: [Hdr10Plus] -> ShowS
show :: Hdr10Plus -> String
$cshow :: Hdr10Plus -> String
showsPrec :: Int -> Hdr10Plus -> ShowS
$cshowsPrec :: Int -> Hdr10Plus -> ShowS
Prelude.Show, (forall x. Hdr10Plus -> Rep Hdr10Plus x)
-> (forall x. Rep Hdr10Plus x -> Hdr10Plus) -> Generic Hdr10Plus
forall x. Rep Hdr10Plus x -> Hdr10Plus
forall x. Hdr10Plus -> Rep Hdr10Plus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Hdr10Plus x -> Hdr10Plus
$cfrom :: forall x. Hdr10Plus -> Rep Hdr10Plus x
Prelude.Generic)

-- |
-- Create a value of 'Hdr10Plus' 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:
--
-- 'masteringMonitorNits', 'hdr10Plus_masteringMonitorNits' - Specify the HDR10+ mastering display normalized peak luminance, in nits.
-- This is the normalized actual peak luminance of the mastering display,
-- as defined by ST 2094-40.
--
-- 'targetMonitorNits', 'hdr10Plus_targetMonitorNits' - Specify the HDR10+ target display nominal peak luminance, in nits. This
-- is the nominal maximum luminance of the target display as defined by ST
-- 2094-40.
newHdr10Plus ::
  Hdr10Plus
newHdr10Plus :: Hdr10Plus
newHdr10Plus =
  Hdr10Plus' :: Maybe Natural -> Maybe Natural -> Hdr10Plus
Hdr10Plus'
    { $sel:masteringMonitorNits:Hdr10Plus' :: Maybe Natural
masteringMonitorNits = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:targetMonitorNits:Hdr10Plus' :: Maybe Natural
targetMonitorNits = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the HDR10+ mastering display normalized peak luminance, in nits.
-- This is the normalized actual peak luminance of the mastering display,
-- as defined by ST 2094-40.
hdr10Plus_masteringMonitorNits :: Lens.Lens' Hdr10Plus (Prelude.Maybe Prelude.Natural)
hdr10Plus_masteringMonitorNits :: (Maybe Natural -> f (Maybe Natural)) -> Hdr10Plus -> f Hdr10Plus
hdr10Plus_masteringMonitorNits = (Hdr10Plus -> Maybe Natural)
-> (Hdr10Plus -> Maybe Natural -> Hdr10Plus)
-> Lens Hdr10Plus Hdr10Plus (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hdr10Plus' {Maybe Natural
masteringMonitorNits :: Maybe Natural
$sel:masteringMonitorNits:Hdr10Plus' :: Hdr10Plus -> Maybe Natural
masteringMonitorNits} -> Maybe Natural
masteringMonitorNits) (\s :: Hdr10Plus
s@Hdr10Plus' {} Maybe Natural
a -> Hdr10Plus
s {$sel:masteringMonitorNits:Hdr10Plus' :: Maybe Natural
masteringMonitorNits = Maybe Natural
a} :: Hdr10Plus)

-- | Specify the HDR10+ target display nominal peak luminance, in nits. This
-- is the nominal maximum luminance of the target display as defined by ST
-- 2094-40.
hdr10Plus_targetMonitorNits :: Lens.Lens' Hdr10Plus (Prelude.Maybe Prelude.Natural)
hdr10Plus_targetMonitorNits :: (Maybe Natural -> f (Maybe Natural)) -> Hdr10Plus -> f Hdr10Plus
hdr10Plus_targetMonitorNits = (Hdr10Plus -> Maybe Natural)
-> (Hdr10Plus -> Maybe Natural -> Hdr10Plus)
-> Lens Hdr10Plus Hdr10Plus (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Hdr10Plus' {Maybe Natural
targetMonitorNits :: Maybe Natural
$sel:targetMonitorNits:Hdr10Plus' :: Hdr10Plus -> Maybe Natural
targetMonitorNits} -> Maybe Natural
targetMonitorNits) (\s :: Hdr10Plus
s@Hdr10Plus' {} Maybe Natural
a -> Hdr10Plus
s {$sel:targetMonitorNits:Hdr10Plus' :: Maybe Natural
targetMonitorNits = Maybe Natural
a} :: Hdr10Plus)

instance Core.FromJSON Hdr10Plus where
  parseJSON :: Value -> Parser Hdr10Plus
parseJSON =
    String -> (Object -> Parser Hdr10Plus) -> Value -> Parser Hdr10Plus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Hdr10Plus"
      ( \Object
x ->
          Maybe Natural -> Maybe Natural -> Hdr10Plus
Hdr10Plus'
            (Maybe Natural -> Maybe Natural -> Hdr10Plus)
-> Parser (Maybe Natural) -> Parser (Maybe Natural -> Hdr10Plus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"masteringMonitorNits")
            Parser (Maybe Natural -> Hdr10Plus)
-> Parser (Maybe Natural) -> Parser Hdr10Plus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targetMonitorNits")
      )

instance Prelude.Hashable Hdr10Plus

instance Prelude.NFData Hdr10Plus

instance Core.ToJSON Hdr10Plus where
  toJSON :: Hdr10Plus -> Value
toJSON Hdr10Plus' {Maybe Natural
targetMonitorNits :: Maybe Natural
masteringMonitorNits :: Maybe Natural
$sel:targetMonitorNits:Hdr10Plus' :: Hdr10Plus -> Maybe Natural
$sel:masteringMonitorNits:Hdr10Plus' :: Hdr10Plus -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"masteringMonitorNits" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
masteringMonitorNits,
            (Text
"targetMonitorNits" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
targetMonitorNits
          ]
      )