MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/Cauldron / ComputeIntersectionArea

Function ComputeIntersectionArea

src/DX12/base/FreesyncHDR.cpp:92–95  ·  view source on GitHub ↗

Compute the overlay area of two rectangles, A and B. (ax1, ay1) = left-top coordinates of A; (ax2, ay2) = right-bottom coordinates of A (bx1, by1) = left-top coordinates of B; (bx2, by2) = right-bottom coordinates of B based on https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/Samples/Desktop/D3D12HDR/src/D3D12HDR.cpp ----------------------------------------------------------------

Source from the content-addressed store, hash-verified

90 // based on https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/Samples/Desktop/D3D12HDR/src/D3D12HDR.cpp
91 //--------------------------------------------------------------------------------------
92 inline int ComputeIntersectionArea(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2)
93 {
94 return max(0, min(ax2, bx2) - max(ax1, bx1)) * max(0, min(ay2, by2) - max(ay1, by1));
95 }
96
97 bool FindBestDisplayIndex(RECT *windowRect, RECT *monitorRect, float *bestIntersectArea)
98 {

Callers 1

FindBestDisplayIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected