module Codec.GlTF.Texture
  ( TextureIx(..)
  , Texture(..)
  ) where

import Codec.GlTF.Prelude

import Codec.GlTF.Image (ImageIx)
import Codec.GlTF.Sampler (SamplerIx)

newtype TextureIx = TextureIx { TextureIx -> Int
unTextureIx :: Int }
  deriving (TextureIx -> TextureIx -> Bool
(TextureIx -> TextureIx -> Bool)
-> (TextureIx -> TextureIx -> Bool) -> Eq TextureIx
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextureIx -> TextureIx -> Bool
== :: TextureIx -> TextureIx -> Bool
$c/= :: TextureIx -> TextureIx -> Bool
/= :: TextureIx -> TextureIx -> Bool
Eq, Eq TextureIx
Eq TextureIx =>
(TextureIx -> TextureIx -> Ordering)
-> (TextureIx -> TextureIx -> Bool)
-> (TextureIx -> TextureIx -> Bool)
-> (TextureIx -> TextureIx -> Bool)
-> (TextureIx -> TextureIx -> Bool)
-> (TextureIx -> TextureIx -> TextureIx)
-> (TextureIx -> TextureIx -> TextureIx)
-> Ord TextureIx
TextureIx -> TextureIx -> Bool
TextureIx -> TextureIx -> Ordering
TextureIx -> TextureIx -> TextureIx
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TextureIx -> TextureIx -> Ordering
compare :: TextureIx -> TextureIx -> Ordering
$c< :: TextureIx -> TextureIx -> Bool
< :: TextureIx -> TextureIx -> Bool
$c<= :: TextureIx -> TextureIx -> Bool
<= :: TextureIx -> TextureIx -> Bool
$c> :: TextureIx -> TextureIx -> Bool
> :: TextureIx -> TextureIx -> Bool
$c>= :: TextureIx -> TextureIx -> Bool
>= :: TextureIx -> TextureIx -> Bool
$cmax :: TextureIx -> TextureIx -> TextureIx
max :: TextureIx -> TextureIx -> TextureIx
$cmin :: TextureIx -> TextureIx -> TextureIx
min :: TextureIx -> TextureIx -> TextureIx
Ord, Int -> TextureIx -> ShowS
[TextureIx] -> ShowS
TextureIx -> String
(Int -> TextureIx -> ShowS)
-> (TextureIx -> String)
-> ([TextureIx] -> ShowS)
-> Show TextureIx
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TextureIx -> ShowS
showsPrec :: Int -> TextureIx -> ShowS
$cshow :: TextureIx -> String
show :: TextureIx -> String
$cshowList :: [TextureIx] -> ShowS
showList :: [TextureIx] -> ShowS
Show, Value -> Parser [TextureIx]
Value -> Parser TextureIx
(Value -> Parser TextureIx)
-> (Value -> Parser [TextureIx]) -> FromJSON TextureIx
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser TextureIx
parseJSON :: Value -> Parser TextureIx
$cparseJSONList :: Value -> Parser [TextureIx]
parseJSONList :: Value -> Parser [TextureIx]
FromJSON, [TextureIx] -> Value
[TextureIx] -> Encoding
TextureIx -> Value
TextureIx -> Encoding
(TextureIx -> Value)
-> (TextureIx -> Encoding)
-> ([TextureIx] -> Value)
-> ([TextureIx] -> Encoding)
-> ToJSON TextureIx
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: TextureIx -> Value
toJSON :: TextureIx -> Value
$ctoEncoding :: TextureIx -> Encoding
toEncoding :: TextureIx -> Encoding
$ctoJSONList :: [TextureIx] -> Value
toJSONList :: [TextureIx] -> Value
$ctoEncodingList :: [TextureIx] -> Encoding
toEncodingList :: [TextureIx] -> Encoding
ToJSON, (forall x. TextureIx -> Rep TextureIx x)
-> (forall x. Rep TextureIx x -> TextureIx) -> Generic TextureIx
forall x. Rep TextureIx x -> TextureIx
forall x. TextureIx -> Rep TextureIx x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TextureIx -> Rep TextureIx x
from :: forall x. TextureIx -> Rep TextureIx x
$cto :: forall x. Rep TextureIx x -> TextureIx
to :: forall x. Rep TextureIx x -> TextureIx
Generic)

data Texture = Texture
  { Texture -> Maybe SamplerIx
sampler    :: Maybe SamplerIx
  , Texture -> Maybe ImageIx
source     :: Maybe ImageIx
  , Texture -> Maybe Text
name       :: Maybe Text
  , Texture -> Maybe Object
extensions :: Maybe Object
  , Texture -> Maybe Value
extras     :: Maybe Value
  } deriving (Texture -> Texture -> Bool
(Texture -> Texture -> Bool)
-> (Texture -> Texture -> Bool) -> Eq Texture
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Texture -> Texture -> Bool
== :: Texture -> Texture -> Bool
$c/= :: Texture -> Texture -> Bool
/= :: Texture -> Texture -> Bool
Eq, Int -> Texture -> ShowS
[Texture] -> ShowS
Texture -> String
(Int -> Texture -> ShowS)
-> (Texture -> String) -> ([Texture] -> ShowS) -> Show Texture
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Texture -> ShowS
showsPrec :: Int -> Texture -> ShowS
$cshow :: Texture -> String
show :: Texture -> String
$cshowList :: [Texture] -> ShowS
showList :: [Texture] -> ShowS
Show, (forall x. Texture -> Rep Texture x)
-> (forall x. Rep Texture x -> Texture) -> Generic Texture
forall x. Rep Texture x -> Texture
forall x. Texture -> Rep Texture x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Texture -> Rep Texture x
from :: forall x. Texture -> Rep Texture x
$cto :: forall x. Rep Texture x -> Texture
to :: forall x. Rep Texture x -> Texture
Generic)

instance FromJSON Texture
instance ToJSON Texture