mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-09 22:40:06 +00:00
Updated Convert (markdown)
parent
cd3503b0a6
commit
3762b6703b
21
Convert.md
21
Convert.md
@ -35,13 +35,13 @@ HRESULT ConvertEx(
|
||||
|
||||
_format_: Target format for conversion.
|
||||
|
||||
_filter_: One or more [[Filter Flags]]. The default value is ``TEX_FILTER_DEFAULT``.
|
||||
_filter_: One or more [[Filter Flags]]. The default value should be ``TEX_FILTER_DEFAULT``.
|
||||
|
||||
_threshold_: Alpha threshold used for converting to single bit alpha channels (0.0 to 1.0 range). Typically use is to pass ``TEX_THRESHOLD_DEFAULT`` (0.5).
|
||||
|
||||
_options_: The Ex versions take the parameters _filter_, _threshold_, etc. using the ``ConvertOptions`` structure.
|
||||
|
||||
_statusCallBack_: This is an optional status callback invoked during processing. If the function returns **false**, then the method is exited with an ``E_ABORT``.
|
||||
_statusCallBack_: This is an optional status callback invoked during processing. If the status callback returns **false**, then the function is exited with an ``E_ABORT``.
|
||||
|
||||
# Example
|
||||
|
||||
@ -57,6 +57,23 @@ hr = Convert( srcImage.GetImages(), srcImage.GetImageCount(),
|
||||
destImage );
|
||||
if ( FAILED(hr) )
|
||||
...
|
||||
|
||||
...
|
||||
ConvertOptions opts = {};
|
||||
opts.filter = TEX_FILTER_DEFAULT;
|
||||
opts.threshold = TEX_THRESHOLD_DEFAULT;
|
||||
|
||||
hr = ConvertEx( srcImage.GetImages(), srcImage.GetImageCount(),
|
||||
srcImage.GetMetadata(),
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM, opts,
|
||||
destImage,
|
||||
[&](size_t current, size_t count) -> bool
|
||||
{
|
||||
// Do status update here current of count
|
||||
return true;
|
||||
});
|
||||
);
|
||||
if ( FAILED(hr))
|
||||
```
|
||||
|
||||
# Remarks
|
||||
|
Loading…
Reference in New Issue
Block a user