5 using System.Runtime.InteropServices;
7 namespace SiliconStudio.TextureConverter.AtitcWrapper
77 internal struct CompressOptions
80 public bool bUseChannelWeighting;
81 public double fWeightingRed;
82 public double fWeightingGreen;
83 public double fWeightingBlue;
84 public bool bUseAdaptiveWeighting;
85 public bool bDXT1UseAlpha;
86 public byte nAlphaThreshold;
87 public bool bDisableMultiThreading;
88 public Speed nCompressionSpeed;
90 public unsafe CompressOptions(
bool bUseChannelWeighting,
double fWeightingRed,
double fWeightingGreen,
double fWeightingBlue,
bool bUseAdaptiveWeighting,
bool bDXT1UseAlpha, byte nAlphaThreshold,
bool bDisableMultiThreading, Speed nCompressionSpeed)
92 this.dwSize =
sizeof(CompressOptions);
93 this.bUseChannelWeighting = bUseChannelWeighting;
94 this.fWeightingRed = fWeightingRed;
95 this.fWeightingGreen = fWeightingGreen;
96 this.fWeightingBlue = fWeightingBlue;
97 this.bUseAdaptiveWeighting = bUseAdaptiveWeighting;
98 this.bDXT1UseAlpha = bDXT1UseAlpha;
99 this.nAlphaThreshold = nAlphaThreshold;
100 this.bDisableMultiThreading = bDisableMultiThreading;
101 this.nCompressionSpeed = nCompressionSpeed;
108 internal struct Texture
115 public int dwDataSize;
118 public unsafe Texture(
int dwWidth,
int dwHeight,
int dwPitch, Format
format,
int dwDataSize, IntPtr pData)
120 this.dwSize =
sizeof(Texture);
121 this.dwWidth = dwWidth;
122 this.dwHeight = dwHeight;
123 this.dwPitch = dwPitch;
125 this.dwDataSize = dwDataSize;
129 public override String ToString()
131 return "width:" + dwWidth +
"\nheight:" + dwHeight +
"\nformat:" + format +
"\nrowPitch:" + dwPitch +
"\nSize:" + dwDataSize +
"\npixels:" + pData;
142 [DllImport(
"AtitcWrapper", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
145 [DllImport(
"AtitcWrapper", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
148 [DllImport(
"AtitcWrapper", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
149 private extern static Result
atitcConvertTexture(out Texture pSourceTexture, out Texture pDestTexture, out CompressOptions pOptions);
152 public static int CalculateBufferSize(out Texture pTexture)
157 public static Result ConvertTexture(out Texture pSourceTexture, out Texture pDestTexture, out CompressOptions pOptions)
162 public static void DeleteData(out Texture pTexture)
A swizzled DXT5 format with the blue component swizzled into the alpha channel. Eight bits per pixel...
The source texture is invalid.
The source and destination texture sizes do not match.
ATI_TC - a compressed ARGB format with interpolated alpha for cellphones & hand-held devices...
The destination texture is invalid.
The source format is not a supported format.
ATI_TC_ERROR atitcConvertTexture(const ATI_TC_Texture *pSourceTexture, ATI_TC_Texture *pDestTexture, const ATI_TC_CompressOptions *pOptions)
An ARGB format with 10-bit fixed channels for color & a 2-bit fixed channel for alpha.
ATI_TC - a compressed RGB format for cellphones & hand-held devices.
A DXTC compressed texture format with interpolated alpha. Eight bits per pixel.
A two component format with 32-bit floating-point channels.
ATI_TC - a compressed ARGB format with explicit alpha for cellphones & hand-held devices.
A single component compressed texture format for Microsoft DirectX10. Identical to ATI1N...
int atitcCalculateBufferSize(const ATI_TC_Texture *pTexture)
An undefined texture format.
A swizzled DXT5 format with the green component swizzled into the alpha channel & the red component s...
A two component format with 8-bit fixed channels.
A single component format with 8-bit fixed channels.
A single component format with 16-bit fixed channels.
SiliconStudio.Core.Utilities Utilities
A two component compression format using the same technique as DXT5 alpha. The same as ATI2N but with...
A DXT5 with the red component swizzled into the alpha channel. Eight bits per pixel.
void atitcDeleteData(ATI_TC_Texture *pTexture)
A four component compressed texture format with interpolated alpha for Microsoft DirectX10. Identical to DXT5. Eight bits per pixel.
A two component compressed texture format for Microsoft DirectX10. Identical to ATI2N. Eight bits per pixel.
An opaque (or 1-bit alpha) DXTC compressed texture format. Four bits per pixel.
Slightly lower quality but much faster compression mode - DXTn & ATInN only.
A four component compressed texture format with explicit alpha for Microsoft DirectX10. Identical to DXT3. Eight bits per pixel.
A single component with 16-bit floating-point channels.
A ARGB format with 16-bit fixed channels.
ETC (aka Ericsson Texture Compression) - a compressed RGB format for cellphones.
A two component format with 16-bit fixed channels.
A two component compression format using the same technique as DXT5 alpha. Designed for compression o...
A two-component swizzled DXT5 format with the red component swizzled into the alpha channel & the gre...
An unknown error occurred.
An ARGB format with 16-bit floating-point channels.
A two component format with 16-bit floating-point channels.
The destination format is not a supported format.
Slightly lower quality but much, much faster compression mode - DXTn & ATInN only.
_In_ size_t _In_ size_t _In_ DXGI_FORMAT format
A swizzled DXT5 format with the green component swizzled into the alpha channel & the blue component ...
A single component compression format using the same technique as DXT5 alpha. Four bits per pixel...
A swizzled DXT5 format with the green component swizzled into the alpha channel. Eight bits per pixel...
A four component opaque (or 1-bit alpha) compressed texture format for Microsoft DirectX10. Identical to DXT1. Four bits per pixel.
An ATI2N like format using DXT5. Intended for use on GPUs that do not natively support ATI2N...
An ARGB format with 32-bit floating-point channels.
An ARGB format with 8-bit fixed channels.
A RGB format with 8-bit fixed channels.
A DXTC compressed texture format with explicit alpha. Eight bits per pixel.
The conversion was aborted.
A single component with 32-bit floating-point channels.
ATI_Compress was unable to initialize the codec needed for conversion.