#include "UnitTestSharpHLSL.fx" #include "QuincunxSampling.fxh" // QuincunxSampling_ComputeSamplingPoints void ComputeSamplingPoints_Identity() { float2x4 expected = { 1, -1, -1, 1, 1, 1, -1, -1, }; float4x4 WCV_Inv = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, }; float2 pixelCenter = float2(0, 0); float pixelHalfWidth = 1; float2x4 actual = QuincunxSampling_ComputeSamplingPoints(WCV_Inv, pixelCenter, pixelHalfWidth); CheckEqual(expected, actual); } void ComputeSamplingPoints_Wide() { float2x4 expected = { 2, -2, -2, 2, 2, 2, -2, -2, }; float4x4 WCV_Inv = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, }; float2 pixelCenter = float2(0, 0); float pixelHalfWidth = 2; float2x4 actual = QuincunxSampling_ComputeSamplingPoints(WCV_Inv, pixelCenter, pixelHalfWidth); CheckEqual(expected, actual); } void ComputeSamplingPoints_Symmetric() { float2x4 expected = { 4, 2, -2, 0, 5, 1, -1, 3, }; float4x4 WCV_Inv = { 1, 2, 0, 1, 2, 1, 0, 2, 0, 0, 0, 0, 1, 2, 0, 1, }; float2 pixelCenter = float2(0, 0); float pixelHalfWidth = 1; float2x4 actual = QuincunxSampling_ComputeSamplingPoints(WCV_Inv, pixelCenter, pixelHalfWidth); CheckEqual(expected, actual); } void ComputeSamplingPoints_RealWorld() { float2x4 expected = { -7, -8, -11, -10, 6, 4, 3, 5, }; float4x4 WCV_Inv = { 1, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, }; float2 pixelCenter = float2(3.5, -4.5); float pixelHalfWidth = 0.5; float2x4 actual = QuincunxSampling_ComputeSamplingPoints(WCV_Inv, pixelCenter, pixelHalfWidth); //expected = transpose(expected); //actual = transpose(actual); CheckEqual(expected, actual); } //QuincunxSampling_IsInsideCircle void IsInsideCircle_Complete() { }