CMP_FORMAT_RGBA_8888_S,// RGBA format with signed 8-bit fixed channels.
CMP_FORMAT_ARGB_8888_S,// ARGB format with signed 8-bit fixed channels.
CMP_FORMAT_ARGB_8888,// ARGB format with 8-bit fixed channels.
CMP_FORMAT_ABGR_8888,// ABGR format with 8-bit fixed channels.
CMP_FORMAT_RGBA_8888,// RGBA format with 8-bit fixed channels.
CMP_FORMAT_BGRA_8888,// BGRA format with 8-bit fixed channels.
CMP_FORMAT_RGB_888,// RGB format with 8-bit fixed channels.
CMP_FORMAT_RGB_888_S,// RGB format with 8-bit fixed channels.
CMP_FORMAT_BGR_888,// BGR format with 8-bit fixed channels.
CMP_FORMAT_RG_8_S,// Two component format with signed 8-bit fixed channels.
CMP_FORMAT_RG_8,// Two component format with 8-bit fixed channels.
CMP_FORMAT_R_8_S,// Single component format with signed 8-bit fixed channel.
CMP_FORMAT_R_8,// Single component format with 8-bit fixed channel.
CMP_FORMAT_ARGB_2101010,// ARGB format with 10-bit fixed channels for color & a 2-bit fixed channel for alpha.
CMP_FORMAT_ARGB_16,// ARGB format with 16-bit fixed channels.
CMP_FORMAT_ABGR_16,// ABGR format with 16-bit fixed channels.
CMP_FORMAT_RGBA_16,// RGBA format with 16-bit fixed channels.
CMP_FORMAT_BGRA_16,// BGRA format with 16-bit fixed channels.
CMP_FORMAT_RG_16,// Two component format with 16-bit fixed channels.
CMP_FORMAT_R_16,// Single component format with 16-bit fixed channels.
CMP_FORMAT_RGBE_32F,// RGB format with 9-bit floating point each channel and shared 5 bit exponent
CMP_FORMAT_ARGB_16F,// ARGB format with 16-bit floating-point channels.
CMP_FORMAT_ABGR_16F,// ABGR format with 16-bit floating-point channels.
CMP_FORMAT_RGBA_16F,// RGBA format with 16-bit floating-point channels.
CMP_FORMAT_BGRA_16F,// BGRA format with 16-bit floating-point channels.
CMP_FORMAT_RG_16F,// Two component format with 16-bit floating-point channels.
CMP_FORMAT_R_16F,// Single component with 16-bit floating-point channels.
CMP_FORMAT_ARGB_32F,// ARGB format with 32-bit floating-point channels.
CMP_FORMAT_ABGR_32F,// ABGR format with 32-bit floating-point channels.
CMP_FORMAT_RGBA_32F,// RGBA format with 32-bit floating-point channels.
CMP_FORMAT_BGRA_32F,// BGRA format with 32-bit floating-point channels.
CMP_FORMAT_RGB_32F,// RGB format with 32-bit floating-point channels.
CMP_FORMAT_BGR_32F,// BGR format with 32-bit floating-point channels.
CMP_FORMAT_RG_32F,// Two component format with 32-bit floating-point channels.
CMP_FORMAT_R_32F,// Single component with 32-bit floating-point channels.
// Compression formats ------------ GPU Mapping DirectX, Vulkan and OpenGL formats and comments --------
CMP_FORMAT_ASTC,// DXGI_FORMAT_UNKNOWN VK_FORMAT_ASTC_4x4_UNORM_BLOCK to VK_FORMAT_ASTC_12x12_UNORM_BLOCK
CMP_FORMAT_ATI1N,// DXGI_FORMAT_BC4_UNORM VK_FORMAT_BC4_UNORM_BLOCK GL_COMPRESSED_RED_RGTC1 Single component compression format using the same technique as DXT5 alpha. Four bits per pixel.
CMP_FORMAT_ATI2N,// DXGI_FORMAT_BC5_UNORM VK_FORMAT_BC5_UNORM_BLOCK GL_COMPRESSED_RG_RGTC2 Two component compression format using the same technique as DXT5 alpha. Designed for compression of tangent space normal maps. Eight bits per pixel.
CMP_FORMAT_ATI2N_XY,// DXGI_FORMAT_BC5_UNORM VK_FORMAT_BC5_UNORM_BLOCK GL_COMPRESSED_RG_RGTC2 Two component compression format using the same technique as DXT5 alpha. The same as ATI2N but with the channels swizzled. Eight bits per pixel.
CMP_FORMAT_ATI2N_DXT5,// DXGI_FORMAT_BC5_UNORM VK_FORMAT_BC5_UNORM_BLOCK GL_COMPRESSED_RG_RGTC2 ATI2N like format using DXT5. Intended for use on GPUs that do not natively support ATI2N. Eight bits per pixel.
CMP_FORMAT_ATC_RGB,// CMP - a compressed RGB format.
CMP_FORMAT_ATC_RGBA_Explicit,// CMP - a compressed ARGB format with explicit alpha.
CMP_FORMAT_BC1,// DXGI_FORMAT_BC1_UNORM GL_COMPRESSED_RGBA_S3TC_DXT1_EXT A four component opaque (or 1-bit alpha) compressed texture format for Microsoft DirectX10. Identical to DXT1. Four bits per pixel.
CMP_FORMAT_BC2,// DXGI_FORMAT_BC2_UNORM VK_FORMAT_BC2_UNORM_BLOCK GL_COMPRESSED_RGBA_S3TC_DXT3_EXT A four component compressed texture format with explicit alpha for Microsoft DirectX10. Identical to DXT3. Eight bits per pixel.
CMP_FORMAT_BC3,// DXGI_FORMAT_BC3_UNORM VK_FORMAT_BC3_UNORM_BLOCK GL_COMPRESSED_RGBA_S3TC_DXT5_EXT A four component compressed texture format with interpolated alpha for Microsoft DirectX10. Identical to DXT5. Eight bits per pixel.
CMP_FORMAT_BC4,// DXGI_FORMAT_BC4_UNORM VK_FORMAT_BC4_UNORM_BLOCK GL_COMPRESSED_RED_RGTC1 A single component compressed texture format for Microsoft DirectX10. Identical to ATI1N. Four bits per pixel.
CMP_FORMAT_BC4_S,// DXGI_FORMAT_BC4_SNORM VK_FORMAT_BC4_SNORM_BLOCK GL_COMPRESSED_SIGNED_RED_RGTC1 A single component compressed texture format for Microsoft DirectX10. Identical to ATI1N. Four bits per pixel.
CMP_FORMAT_BC5,// DXGI_FORMAT_BC5_UNORM VK_FORMAT_BC5_UNORM_BLOCK GL_COMPRESSED_RG_RGTC2 A two component compressed texture format for Microsoft DirectX10. Identical to ATI2N_XY. Eight bits per pixel.
CMP_FORMAT_BC5_S,// DXGI_FORMAT_BC5_SNORM VK_FORMAT_BC5_SNORM_BLOCK GL_COMPRESSED_RGBA_BPTC_UNORM A two component compressed texture format for Microsoft DirectX10. Identical to ATI2N_XY. Eight bits per pixel.
CMP_FORMAT_BC6H,// DXGI_FORMAT_BC6H_UF16 VK_FORMAT_BC6H_UFLOAT_BLOCK GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT BC6H compressed texture format (UF)
CMP_FORMAT_BC6H_SF,// DXGI_FORMAT_BC6H_SF16 VK_FORMAT_BC6H_SFLOAT_BLOCK GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT BC6H compressed texture format (SF)
CMP_FORMAT_BC7,// DXGI_FORMAT_BC7_UNORM VK_FORMAT_BC7_UNORM_BLOCK GL_COMPRESSED_RGBA_BPTC_UNORM BC7 compressed texture format
CMP_FORMAT_DXT1,// DXGI_FORMAT_BC1_UNORM VK_FORMAT_BC1_RGB_UNORM_BLOCK GL_COMPRESSED_RGBA_S3TC_DXT1_EXT An DXTC compressed texture matopaque (or 1-bit alpha). Four bits per pixel.
CMP_FORMAT_DXT3,// DXGI_FORMAT_BC2_UNORM VK_FORMAT_BC2_UNORM_BLOCK GL_COMPRESSED_RGBA_S3TC_DXT3_EXT DXTC compressed texture format with explicit alpha. Eight bits per pixel.
CMP_FORMAT_DXT5,// DXGI_FORMAT_BC3_UNORM VK_FORMAT_BC3_UNORM_BLOCK GL_COMPRESSED_RGBA_S3TC_DXT5_EXT DXTC compressed texture format with interpolated alpha. Eight bits per pixel.
CMP_FORMAT_DXT5_xGBR,// DXGI_FORMAT_UNKNOWN DXT5 with the red component swizzled into the alpha channel. Eight bits per pixel.
CMP_FORMAT_DXT5_RxBG,// DXGI_FORMAT_UNKNOWN swizzled DXT5 format with the green component swizzled into the alpha channel. Eight bits per pixel.
CMP_FORMAT_DXT5_RBxG,// DXGI_FORMAT_UNKNOWN swizzled DXT5 format with the green component swizzled into the alpha channel & the blue component swizzled into the green channel. Eight bits per pixel.
CMP_FORMAT_DXT5_xRBG,// DXGI_FORMAT_UNKNOWN swizzled DXT5 format with the green component swizzled into the alpha channel & the red component swizzled into the green channel. Eight bits per pixel.
CMP_FORMAT_DXT5_RGxB,// DXGI_FORMAT_UNKNOWN swizzled DXT5 format with the blue component swizzled into the alpha channel. Eight bits per pixel.
CMP_FORMAT_DXT5_xGxR,// two-component swizzled DXT5 format with the red component swizzled into the alpha channel & the green component in the green channel. Eight bits per pixel.
CMP_BOOLbUseRefinementSteps;// Used by BC1,BC2, BC3 codecs for improved quality, this setting will increase encoding time for better quality results
CMP_INTnRefinementSteps;// Currently only 1 step is implemneted
// v4.1 and older settings
CMP_BOOLbUseChannelWeighting;// Use channel weightings. With swizzled formats the weighting applies to the data within the specified channel not the channel itself.
// channel weigthing is not implemented for BC6H and BC7
CMP_FLOATfWeightingRed;// The weighting of the Red or X Channel.
CMP_FLOATfWeightingGreen;// The weighting of the Green or Y Channel.
CMP_FLOATfWeightingBlue;// The weighting of the Blue or Z Channel.
CMP_BOOLbUseAdaptiveWeighting;// Adapt weighting on a per-block basis.
CMP_BOOLbDXT1UseAlpha;// Encode single-bit alpha data. Only valid when compressing to DXT1 & BC1.
CMP_BOOLbUseGPUDecompress;// Use GPU to decompress. Decode API can be changed by specified in DecodeWith parameter. Default is OpenGL.
CMP_BOOLbUseCGCompress;// Use SPMD/GPU to compress. Encode API can be changed by specified in EncodeWith parameter. Default is OpenCL.
CMP_BYTEnAlphaThreshold;// The alpha threshold to use when compressing to DXT1 & BC1 with bDXT1UseAlpha. Texels with an alpha value less than the threshold are treated as transparent.
// Note: When nCompressionSpeed is not set to Normal AphaThreshold is ignored for DXT1 & BC1
CMP_BOOLbDisableMultiThreading;// Disable multi-threading of the compression. This will slow the compression but can be useful if you're managing threads in your application.
// if set BC7 dwnumThreads will default to 1 during encoding and then return back to its original value when done.
CMP_SpeednCompressionSpeed;// The trade-off between compression speed & quality.
// Notes:
// 1. This value is ignored for BC6H and BC7 (for BC7 the compression speed depends on fquaility value)
// 2. For 64 bit DXT1 to DXT5 and BC1 to BC5 nCompressionSpeed is ignored and set to Noramal Speed
// 3. To force the use of nCompressionSpeed setting regarless of Note 2 use fQuality at 0.05
CMP_GPUDecodenGPUDecode;// This value is set using DecodeWith argument (OpenGL, DirectX) default is OpenGL
CMP_Compute_typenEncodeWith;// This value is set using EncodeWith argument, currently only OpenCL is used
CMP_DWORDdwnumThreads;// Number of threads to initialize for BC7 encoding (Max up to 128). Default set to auto,
CMP_FLOATfquality;// Quality of encoding. This value ranges between 0.0 and 1.0. BC7 & BC6 default is 0.05, others codecs are set at 1.0
// setting fquality above 0.0 gives the fastest, lowest quality encoding, 1.0 is the slowest, highest quality encoding. Default set to a low value of 0.05
CMP_BOOLbrestrictColour;// This setting is a quality tuning setting for BC7 which may be necessary for convenience in some applications. Default set to false
// if set and the block does not need alpha it instructs the code not to use modes that have combined colour + alpha - this
// avoids the possibility that the encoder might choose an alpha other than 1.0 (due to parity) and cause something to
// become accidentally slightly transparent (it's possible that when encoding 3-component texture applications will assume that
// the 4th component can safely be assumed to be 1.0 all the time.)
CMP_BOOLbrestrictAlpha;// This setting is a quality tuning setting for BC7 which may be necessary for some textures. Default set to false,
// if set it will also apply restriction to blocks with alpha to avoid issues with punch-through or thresholded alpha encoding
CMP_DWORDdwmodeMask;// Mode to set BC7 to encode blocks using any of 8 different block modes in order to obtain the highest quality. Default set to 0xFF)
// You can combine the bits to test for which modes produce the best image quality.
// The mode that produces the best image quality above a set quality level (fquality) is used and subsequent modes set in the mask
// are not tested, this optimizes the performance of the compression versus the required quality.
// If you prefer to check all modes regardless of the quality then set the fquality to a value of 0
intNumCmds;// Count of the number of command value pairs in CmdSet[]. Max value that can be set is AMD_MAX_CMDS = 20 on this release
AMD_CMD_SETCmdSet[AMD_MAX_CMDS];// Extended command options that can be set for the specified codec\n
// Example to set the number of threads and quality used for compression\n
CMP_INTiVcacheSize;// For mesh vertices optimization, hardware vertex cache size. (value range 1- no limit as it allows users to simulate hardware cache size to find the most optimum size)- default is enabled with cache size = 16
CMP_INTiVcacheFIFOSize;// For mesh vertices optimization, hardware vertex cache size. (value range 1- no limit as it allows users to simulate hardware cache size to find the most optimum size)- default is disabled.
CMP_FLOATfOverdrawACMR;// For mesh overdraw optimization, optimize overdraw with ACMR (average cache miss ratio) threshold value specified (value range 1-3) - default is enabled with ACMR value = 1.05 (i.e. 5% worse)
CMP_INTiSimplifyLOD;// simplify mesh using LOD (Level of Details) value specified.(value range 1- no limit as it allows users to simplify the mesh until the level they desired. Higher level means less triangles drawn, less details.)
boolbVertexFetch;// optimize vertices fetch . boolean value 0 - disabled, 1-enabled. -default is enabled.
// way of passing data around in internal classes.
//
// For 2D textures there are m_nMipLevels MipLevels.
// Cube maps have multiple faces or sides for each mip-map level . Instead of making a totally new data type, we just made each one of these faces be represented by a MipLevel, even though the terminology can be a bit confusing at first. So if your cube map consists of 6 faces for each mip-map level, then your first mip-map level will consist of 6 MipLevels, each having the same m_nWidth, m_nHeight. The next mip-map level will have half the m_nWidth & m_nHeight as the previous, but will be composed of 6 MipLevels still.
// A volume texture is a 3D texture. Again, instead of creating a new data type, we chose to make use of multiple MipLevels to create a single mip-map level of a volume texture. So a single mip-map level of a volume texture will consist of many MipLevels, all having the same m_nWidth and m_nHeight. The next mip-map level will have m_nWidth and m_nHeight half of the previous mip-map level's (to a minimum of 1) and will be composed of half as many MipLevels as the previous mip-map level (the first mip-map level takes this number from the MipSet it's part of), to a minimum of one.
typedefstruct{
CMP_INTm_nWidth;// User Setting: Width in pixels of the topmost mip-map level of the mip-map set. Initialized by TC_AppAllocateMipSet.
CMP_INTm_nHeight;// User Setting: Height in pixels of the topmost mip-map level of the mip-map set. Initialized by TC_AppAllocateMipSet.
CMP_INTm_nDepth;// User Setting: Depth in MipLevels of the topmost mip-map level of the mip-map set. Initialized by TC_AppAllocateMipSet. See Remarks.
CMP_FORMATm_format;// User Setting: Format for this MipSet
// set by various API for internal use and user ref
ChannelFormatm_ChannelFormat;// A texture is usually composed of channels, such as RGB channels for a texture with red green and blue image data. m_ChannelFormat indicates the representation of each of these channels. So a texture where each channel is an 8 bit integer would have CF_8bit for this. A compressed texture would use CF_Compressed.
TextureDataTypem_TextureDataType;// An indication of the type of data that the texture contains. A texture with just RGB values would use TDT_XRGB, while a texture that also uses the alpha channel would use TDT_ARGB.
TextureTypem_TextureType;// Indicates whether the texture is 2D, a cube map, or a volume texture. Used to determine how to treat MipLevels, among other things.
CMP_UINTm_Flags;// Flags that mip-map set.
CMP_BYTEm_CubeFaceMask;// A mask of MS_CubeFace values indicating which cube-map faces are present.
CMP_DWORDm_dwFourCC;// The FourCC for this mip-map set. 0 if the mip-map set is uncompressed. Generated using MAKEFOURCC (defined in the Platform SDK or DX SDK).
CMP_DWORDm_dwFourCC2;// An extra FourCC used by The Compressonator internally. Our DDS plugin saves/loads m_dwFourCC2 from pDDSD ddpfPixelFormat.dwPrivateFormatBitCount (since it's not really used by anything else) whether or not it is 0. Generated using MAKEFOURCC (defined in the Platform SDK or DX SDK). The FourCC2 field is currently used to allow differentiation between the various swizzled DXT5 formats. These formats must have a FourCC of DXT5 to be supported by the DirectX runtime but The Compressonator needs to know the swizzled FourCC to correctly display the texture.
CMP_INTm_nMaxMipLevels;// Set by The Compressonator when you call TC_AppAllocateMipSet based on the width, height, depth, and textureType values passed in. Is really the maximum number of mip-map levels possible for that texture including the topmost mip-map level if you integer divide width height and depth by 2, rounding down but never falling below 1 until all three of them are 1. So a 5x10 2D texture would have a m_nMaxMipLevels of 4 (5x10 2x5 1x2 1x1).
CMP_INTm_nMipLevels;// The number of mip-map levels in the mip-map set that actually have data. Always less than or equal to m_nMaxMipLevels. Set to 0 after TC_AppAllocateMipSet.
CMP_FORMATm_transcodeFormat;// For universal format: Sets the target data format for data processing and analysis
CMP_BOOLm_compressed;// New Flags if data is compressed (example Block Compressed data in form of BCxx)
CMP_FORMATm_isDeCompressed;// The New MipSet is a decompressed result from a prior Compressed MipSet Format specified
CMP_BOOLm_swizzle;// Flag is used by image load and save to indicate channels were swizzled from the origial source
CMP_BYTEm_nBlockWidth;// Width in pixels of the Compression Block that is to be processed default for ASTC is 4
CMP_BYTEm_nBlockHeight;// Height in pixels of the Compression Block that is to be processed default for ASTC is 4
CMP_BYTEm_nBlockDepth;// Depth in pixels of the Compression Block that is to be processed default for ASTC is 1
// set by various API for internal use. These values change when processing MipLevels
CMP_DWORDdwWidth;// set by various API for ref,Width of the current active miplevel. if toplevel mipmap then value is same as m_nWidth
CMP_DWORDdwHeight;// set by various API for ref,Height of the current active miplevel. if toplevel mipmap then value is same as m_nHeight
CMP_DWORDdwDataSize;// set by various API for ref,Size of the current active miplevel allocated texture data.
CMP_BYTE*pData;// set by various API for ref,Pointer to the current active miplevel texture data: used in MipLevelTable
// Structure to hold all mip levels buffers
CMP_MipLevelTable*m_pMipLevelTable;// set by various API for ref, This is an implementation dependent way of storing the MipLevels that this mip-map set contains. Do not depend on it, use TC_AppGetMipLevel to access a mip-map set's MipLevels.
void*m_pReservedData;// Reserved for ArchitectMF ImageLoader