{-# language Strict #-}
{-# language CPP #-}
{-# language PatternSynonyms #-}
{-# language OverloadedStrings #-}
{-# language DataKinds #-}
{-# language TypeOperators #-}
{-# language DuplicateRecordFields #-}
module Graphics.Vulkan.Extensions.VK_EXT_hdr_metadata
( pattern VK_STRUCTURE_TYPE_HDR_METADATA_EXT
, pattern VK_EXT_HDR_METADATA_SPEC_VERSION
, pattern VK_EXT_HDR_METADATA_EXTENSION_NAME
, vkSetHdrMetadataEXT
, VkXYColorEXT(..)
, VkHdrMetadataEXT(..)
) where
import Data.String
( IsString
)
import Data.Word
( Word32
)
import Foreign.C.Types
( CFloat(..)
)
import Foreign.Ptr
( plusPtr
, Ptr
)
import Foreign.Storable
( Storable(..)
, Storable
)
import Graphics.Vulkan.NamedType
( (:::)
)
import Graphics.Vulkan.Core10.Core
( VkStructureType(..)
)
import Graphics.Vulkan.Core10.DeviceInitialization
( VkDevice
)
import Graphics.Vulkan.Extensions.VK_KHR_swapchain
( VkSwapchainKHR
)
pattern VK_STRUCTURE_TYPE_HDR_METADATA_EXT :: VkStructureType
pattern VK_STRUCTURE_TYPE_HDR_METADATA_EXT = VkStructureType 1000105000
pattern VK_EXT_HDR_METADATA_SPEC_VERSION :: Integral a => a
pattern VK_EXT_HDR_METADATA_SPEC_VERSION = 1
pattern VK_EXT_HDR_METADATA_EXTENSION_NAME :: (Eq a ,IsString a) => a
pattern VK_EXT_HDR_METADATA_EXTENSION_NAME = "VK_EXT_hdr_metadata"
foreign import ccall "vkSetHdrMetadataEXT" vkSetHdrMetadataEXT :: ("device" ::: VkDevice) -> ("swapchainCount" ::: Word32) -> ("pSwapchains" ::: Ptr VkSwapchainKHR) -> ("pMetadata" ::: Ptr VkHdrMetadataEXT) -> IO ()
data VkXYColorEXT = VkXYColorEXT
{
vkX :: CFloat
,
vkY :: CFloat
}
deriving (Eq, Show)
instance Storable VkXYColorEXT where
sizeOf ~_ = 8
alignment ~_ = 4
peek ptr = VkXYColorEXT <$> peek (ptr `plusPtr` 0)
<*> peek (ptr `plusPtr` 4)
poke ptr poked = poke (ptr `plusPtr` 0) (vkX (poked :: VkXYColorEXT))
*> poke (ptr `plusPtr` 4) (vkY (poked :: VkXYColorEXT))
data VkHdrMetadataEXT = VkHdrMetadataEXT
{
vkSType :: VkStructureType
,
vkPNext :: Ptr ()
,
vkDisplayPrimaryRed :: VkXYColorEXT
,
vkDisplayPrimaryGreen :: VkXYColorEXT
,
vkDisplayPrimaryBlue :: VkXYColorEXT
,
vkWhitePoint :: VkXYColorEXT
,
vkMaxLuminance :: CFloat
,
vkMinLuminance :: CFloat
,
vkMaxContentLightLevel :: CFloat
,
vkMaxFrameAverageLightLevel :: CFloat
}
deriving (Eq, Show)
instance Storable VkHdrMetadataEXT where
sizeOf ~_ = 64
alignment ~_ = 8
peek ptr = VkHdrMetadataEXT <$> peek (ptr `plusPtr` 0)
<*> peek (ptr `plusPtr` 8)
<*> peek (ptr `plusPtr` 16)
<*> peek (ptr `plusPtr` 24)
<*> peek (ptr `plusPtr` 32)
<*> peek (ptr `plusPtr` 40)
<*> peek (ptr `plusPtr` 48)
<*> peek (ptr `plusPtr` 52)
<*> peek (ptr `plusPtr` 56)
<*> peek (ptr `plusPtr` 60)
poke ptr poked = poke (ptr `plusPtr` 0) (vkSType (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 8) (vkPNext (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 16) (vkDisplayPrimaryRed (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 24) (vkDisplayPrimaryGreen (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 32) (vkDisplayPrimaryBlue (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 40) (vkWhitePoint (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 48) (vkMaxLuminance (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 52) (vkMinLuminance (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 56) (vkMaxContentLightLevel (poked :: VkHdrMetadataEXT))
*> poke (ptr `plusPtr` 60) (vkMaxFrameAverageLightLevel (poked :: VkHdrMetadataEXT))