{-# 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.MediaLive.Types.H265ColorSpaceSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.H265ColorSpaceSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.ColorSpacePassthroughSettings
import Amazonka.MediaLive.Types.DolbyVision81Settings
import Amazonka.MediaLive.Types.Hdr10Settings
import Amazonka.MediaLive.Types.Rec601Settings
import Amazonka.MediaLive.Types.Rec709Settings
import qualified Amazonka.Prelude as Prelude

-- | H265 Color Space Settings
--
-- /See:/ 'newH265ColorSpaceSettings' smart constructor.
data H265ColorSpaceSettings = H265ColorSpaceSettings'
  { H265ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings :: Prelude.Maybe ColorSpacePassthroughSettings,
    H265ColorSpaceSettings -> Maybe DolbyVision81Settings
dolbyVision81Settings :: Prelude.Maybe DolbyVision81Settings,
    H265ColorSpaceSettings -> Maybe Hdr10Settings
hdr10Settings :: Prelude.Maybe Hdr10Settings,
    H265ColorSpaceSettings -> Maybe Rec601Settings
rec601Settings :: Prelude.Maybe Rec601Settings,
    H265ColorSpaceSettings -> Maybe Rec709Settings
rec709Settings :: Prelude.Maybe Rec709Settings
  }
  deriving (H265ColorSpaceSettings -> H265ColorSpaceSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: H265ColorSpaceSettings -> H265ColorSpaceSettings -> Bool
$c/= :: H265ColorSpaceSettings -> H265ColorSpaceSettings -> Bool
== :: H265ColorSpaceSettings -> H265ColorSpaceSettings -> Bool
$c== :: H265ColorSpaceSettings -> H265ColorSpaceSettings -> Bool
Prelude.Eq, ReadPrec [H265ColorSpaceSettings]
ReadPrec H265ColorSpaceSettings
Int -> ReadS H265ColorSpaceSettings
ReadS [H265ColorSpaceSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [H265ColorSpaceSettings]
$creadListPrec :: ReadPrec [H265ColorSpaceSettings]
readPrec :: ReadPrec H265ColorSpaceSettings
$creadPrec :: ReadPrec H265ColorSpaceSettings
readList :: ReadS [H265ColorSpaceSettings]
$creadList :: ReadS [H265ColorSpaceSettings]
readsPrec :: Int -> ReadS H265ColorSpaceSettings
$creadsPrec :: Int -> ReadS H265ColorSpaceSettings
Prelude.Read, Int -> H265ColorSpaceSettings -> ShowS
[H265ColorSpaceSettings] -> ShowS
H265ColorSpaceSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [H265ColorSpaceSettings] -> ShowS
$cshowList :: [H265ColorSpaceSettings] -> ShowS
show :: H265ColorSpaceSettings -> String
$cshow :: H265ColorSpaceSettings -> String
showsPrec :: Int -> H265ColorSpaceSettings -> ShowS
$cshowsPrec :: Int -> H265ColorSpaceSettings -> ShowS
Prelude.Show, forall x. Rep H265ColorSpaceSettings x -> H265ColorSpaceSettings
forall x. H265ColorSpaceSettings -> Rep H265ColorSpaceSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep H265ColorSpaceSettings x -> H265ColorSpaceSettings
$cfrom :: forall x. H265ColorSpaceSettings -> Rep H265ColorSpaceSettings x
Prelude.Generic)

-- |
-- Create a value of 'H265ColorSpaceSettings' 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:
--
-- 'colorSpacePassthroughSettings', 'h265ColorSpaceSettings_colorSpacePassthroughSettings' - Undocumented member.
--
-- 'dolbyVision81Settings', 'h265ColorSpaceSettings_dolbyVision81Settings' - Undocumented member.
--
-- 'hdr10Settings', 'h265ColorSpaceSettings_hdr10Settings' - Undocumented member.
--
-- 'rec601Settings', 'h265ColorSpaceSettings_rec601Settings' - Undocumented member.
--
-- 'rec709Settings', 'h265ColorSpaceSettings_rec709Settings' - Undocumented member.
newH265ColorSpaceSettings ::
  H265ColorSpaceSettings
newH265ColorSpaceSettings :: H265ColorSpaceSettings
newH265ColorSpaceSettings =
  H265ColorSpaceSettings'
    { $sel:colorSpacePassthroughSettings:H265ColorSpaceSettings' :: Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dolbyVision81Settings:H265ColorSpaceSettings' :: Maybe DolbyVision81Settings
dolbyVision81Settings = forall a. Maybe a
Prelude.Nothing,
      $sel:hdr10Settings:H265ColorSpaceSettings' :: Maybe Hdr10Settings
hdr10Settings = forall a. Maybe a
Prelude.Nothing,
      $sel:rec601Settings:H265ColorSpaceSettings' :: Maybe Rec601Settings
rec601Settings = forall a. Maybe a
Prelude.Nothing,
      $sel:rec709Settings:H265ColorSpaceSettings' :: Maybe Rec709Settings
rec709Settings = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
h265ColorSpaceSettings_colorSpacePassthroughSettings :: Lens.Lens' H265ColorSpaceSettings (Prelude.Maybe ColorSpacePassthroughSettings)
h265ColorSpaceSettings_colorSpacePassthroughSettings :: Lens' H265ColorSpaceSettings (Maybe ColorSpacePassthroughSettings)
h265ColorSpaceSettings_colorSpacePassthroughSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H265ColorSpaceSettings' {Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings :: Maybe ColorSpacePassthroughSettings
$sel:colorSpacePassthroughSettings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings} -> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings) (\s :: H265ColorSpaceSettings
s@H265ColorSpaceSettings' {} Maybe ColorSpacePassthroughSettings
a -> H265ColorSpaceSettings
s {$sel:colorSpacePassthroughSettings:H265ColorSpaceSettings' :: Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings = Maybe ColorSpacePassthroughSettings
a} :: H265ColorSpaceSettings)

-- | Undocumented member.
h265ColorSpaceSettings_dolbyVision81Settings :: Lens.Lens' H265ColorSpaceSettings (Prelude.Maybe DolbyVision81Settings)
h265ColorSpaceSettings_dolbyVision81Settings :: Lens' H265ColorSpaceSettings (Maybe DolbyVision81Settings)
h265ColorSpaceSettings_dolbyVision81Settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H265ColorSpaceSettings' {Maybe DolbyVision81Settings
dolbyVision81Settings :: Maybe DolbyVision81Settings
$sel:dolbyVision81Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe DolbyVision81Settings
dolbyVision81Settings} -> Maybe DolbyVision81Settings
dolbyVision81Settings) (\s :: H265ColorSpaceSettings
s@H265ColorSpaceSettings' {} Maybe DolbyVision81Settings
a -> H265ColorSpaceSettings
s {$sel:dolbyVision81Settings:H265ColorSpaceSettings' :: Maybe DolbyVision81Settings
dolbyVision81Settings = Maybe DolbyVision81Settings
a} :: H265ColorSpaceSettings)

-- | Undocumented member.
h265ColorSpaceSettings_hdr10Settings :: Lens.Lens' H265ColorSpaceSettings (Prelude.Maybe Hdr10Settings)
h265ColorSpaceSettings_hdr10Settings :: Lens' H265ColorSpaceSettings (Maybe Hdr10Settings)
h265ColorSpaceSettings_hdr10Settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H265ColorSpaceSettings' {Maybe Hdr10Settings
hdr10Settings :: Maybe Hdr10Settings
$sel:hdr10Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Hdr10Settings
hdr10Settings} -> Maybe Hdr10Settings
hdr10Settings) (\s :: H265ColorSpaceSettings
s@H265ColorSpaceSettings' {} Maybe Hdr10Settings
a -> H265ColorSpaceSettings
s {$sel:hdr10Settings:H265ColorSpaceSettings' :: Maybe Hdr10Settings
hdr10Settings = Maybe Hdr10Settings
a} :: H265ColorSpaceSettings)

-- | Undocumented member.
h265ColorSpaceSettings_rec601Settings :: Lens.Lens' H265ColorSpaceSettings (Prelude.Maybe Rec601Settings)
h265ColorSpaceSettings_rec601Settings :: Lens' H265ColorSpaceSettings (Maybe Rec601Settings)
h265ColorSpaceSettings_rec601Settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H265ColorSpaceSettings' {Maybe Rec601Settings
rec601Settings :: Maybe Rec601Settings
$sel:rec601Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec601Settings
rec601Settings} -> Maybe Rec601Settings
rec601Settings) (\s :: H265ColorSpaceSettings
s@H265ColorSpaceSettings' {} Maybe Rec601Settings
a -> H265ColorSpaceSettings
s {$sel:rec601Settings:H265ColorSpaceSettings' :: Maybe Rec601Settings
rec601Settings = Maybe Rec601Settings
a} :: H265ColorSpaceSettings)

-- | Undocumented member.
h265ColorSpaceSettings_rec709Settings :: Lens.Lens' H265ColorSpaceSettings (Prelude.Maybe Rec709Settings)
h265ColorSpaceSettings_rec709Settings :: Lens' H265ColorSpaceSettings (Maybe Rec709Settings)
h265ColorSpaceSettings_rec709Settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H265ColorSpaceSettings' {Maybe Rec709Settings
rec709Settings :: Maybe Rec709Settings
$sel:rec709Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec709Settings
rec709Settings} -> Maybe Rec709Settings
rec709Settings) (\s :: H265ColorSpaceSettings
s@H265ColorSpaceSettings' {} Maybe Rec709Settings
a -> H265ColorSpaceSettings
s {$sel:rec709Settings:H265ColorSpaceSettings' :: Maybe Rec709Settings
rec709Settings = Maybe Rec709Settings
a} :: H265ColorSpaceSettings)

instance Data.FromJSON H265ColorSpaceSettings where
  parseJSON :: Value -> Parser H265ColorSpaceSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"H265ColorSpaceSettings"
      ( \Object
x ->
          Maybe ColorSpacePassthroughSettings
-> Maybe DolbyVision81Settings
-> Maybe Hdr10Settings
-> Maybe Rec601Settings
-> Maybe Rec709Settings
-> H265ColorSpaceSettings
H265ColorSpaceSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"colorSpacePassthroughSettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"dolbyVision81Settings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"hdr10Settings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"rec601Settings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"rec709Settings")
      )

instance Prelude.Hashable H265ColorSpaceSettings where
  hashWithSalt :: Int -> H265ColorSpaceSettings -> Int
hashWithSalt Int
_salt H265ColorSpaceSettings' {Maybe ColorSpacePassthroughSettings
Maybe DolbyVision81Settings
Maybe Hdr10Settings
Maybe Rec601Settings
Maybe Rec709Settings
rec709Settings :: Maybe Rec709Settings
rec601Settings :: Maybe Rec601Settings
hdr10Settings :: Maybe Hdr10Settings
dolbyVision81Settings :: Maybe DolbyVision81Settings
colorSpacePassthroughSettings :: Maybe ColorSpacePassthroughSettings
$sel:rec709Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec709Settings
$sel:rec601Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec601Settings
$sel:hdr10Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Hdr10Settings
$sel:dolbyVision81Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe DolbyVision81Settings
$sel:colorSpacePassthroughSettings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DolbyVision81Settings
dolbyVision81Settings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Hdr10Settings
hdr10Settings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Rec601Settings
rec601Settings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Rec709Settings
rec709Settings

instance Prelude.NFData H265ColorSpaceSettings where
  rnf :: H265ColorSpaceSettings -> ()
rnf H265ColorSpaceSettings' {Maybe ColorSpacePassthroughSettings
Maybe DolbyVision81Settings
Maybe Hdr10Settings
Maybe Rec601Settings
Maybe Rec709Settings
rec709Settings :: Maybe Rec709Settings
rec601Settings :: Maybe Rec601Settings
hdr10Settings :: Maybe Hdr10Settings
dolbyVision81Settings :: Maybe DolbyVision81Settings
colorSpacePassthroughSettings :: Maybe ColorSpacePassthroughSettings
$sel:rec709Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec709Settings
$sel:rec601Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec601Settings
$sel:hdr10Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Hdr10Settings
$sel:dolbyVision81Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe DolbyVision81Settings
$sel:colorSpacePassthroughSettings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DolbyVision81Settings
dolbyVision81Settings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Hdr10Settings
hdr10Settings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Rec601Settings
rec601Settings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Rec709Settings
rec709Settings

instance Data.ToJSON H265ColorSpaceSettings where
  toJSON :: H265ColorSpaceSettings -> Value
toJSON H265ColorSpaceSettings' {Maybe ColorSpacePassthroughSettings
Maybe DolbyVision81Settings
Maybe Hdr10Settings
Maybe Rec601Settings
Maybe Rec709Settings
rec709Settings :: Maybe Rec709Settings
rec601Settings :: Maybe Rec601Settings
hdr10Settings :: Maybe Hdr10Settings
dolbyVision81Settings :: Maybe DolbyVision81Settings
colorSpacePassthroughSettings :: Maybe ColorSpacePassthroughSettings
$sel:rec709Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec709Settings
$sel:rec601Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Rec601Settings
$sel:hdr10Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe Hdr10Settings
$sel:dolbyVision81Settings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe DolbyVision81Settings
$sel:colorSpacePassthroughSettings:H265ColorSpaceSettings' :: H265ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"colorSpacePassthroughSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings,
            (Key
"dolbyVision81Settings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DolbyVision81Settings
dolbyVision81Settings,
            (Key
"hdr10Settings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Hdr10Settings
hdr10Settings,
            (Key
"rec601Settings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Rec601Settings
rec601Settings,
            (Key
"rec709Settings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Rec709Settings
rec709Settings
          ]
      )