{-# 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.NoiseReducerSpatialFilterSettings
-- 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.NoiseReducerSpatialFilterSettings where

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

-- | Noise reducer filter settings for spatial filter.
--
-- /See:/ 'newNoiseReducerSpatialFilterSettings' smart constructor.
data NoiseReducerSpatialFilterSettings = NoiseReducerSpatialFilterSettings'
  { -- | Specify strength of post noise reduction sharpening filter, with 0
    -- disabling the filter and 3 enabling it at maximum strength.
    NoiseReducerSpatialFilterSettings -> Maybe Natural
postFilterSharpenStrength :: Prelude.Maybe Prelude.Natural,
    -- | The speed of the filter, from -2 (lower speed) to 3 (higher speed), with
    -- 0 being the nominal value.
    NoiseReducerSpatialFilterSettings -> Maybe Int
speed :: Prelude.Maybe Prelude.Int,
    -- | Relative strength of noise reducing filter. Higher values produce
    -- stronger filtering.
    NoiseReducerSpatialFilterSettings -> Maybe Natural
strength :: Prelude.Maybe Prelude.Natural
  }
  deriving (NoiseReducerSpatialFilterSettings
-> NoiseReducerSpatialFilterSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NoiseReducerSpatialFilterSettings
-> NoiseReducerSpatialFilterSettings -> Bool
$c/= :: NoiseReducerSpatialFilterSettings
-> NoiseReducerSpatialFilterSettings -> Bool
== :: NoiseReducerSpatialFilterSettings
-> NoiseReducerSpatialFilterSettings -> Bool
$c== :: NoiseReducerSpatialFilterSettings
-> NoiseReducerSpatialFilterSettings -> Bool
Prelude.Eq, ReadPrec [NoiseReducerSpatialFilterSettings]
ReadPrec NoiseReducerSpatialFilterSettings
Int -> ReadS NoiseReducerSpatialFilterSettings
ReadS [NoiseReducerSpatialFilterSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NoiseReducerSpatialFilterSettings]
$creadListPrec :: ReadPrec [NoiseReducerSpatialFilterSettings]
readPrec :: ReadPrec NoiseReducerSpatialFilterSettings
$creadPrec :: ReadPrec NoiseReducerSpatialFilterSettings
readList :: ReadS [NoiseReducerSpatialFilterSettings]
$creadList :: ReadS [NoiseReducerSpatialFilterSettings]
readsPrec :: Int -> ReadS NoiseReducerSpatialFilterSettings
$creadsPrec :: Int -> ReadS NoiseReducerSpatialFilterSettings
Prelude.Read, Int -> NoiseReducerSpatialFilterSettings -> ShowS
[NoiseReducerSpatialFilterSettings] -> ShowS
NoiseReducerSpatialFilterSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NoiseReducerSpatialFilterSettings] -> ShowS
$cshowList :: [NoiseReducerSpatialFilterSettings] -> ShowS
show :: NoiseReducerSpatialFilterSettings -> String
$cshow :: NoiseReducerSpatialFilterSettings -> String
showsPrec :: Int -> NoiseReducerSpatialFilterSettings -> ShowS
$cshowsPrec :: Int -> NoiseReducerSpatialFilterSettings -> ShowS
Prelude.Show, forall x.
Rep NoiseReducerSpatialFilterSettings x
-> NoiseReducerSpatialFilterSettings
forall x.
NoiseReducerSpatialFilterSettings
-> Rep NoiseReducerSpatialFilterSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NoiseReducerSpatialFilterSettings x
-> NoiseReducerSpatialFilterSettings
$cfrom :: forall x.
NoiseReducerSpatialFilterSettings
-> Rep NoiseReducerSpatialFilterSettings x
Prelude.Generic)

-- |
-- Create a value of 'NoiseReducerSpatialFilterSettings' 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:
--
-- 'postFilterSharpenStrength', 'noiseReducerSpatialFilterSettings_postFilterSharpenStrength' - Specify strength of post noise reduction sharpening filter, with 0
-- disabling the filter and 3 enabling it at maximum strength.
--
-- 'speed', 'noiseReducerSpatialFilterSettings_speed' - The speed of the filter, from -2 (lower speed) to 3 (higher speed), with
-- 0 being the nominal value.
--
-- 'strength', 'noiseReducerSpatialFilterSettings_strength' - Relative strength of noise reducing filter. Higher values produce
-- stronger filtering.
newNoiseReducerSpatialFilterSettings ::
  NoiseReducerSpatialFilterSettings
newNoiseReducerSpatialFilterSettings :: NoiseReducerSpatialFilterSettings
newNoiseReducerSpatialFilterSettings =
  NoiseReducerSpatialFilterSettings'
    { $sel:postFilterSharpenStrength:NoiseReducerSpatialFilterSettings' :: Maybe Natural
postFilterSharpenStrength =
        forall a. Maybe a
Prelude.Nothing,
      $sel:speed:NoiseReducerSpatialFilterSettings' :: Maybe Int
speed = forall a. Maybe a
Prelude.Nothing,
      $sel:strength:NoiseReducerSpatialFilterSettings' :: Maybe Natural
strength = forall a. Maybe a
Prelude.Nothing
    }

-- | Specify strength of post noise reduction sharpening filter, with 0
-- disabling the filter and 3 enabling it at maximum strength.
noiseReducerSpatialFilterSettings_postFilterSharpenStrength :: Lens.Lens' NoiseReducerSpatialFilterSettings (Prelude.Maybe Prelude.Natural)
noiseReducerSpatialFilterSettings_postFilterSharpenStrength :: Lens' NoiseReducerSpatialFilterSettings (Maybe Natural)
noiseReducerSpatialFilterSettings_postFilterSharpenStrength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NoiseReducerSpatialFilterSettings' {Maybe Natural
postFilterSharpenStrength :: Maybe Natural
$sel:postFilterSharpenStrength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
postFilterSharpenStrength} -> Maybe Natural
postFilterSharpenStrength) (\s :: NoiseReducerSpatialFilterSettings
s@NoiseReducerSpatialFilterSettings' {} Maybe Natural
a -> NoiseReducerSpatialFilterSettings
s {$sel:postFilterSharpenStrength:NoiseReducerSpatialFilterSettings' :: Maybe Natural
postFilterSharpenStrength = Maybe Natural
a} :: NoiseReducerSpatialFilterSettings)

-- | The speed of the filter, from -2 (lower speed) to 3 (higher speed), with
-- 0 being the nominal value.
noiseReducerSpatialFilterSettings_speed :: Lens.Lens' NoiseReducerSpatialFilterSettings (Prelude.Maybe Prelude.Int)
noiseReducerSpatialFilterSettings_speed :: Lens' NoiseReducerSpatialFilterSettings (Maybe Int)
noiseReducerSpatialFilterSettings_speed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NoiseReducerSpatialFilterSettings' {Maybe Int
speed :: Maybe Int
$sel:speed:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Int
speed} -> Maybe Int
speed) (\s :: NoiseReducerSpatialFilterSettings
s@NoiseReducerSpatialFilterSettings' {} Maybe Int
a -> NoiseReducerSpatialFilterSettings
s {$sel:speed:NoiseReducerSpatialFilterSettings' :: Maybe Int
speed = Maybe Int
a} :: NoiseReducerSpatialFilterSettings)

-- | Relative strength of noise reducing filter. Higher values produce
-- stronger filtering.
noiseReducerSpatialFilterSettings_strength :: Lens.Lens' NoiseReducerSpatialFilterSettings (Prelude.Maybe Prelude.Natural)
noiseReducerSpatialFilterSettings_strength :: Lens' NoiseReducerSpatialFilterSettings (Maybe Natural)
noiseReducerSpatialFilterSettings_strength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NoiseReducerSpatialFilterSettings' {Maybe Natural
strength :: Maybe Natural
$sel:strength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
strength} -> Maybe Natural
strength) (\s :: NoiseReducerSpatialFilterSettings
s@NoiseReducerSpatialFilterSettings' {} Maybe Natural
a -> NoiseReducerSpatialFilterSettings
s {$sel:strength:NoiseReducerSpatialFilterSettings' :: Maybe Natural
strength = Maybe Natural
a} :: NoiseReducerSpatialFilterSettings)

instance
  Data.FromJSON
    NoiseReducerSpatialFilterSettings
  where
  parseJSON :: Value -> Parser NoiseReducerSpatialFilterSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NoiseReducerSpatialFilterSettings"
      ( \Object
x ->
          Maybe Natural
-> Maybe Int -> Maybe Natural -> NoiseReducerSpatialFilterSettings
NoiseReducerSpatialFilterSettings'
            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
"postFilterSharpenStrength")
            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
"speed")
            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
"strength")
      )

instance
  Prelude.Hashable
    NoiseReducerSpatialFilterSettings
  where
  hashWithSalt :: Int -> NoiseReducerSpatialFilterSettings -> Int
hashWithSalt
    Int
_salt
    NoiseReducerSpatialFilterSettings' {Maybe Int
Maybe Natural
strength :: Maybe Natural
speed :: Maybe Int
postFilterSharpenStrength :: Maybe Natural
$sel:strength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
$sel:speed:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Int
$sel:postFilterSharpenStrength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
postFilterSharpenStrength
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
speed
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
strength

instance
  Prelude.NFData
    NoiseReducerSpatialFilterSettings
  where
  rnf :: NoiseReducerSpatialFilterSettings -> ()
rnf NoiseReducerSpatialFilterSettings' {Maybe Int
Maybe Natural
strength :: Maybe Natural
speed :: Maybe Int
postFilterSharpenStrength :: Maybe Natural
$sel:strength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
$sel:speed:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Int
$sel:postFilterSharpenStrength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
postFilterSharpenStrength
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
speed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
strength

instance
  Data.ToJSON
    NoiseReducerSpatialFilterSettings
  where
  toJSON :: NoiseReducerSpatialFilterSettings -> Value
toJSON NoiseReducerSpatialFilterSettings' {Maybe Int
Maybe Natural
strength :: Maybe Natural
speed :: Maybe Int
postFilterSharpenStrength :: Maybe Natural
$sel:strength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
$sel:speed:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Int
$sel:postFilterSharpenStrength:NoiseReducerSpatialFilterSettings' :: NoiseReducerSpatialFilterSettings -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"postFilterSharpenStrength" 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
postFilterSharpenStrength,
            (Key
"speed" 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
speed,
            (Key
"strength" 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
strength
          ]
      )