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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.ColorSpaceConversion
import Amazonka.MediaConvert.Types.Hdr10Metadata
import Amazonka.MediaConvert.Types.SampleRangeConversion
import qualified Amazonka.Prelude as Prelude

-- | Settings for color correction.
--
-- /See:/ 'newColorCorrector' smart constructor.
data ColorCorrector = ColorCorrector'
  { -- | Brightness level.
    ColorCorrector -> Maybe Natural
brightness :: Prelude.Maybe Prelude.Natural,
    -- | Specify the color space you want for this output. The service supports
    -- conversion between HDR formats, between SDR formats, from SDR to HDR,
    -- and from HDR to SDR. SDR to HDR conversion doesn\'t upgrade the dynamic
    -- range. The converted video has an HDR format, but visually appears the
    -- same as an unconverted output. HDR to SDR conversion uses Elemental tone
    -- mapping technology to approximate the outcome of manually regrading from
    -- HDR to SDR. Select Force P3D65 (SDR) to set the output color space
    -- metadata to the following: * Color primaries: Display P3 * Transfer
    -- characteristics: SMPTE 428M * Matrix coefficients: BT.709
    ColorCorrector -> Maybe ColorSpaceConversion
colorSpaceConversion :: Prelude.Maybe ColorSpaceConversion,
    -- | Contrast level.
    ColorCorrector -> Maybe Natural
contrast :: Prelude.Maybe Prelude.Natural,
    -- | Use these settings when you convert to the HDR 10 color space. Specify
    -- the SMPTE ST 2086 Mastering Display Color Volume static metadata that
    -- you want signaled in the output. These values don\'t affect the pixel
    -- values that are encoded in the video stream. They are intended to help
    -- the downstream video player display content in a way that reflects the
    -- intentions of the the content creator. When you set Color space
    -- conversion (ColorSpaceConversion) to HDR 10 (FORCE_HDR10), these
    -- settings are required. You must set values for Max frame average light
    -- level (maxFrameAverageLightLevel) and Max content light level
    -- (maxContentLightLevel); these settings don\'t have a default value. The
    -- default values for the other HDR 10 metadata settings are defined by the
    -- P3D65 color space. For more information about MediaConvert HDR jobs, see
    -- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/hdr.
    ColorCorrector -> Maybe Hdr10Metadata
hdr10Metadata :: Prelude.Maybe Hdr10Metadata,
    -- | Hue in degrees.
    ColorCorrector -> Maybe Int
hue :: Prelude.Maybe Prelude.Int,
    -- | Specify the video color sample range for this output. To create a full
    -- range output, you must start with a full range YUV input and keep the
    -- default value, None (NONE). To create a limited range output from a full
    -- range input, choose Limited range (LIMITED_RANGE_SQUEEZE). With RGB
    -- inputs, your output is always limited range, regardless of your choice
    -- here. When you create a limited range output from a full range input,
    -- MediaConvert limits the active pixel values in a way that depends on the
    -- output\'s bit depth: 8-bit outputs contain only values from 16 through
    -- 235 and 10-bit outputs contain only values from 64 through 940. With
    -- this conversion, MediaConvert also changes the output metadata to note
    -- the limited range.
    ColorCorrector -> Maybe SampleRangeConversion
sampleRangeConversion :: Prelude.Maybe SampleRangeConversion,
    -- | Saturation level.
    ColorCorrector -> Maybe Natural
saturation :: Prelude.Maybe Prelude.Natural,
    -- | Specify the reference white level, in nits, for all of your SDR inputs.
    -- Use to correct brightness levels within HDR10 outputs. The following
    -- color metadata must be present in your SDR input: color primaries,
    -- transfer characteristics, and matrix coefficients. If your SDR input has
    -- missing color metadata, or if you want to correct input color metadata,
    -- manually specify a color space in the input video selector. For 1,000
    -- nit peak brightness displays, we recommend that you set SDR reference
    -- white level to 203 (according to ITU-R BT.2408). Leave blank to use the
    -- default value of 100, or specify an integer from 100 to 1000.
    ColorCorrector -> Maybe Natural
sdrReferenceWhiteLevel :: Prelude.Maybe Prelude.Natural
  }
  deriving (ColorCorrector -> ColorCorrector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColorCorrector -> ColorCorrector -> Bool
$c/= :: ColorCorrector -> ColorCorrector -> Bool
== :: ColorCorrector -> ColorCorrector -> Bool
$c== :: ColorCorrector -> ColorCorrector -> Bool
Prelude.Eq, ReadPrec [ColorCorrector]
ReadPrec ColorCorrector
Int -> ReadS ColorCorrector
ReadS [ColorCorrector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColorCorrector]
$creadListPrec :: ReadPrec [ColorCorrector]
readPrec :: ReadPrec ColorCorrector
$creadPrec :: ReadPrec ColorCorrector
readList :: ReadS [ColorCorrector]
$creadList :: ReadS [ColorCorrector]
readsPrec :: Int -> ReadS ColorCorrector
$creadsPrec :: Int -> ReadS ColorCorrector
Prelude.Read, Int -> ColorCorrector -> ShowS
[ColorCorrector] -> ShowS
ColorCorrector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColorCorrector] -> ShowS
$cshowList :: [ColorCorrector] -> ShowS
show :: ColorCorrector -> String
$cshow :: ColorCorrector -> String
showsPrec :: Int -> ColorCorrector -> ShowS
$cshowsPrec :: Int -> ColorCorrector -> ShowS
Prelude.Show, forall x. Rep ColorCorrector x -> ColorCorrector
forall x. ColorCorrector -> Rep ColorCorrector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColorCorrector x -> ColorCorrector
$cfrom :: forall x. ColorCorrector -> Rep ColorCorrector x
Prelude.Generic)

-- |
-- Create a value of 'ColorCorrector' 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:
--
-- 'brightness', 'colorCorrector_brightness' - Brightness level.
--
-- 'colorSpaceConversion', 'colorCorrector_colorSpaceConversion' - Specify the color space you want for this output. The service supports
-- conversion between HDR formats, between SDR formats, from SDR to HDR,
-- and from HDR to SDR. SDR to HDR conversion doesn\'t upgrade the dynamic
-- range. The converted video has an HDR format, but visually appears the
-- same as an unconverted output. HDR to SDR conversion uses Elemental tone
-- mapping technology to approximate the outcome of manually regrading from
-- HDR to SDR. Select Force P3D65 (SDR) to set the output color space
-- metadata to the following: * Color primaries: Display P3 * Transfer
-- characteristics: SMPTE 428M * Matrix coefficients: BT.709
--
-- 'contrast', 'colorCorrector_contrast' - Contrast level.
--
-- 'hdr10Metadata', 'colorCorrector_hdr10Metadata' - Use these settings when you convert to the HDR 10 color space. Specify
-- the SMPTE ST 2086 Mastering Display Color Volume static metadata that
-- you want signaled in the output. These values don\'t affect the pixel
-- values that are encoded in the video stream. They are intended to help
-- the downstream video player display content in a way that reflects the
-- intentions of the the content creator. When you set Color space
-- conversion (ColorSpaceConversion) to HDR 10 (FORCE_HDR10), these
-- settings are required. You must set values for Max frame average light
-- level (maxFrameAverageLightLevel) and Max content light level
-- (maxContentLightLevel); these settings don\'t have a default value. The
-- default values for the other HDR 10 metadata settings are defined by the
-- P3D65 color space. For more information about MediaConvert HDR jobs, see
-- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/hdr.
--
-- 'hue', 'colorCorrector_hue' - Hue in degrees.
--
-- 'sampleRangeConversion', 'colorCorrector_sampleRangeConversion' - Specify the video color sample range for this output. To create a full
-- range output, you must start with a full range YUV input and keep the
-- default value, None (NONE). To create a limited range output from a full
-- range input, choose Limited range (LIMITED_RANGE_SQUEEZE). With RGB
-- inputs, your output is always limited range, regardless of your choice
-- here. When you create a limited range output from a full range input,
-- MediaConvert limits the active pixel values in a way that depends on the
-- output\'s bit depth: 8-bit outputs contain only values from 16 through
-- 235 and 10-bit outputs contain only values from 64 through 940. With
-- this conversion, MediaConvert also changes the output metadata to note
-- the limited range.
--
-- 'saturation', 'colorCorrector_saturation' - Saturation level.
--
-- 'sdrReferenceWhiteLevel', 'colorCorrector_sdrReferenceWhiteLevel' - Specify the reference white level, in nits, for all of your SDR inputs.
-- Use to correct brightness levels within HDR10 outputs. The following
-- color metadata must be present in your SDR input: color primaries,
-- transfer characteristics, and matrix coefficients. If your SDR input has
-- missing color metadata, or if you want to correct input color metadata,
-- manually specify a color space in the input video selector. For 1,000
-- nit peak brightness displays, we recommend that you set SDR reference
-- white level to 203 (according to ITU-R BT.2408). Leave blank to use the
-- default value of 100, or specify an integer from 100 to 1000.
newColorCorrector ::
  ColorCorrector
newColorCorrector :: ColorCorrector
newColorCorrector =
  ColorCorrector'
    { $sel:brightness:ColorCorrector' :: Maybe Natural
brightness = forall a. Maybe a
Prelude.Nothing,
      $sel:colorSpaceConversion:ColorCorrector' :: Maybe ColorSpaceConversion
colorSpaceConversion = forall a. Maybe a
Prelude.Nothing,
      $sel:contrast:ColorCorrector' :: Maybe Natural
contrast = forall a. Maybe a
Prelude.Nothing,
      $sel:hdr10Metadata:ColorCorrector' :: Maybe Hdr10Metadata
hdr10Metadata = forall a. Maybe a
Prelude.Nothing,
      $sel:hue:ColorCorrector' :: Maybe Int
hue = forall a. Maybe a
Prelude.Nothing,
      $sel:sampleRangeConversion:ColorCorrector' :: Maybe SampleRangeConversion
sampleRangeConversion = forall a. Maybe a
Prelude.Nothing,
      $sel:saturation:ColorCorrector' :: Maybe Natural
saturation = forall a. Maybe a
Prelude.Nothing,
      $sel:sdrReferenceWhiteLevel:ColorCorrector' :: Maybe Natural
sdrReferenceWhiteLevel = forall a. Maybe a
Prelude.Nothing
    }

-- | Brightness level.
colorCorrector_brightness :: Lens.Lens' ColorCorrector (Prelude.Maybe Prelude.Natural)
colorCorrector_brightness :: Lens' ColorCorrector (Maybe Natural)
colorCorrector_brightness = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe Natural
brightness :: Maybe Natural
$sel:brightness:ColorCorrector' :: ColorCorrector -> Maybe Natural
brightness} -> Maybe Natural
brightness) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe Natural
a -> ColorCorrector
s {$sel:brightness:ColorCorrector' :: Maybe Natural
brightness = Maybe Natural
a} :: ColorCorrector)

-- | Specify the color space you want for this output. The service supports
-- conversion between HDR formats, between SDR formats, from SDR to HDR,
-- and from HDR to SDR. SDR to HDR conversion doesn\'t upgrade the dynamic
-- range. The converted video has an HDR format, but visually appears the
-- same as an unconverted output. HDR to SDR conversion uses Elemental tone
-- mapping technology to approximate the outcome of manually regrading from
-- HDR to SDR. Select Force P3D65 (SDR) to set the output color space
-- metadata to the following: * Color primaries: Display P3 * Transfer
-- characteristics: SMPTE 428M * Matrix coefficients: BT.709
colorCorrector_colorSpaceConversion :: Lens.Lens' ColorCorrector (Prelude.Maybe ColorSpaceConversion)
colorCorrector_colorSpaceConversion :: Lens' ColorCorrector (Maybe ColorSpaceConversion)
colorCorrector_colorSpaceConversion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe ColorSpaceConversion
colorSpaceConversion :: Maybe ColorSpaceConversion
$sel:colorSpaceConversion:ColorCorrector' :: ColorCorrector -> Maybe ColorSpaceConversion
colorSpaceConversion} -> Maybe ColorSpaceConversion
colorSpaceConversion) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe ColorSpaceConversion
a -> ColorCorrector
s {$sel:colorSpaceConversion:ColorCorrector' :: Maybe ColorSpaceConversion
colorSpaceConversion = Maybe ColorSpaceConversion
a} :: ColorCorrector)

-- | Contrast level.
colorCorrector_contrast :: Lens.Lens' ColorCorrector (Prelude.Maybe Prelude.Natural)
colorCorrector_contrast :: Lens' ColorCorrector (Maybe Natural)
colorCorrector_contrast = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe Natural
contrast :: Maybe Natural
$sel:contrast:ColorCorrector' :: ColorCorrector -> Maybe Natural
contrast} -> Maybe Natural
contrast) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe Natural
a -> ColorCorrector
s {$sel:contrast:ColorCorrector' :: Maybe Natural
contrast = Maybe Natural
a} :: ColorCorrector)

-- | Use these settings when you convert to the HDR 10 color space. Specify
-- the SMPTE ST 2086 Mastering Display Color Volume static metadata that
-- you want signaled in the output. These values don\'t affect the pixel
-- values that are encoded in the video stream. They are intended to help
-- the downstream video player display content in a way that reflects the
-- intentions of the the content creator. When you set Color space
-- conversion (ColorSpaceConversion) to HDR 10 (FORCE_HDR10), these
-- settings are required. You must set values for Max frame average light
-- level (maxFrameAverageLightLevel) and Max content light level
-- (maxContentLightLevel); these settings don\'t have a default value. The
-- default values for the other HDR 10 metadata settings are defined by the
-- P3D65 color space. For more information about MediaConvert HDR jobs, see
-- https:\/\/docs.aws.amazon.com\/console\/mediaconvert\/hdr.
colorCorrector_hdr10Metadata :: Lens.Lens' ColorCorrector (Prelude.Maybe Hdr10Metadata)
colorCorrector_hdr10Metadata :: Lens' ColorCorrector (Maybe Hdr10Metadata)
colorCorrector_hdr10Metadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe Hdr10Metadata
hdr10Metadata :: Maybe Hdr10Metadata
$sel:hdr10Metadata:ColorCorrector' :: ColorCorrector -> Maybe Hdr10Metadata
hdr10Metadata} -> Maybe Hdr10Metadata
hdr10Metadata) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe Hdr10Metadata
a -> ColorCorrector
s {$sel:hdr10Metadata:ColorCorrector' :: Maybe Hdr10Metadata
hdr10Metadata = Maybe Hdr10Metadata
a} :: ColorCorrector)

-- | Hue in degrees.
colorCorrector_hue :: Lens.Lens' ColorCorrector (Prelude.Maybe Prelude.Int)
colorCorrector_hue :: Lens' ColorCorrector (Maybe Int)
colorCorrector_hue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe Int
hue :: Maybe Int
$sel:hue:ColorCorrector' :: ColorCorrector -> Maybe Int
hue} -> Maybe Int
hue) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe Int
a -> ColorCorrector
s {$sel:hue:ColorCorrector' :: Maybe Int
hue = Maybe Int
a} :: ColorCorrector)

-- | Specify the video color sample range for this output. To create a full
-- range output, you must start with a full range YUV input and keep the
-- default value, None (NONE). To create a limited range output from a full
-- range input, choose Limited range (LIMITED_RANGE_SQUEEZE). With RGB
-- inputs, your output is always limited range, regardless of your choice
-- here. When you create a limited range output from a full range input,
-- MediaConvert limits the active pixel values in a way that depends on the
-- output\'s bit depth: 8-bit outputs contain only values from 16 through
-- 235 and 10-bit outputs contain only values from 64 through 940. With
-- this conversion, MediaConvert also changes the output metadata to note
-- the limited range.
colorCorrector_sampleRangeConversion :: Lens.Lens' ColorCorrector (Prelude.Maybe SampleRangeConversion)
colorCorrector_sampleRangeConversion :: Lens' ColorCorrector (Maybe SampleRangeConversion)
colorCorrector_sampleRangeConversion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe SampleRangeConversion
sampleRangeConversion :: Maybe SampleRangeConversion
$sel:sampleRangeConversion:ColorCorrector' :: ColorCorrector -> Maybe SampleRangeConversion
sampleRangeConversion} -> Maybe SampleRangeConversion
sampleRangeConversion) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe SampleRangeConversion
a -> ColorCorrector
s {$sel:sampleRangeConversion:ColorCorrector' :: Maybe SampleRangeConversion
sampleRangeConversion = Maybe SampleRangeConversion
a} :: ColorCorrector)

-- | Saturation level.
colorCorrector_saturation :: Lens.Lens' ColorCorrector (Prelude.Maybe Prelude.Natural)
colorCorrector_saturation :: Lens' ColorCorrector (Maybe Natural)
colorCorrector_saturation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe Natural
saturation :: Maybe Natural
$sel:saturation:ColorCorrector' :: ColorCorrector -> Maybe Natural
saturation} -> Maybe Natural
saturation) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe Natural
a -> ColorCorrector
s {$sel:saturation:ColorCorrector' :: Maybe Natural
saturation = Maybe Natural
a} :: ColorCorrector)

-- | Specify the reference white level, in nits, for all of your SDR inputs.
-- Use to correct brightness levels within HDR10 outputs. The following
-- color metadata must be present in your SDR input: color primaries,
-- transfer characteristics, and matrix coefficients. If your SDR input has
-- missing color metadata, or if you want to correct input color metadata,
-- manually specify a color space in the input video selector. For 1,000
-- nit peak brightness displays, we recommend that you set SDR reference
-- white level to 203 (according to ITU-R BT.2408). Leave blank to use the
-- default value of 100, or specify an integer from 100 to 1000.
colorCorrector_sdrReferenceWhiteLevel :: Lens.Lens' ColorCorrector (Prelude.Maybe Prelude.Natural)
colorCorrector_sdrReferenceWhiteLevel :: Lens' ColorCorrector (Maybe Natural)
colorCorrector_sdrReferenceWhiteLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColorCorrector' {Maybe Natural
sdrReferenceWhiteLevel :: Maybe Natural
$sel:sdrReferenceWhiteLevel:ColorCorrector' :: ColorCorrector -> Maybe Natural
sdrReferenceWhiteLevel} -> Maybe Natural
sdrReferenceWhiteLevel) (\s :: ColorCorrector
s@ColorCorrector' {} Maybe Natural
a -> ColorCorrector
s {$sel:sdrReferenceWhiteLevel:ColorCorrector' :: Maybe Natural
sdrReferenceWhiteLevel = Maybe Natural
a} :: ColorCorrector)

instance Data.FromJSON ColorCorrector where
  parseJSON :: Value -> Parser ColorCorrector
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ColorCorrector"
      ( \Object
x ->
          Maybe Natural
-> Maybe ColorSpaceConversion
-> Maybe Natural
-> Maybe Hdr10Metadata
-> Maybe Int
-> Maybe SampleRangeConversion
-> Maybe Natural
-> Maybe Natural
-> ColorCorrector
ColorCorrector'
            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
"brightness")
            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
"colorSpaceConversion")
            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
"contrast")
            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
"hdr10Metadata")
            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
"hue")
            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
"sampleRangeConversion")
            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
"saturation")
            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
"sdrReferenceWhiteLevel")
      )

instance Prelude.Hashable ColorCorrector where
  hashWithSalt :: Int -> ColorCorrector -> Int
hashWithSalt Int
_salt ColorCorrector' {Maybe Int
Maybe Natural
Maybe ColorSpaceConversion
Maybe Hdr10Metadata
Maybe SampleRangeConversion
sdrReferenceWhiteLevel :: Maybe Natural
saturation :: Maybe Natural
sampleRangeConversion :: Maybe SampleRangeConversion
hue :: Maybe Int
hdr10Metadata :: Maybe Hdr10Metadata
contrast :: Maybe Natural
colorSpaceConversion :: Maybe ColorSpaceConversion
brightness :: Maybe Natural
$sel:sdrReferenceWhiteLevel:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:saturation:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:sampleRangeConversion:ColorCorrector' :: ColorCorrector -> Maybe SampleRangeConversion
$sel:hue:ColorCorrector' :: ColorCorrector -> Maybe Int
$sel:hdr10Metadata:ColorCorrector' :: ColorCorrector -> Maybe Hdr10Metadata
$sel:contrast:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:colorSpaceConversion:ColorCorrector' :: ColorCorrector -> Maybe ColorSpaceConversion
$sel:brightness:ColorCorrector' :: ColorCorrector -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
brightness
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ColorSpaceConversion
colorSpaceConversion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
contrast
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Hdr10Metadata
hdr10Metadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
hue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SampleRangeConversion
sampleRangeConversion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
saturation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sdrReferenceWhiteLevel

instance Prelude.NFData ColorCorrector where
  rnf :: ColorCorrector -> ()
rnf ColorCorrector' {Maybe Int
Maybe Natural
Maybe ColorSpaceConversion
Maybe Hdr10Metadata
Maybe SampleRangeConversion
sdrReferenceWhiteLevel :: Maybe Natural
saturation :: Maybe Natural
sampleRangeConversion :: Maybe SampleRangeConversion
hue :: Maybe Int
hdr10Metadata :: Maybe Hdr10Metadata
contrast :: Maybe Natural
colorSpaceConversion :: Maybe ColorSpaceConversion
brightness :: Maybe Natural
$sel:sdrReferenceWhiteLevel:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:saturation:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:sampleRangeConversion:ColorCorrector' :: ColorCorrector -> Maybe SampleRangeConversion
$sel:hue:ColorCorrector' :: ColorCorrector -> Maybe Int
$sel:hdr10Metadata:ColorCorrector' :: ColorCorrector -> Maybe Hdr10Metadata
$sel:contrast:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:colorSpaceConversion:ColorCorrector' :: ColorCorrector -> Maybe ColorSpaceConversion
$sel:brightness:ColorCorrector' :: ColorCorrector -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
brightness
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ColorSpaceConversion
colorSpaceConversion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
contrast
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Hdr10Metadata
hdr10Metadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
hue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SampleRangeConversion
sampleRangeConversion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
saturation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
sdrReferenceWhiteLevel

instance Data.ToJSON ColorCorrector where
  toJSON :: ColorCorrector -> Value
toJSON ColorCorrector' {Maybe Int
Maybe Natural
Maybe ColorSpaceConversion
Maybe Hdr10Metadata
Maybe SampleRangeConversion
sdrReferenceWhiteLevel :: Maybe Natural
saturation :: Maybe Natural
sampleRangeConversion :: Maybe SampleRangeConversion
hue :: Maybe Int
hdr10Metadata :: Maybe Hdr10Metadata
contrast :: Maybe Natural
colorSpaceConversion :: Maybe ColorSpaceConversion
brightness :: Maybe Natural
$sel:sdrReferenceWhiteLevel:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:saturation:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:sampleRangeConversion:ColorCorrector' :: ColorCorrector -> Maybe SampleRangeConversion
$sel:hue:ColorCorrector' :: ColorCorrector -> Maybe Int
$sel:hdr10Metadata:ColorCorrector' :: ColorCorrector -> Maybe Hdr10Metadata
$sel:contrast:ColorCorrector' :: ColorCorrector -> Maybe Natural
$sel:colorSpaceConversion:ColorCorrector' :: ColorCorrector -> Maybe ColorSpaceConversion
$sel:brightness:ColorCorrector' :: ColorCorrector -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"brightness" 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 Natural
brightness,
            (Key
"colorSpaceConversion" 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 ColorSpaceConversion
colorSpaceConversion,
            (Key
"contrast" 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 Natural
contrast,
            (Key
"hdr10Metadata" 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 Hdr10Metadata
hdr10Metadata,
            (Key
"hue" 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 Int
hue,
            (Key
"sampleRangeConversion" 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 SampleRangeConversion
sampleRangeConversion,
            (Key
"saturation" 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 Natural
saturation,
            (Key
"sdrReferenceWhiteLevel" 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 Natural
sdrReferenceWhiteLevel
          ]
      )