15 #ifndef _D2D1_1HELPER_H_ 16 #define _D2D1_1HELPER_H_ 20 #endif // #ifndef _D2D1_H_ 22 #ifndef D2D_USE_C_DEFINITIONS 32 struct TypeTraits<
INT32>
39 struct TypeTraits<LONG>
163 return _11 ==
r._11 && _12 ==
r._12 && _13 ==
r._13 && _14 ==
r._14 &&
164 _21 ==
r._21 && _22 ==
r._22 && _23 ==
r._23 && _24 ==
r._24 &&
165 _31 ==
r._31 && _32 ==
r._32 && _33 ==
r._33 && _34 ==
r._34 &&
166 _41 ==
r._41 && _42 ==
r._42 && _43 ==
r._43 && _44 ==
r._44;
176 return !(*
this ==
r);
185 Matrix4x4F translation;
187 translation._11 = 1.0; translation._12 = 0.0; translation._13 = 0.0; translation._14 = 0.0;
188 translation._21 = 0.0; translation._22 = 1.0; translation._23 = 0.0; translation._24 = 0.0;
189 translation._31 = 0.0; translation._32 = 0.0; translation._33 = 1.0; translation._34 = 0.0;
190 translation._41 =
x; translation._42 =
y; translation._43 =
z; translation._44 = 1.0;
215 RotationX(
FLOAT degreeX)
217 FLOAT angleInRadian = degreeX * (3.141592654f / 180.0f);
219 FLOAT sinAngle = 0.0;
220 FLOAT cosAngle = 0.0;
221 D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
223 Matrix4x4F rotationX(
225 0, cosAngle, sinAngle, 0,
226 0, -sinAngle, cosAngle, 0,
237 RotationY(
FLOAT degreeY)
239 FLOAT angleInRadian = degreeY * (3.141592654f / 180.0f);
241 FLOAT sinAngle = 0.0;
242 FLOAT cosAngle = 0.0;
243 D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
245 Matrix4x4F rotationY(
246 cosAngle, 0, -sinAngle, 0,
248 sinAngle, 0, cosAngle, 0,
259 RotationZ(
FLOAT degreeZ)
261 FLOAT angleInRadian = degreeZ * (3.141592654f / 180.0f);
263 FLOAT sinAngle = 0.0;
264 FLOAT cosAngle = 0.0;
265 D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
267 Matrix4x4F rotationZ(
268 cosAngle, sinAngle, 0, 0,
269 -sinAngle, cosAngle, 0, 0,
292 FLOAT angleInRadian = degree * (3.141592654f / 180.0f);
294 FLOAT sinAngle = 0.0;
295 FLOAT cosAngle = 0.0;
296 D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
298 FLOAT oneMinusCosAngle = 1 - cosAngle;
300 Matrix4x4F rotationArb(
301 1 + oneMinusCosAngle * (
x *
x - 1),
302 z * sinAngle + oneMinusCosAngle *
x *
y,
303 -
y * sinAngle + oneMinusCosAngle *
x *
z,
306 -
z * sinAngle + oneMinusCosAngle *
y *
x,
307 1 + oneMinusCosAngle * (
y *
y - 1),
308 x * sinAngle + oneMinusCosAngle *
y *
z,
311 y * sinAngle + oneMinusCosAngle *
z *
x,
312 -
x * sinAngle + oneMinusCosAngle *
z *
y,
313 1 + oneMinusCosAngle * (
z *
z - 1) ,
328 FLOAT angleInRadian = degreeX * (3.141592654f / 180.0f);
348 FLOAT angleInRadian = degreeY * (3.141592654f / 180.0f);
376 Matrix4x4F projection(
396 return static_cast<const Matrix4x4F *
>(pMatrix);
405 return static_cast<Matrix4x4F *
>(pMatrix);
413 FLOAT minor1 = _41 * (_12 * (_23 * _34 - _33 * _24) - _13 * (_22 * _34 - _24 * _32) + _14 * (_22 * _33 - _23 * _32));
414 FLOAT minor2 = _42 * (_11 * (_21 * _34 - _31 * _24) - _13 * (_21 * _34 - _24 * _31) + _14 * (_21 * _33 - _23 * _31));
415 FLOAT minor3 = _43 * (_11 * (_22 * _34 - _32 * _24) - _12 * (_21 * _34 - _24 * _31) + _14 * (_21 * _32 - _22 * _31));
416 FLOAT minor4 = _44 * (_11 * (_22 * _33 - _32 * _23) - _12 * (_21 * _33 - _23 * _31) + _13 * (_21 * _32 - _22 * _31));
418 return minor1 - minor2 + minor3 - minor4;
426 return _11 == 1.f && _12 == 0.f && _13 == 0.f && _14 == 0.f
427 && _21 == 0.f && _22 == 1.f && _23 == 0.f && _24 == 0.f
428 && _31 == 0.f && _32 == 0.f && _33 == 1.f && _34 == 0.f
429 && _41 == 0.f && _42 == 0.f && _43 == 0.f && _44 == 1.f;
435 SetProduct(
const Matrix4x4F &
a,
const Matrix4x4F &
b)
437 _11 =
a._11 *
b._11 +
a._12 *
b._21 +
a._13 *
b._31 +
a._14 *
b._41;
438 _12 =
a._11 *
b._12 +
a._12 *
b._22 +
a._13 *
b._32 +
a._14 *
b._42;
439 _13 =
a._11 *
b._13 +
a._12 *
b._23 +
a._13 *
b._33 +
a._14 *
b._43;
440 _14 =
a._11 *
b._14 +
a._12 *
b._24 +
a._13 *
b._34 +
a._14 *
b._44;
442 _21 =
a._21 *
b._11 +
a._22 *
b._21 +
a._23 *
b._31 +
a._24 *
b._41;
443 _22 =
a._21 *
b._12 +
a._22 *
b._22 +
a._23 *
b._32 +
a._24 *
b._42;
444 _23 =
a._21 *
b._13 +
a._22 *
b._23 +
a._23 *
b._33 +
a._24 *
b._43;
445 _24 =
a._21 *
b._14 +
a._22 *
b._24 +
a._23 *
b._34 +
a._24 *
b._44;
447 _31 =
a._31 *
b._11 +
a._32 *
b._21 +
a._33 *
b._31 +
a._34 *
b._41;
448 _32 =
a._31 *
b._12 +
a._32 *
b._22 +
a._33 *
b._32 +
a._34 *
b._42;
449 _33 =
a._31 *
b._13 +
a._32 *
b._23 +
a._33 *
b._33 +
a._34 *
b._43;
450 _34 =
a._31 *
b._14 +
a._32 *
b._24 +
a._33 *
b._34 +
a._34 *
b._44;
452 _41 =
a._41 *
b._11 +
a._42 *
b._21 +
a._43 *
b._31 +
a._44 *
b._41;
453 _42 =
a._41 *
b._12 +
a._42 *
b._22 +
a._43 *
b._32 +
a._44 *
b._42;
454 _43 =
a._41 *
b._13 +
a._42 *
b._23 +
a._43 *
b._33 +
a._44 *
b._43;
455 _44 =
a._41 *
b._14 +
a._42 *
b._24 +
a._43 *
b._34 +
a._44 *
b._44;
461 operator*(
const Matrix4x4F &
matrix)
const 554 destinationColorSpace,
562 DrawingStateDescription1(
576 drawingStateDescription1.
tag1 = tag1;
577 drawingStateDescription1.
tag2 = tag2;
580 drawingStateDescription1.
unitMode = unitMode;
582 return drawingStateDescription1;
588 DrawingStateDescription1(
598 drawingStateDescription1.
tag1 = desc.tag1;
599 drawingStateDescription1.
tag2 = desc.tag2;
600 drawingStateDescription1.
transform = desc.transform;
602 drawingStateDescription1.
unitMode = unitMode;
604 return drawingStateDescription1;
626 return bitmapProperties;
645 layerParameters.geometricMask = geometricMask;
648 layerParameters.
opacity = opacity;
649 layerParameters.opacityBrush = opacityBrush;
652 return layerParameters;
658 StrokeStyleProperties1(
671 strokeStyleProperties.
startCap = startCap;
672 strokeStyleProperties.
endCap = endCap;
673 strokeStyleProperties.
dashCap = dashCap;
674 strokeStyleProperties.
lineJoin = lineJoin;
675 strokeStyleProperties.
miterLimit = miterLimit;
676 strokeStyleProperties.
dashStyle = dashStyle;
677 strokeStyleProperties.
dashOffset = dashOffset;
680 return strokeStyleProperties;
686 ImageBrushProperties(
700 return imageBrushProperties;
706 BitmapBrushProperties1(
718 return bitmapBrush1Properties;
724 PrintControlProperties(
732 printControlProps.
fontSubset = fontSubsetMode;
736 return printControlProps;
750 renderingControls.
tileSize = tileSize;
752 return renderingControls;
758 EffectInputDescription(
788 return creationProperties;
838 return Point2<INT32>(
x,
y);
861 SetDpiCompensatedEffectInput(
875 effect->SetInput(inputIndex,
NULL);
879 hr = deviceContext->CreateEffect(CLSID_D2D1DpiCompensation, &dpiCompensationEffect);
885 dpiCompensationEffect->SetInput(0, inputBitmap);
888 inputBitmap->GetDpi(&bitmapDpi.
x, &bitmapDpi.
y);
904 effect->SetInputEffect(inputIndex, dpiCompensationEffect);
907 if (dpiCompensationEffect)
909 dpiCompensationEffect->Release();
921 #endif // #ifndef D2D_USE_C_DEFINITIONS 923 #endif // #ifndef _D2D1_HELPER_H_ FLOAT y
Definition: dcommon.h:178
FLOAT WINAPI D2D1Tan(_In_ FLOAT angle)
D2D1_CAP_STYLE
Enum which describes the drawing of the ends of a line.
Definition: d2d1.h:380
#define D2D1FORCEINLINE
Definition: d2d1.h:3704
FLOAT rasterDPI
DPI for rasterization of all unsupported D2D commands or options, defaults to 150....
Definition: d2d1_1.h:619
D2D1_TAG tag1
Definition: d2d1_1.h:599
Render text using the current system setting.
Definition: d2d1.h:205
D2D1_BUFFER_PRECISION bufferPrecision
The default buffer precision, used if the precision isn't otherwise specified.
Definition: d2d1_1.h:438
D2D1_CAP_STYLE endCap
Definition: d2d1_1.h:521
Definition: glslang_tab.cpp:129
This describes the drawing state.
Definition: d2d1_1.h:595
#define PixelFormat
Definition: record_ffmpeg.c:117
D2D1_TEXT_ANTIALIAS_MODE
Describes the antialiasing mode used for drawing text.
Definition: d2d1.h:199
D2D1_ANTIALIAS_MODE antialiasMode
Definition: d2d1_1.h:597
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
D2D1_DEVICE_CONTEXT_OPTIONS
This specifies options that apply to the device context for its lifetime.
Definition: d2d1_1.h:295
D2D1_CAP_STYLE dashCap
Definition: d2d1_1.h:522
D2D_POINT_2L D2D1_POINT_2L
Definition: d2d1_1.h:58
D2D1_CAP_STYLE startCap
Definition: d2d1_1.h:520
D2D1_PRIMITIVE_BLEND primitiveBlend
Definition: d2d1_1.h:602
GLfloat f
Definition: glext.h:8207
D2D1_EXTEND_MODE extendModeY
Definition: d2d1_1.h:497
D2D1_DASH_STYLE
Describes the sequence of dashes and gaps in a stroke.
Definition: d2d1.h:410
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9939
D2D1_UNIT_MODE unitMode
Definition: d2d1_1.h:603
GLuint GLenum matrix
Definition: glext.h:10314
GLdouble GLdouble z
Definition: glext.h:6514
Represents a rectangle defined by the coordinates of the upper-left corner (left, top) and the coordi...
Definition: dcommon.h:224
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
GLint GLint bottom
Definition: glext.h:8393
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:11766
D2D1_LINE_JOIN lineJoin
Definition: d2d1_1.h:523
D2D1_RECT_F sourceRectangle
Definition: d2d1_1.h:495
GLdouble GLdouble right
Definition: glext.h:11766
The edges of each primitive are antialiased sequentially.
Definition: d2d1.h:185
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
Miter join.
Definition: d2d1.h:432
Subset for used glyphs, send and discard font resource after every five pages
Definition: d2d1_1.h:576
The bitmap is created with default properties.
Definition: d2d1_1.h:138
The sRGB color space.
Definition: d2d1_1.h:281
D2D1_DEBUG_LEVEL
Indicates the debug level to be output by the debug layer.
Definition: d2d1.h:971
Represents a 5-by-4 matrix.
Definition: dcommon.h:371
D2D1_PRIMITIVE_BLEND
A blend mode that applies to all primitives drawn on the context.
Definition: d2d1_1.h:341
D2D1_COLOR_SPACE
Defines a color space.
Definition: d2d1_1.h:270
D2D1_DEBUG_LEVEL debugLevel
Definition: d2d1_1.h:640
D2D1_INTERPOLATION_MODE interpolationMode
Definition: d2d1_1.h:510
#define NULL
Pointer to 0.
Definition: gctypes.h:65
interface ID2D1Effect ID2D1Effect
Definition: d2d1_1.h:53
D2D1_LINE_JOIN
Enum which describes the drawing of the corners on the line.
Definition: d2d1.h:426
Extend the edges of the source out by clamping sample points outside the source to the edges.
Definition: d2d1.h:158
int32_t INT32
Definition: coretypes.h:17
FLOAT x
Definition: dcommon.h:177
D2D1_INTERPOLATION_MODE
This is used to specify the quality of image scaling with ID2D1DeviceContext::DrawImage and with the ...
Definition: d2d1_1.h:242
void WINAPI D2D1SinCos(_In_ FLOAT angle, _Out_ FLOAT *s, _Out_ FLOAT *c)
D2D1_INTERPOLATION_MODE interpolationMode
Definition: d2d1_1.h:498
D2D1_STROKE_TRANSFORM_TYPE
Defines how the world transform, dots per inch (dpi), and stroke width affect the shape of the pen us...
Definition: d2d1_1.h:315
A vector of 2 FLOAT values (x, y).
Definition: dcommon.h:187
interface ID2D1DeviceContext ID2D1DeviceContext
Definition: d2d1_1.h:2432
Description of a pixel format.
Definition: dcommon.h:155
D2D1_THREADING_MODE threadingMode
Describes locking behavior of D2D resources
Definition: d2d1_1.h:639
interface ID2D1Geometry ID2D1Geometry
Definition: d2d1.h:76
D2D1_EXTEND_MODE
Enum which describes how to sample from a source outside its base tile.
Definition: d2d1.h:151
D2D1_ANTIALIAS_MODE
Enum which describes the manner in which we render edges of non-text primitives.
Definition: d2d1.h:179
D2D1_DASH_STYLE dashStyle
Definition: d2d1_1.h:525
D2D1_BITMAP_OPTIONS
Specifies how the bitmap can be used.
Definition: d2d1_1.h:132
D2D1_RECT_F contentBounds
Definition: d2d1_1.h:556
D2D1_UNIT_MODE
This specifies what units should be accepted by the D2D API.
Definition: d2d1_1.h:258
UINT64 D2D1_TAG
Definition: d2d1.h:290
Definition: d2d1effects.h:73
D2D1_MATRIX_3X2_F maskTransform
Definition: d2d1_1.h:559
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
A vector of 4 FLOAT values (x, y, z, w).
Definition: dcommon.h:210
D2D1_PRINT_FONT_SUBSET_MODE
Defines when font resources should be subset during printing.
Definition: d2d1_1.h:570
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
GLuint64EXT * result
Definition: glext.h:12211
Represents an x-coordinate and y-coordinate pair in two-dimensional space.
Definition: dcommon.h:175
GLint GLint GLsizei GLsizei GLsizei depth
Definition: glext.h:6293
Describes the extend modes and the interpolation mode of an ID2D1BitmapBrush.
Definition: d2d1_1.h:506
description
Definition: setup.py:7
FLOAT dashOffset
Definition: d2d1_1.h:526
D2D1_BUFFER_PRECISION
This specifies the precision that should be used in buffers allocated by D2D.
Definition: d2d1_1.h:193
D2D1_LAYER_OPTIONS1
Specifies how the layer contents should be prepared.
Definition: d2d1_1.h:539
D2D1_MATRIX_3X2_F transform
Definition: d2d1_1.h:601
The stroke respects the world transform, the DPI, and the stroke width.
Definition: d2d1_1.h:321
D2D1_THREADING_MODE
This specifies the threading mode used while simultaneously creating the device, factory,...
Definition: d2d1_1.h:357
Represents a 3-by-2 matrix.
Definition: dcommon.h:275
interface ID2D1ColorContext ID2D1ColorContext
Definition: d2d1_1.h:31
D2D1_EXTEND_MODE extendModeX
Definition: d2d1_1.h:496
D2D1_SIZE_U tileSize
The size of allocated tiles used to render imaging effects.
Definition: d2d1_1.h:443
Allows the drawing state to be atomically created. This also specifies the drawing state that is save...
Definition: d2d1.h:936
Flat line cap.
Definition: d2d1.h:386
This specifies the options while simultaneously creating the device, factory, and device context.
Definition: d2d1_1.h:633
A vector of 3 FLOAT values (x, y, z).
Definition: dcommon.h:198
bool operator==(const FloatProxy< T > &first, const FloatProxy< T > &second)
Definition: hex_float.h:162
interface ID2D1Bitmap ID2D1Bitmap
Definition: d2d1.h:3580
uint32_t UINT32
Definition: coretypes.h:10
GLuint color
Definition: glext.h:6883
interface ID2D1Brush ID2D1Brush
Definition: d2d1.h:77
D2D1_COLOR_SPACE colorSpace
Color space for vector graphics in XPS package
Definition: d2d1_1.h:624
Property Name: "BorderMode" Property Type: D2D1_BORDER_MODE
Definition: d2d1effects.h:597
FLOAT opacity
Definition: d2d1_1.h:560
This identifies a certain input connection of a certain effect.
Definition: d2d1_1.h:451
D2D1_EXTEND_MODE extendModeX
Definition: d2d1_1.h:508
FLOAT WINAPI D2D1Vec3Length(_In_ FLOAT x, _In_ FLOAT y, _In_ FLOAT z)
Extended bitmap properties.
Definition: d2d1_1.h:403
Stores an ordered pair of integers, typically the width and height of a rectangle.
Definition: dcommon.h:264
D2D1_PRINT_FONT_SUBSET_MODE fontSubset
Definition: d2d1_1.h:613
GLuint GLenum GLenum transform
Definition: glext.h:10314
D2D1_LAYER_OPTIONS1 layerOptions
Definition: d2d1_1.h:562
Definition: glslang_tab.cpp:133
D2D1_ANTIALIAS_MODE maskAntialiasMode
Definition: d2d1_1.h:558
GLuint GLenum transformType
Definition: glext.h:12627
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
Definition: d2d1_1.h:598
D2D1_EXTEND_MODE extendModeY
Definition: d2d1_1.h:509
All parameters related to pushing a layer.
Definition: d2d1_1.h:554
Represents a 4-by-4 matrix.
Definition: dcommon.h:350
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6742
D2D1_COLOR_F WINAPI D2D1ConvertColorSpace(D2D1_COLOR_SPACE sourceColorSpace, D2D1_COLOR_SPACE destinationColorSpace, _In_ CONST D2D1_COLOR_F *color)
Creation properties for an image brush.
Definition: d2d1_1.h:493
D2D1_TAG tag2
Definition: d2d1_1.h:600
Represents a 4-by-3 matrix.
Definition: dcommon.h:329
GLint left
Definition: glext.h:8393
This controls advanced settings of the Direct2D imaging pipeline.
Definition: d2d1_1.h:432
D2D1_BORDER_MODE
Specifies how the Crop effect handles the crop rectangle falling on fractional pixel coordinates.
Definition: d2d1effects.h:70
D2D_RECT_L D2D1_RECT_L
Definition: d2d1_1.h:57
Property Name: "InputDpi" Property Type: D2D1_VECTOR_2F
Definition: d2d1effects.h:603
D2D1_DEVICE_CONTEXT_OPTIONS options
Definition: d2d1_1.h:641
Property Name: "InterpolationMode" Property Type: D2D1_DPICOMPENSATION_INTERPOLATION_MODE
Definition: d2d1effects.h:591
bf_uint8_t options
Definition: connect_ps4.c:78
FLOAT miterLimit
Definition: d2d1_1.h:524
The text renderer interface represents a set of application-defined callbacks that perform rendering ...
Definition: d3d8types.h:57
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
D2D1_STROKE_TRANSFORM_TYPE transformType
How the nib of the stroke is influenced by the context properties.
Definition: d2d1_1.h:531
The creation properties for a ID2D1PrintControl object.
Definition: d2d1_1.h:611
This defines how geometries should be drawn and widened.
Definition: d2d1_1.h:518