Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
Filters.h File Reference
#include <directxmath.h>
#include <directxpackedvector.h>
#include <memory>
#include "scoped.h"

Go to the source code of this file.

Classes

struct  DirectX::LinearFilter
 
struct  DirectX::CubicFilter
 
struct  DirectX::TriangleFilter::FilterTo
 
struct  DirectX::TriangleFilter::FilterFrom
 
struct  DirectX::TriangleFilter::Filter
 
struct  DirectX::TriangleFilter::TriangleRow
 

Namespaces

 DirectX
 
 DirectX::TriangleFilter
 

Macros

#define AVERAGE4(res, p0, p1, p2, p3)
 
#define AVERAGE8(res, p0, p1, p2, p3, p4, p5, p6, p7)
 
#define BILINEAR_INTERPOLATE(res, x, y, r0, r1)
 
#define TRILINEAR_INTERPOLATE(res, x, y, z, r0, r1, r2, r3)
 
#define CUBIC_INTERPOLATE(res, dx, p0, p1, p2, p3)
 

Functions

void DirectX::_CreateLinearFilter (_In_ size_t source, _In_ size_t dest, _In_ bool wrap, _Out_writes_(dest) LinearFilter *lf)
 
ptrdiff_t DirectX::bounduvw (ptrdiff_t u, ptrdiff_t maxu, bool wrap, bool mirror)
 
void DirectX::_CreateCubicFilter (_In_ size_t source, _In_ size_t dest, _In_ bool wrap, _In_ bool mirror, _Out_writes_(dest) CubicFilter *cf)
 
HRESULT DirectX::TriangleFilter::_Create (_In_ size_t source, _In_ size_t dest, _In_ bool wrap, _Inout_ std::unique_ptr< Filter > &tf)
 

Variables

XMGLOBALCONST XMVECTORF32 DirectX::g_boxScale = { 0.25f, 0.25f, 0.25f, 0.25f }
 
XMGLOBALCONST XMVECTORF32 DirectX::g_boxScale3D = { 0.125f, 0.125f, 0.125f, 0.125f }
 
XMGLOBALCONST XMVECTORF32 DirectX::g_cubicThird = { 1.f/3.f, 1.f/3.f, 1.f/3.f, 1.f/3.f }
 
XMGLOBALCONST XMVECTORF32 DirectX::g_cubicSixth = { 1.f/6.f, 1.f/6.f, 1.f/6.f, 1.f/6.f }
 
XMGLOBALCONST XMVECTORF32 DirectX::g_cubicHalf = { 1.f/2.f, 1.f/2.f, 1.f/2.f, 1.f/2.f }
 
static const size_t DirectX::TriangleFilter::TF_FILTER_SIZE = sizeof(Filter) - sizeof(FilterFrom)
 
static const size_t DirectX::TriangleFilter::TF_FROM_SIZE = sizeof(FilterFrom) - sizeof(FilterTo)
 
static const size_t DirectX::TriangleFilter::TF_TO_SIZE = sizeof(FilterTo)
 
static const float DirectX::TriangleFilter::TF_EPSILON = 0.00001f
 

Macro Definition Documentation

#define AVERAGE4 (   res,
  p0,
  p1,
  p2,
  p3 
)
Value:
{ \
XMVECTOR v = XMVectorAdd( (p0), (p1) ); \
v = XMVectorAdd( v, (p2) ); \
v = XMVectorAdd( v, (p3) ); \
res = XMVectorMultiply( v, g_boxScale ); \
}
XMGLOBALCONST XMVECTORF32 g_boxScale
Definition: Filters.h:32

Definition at line 35 of file Filters.h.

Referenced by DirectX::_Generate2DMipsBoxFilter(), DirectX::_Generate3DMipsBoxFilter(), and DirectX::_ResizeBoxFilter().

#define AVERAGE8 (   res,
  p0,
  p1,
  p2,
  p3,
  p4,
  p5,
  p6,
  p7 
)
Value:
{ \
XMVECTOR v = XMVectorAdd( (p0), (p1) ); \
v = XMVectorAdd( v, (p2) ); \
v = XMVectorAdd( v, (p3) ); \
v = XMVectorAdd( v, (p4) ); \
v = XMVectorAdd( v, (p5) ); \
v = XMVectorAdd( v, (p6) ); \
v = XMVectorAdd( v, (p7) ); \
res = XMVectorMultiply( v, g_boxScale3D ); \
}
XMGLOBALCONST XMVECTORF32 g_boxScale3D
Definition: Filters.h:33

Definition at line 43 of file Filters.h.

Referenced by DirectX::_Generate3DMipsBoxFilter().

#define BILINEAR_INTERPOLATE (   res,
  x,
  y,
  r0,
  r1 
)
Value:
res = ( y.weight0 * ( (r0)[ x.u0 ] * x.weight0 + (r0)[ x.u1 ] * x.weight1 ) ) \
+ ( y.weight1 * ( (r1)[ x.u0 ] * x.weight0 + (r1)[ x.u1 ] * x.weight1 ) )
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ float size_t y
Definition: DirectXTexP.h:191

Definition at line 106 of file Filters.h.

Referenced by DirectX::_Generate2DMipsLinearFilter(), DirectX::_Generate3DMipsLinearFilter(), and DirectX::_ResizeLinearFilter().

#define CUBIC_INTERPOLATE (   res,
  dx,
  p0,
  p1,
  p2,
  p3 
)
Value:
{ \
XMVECTOR a0 = (p1); \
XMVECTOR d0 = (p0) - a0; \
XMVECTOR d2 = (p2) - a0; \
XMVECTOR d3 = (p3) - a0; \
XMVECTOR a1 = d2 - g_cubicThird*d0 - g_cubicSixth*d3; \
XMVECTOR a2 = g_cubicHalf*d0 + g_cubicHalf*d2; \
XMVECTOR a3 = g_cubicSixth*d3 - g_cubicSixth*d0 - g_cubicHalf*d2; \
XMVECTOR vdx = XMVectorReplicate( dx ); \
XMVECTOR vdx2 = vdx * vdx; \
XMVECTOR vdx3 = vdx2 * vdx; \
res = a0 + a1*vdx + a2*vdx2 + a3*vdx3; \
}
XMGLOBALCONST XMVECTORF32 g_cubicSixth
Definition: Filters.h:122
XMGLOBALCONST XMVECTORF32 g_cubicThird
Definition: Filters.h:121
XMGLOBALCONST XMVECTORF32 g_cubicHalf
Definition: Filters.h:123

Definition at line 194 of file Filters.h.

Referenced by DirectX::_Generate2DMipsCubicFilter(), DirectX::_Generate3DMipsCubicFilter(), and DirectX::_ResizeCubicFilter().

#define TRILINEAR_INTERPOLATE (   res,
  x,
  y,
  z,
  r0,
  r1,
  r2,
  r3 
)
Value:
res = ( z.weight0 * ( ( y.weight0 * ( (r0)[ x.u0 ] * x.weight0 + (r0)[ x.u1 ] * x.weight1 ) ) \
+ ( y.weight1 * ( (r1)[ x.u0 ] * x.weight0 + (r1)[ x.u1 ] * x.weight1 ) ) ) ) \
+ ( z.weight1 * ( ( y.weight0 * ( (r2)[ x.u0 ] * x.weight0 + (r2)[ x.u1 ] * x.weight1 ) ) \
+ ( y.weight1 * ( (r3)[ x.u0 ] * x.weight0 + (r3)[ x.u1 ] * x.weight1 ) ) ) )
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ float size_t y
Definition: DirectXTexP.h:191
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ float size_t size_t z
Definition: DirectXTexP.h:191

Definition at line 110 of file Filters.h.

Referenced by DirectX::_Generate3DMipsLinearFilter().