mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-14 06:00:14 +02:00
Rename Evaluate and Transform
This commit is contained in:
parent
303806d29f
commit
bfa53ff6c0
@ -616,14 +616,14 @@ namespace DirectX
|
|||||||
|
|
||||||
HRESULT __cdecl ComputeMSE( _In_ const Image& image1, _In_ const Image& image2, _Out_ float& mse, _Out_writes_opt_(4) float* mseV, _In_ DWORD flags = 0 );
|
HRESULT __cdecl ComputeMSE( _In_ const Image& image1, _In_ const Image& image2, _Out_ float& mse, _Out_writes_opt_(4) float* mseV, _In_ DWORD flags = 0 );
|
||||||
|
|
||||||
HRESULT __cdecl Evaluate( _In_ const Image& image,
|
HRESULT __cdecl EvaluateImage( _In_ const Image& image,
|
||||||
_In_ std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc );
|
_In_ std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc );
|
||||||
|
|
||||||
HRESULT __cdecl Transform( _In_ const Image& image,
|
HRESULT __cdecl TransformImage( _In_ const Image& image,
|
||||||
_In_ std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels,
|
_In_ std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels,
|
||||||
_In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
_In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
||||||
ScratchImage& result );
|
ScratchImage& result );
|
||||||
HRESULT __cdecl Transform(_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
|
HRESULT __cdecl TransformImage( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
|
||||||
_In_ std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels,
|
_In_ std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels,
|
||||||
_In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
_In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
||||||
ScratchImage& result );
|
ScratchImage& result );
|
||||||
|
@ -168,7 +168,7 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
HRESULT Evaluate_(
|
HRESULT EvaluateImage_(
|
||||||
const Image& image,
|
const Image& image,
|
||||||
std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc)
|
std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc)
|
||||||
{
|
{
|
||||||
@ -204,7 +204,7 @@ namespace
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
HRESULT Transform_(
|
HRESULT TransformImage_(
|
||||||
const Image& srcImage,
|
const Image& srcImage,
|
||||||
std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels, _In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels, _In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
||||||
const Image& destImage)
|
const Image& destImage)
|
||||||
@ -464,7 +464,7 @@ HRESULT DirectX::ComputeMSE(
|
|||||||
// Evaluates a user-supplied function for all the pixels in the image
|
// Evaluates a user-supplied function for all the pixels in the image
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
_Use_decl_annotations_
|
_Use_decl_annotations_
|
||||||
HRESULT DirectX::Evaluate(
|
HRESULT DirectX::EvaluateImage(
|
||||||
const Image& image,
|
const Image& image,
|
||||||
std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc)
|
std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc)
|
||||||
{
|
{
|
||||||
@ -489,11 +489,11 @@ HRESULT DirectX::Evaluate(
|
|||||||
if (!img)
|
if (!img)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
return Evaluate_(*img, pixelFunc);
|
return EvaluateImage_(*img, pixelFunc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Evaluate_(image, pixelFunc);
|
return EvaluateImage_(image, pixelFunc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ HRESULT DirectX::Evaluate(
|
|||||||
// Use a user-supplied function to compute a new image from an input image
|
// Use a user-supplied function to compute a new image from an input image
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
_Use_decl_annotations_
|
_Use_decl_annotations_
|
||||||
HRESULT DirectX::Transform(
|
HRESULT DirectX::TransformImage(
|
||||||
const Image& image,
|
const Image& image,
|
||||||
std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels, _In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels, _In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
||||||
ScratchImage& result)
|
ScratchImage& result)
|
||||||
@ -525,7 +525,7 @@ HRESULT DirectX::Transform(
|
|||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = Transform_(image, pixelFunc, *dimg);
|
hr = TransformImage_(image, pixelFunc, *dimg);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
result.Release();
|
result.Release();
|
||||||
@ -536,7 +536,7 @@ HRESULT DirectX::Transform(
|
|||||||
}
|
}
|
||||||
|
|
||||||
_Use_decl_annotations_
|
_Use_decl_annotations_
|
||||||
HRESULT DirectX::Transform(
|
HRESULT DirectX::TransformImage(
|
||||||
const Image* srcImages,
|
const Image* srcImages,
|
||||||
size_t nimages, const TexMetadata& metadata,
|
size_t nimages, const TexMetadata& metadata,
|
||||||
std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels, _In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels, _In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
|
||||||
@ -599,7 +599,7 @@ HRESULT DirectX::Transform(
|
|||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = Transform_(src, pixelFunc, dst);
|
hr = TransformImage_(src, pixelFunc, dst);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
result.Release();
|
result.Release();
|
||||||
@ -643,7 +643,7 @@ HRESULT DirectX::Transform(
|
|||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = Transform_(src, pixelFunc, dst);
|
hr = TransformImage_(src, pixelFunc, dst);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
result.Release();
|
result.Release();
|
||||||
|
@ -1744,7 +1744,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
|||||||
|
|
||||||
XMVECTOR colorKeyValue = XMLoadColor(reinterpret_cast<const XMCOLOR*>(&colorKey));
|
XMVECTOR colorKeyValue = XMLoadColor(reinterpret_cast<const XMCOLOR*>(&colorKey));
|
||||||
|
|
||||||
hr = Transform(image->GetImages(), image->GetImageCount(), image->GetMetadata(),
|
hr = TransformImage(image->GetImages(), image->GetImageCount(), image->GetMetadata(),
|
||||||
[&](XMVECTOR* outPixels, const XMVECTOR* inPixels, size_t width, size_t y)
|
[&](XMVECTOR* outPixels, const XMVECTOR* inPixels, size_t width, size_t y)
|
||||||
{
|
{
|
||||||
static const XMVECTORF32 s_tolerance = { 0.2f, 0.2f, 0.2f, 0.f };
|
static const XMVECTORF32 s_tolerance = { 0.2f, 0.2f, 0.2f, 0.f };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user