ktx-codec-0.0.2.1: Khronos texture format
Safe HaskellSafe-Inferred
LanguageHaskell2010

Codec.Ktx2.Header

Documentation

data Header Source #

Constructors

Header 

Fields

  • vkFormat :: Word32

    Specifies the image format using Vulkan VkFormat enum values. It can be any value defined in core Vulkan 1.2, future core versions or registered Vulkan extensions, except for values listed in Table 1, “Prohibited Formats” and any *SCALED* or *[2-9]PLANE* formats added in future.

  • typeSize :: Word32

    Specifies the size of the data type in bytes used to upload the data to a graphics API. When typeSize is greater than 1, software on big-endian systems must endian convert all image data since it is little-endian. When format is VK_FORMAT_UNDEFINED, typeSize must equal 1.

  • pixelWidth :: Word32
     
  • pixelHeight :: Word32
     
  • pixelDepth :: Word32
     
  • layerCount :: Word32

    Specifies the number of array elements. If the texture is not an array texture, layerCount must equal 0.

  • faceCount :: Word32

    If faceCount is equal to 6, pixelHeight must be equal to pixelWidth, and pixelDepth must be 0.

  • levelCount :: Word32

    Specifies the number of levels in the Mip Level Array and, by extension, the number of indices in the Level Index array. A KTX file does not need to contain a complete mipmap pyramid.

  • supercompressionScheme :: Word32

    Indicates if a supercompression scheme has been applied to the data in levelImages. It must be one of the values from Table 2, “Supercompression Schemes”. A value of 0 indicates no supercompression.

  • dfdByteOffset :: Word32

    The offset from the start of the file of the dfdTotalSize field of the Data Format Descriptor.

  • dfdByteLength :: Word32

    The total number of bytes in the Data Format Descriptor including the dfdTotalSize field. dfdByteLength must equal dfdTotalSize.

  • kvdByteOffset :: Word32

    An arbitrary number of keyvalue pairs may follow the Index. These can be used to encode any arbitrary data. The kvdByteOffset field gives the offset of this data, i.e. that of first keyvalue pair, from the start of the file. The value must be 0 when kvdByteLength = 0.

  • kvdByteLength :: Word32

    The total number of bytes of key/value data including all keyAndValueByteLength fields, all keyAndValue fields and all valuePadding fields.

  • sgdByteOffset :: Word64

    The offset from the start of the file of supercompressionGlobalData. The value must be 0 when sgdByteLength = 0.

  • sgdByteLength :: Word64

    The number of bytes of supercompressionGlobalData. For supercompression schemes for which no reference is provided in the Global Data Format column of Table 2, “Supercompression Schemes”. the value must be 0.

Instances

Instances details
Generic Header Source # 
Instance details

Defined in Codec.Ktx2.Header

Associated Types

type Rep Header :: Type -> Type #

Methods

from :: Header -> Rep Header x #

to :: Rep Header x -> Header #

Show Header Source # 
Instance details

Defined in Codec.Ktx2.Header

Binary Header Source # 
Instance details

Defined in Codec.Ktx2.Header

Methods

put :: Header -> Put #

get :: Get Header #

putList :: [Header] -> Put #

Eq Header Source # 
Instance details

Defined in Codec.Ktx2.Header

Methods

(==) :: Header -> Header -> Bool #

(/=) :: Header -> Header -> Bool #

type Rep Header Source # 
Instance details

Defined in Codec.Ktx2.Header

type Rep Header = D1 ('MetaData "Header" "Codec.Ktx2.Header" "ktx-codec-0.0.2.1-AFX5voQ2mUt7MGimSGTUau" 'False) (C1 ('MetaCons "Header" 'PrefixI 'True) (((S1 ('MetaSel ('Just "vkFormat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "typeSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "pixelWidth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32))) :*: ((S1 ('MetaSel ('Just "pixelHeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "pixelDepth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "layerCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "faceCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32)))) :*: (((S1 ('MetaSel ('Just "levelCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "supercompressionScheme") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "dfdByteOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "dfdByteLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32))) :*: ((S1 ('MetaSel ('Just "kvdByteOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "kvdByteLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "sgdByteOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgdByteLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word64))))))

prepare :: Integral dims => Word32 -> Word32 -> dims -> dims -> dims -> Word32 -> Header Source #

pattern SC_NONE :: (Eq a, Num a) => a Source #

pattern SC_BASISLZ :: (Eq a, Num a) => a Source #

pattern SC_ZSTANDARD :: (Eq a, Num a) => a Source #

pattern SC_ZLIB :: (Eq a, Num a) => a Source #