Header file defining the data format descriptor utilities API. More...
#include <KHR/khr_df.h>#include <stdbool.h>#include <vulkan/vulkan_core.h>Data Structures | |
| struct | InterpretedDFDChannel |
| Interpretation of a channel from the data format descriptor. More... | |
| struct | Primaries |
| Colourspace primaries information. More... | |
Functions | |
| uint32_t * | vk2dfd (enum VkFormat format) |
| Create a DFD matching a VkFormat. | |
| uint32_t * | createDFDUnpacked (int bigEndian, int numChannels, int bytes, int redBlueSwap, enum VkSuffix suffix) |
| Create a Data Format Descriptor for an unpacked format. | |
| uint32_t * | createDFDPackedPadded (int bigEndian, int numChannels, int bits[], int paddings[], int channels[], enum VkSuffix suffix) |
| Create a Data Format Descriptor for a packed format. | |
| uint32_t * | createDFDPacked (int bigEndian, int numChannels, int bits[], int channels[], enum VkSuffix suffix) |
| Create a Data Format Descriptor for a packed format. | |
| uint32_t * | createDFDCompressed (enum VkCompScheme compScheme, int bwidth, int bheight, int bdepth, enum VkSuffix suffix) |
| Create a Data Format Descriptor for a compressed format. | |
| uint32_t * | createDFDDepthStencil (int depthBits, int stencilBits, int sizeBytes) |
| Create a Data Format Descriptor for a depth-stencil format. | |
| uint32_t * | createDFDAlpha (int bigEndian, int bytes, enum VkSuffix suffix) |
| Create a Data Format Descriptor for an alpha-only format. | |
| enum InterpretDFDResult | interpretDFD (const uint32_t *DFD, InterpretedDFDChannel *R, InterpretedDFDChannel *G, InterpretedDFDChannel *B, InterpretedDFDChannel *A, uint32_t *wordBytes) |
| Interpret a Data Format Descriptor for a simple format. | |
| void | printDFD (uint32_t *DFD, uint32_t dataSize) |
| Print a human-readable interpretation of a data format descriptor. | |
| void | printDFDJSON (uint32_t *DFD, uint32_t dataSize, uint32_t base_indent, uint32_t indent_width, bool minified) |
| Print a JSON interpretation of a data format descriptor. | |
| khr_df_primaries_e | findMapping (const Primaries *p, float latitude) |
| Map a set of primaries to a KDFS primaries enum. | |
| bool | getPrimaries (khr_df_primaries_e primaries, Primaries *p) |
| Get the primaries corresponding to a KDFS primaries enum. | |
Header file defining the data format descriptor utilities API.
| enum InterpretDFDResult |
Result of interpreting the data format descriptor.
| enum VkCompScheme |
Compression scheme, in Vulkan terms.
| enum VkSuffix |
Qualifier suffix to the format, in Vulkan terms.
| uint32_t * createDFDAlpha | ( | int | bigEndian, |
| int | bytes, | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for an alpha-only format.
| bigEndian | Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| bytes | The number of bytes per channel. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDCompressed | ( | enum VkCompScheme | compScheme, |
| int | bwidth, | ||
| int | bheight, | ||
| int | bdepth, | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for a compressed format.
| compScheme | Vulkan-style compression scheme enumeration. |
| bwidth | Block width in texel coordinates. |
| bheight | Block height in texel coordinates. |
| bdepth | Block depth in texel coordinates. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDDepthStencil | ( | int | depthBits, |
| int | stencilBits, | ||
| int | sizeBytes | ||
| ) |
Create a Data Format Descriptor for a depth-stencil format.
| depthBits | The numeber of bits in the depth channel. |
| stencilBits | The numeber of bits in the stencil channel. |
| sizeBytes | The total byte size of the texel. |
| uint32_t * createDFDPacked | ( | int | bigEndian, |
| int | numChannels, | ||
| int | bits[], | ||
| int | channels[], | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for a packed format.
| bigEndian | Big-endian flag: Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| numChannels | The number of color channels. |
| bits[] | An array of length numChannels. Each entry is the number of bits composing the channel, in order starting at bit 0 of the packed type. |
| channels[] | An array of length numChannels. Each entry enumerates the channel type: 0 = red, 1 = green, 2 = blue, 15 = alpha, in order starting at bit 0 of the packed type. These values match channel IDs for RGBSDA in the Khronos Data Format header. To simplify iteration through channels, channel id 3 is a synonym for alpha. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDPackedPadded | ( | int | bigEndian, |
| int | numChannels, | ||
| int | bits[], | ||
| int | paddings[], | ||
| int | channels[], | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for a packed format.
| bigEndian | Big-endian flag: Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| numChannels | The number of color channels. |
| bits[] | An array of length numChannels. Each entry is the number of bits composing the channel, in order starting at bit 0 of the packed type. |
| paddings[] | An array of length numChannels. Each entry is the number of padding bits after each channel. |
| channels[] | An array of length numChannels. Each entry enumerates the channel type: 0 = red, 1 = green, 2 = blue, 15 = alpha, in order starting at bit 0 of the packed type. These values match channel IDs for RGBSDA in the Khronos Data Format header. To simplify iteration through channels, channel id 3 is a synonym for alpha. |
| suffix | Indicates the format suffix for the type. |
| uint32_t * createDFDUnpacked | ( | int | bigEndian, |
| int | numChannels, | ||
| int | bytes, | ||
| int | redBlueSwap, | ||
| enum VkSuffix | suffix | ||
| ) |
Create a Data Format Descriptor for an unpacked format.
| bigEndian | Set to 1 for big-endian byte ordering and 0 for little-endian byte ordering. |
| numChannels | The number of color channels. |
| bytes | The number of bytes per channel. |
| redBlueSwap | Normally channels appear in consecutive R, G, B, A order in memory; redBlueSwap inverts red and blue, allowing B, G, R, A. |
| suffix | Indicates the format suffix for the type. |
| khr_df_primaries_e findMapping | ( | const Primaries * | p, |
| float | latitude | ||
| ) |
Map a set of primaries to a KDFS primaries enum.
| [in] | p | pointer to a Primaries struct filled in with the primary values. |
| [in] | latitude | tolerance to use while matching. A suitable value might be 0.002 but it depends on the application. |
| bool getPrimaries | ( | khr_df_primaries_e | primaries, |
| Primaries * | p | ||
| ) |
Get the primaries corresponding to a KDFS primaries enum.
| [in] | primaries | the enum identifying the KDFS primaries. |
| [out] | p | pointer to a Primaries struct that will be filled with the primary values. |
| enum InterpretDFDResult interpretDFD | ( | const uint32_t * | DFD, |
| InterpretedDFDChannel * | R, | ||
| InterpretedDFDChannel * | G, | ||
| InterpretedDFDChannel * | B, | ||
| InterpretedDFDChannel * | A, | ||
| uint32_t * | wordBytes | ||
| ) |
Interpret a Data Format Descriptor for a simple format.
| DFD | Pointer to a Data Format Descriptor to interpret, described as 32-bit words in native endianness. Note that this is the whole descriptor, not just the basic descriptor block. |
| R | Information about the decoded red channel or the depth channel, if any. |
| G | Information about the decoded green channel or the stencil channel, if any. |
| B | Information about the decoded blue channel, if any. |
| A | Information about the decoded alpha channel, if any. |
| wordBytes | Byte size of the channels (unpacked) or total size (packed). |
| void printDFD | ( | uint32_t * | DFD, |
| uint32_t | dataSize | ||
| ) |
Print a human-readable interpretation of a data format descriptor.
| DFD | Pointer to a data format descriptor. |
| dataSize | The maximum size that can be considered as part of the DFD. |
| void printDFDJSON | ( | uint32_t * | DFD, |
| uint32_t | dataSize, | ||
| uint32_t | base_indent, | ||
| uint32_t | indent_width, | ||
| bool | minified | ||
| ) |
Print a JSON interpretation of a data format descriptor.
| DFD | Pointer to a data format descriptor. |
| dataSize | The maximum size that can be considered as part of the DFD. |
| base_indent | The number of indentations to include at the front of every line |
| indent_width | The number of spaces to add with each nested scope |
| minified | Specifies whether the JSON output should be minified |
Prints an enum as string or number
Prints an enum as string or number if the to string function fails with a trailing comma
Prints an enum as string or number if the to string function fails without a trailing comma
| uint32_t * vk2dfd | ( | enum VkFormat | format | ) |
Create a DFD matching a VkFormat.
| [in] | format | VkFormat for which to create a DFD. |