File Index Symbol Index

//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2D1_1.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2D1_1_H_
#define _D2D1_1_H_
#ifndef _D2D1_H_ #include <d2d1.h> #endif // #ifndef _D2D1_H_
#ifndef _D2D1_EFFECTS_ #include <d2d1effects.h> #endif // #ifndef _D2D1_EFFECTS_
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <dxgi.h> #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#include <winapifamily.h>
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
typedef
struct
DWRITE_GLYPH_RUN_DESCRIPTION
DWRITE_GLYPH_RUN_DESCRIPTION
;
typedef
struct
D2D1_PROPERTY_BINDING
D2D1_PROPERTY_BINDING
;
/// <summary>
/// Function pointer to construct a new effect once registered.
/// </summary>
);
#ifndef D2D_USE_C_DEFINITIONS
#else
typedef interface ID2D1Device ID2D1Device;
typedef interface ID2D1Effect ID2D1Effect;
#endif
#define D2D1_INVALID_PROPERTY_INDEX UINT_MAX
typedef
D2D_RECT_L
D2D1_RECT_L
;
typedef
D2D_POINT_2L
D2D1_POINT_2L
;
/// <summary>
/// This defines the valid property types that can be used in an effect property
/// interface.
/// </summary>
typedef
enum
D2D1_PROPERTY_TYPE
{
D2D1_PROPERTY_TYPE_UNKNOWN
=
0
,
D2D1_PROPERTY_TYPE_STRING
=
1
,
D2D1_PROPERTY_TYPE_BOOL
=
2
,
D2D1_PROPERTY_TYPE_UINT32
=
3
,
D2D1_PROPERTY_TYPE_INT32
=
4
,
D2D1_PROPERTY_TYPE_FLOAT
=
5
,
D2D1_PROPERTY_TYPE_VECTOR2
=
6
,
D2D1_PROPERTY_TYPE_VECTOR3
=
7
,
D2D1_PROPERTY_TYPE_VECTOR4
=
8
,
D2D1_PROPERTY_TYPE_BLOB
=
9
,
D2D1_PROPERTY_TYPE_IUNKNOWN
=
10
,
D2D1_PROPERTY_TYPE_ENUM
=
11
,
D2D1_PROPERTY_TYPE_ARRAY
=
12
,
D2D1_PROPERTY_TYPE_CLSID
=
13
,
D2D1_PROPERTY_TYPE_MATRIX_3X2
=
14
,
D2D1_PROPERTY_TYPE_MATRIX_4X3
=
15
,
D2D1_PROPERTY_TYPE_MATRIX_4X4
=
16
,
D2D1_PROPERTY_TYPE_MATRIX_5X4
=
17
,
D2D1_PROPERTY_TYPE_COLOR_CONTEXT
=
18
,
D2D1_PROPERTY_TYPE_FORCE_DWORD
=
0xffffffff
}
D2D1_PROPERTY_TYPE
;
/// <summary>
/// This defines the list of system properties present on the root effect property
/// interface.
/// </summary>
typedef
enum
D2D1_PROPERTY
{
D2D1_PROPERTY_CLSID
=
0x80000000
,
D2D1_PROPERTY_DISPLAYNAME
=
0x80000001
,
D2D1_PROPERTY_AUTHOR
=
0x80000002
,
D2D1_PROPERTY_CATEGORY
=
0x80000003
,
D2D1_PROPERTY_DESCRIPTION
=
0x80000004
,
D2D1_PROPERTY_INPUTS
=
0x80000005
,
D2D1_PROPERTY_CACHED
=
0x80000006
,
D2D1_PROPERTY_PRECISION
=
0x80000007
,
D2D1_PROPERTY_MIN_INPUTS
=
0x80000008
,
D2D1_PROPERTY_MAX_INPUTS
=
0x80000009
,
D2D1_PROPERTY_FORCE_DWORD
=
0xffffffff
}
D2D1_PROPERTY
;
/// <summary>
/// This defines the indices of sub-properties that may be present on any parent
/// property.
/// </summary>
typedef
enum
D2D1_SUBPROPERTY
{
D2D1_SUBPROPERTY_DISPLAYNAME
=
0x80000000
,
D2D1_SUBPROPERTY_ISREADONLY
=
0x80000001
,
D2D1_SUBPROPERTY_MIN
=
0x80000002
,
D2D1_SUBPROPERTY_MAX
=
0x80000003
,
D2D1_SUBPROPERTY_DEFAULT
=
0x80000004
,
D2D1_SUBPROPERTY_FIELDS
=
0x80000005
,
D2D1_SUBPROPERTY_INDEX
=
0x80000006
,
D2D1_SUBPROPERTY_FORCE_DWORD
=
0xffffffff
}
D2D1_SUBPROPERTY
;
/// <summary>
/// Specifies how the bitmap can be used.
/// </summary>
typedef
enum
D2D1_BITMAP_OPTIONS
{
/// <summary>
/// The bitmap is created with default properties.
/// </summary>
D2D1_BITMAP_OPTIONS_NONE
=
0x00000000
,
/// <summary>
/// The bitmap can be specified as a target in ID2D1DeviceContext::SetTarget
/// </summary>
D2D1_BITMAP_OPTIONS_TARGET
=
0x00000001
,
/// <summary>
/// The bitmap cannot be used as an input to DrawBitmap, DrawImage, in a bitmap
/// brush or as an input to an effect.
/// </summary>
D2D1_BITMAP_OPTIONS_CANNOT_DRAW
=
0x00000002
,
/// <summary>
/// The bitmap can be read from the CPU.
/// </summary>
D2D1_BITMAP_OPTIONS_CPU_READ
=
0x00000004
,
/// <summary>
/// The bitmap works with the ID2D1GdiInteropRenderTarget::GetDC API.
/// </summary>
D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE
=
0x00000008
,
D2D1_BITMAP_OPTIONS_FORCE_DWORD
=
0xffffffff
}
D2D1_BITMAP_OPTIONS
;
/// <summary>
/// Specifies the composite mode that will be applied.
/// </summary>
typedef
enum
D2D1_COMPOSITE_MODE
{
D2D1_COMPOSITE_MODE_SOURCE_OVER
=
0
,
D2D1_COMPOSITE_MODE_DESTINATION_OVER
=
1
,
D2D1_COMPOSITE_MODE_SOURCE_IN
=
2
,
D2D1_COMPOSITE_MODE_DESTINATION_IN
=
3
,
D2D1_COMPOSITE_MODE_SOURCE_OUT
=
4
,
D2D1_COMPOSITE_MODE_DESTINATION_OUT
=
5
,
D2D1_COMPOSITE_MODE_SOURCE_ATOP
=
6
,
D2D1_COMPOSITE_MODE_DESTINATION_ATOP
=
7
,
D2D1_COMPOSITE_MODE_XOR
=
8
,
D2D1_COMPOSITE_MODE_PLUS
=
9
,
D2D1_COMPOSITE_MODE_SOURCE_COPY
=
10
,
D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY
=
11
,
D2D1_COMPOSITE_MODE_MASK_INVERT
=
12
,
D2D1_COMPOSITE_MODE_FORCE_DWORD
=
0xffffffff
}
D2D1_COMPOSITE_MODE
;
/// <summary>
/// This specifies the precision that should be used in buffers allocated by D2D.
/// </summary>
typedef
enum
D2D1_BUFFER_PRECISION
{
D2D1_BUFFER_PRECISION_UNKNOWN
=
0
,
D2D1_BUFFER_PRECISION_8BPC_UNORM
=
1
,
D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB
=
2
,
D2D1_BUFFER_PRECISION_16BPC_UNORM
=
3
,
D2D1_BUFFER_PRECISION_16BPC_FLOAT
=
4
,
D2D1_BUFFER_PRECISION_32BPC_FLOAT
=
5
,
D2D1_BUFFER_PRECISION_FORCE_DWORD
=
0xffffffff
}
D2D1_BUFFER_PRECISION
;
/// <summary>
/// This describes how the individual mapping operation should be performed.
/// </summary>
typedef
enum
D2D1_MAP_OPTIONS
{
/// <summary>
/// The mapped pointer has undefined behavior.
/// </summary>
D2D1_MAP_OPTIONS_NONE
=
0
,
/// <summary>
/// The mapped pointer can be read from.
/// </summary>
D2D1_MAP_OPTIONS_READ
=
1
,
/// <summary>
/// The mapped pointer can be written to.
/// </summary>
D2D1_MAP_OPTIONS_WRITE
=
2
,
/// <summary>
/// The previous contents of the bitmap are discarded when it is mapped.
/// </summary>
D2D1_MAP_OPTIONS_DISCARD
=
4
,
D2D1_MAP_OPTIONS_FORCE_DWORD
=
0xffffffff
}
D2D1_MAP_OPTIONS
;
/// <summary>
/// This is used to specify the quality of image scaling with
/// ID2D1DeviceContext::DrawImage and with the 2D Affine Transform Effect.
/// </summary>
typedef
enum
D2D1_INTERPOLATION_MODE
{
D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR
=
D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR
,
D2D1_INTERPOLATION_MODE_LINEAR
=
D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR
,
D2D1_INTERPOLATION_MODE_CUBIC
=
D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC
,
D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR
=
D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR
,
D2D1_INTERPOLATION_MODE_ANISOTROPIC
=
D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC
,
D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC
=
D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC
,
D2D1_INTERPOLATION_MODE_FORCE_DWORD
=
0xffffffff
}
D2D1_INTERPOLATION_MODE
;
/// <summary>
/// This specifies what units should be accepted by the D2D API.
/// </summary>
typedef
enum
D2D1_UNIT_MODE
{
D2D1_UNIT_MODE_DIPS
=
0
,
D2D1_UNIT_MODE_PIXELS
=
1
,
D2D1_UNIT_MODE_FORCE_DWORD
=
0xffffffff
}
D2D1_UNIT_MODE
;
/// <summary>
/// Defines a color space.
/// </summary>
typedef
enum
D2D1_COLOR_SPACE
{
/// <summary>
/// The color space is described by accompanying data, such as a color profile.
/// </summary>
D2D1_COLOR_SPACE_CUSTOM
=
0
,
/// <summary>
/// The sRGB color space.
/// </summary>
D2D1_COLOR_SPACE_SRGB
=
1
,
/// <summary>
/// The scRGB color space.
/// </summary>
D2D1_COLOR_SPACE_SCRGB
=
2
,
D2D1_COLOR_SPACE_FORCE_DWORD
=
0xffffffff
}
D2D1_COLOR_SPACE
;
/// <summary>
/// This specifies options that apply to the device context for its lifetime.
/// </summary>
typedef
enum
D2D1_DEVICE_CONTEXT_OPTIONS
{
D2D1_DEVICE_CONTEXT_OPTIONS_NONE
=
0
,
/// <summary>
/// Geometry rendering will be performed on many threads in parallel, a single
/// thread is the default.
/// </summary>
D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS
=
1
,
D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD
=
0xffffffff
}
D2D1_DEVICE_CONTEXT_OPTIONS
;
/// <summary>
/// Defines how the world transform, dots per inch (dpi), and stroke width affect
/// the shape of the pen used to stroke a primitive.
/// </summary>
typedef
enum
D2D1_STROKE_TRANSFORM_TYPE
{
/// <summary>
/// The stroke respects the world transform, the DPI, and the stroke width.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE_NORMAL
=
0
,
/// <summary>
/// The stroke does not respect the world transform, but it does respect the DPI and
/// the stroke width.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE_FIXED
=
1
,
/// <summary>
/// The stroke is forced to one pixel wide.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE
=
2
,
D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD
=
0xffffffff
}
D2D1_STROKE_TRANSFORM_TYPE
;
/// <summary>
/// A blend mode that applies to all primitives drawn on the context.
/// </summary>
typedef
enum
D2D1_PRIMITIVE_BLEND
{
D2D1_PRIMITIVE_BLEND_SOURCE_OVER
=
0
,
D2D1_PRIMITIVE_BLEND_COPY
=
1
,
D2D1_PRIMITIVE_BLEND_MIN
=
2
,
D2D1_PRIMITIVE_BLEND_ADD
=
3
,
D2D1_PRIMITIVE_BLEND_MAX
=
4
,
D2D1_PRIMITIVE_BLEND_FORCE_DWORD
=
0xffffffff
}
D2D1_PRIMITIVE_BLEND
;
/// <summary>
/// This specifies the threading mode used while simultaneously creating the device,
/// factory, and device context.
/// </summary>
typedef
enum
D2D1_THREADING_MODE
{
/// <summary>
/// Resources may only be invoked serially. Reference counts on resources are
/// interlocked, however, resource and render target state is not protected from
/// multi-threaded access
/// </summary>
D2D1_THREADING_MODE_SINGLE_THREADED
=
D2D1_FACTORY_TYPE_SINGLE_THREADED
,
/// <summary>
/// Resources may be invoked from multiple threads. Resources use interlocked
/// reference counting and their state is protected.
/// </summary>
D2D1_THREADING_MODE_MULTI_THREADED
=
D2D1_FACTORY_TYPE_MULTI_THREADED
,
D2D1_THREADING_MODE_FORCE_DWORD
=
0xffffffff
}
D2D1_THREADING_MODE
;
/// <summary>
/// This specifies how colors are interpolated.
/// </summary>
typedef
enum
D2D1_COLOR_INTERPOLATION_MODE
{
/// <summary>
/// Colors will be interpolated in straight alpha space.
/// </summary>
D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT
=
0
,
/// <summary>
/// Colors will be interpolated in premultiplied alpha space.
/// </summary>
D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED
=
1
,
D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD
=
0xffffffff
}
D2D1_COLOR_INTERPOLATION_MODE
;
typedef
D2D_VECTOR_2F
D2D1_VECTOR_2F
;
typedef
D2D_VECTOR_3F
D2D1_VECTOR_3F
;
typedef
D2D_VECTOR_4F
D2D1_VECTOR_4F
;
/// <summary>
/// Extended bitmap properties.
/// </summary>
typedef
struct
D2D1_BITMAP_PROPERTIES1
{
D2D1_PIXEL_FORMAT
pixelFormat
;
FLOAT
dpiX
;
FLOAT
dpiY
;
/// <summary>
/// Specifies how the bitmap can be used.
/// </summary>
D2D1_BITMAP_OPTIONS
bitmapOptions
; }
D2D1_BITMAP_PROPERTIES1
;
/// <summary>
/// Describes mapped memory from the ID2D1Bitmap1::Map API.
/// </summary>
typedef
struct
D2D1_MAPPED_RECT
{
UINT32
pitch
;
BYTE
*
bits
; }
D2D1_MAPPED_RECT
;
/// <summary>
/// This controls advanced settings of the Direct2D imaging pipeline.
/// </summary>
typedef
struct
D2D1_RENDERING_CONTROLS
{
/// <summary>
/// The default buffer precision, used if the precision isn't otherwise specified.
/// </summary>
D2D1_BUFFER_PRECISION
bufferPrecision
;
/// <summary>
/// The size of allocated tiles used to render imaging effects.
/// </summary>
D2D1_SIZE_U
tileSize
; }
D2D1_RENDERING_CONTROLS
;
/// <summary>
/// This identifies a certain input connection of a certain effect.
/// </summary>
typedef
struct
D2D1_EFFECT_INPUT_DESCRIPTION
{
/// <summary>
/// The effect whose input connection is being specified.
/// </summary>
ID2D1Effect
*
effect
;
/// <summary>
/// The index of the input connection into the specified effect.
/// </summary>
UINT32
inputIndex
;
/// <summary>
/// The rectangle which would be available on the specified input connection during
/// render operations.
/// </summary>
D2D1_RECT_F
inputRectangle
; }
D2D1_EFFECT_INPUT_DESCRIPTION
;
typedef
D2D_MATRIX_4X3_F
D2D1_MATRIX_4X3_F
;
typedef
D2D_MATRIX_4X4_F
D2D1_MATRIX_4X4_F
;
typedef
D2D_MATRIX_5X4_F
D2D1_MATRIX_5X4_F
;
/// <summary>
/// Describes a point along a path.
/// </summary>
typedef
struct
D2D1_POINT_DESCRIPTION
{
D2D1_POINT_2F
point
;
D2D1_POINT_2F
unitTangentVector
;
UINT32
endSegment
;
UINT32
endFigure
;
FLOAT
lengthToEndSegment
; }
D2D1_POINT_DESCRIPTION
;
/// <summary>
/// Creation properties for an image brush.
/// </summary>
typedef
struct
D2D1_IMAGE_BRUSH_PROPERTIES
{
D2D1_RECT_F
sourceRectangle
;
D2D1_EXTEND_MODE
extendModeX
;
D2D1_EXTEND_MODE
extendModeY
;
D2D1_INTERPOLATION_MODE
interpolationMode
; }
D2D1_IMAGE_BRUSH_PROPERTIES
;
/// <summary>
/// Describes the extend modes and the interpolation mode of an ID2D1BitmapBrush.
/// </summary>
typedef
struct
D2D1_BITMAP_BRUSH_PROPERTIES1
{
D2D1_EXTEND_MODE
extendModeX
;
D2D1_EXTEND_MODE
extendModeY
;
D2D1_INTERPOLATION_MODE
interpolationMode
; }
D2D1_BITMAP_BRUSH_PROPERTIES1
;
/// <summary>
/// This defines how geometries should be drawn and widened.
/// </summary>
typedef
struct
D2D1_STROKE_STYLE_PROPERTIES1
{
D2D1_CAP_STYLE
startCap
;
D2D1_CAP_STYLE
endCap
;
D2D1_CAP_STYLE
dashCap
;
D2D1_LINE_JOIN
lineJoin
;
FLOAT
miterLimit
;
D2D1_DASH_STYLE
dashStyle
;
FLOAT
dashOffset
;
/// <summary>
/// How the nib of the stroke is influenced by the context properties.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE
transformType
; }
D2D1_STROKE_STYLE_PROPERTIES1
;
/// <summary>
/// Specifies how the layer contents should be prepared.
/// </summary>
typedef
enum
D2D1_LAYER_OPTIONS1
{
D2D1_LAYER_OPTIONS1_NONE
=
0
,
D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND
=
1
,
D2D1_LAYER_OPTIONS1_IGNORE_ALPHA
=
2
,
D2D1_LAYER_OPTIONS1_FORCE_DWORD
=
0xffffffff
}
D2D1_LAYER_OPTIONS1
;
/// <summary>
/// All parameters related to pushing a layer.
/// </summary>
typedef
struct
D2D1_LAYER_PARAMETERS1
{
D2D1_RECT_F
contentBounds
;
D2D1_ANTIALIAS_MODE
maskAntialiasMode
;
D2D1_MATRIX_3X2_F
maskTransform
;
FLOAT
opacity
;
D2D1_LAYER_OPTIONS1
layerOptions
; }
D2D1_LAYER_PARAMETERS1
;
/// <summary>
/// Defines when font resources should be subset during printing.
/// </summary>
typedef
enum
D2D1_PRINT_FONT_SUBSET_MODE
{
/// <summary>
/// Subset for used glyphs, send and discard font resource after every five pages
/// </summary>
D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT
=
0
,
/// <summary>
/// Subset for used glyphs, send and discard font resource after each page
/// </summary>
D2D1_PRINT_FONT_SUBSET_MODE_EACHPAGE
=
1
,
/// <summary>
/// Do not subset, reuse font for all pages, send it after first page
/// </summary>
D2D1_PRINT_FONT_SUBSET_MODE_NONE
=
2
,
D2D1_PRINT_FONT_SUBSET_MODE_FORCE_DWORD
=
0xffffffff
}
D2D1_PRINT_FONT_SUBSET_MODE
;
/// <summary>
/// This describes the drawing state.
/// </summary>
typedef
struct
D2D1_DRAWING_STATE_DESCRIPTION1
{
D2D1_ANTIALIAS_MODE
antialiasMode
;
D2D1_TEXT_ANTIALIAS_MODE
textAntialiasMode
;
D2D1_TAG
tag1
;
D2D1_TAG
tag2
;
D2D1_MATRIX_3X2_F
transform
;
D2D1_PRIMITIVE_BLEND
primitiveBlend
;
D2D1_UNIT_MODE
unitMode
; }
D2D1_DRAWING_STATE_DESCRIPTION1
;
/// <summary>
/// The creation properties for a ID2D1PrintControl object.
/// </summary>
typedef
struct
D2D1_PRINT_CONTROL_PROPERTIES
{
D2D1_PRINT_FONT_SUBSET_MODE
fontSubset
;
/// <summary>
/// DPI for rasterization of all unsupported D2D commands or options, defaults to
/// 150.0
/// </summary>
FLOAT
rasterDPI
;
/// <summary>
/// Color space for vector graphics in XPS package
/// </summary>
D2D1_COLOR_SPACE
colorSpace
; }
D2D1_PRINT_CONTROL_PROPERTIES
;
/// <summary>
/// This specifies the options while simultaneously creating the device, factory,
/// and device context.
/// </summary>
typedef
struct
D2D1_CREATION_PROPERTIES
{
/// <summary>
/// Describes locking behavior of D2D resources
/// </summary>
D2D1_THREADING_MODE
threadingMode
;
D2D1_DEBUG_LEVEL
debugLevel
;
D2D1_DEVICE_CONTEXT_OPTIONS
options
; }
D2D1_CREATION_PROPERTIES
;
#ifndef D2D_USE_C_DEFINITIONS
/// <summary>
/// User-implementable interface for introspecting on a metafile.
/// </summary>
{
/// <summary>
/// Callback for examining a metafile record.
/// </summary>
DWORD
recordType
,
DWORD
recordDataSize
};
// interface ID2D1GdiMetafileSink
/// <summary>
/// Interface encapsulating a GDI/GDI+ metafile.
/// </summary>
{
/// <summary>
/// Play the metafile into a caller-supplied sink interface.
/// </summary>
/// <summary>
/// Gets the bounds of the metafile.
/// </summary>
};
// interface ID2D1GdiMetafile
/// <summary>
/// Caller-supplied implementation of an interface to receive the recorded command
/// list.
/// </summary>
{
D2D1_ANTIALIAS_MODE
antialiasMode
D2D1_TAG
tag1
,
D2D1_TAG
tag2
D2D1_TEXT_ANTIALIAS_MODE
textAntialiasMode
D2D1_PRIMITIVE_BLEND
primitiveBlend
D2D1_UNIT_MODE
unitMode
D2D1_POINT_2F
baselineOrigin
,
DWRITE_MEASURING_MODE
measuringMode
D2D1_POINT_2F
point0
,
D2D1_POINT_2F
point1
,
FLOAT
strokeWidth
,
FLOAT
strokeWidth
,
FLOAT
strokeWidth
,
FLOAT
opacity
,
D2D1_INTERPOLATION_MODE
interpolationMode
,
D2D1_INTERPOLATION_MODE
interpolationMode
,
D2D1_COMPOSITE_MODE
compositeMode
D2D1_ANTIALIAS_MODE
antialiasMode
};
// interface ID2D1CommandSink
/// <summary>
/// The commandList interface.
/// </summary>
{
/// <summary>
/// Play the command list into a caller-supplied sink interface.
/// </summary>
/// <summary>
/// Marks the command list as ready for use.
/// </summary>
};
// interface ID2D1CommandList
/// <summary>
/// Converts Direct2D primitives stored in an ID2D1CommandList into a fixed page
/// representation. The print sub-system then consumes the primitives.
/// </summary>
{
D2D_SIZE_F
pageSize
, };
// interface ID2D1PrintControl
/// <summary>
/// Provides a brush that can take any effect, command list or bitmap and use it to
/// fill a 2D shape.
/// </summary>
{
D2D1_EXTEND_MODE
extendModeX
D2D1_EXTEND_MODE
extendModeY
D2D1_INTERPOLATION_MODE
interpolationMode
};
// interface ID2D1ImageBrush
/// <summary>
/// A bitmap brush allows a bitmap to be used to fill a geometry. Interpolation
/// mode is specified with D2D1_INTERPOLATION_MODE
/// </summary>
{
/// <summary>
/// Sets the interpolation mode used when this brush is used.
/// </summary>
D2D1_INTERPOLATION_MODE
interpolationMode
};
// interface ID2D1BitmapBrush1
/// <summary>
/// Extends a stroke style to allow nominal width strokes.
/// </summary>
{ };
// interface ID2D1StrokeStyle1
/// <summary>
/// The ID2D1PathGeometry1 interface adds functionality to ID2D1PathGeometry. In
/// particular, it provides the path geometry-specific
/// ComputePointAndSegmentAtLength method.
/// </summary>
{
FLOAT
length
,
UINT32
startSegment
,
FLOAT
flatteningTolerance
,
HRESULT
ComputePointAndSegmentAtLength
(
FLOAT
length
,
UINT32
startSegment
,
FLOAT
flatteningTolerance
, {
return
ComputePointAndSegmentAtLength
(
length
,
startSegment
, &
worldTransform
,
flatteningTolerance
,
pointDescription
); }
HRESULT
ComputePointAndSegmentAtLength
(
FLOAT
length
,
UINT32
startSegment
, { }
HRESULT
ComputePointAndSegmentAtLength
(
FLOAT
length
,
UINT32
startSegment
, { } };
// interface ID2D1PathGeometry1
/// <summary>
/// Represents a set of run-time bindable and discoverable properties that allow a
/// data-driven application to modify the state of a Direct2D effect.
/// </summary>
{
/// <summary>
/// Returns the total number of custom properties in this interface.
/// </summary>
/// <summary>
/// Retrieves the property name from the given property index.
/// </summary>
UINT32
index
,
UINT32
nameCount
/// <summary>
/// Returns the length of the property name from the given index.
/// </summary>
UINT32
index
/// <summary>
/// Retrieves the type of the given property.
/// </summary>
UINT32
index
/// <summary>
/// Retrieves the property index for the given property name.
/// </summary>
/// <summary>
/// Sets the value of the given property using its name.
/// </summary>
D2D1_PROPERTY_TYPE
type
,
UINT32
dataSize
/// <summary>
/// Sets the given value using the property index.
/// </summary>
UINT32
index
,
D2D1_PROPERTY_TYPE
type
,
UINT32
dataSize
/// <summary>
/// Retrieves the given property or sub-property by name. '.' is the delimiter for
/// sub-properties.
/// </summary>
D2D1_PROPERTY_TYPE
type
,
UINT32
dataSize
/// <summary>
/// Retrieves the given value by index.
/// </summary>
UINT32
index
,
D2D1_PROPERTY_TYPE
type
,
UINT32
dataSize
/// <summary>
/// Returns the value size for the given property index.
/// </summary>
UINT32
index
/// <summary>
/// Retrieves the sub-properties of the given property by index.
/// </summary>
UINT32
index
,
HRESULT
SetValueByName
(
UINT32
dataSize
) {
return
SetValueByName
(
name
,
D2D1_PROPERTY_TYPE_UNKNOWN
,
data
,
dataSize
); }
HRESULT
SetValue
(
UINT32
index
,
UINT32
dataSize
) {
return
SetValue
(
index
,
D2D1_PROPERTY_TYPE_UNKNOWN
,
data
,
dataSize
); }
HRESULT
GetValueByName
(
UINT32
dataSize
{
return
GetValueByName
(
name
,
D2D1_PROPERTY_TYPE_UNKNOWN
,
data
,
dataSize
); }
HRESULT
GetValue
(
UINT32
index
,
UINT32
dataSize
{
return
GetValue
(
index
,
D2D1_PROPERTY_TYPE_UNKNOWN
,
data
,
dataSize
); }
//
// Templatized helper functions:
//
template
<
typename
T
>
HRESULT
GetValueByName
( )
const
{
return
GetValueByName
(
propertyName
,
reinterpret_cast
<
BYTE
*>(
value
),
sizeof
(*
value
)); }
template
<
typename
T
>
T
GetValueByName
( )
const
{
T
value
;
HRESULT
ignoreHr
=
GetValueByName
(
propertyName
,
reinterpret_cast
<
BYTE
*>(&
value
),
sizeof
(
value
));
return
value
; }
template
<
typename
T
>
HRESULT
SetValueByName
( ) {
return
SetValueByName
(
propertyName
,
reinterpret_cast
<
const
BYTE
*>(&
value
),
sizeof
(
value
)); }
template
<
typename
U
>
HRESULT
GetValue
(
U
index
,
UINT32
dataSize
{
return
GetValue
(
static_cast
<
UINT32
>(
index
),
data
,
dataSize
); }
template
<
typename
T
,
typename
U
>
HRESULT
GetValue
(
U
index
, )
const
{
return
GetValue
(
static_cast
<
UINT32
>(
index
),
reinterpret_cast
<
BYTE
*>(
value
),
sizeof
(*
value
)); }
template
<
typename
T
,
typename
U
>
T
GetValue
(
U
index
)
const
{
T
value
;
HRESULT
ignoreHr
=
GetValue
(
static_cast
<
UINT32
>(
index
),
reinterpret_cast
<
BYTE
*>(&
value
),
sizeof
(
value
));
// Unreferenced variable:
ignoreHr
;
return
value
; }
template
<
typename
U
>
HRESULT
SetValue
(
U
index
,
UINT32
dataSize
) {
return
SetValue
(
static_cast
<
UINT32
>(
index
),
data
,
dataSize
); }
template
<
typename
T
,
typename
U
>
HRESULT
SetValue
(
U
index
, ) {
return
SetValue
(
static_cast
<
UINT32
>(
index
),
reinterpret_cast
<
const
BYTE
*>(&
value
),
sizeof
(
value
)); }
template
<
typename
U
>
HRESULT
GetPropertyName
(
U
index
,
UINT32
nameCount
{
return
GetPropertyName
(
static_cast
<
UINT32
>(
index
),
name
,
nameCount
); }
template
<
typename
U
>
UINT32
GetPropertyNameLength
(
U
index
{
return
GetPropertyNameLength
(
static_cast
<
UINT32
>(
index
)); }
template
<
typename
U
>
D2D1_PROPERTY_TYPE
GetType
(
U
index
{
return
GetType
(
static_cast
<
UINT32
>(
index
)); }
template
<
typename
U
>
UINT32
GetValueSize
(
U
index
{
return
GetValueSize
(
static_cast
<
UINT32
>(
index
)); }
template
<
typename
U
>
HRESULT
GetSubProperties
(
U
index
, {
return
GetSubProperties
(
static_cast
<
UINT32
>(
index
),
subProperties
); } };
// interface ID2D1Properties
/// <summary>
/// The effect interface. Properties control how the effect is rendered. The effect
/// is Drawn with the DrawImage call.
/// </summary>
{
/// <summary>
/// Sets the input to the given effect. The input can be a concrete bitmap or the
/// output of another effect.
/// </summary>
UINT32
index
,
/// <summary>
/// If the effect supports a variable number of inputs, this sets the number of
/// input that are currently active on the effect.
/// </summary>
UINT32
inputCount
/// <summary>
/// Returns the input image to the effect. The input could be another effect or a
/// bitmap.
/// </summary>
UINT32
index
,
/// <summary>
/// This returns the number of input that are bound into this effect.
/// </summary>
/// <summary>
/// Returns the output image of the given effect. This can be set as the input to
/// another effect or can be drawn with DrawImage.
/// </summary>
void
SetInputEffect
(
UINT32
index
, ) { {
inputEffect
->
GetOutput
(&
output
); }
SetInput
(
index
,
output
,
invalidate
); {
output
->
Release
(); } } };
// interface ID2D1Effect
/// <summary>
/// Represents a bitmap that can be used as a surface for an ID2D1DeviceContext or
/// mapped into system memory, and can contain additional color context information.
/// </summary>
{
/// <summary>
/// Retrieves the color context information associated with the bitmap.
/// </summary>
/// <summary>
/// Retrieves the bitmap options used when creating the API.
/// </summary>
/// <summary>
/// Retrieves the DXGI surface from the corresponding bitmap, if the bitmap was
/// created from a device derived from a D3D device.
/// </summary>
/// <summary>
/// Maps the given bitmap into memory. The bitmap must have been created with the
/// D2D1_BITMAP_OPTIONS_CPU_READ flag.
/// </summary>
D2D1_MAP_OPTIONS
options
,
/// <summary>
/// Unmaps the given bitmap from memory.
/// </summary>
};
// interface ID2D1Bitmap1
/// <summary>
/// Represents a color context that can be used with an ID2D1Bitmap1 object.
/// </summary>
{
/// <summary>
/// Retrieves the color space of the color context.
/// </summary>
/// <summary>
/// Retrieves the size of the color profile, in bytes.
/// </summary>
/// <summary>
/// Retrieves the color profile bytes.
/// </summary>
UINT32
profileSize
};
// interface ID2D1ColorContext
/// <summary>
/// Represents an collection of gradient stops that can then be the source resource
/// for either a linear or radial gradient brush.
/// </summary>
{
/// <summary>
/// Copies the gradient stops from the collection into the caller's memory. If this
/// object was created using ID2D1DeviceContext::CreateGradientStopCollection, this
/// method returns the same values as were specified in the creation method. If this
/// object was created using ID2D1RenderTarget::CreateGradientStopCollection, the
/// stops returned here will first be transformed into the gamma space specified by
/// the colorInterpolationGamma parameter.
/// </summary>
UINT32
gradientStopsCount
/// <summary>
/// Returns the color space in which interpolation occurs. If this object was
/// created using ID2D1RenderTarget::CreateGradientStopCollection, this method
/// returns the color space related to the color interpolation gamma.
/// </summary>
/// <summary>
/// Returns the color space colors will be converted to after interpolation occurs.
/// If this object was created using
/// ID2D1RenderTarget::CreateGradientStopCollection, this method returns
/// D2D1_COLOR_SPACE_SRGB.
/// </summary>
/// <summary>
/// Returns the buffer precision of this gradient. If this object was created using
/// ID2D1RenderTarget::CreateGradientStopCollection, this method returns
/// D2D1_BUFFER_PRECISION_8BPC_UNORM.
/// </summary>
/// <summary>
/// Returns the interpolation mode used to interpolate colors in the gradient.
/// </summary>
};
// interface ID2D1GradientStopCollection1
/// <summary>
/// Represents drawing state.
/// </summary>
{
/// <summary>
/// Retrieves the state currently contained within this state block resource.
/// </summary>
using
ID2D1DrawingStateBlock
::
GetDescription
;
/// <summary>
/// Sets the state description of this state block resource.
/// </summary>
using
ID2D1DrawingStateBlock
::
SetDescription
; };
// interface ID2D1DrawingStateBlock1
/// <summary>
/// The device context represents a set of state and a command buffer that is used
/// to render to a target bitmap.
/// </summary>
{
/// <summary>
/// Creates a bitmap with extended bitmap properties, potentially from a block of
/// memory.
/// </summary>
D2D1_SIZE_U
size
,
UINT32
pitch
,
using
ID2D1RenderTarget
::
CreateBitmap
;
/// <summary>
/// Create a D2D bitmap by copying a WIC bitmap.
/// </summary>
using
ID2D1RenderTarget
::
CreateBitmapFromWicBitmap
;
/// <summary>
/// Creates a color context from a color space. If the space is Custom, the context
/// is initialized from the profile/profileSize arguments. Otherwise the context is
/// initialized with the profile bytes associated with the space and
/// profile/profileSize are ignored.
/// </summary>
D2D1_COLOR_SPACE
space
,
UINT32
profileSize
,
/// <summary>
/// Creates a bitmap from a DXGI surface with a set of extended properties.
/// </summary>
/// <summary>
/// Create a new effect, the effect must either be built in or previously registered
/// through ID2D1Factory1::RegisterEffectFromStream or
/// ID2D1Factory1::RegisterEffectFromString.
/// </summary>
/// <summary>
/// A gradient stop collection represents a set of stops in an ideal unit length.
/// This is the source resource for a linear gradient and radial gradient brush.
/// </summary>
/// <param name="preInterpolationSpace">Specifies both the input color space and the
/// space in which the color interpolation occurs.</param>
/// <param name="postInterpolationSpace">Specifies the color space colors will be
/// converted to after interpolation occurs.</param>
/// <param name="bufferPrecision">Specifies the precision in which the gradient
/// buffer will be held.</param>
/// <param name="extendMode">Specifies how the gradient will be extended outside of
/// the unit length.</param>
/// <param name="colorInterpolationMode">Determines if colors will be interpolated
/// in straight alpha or premultiplied alpha space.</param>
D2D1_COLOR_SPACE
preInterpolationSpace
,
D2D1_COLOR_SPACE
postInterpolationSpace
,
D2D1_BUFFER_PRECISION
bufferPrecision
,
D2D1_EXTEND_MODE
extendMode
,
D2D1_COLOR_INTERPOLATION_MODE
colorInterpolationMode
,
using
ID2D1RenderTarget
::
CreateGradientStopCollection
;
/// <summary>
/// Creates an image brush, the input image can be any type of image, including a
/// bitmap, effect and a command list.
/// </summary>
using
ID2D1RenderTarget
::
CreateBitmapBrush
;
/// <summary>
/// Creates a new command list.
/// </summary>
/// <summary>
/// Indicates whether the format is supported by D2D.
/// </summary>
DXGI_FORMAT
format
/// <summary>
/// Indicates whether the buffer precision is supported by D2D.
/// </summary>
D2D1_BUFFER_PRECISION
bufferPrecision
/// <summary>
/// This retrieves the local-space bounds in DIPs of the current image using the
/// device context DPI.
/// </summary>
/// <summary>
/// This retrieves the world-space bounds in DIPs of the current image using the
/// device context DPI.
/// </summary>
/// <summary>
/// Retrieves the world-space bounds in DIPs of the glyph run using the device
/// context DPI.
/// </summary>
D2D1_POINT_2F
baselineOrigin
,
DWRITE_MEASURING_MODE
measuringMode
,
/// <summary>
/// Retrieves the device associated with this device context.
/// </summary>
/// <summary>
/// Sets the target for this device context to point to the given image. The image
/// can be a command list or a bitmap created with the D2D1_BITMAP_OPTIONS_TARGET
/// flag.
/// </summary>
/// <summary>
/// Gets the target that this device context is currently pointing to.
/// </summary>
/// <summary>
/// Sets tuning parameters for internal rendering inside the device context.
/// </summary>
/// <summary>
/// This retrieves the rendering controls currently selected into the device
/// context.
/// </summary>
/// <summary>
/// Changes the primitive blending mode for all of the rendering operations.
/// </summary>
D2D1_PRIMITIVE_BLEND
primitiveBlend
/// <summary>
/// Returns the primitive blend currently selected into the device context.
/// </summary>
/// <summary>
/// Changes the units used for all of the rendering operations.
/// </summary>
D2D1_UNIT_MODE
unitMode
/// <summary>
/// Returns the unit mode currently set on the device context.
/// </summary>
/// <summary>
/// Draws the glyph run with an extended description to describe the glyphs.
/// </summary>
D2D1_POINT_2F
baselineOrigin
,
DWRITE_MEASURING_MODE
measuringMode
=
DWRITE_MEASURING_MODE_NATURAL
using
ID2D1RenderTarget
::
DrawGlyphRun
;
/// <summary>
/// Draw an image to the device context. The image represents either a concrete
/// bitmap or the output of an effect graph.
/// </summary>
D2D1_INTERPOLATION_MODE
interpolationMode
=
D2D1_INTERPOLATION_MODE_LINEAR
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
/// <summary>
/// Draw a metafile to the device context.
/// </summary>
FLOAT
opacity
,
D2D1_INTERPOLATION_MODE
interpolationMode
,
using
ID2D1RenderTarget
::
DrawBitmap
;
/// <summary>
/// Push a layer on the device context.
/// </summary>
using
ID2D1RenderTarget
::
PushLayer
;
/// <summary>
/// This indicates that a portion of an effect's input is invalid. This method can
/// be called many times.
/// </summary>
UINT32
input
,
/// <summary>
/// Gets the number of invalid ouptut rectangles that have accumulated at the
/// effect.
/// </summary>
/// <summary>
/// Gets the invalid rectangles that are at the output of the effect.
/// </summary>
UINT32
rectanglesCount
/// <summary>
/// Gets the maximum region of each specified input which would be used during a
/// subsequent rendering operation
/// </summary>
UINT32
inputCount
/// <summary>
/// Fill using the alpha channel of the supplied opacity mask bitmap. The brush
/// opacity will be modulated by the mask. The render target antialiasing mode must
/// be set to aliased.
/// </summary>
using
ID2D1RenderTarget
::
FillOpacityMask
;
HRESULT
CreateBitmap
(
D2D1_SIZE_U
size
,
UINT32
pitch
, ) {
return
CreateBitmap
(
size
,
sourceData
,
pitch
, &
bitmapProperties
,
bitmap
); }
/// <summary>
/// Create a D2D bitmap by copying a WIC bitmap.
/// </summary>
HRESULT
CreateBitmapFromWicBitmap
( ) {
return
CreateBitmapFromWicBitmap
(
wicBitmapSource
, &
bitmapProperties
,
bitmap
); }
/// <summary>
/// Create a D2D bitmap by copying a WIC bitmap.
/// </summary>
HRESULT
CreateBitmapFromWicBitmap
( ) { }
HRESULT
CreateBitmapFromDxgiSurface
( ) {
return
CreateBitmapFromDxgiSurface
(
surface
, &
bitmapProperties
,
bitmap
); }
HRESULT
CreateImageBrush
( ) {
return
CreateImageBrush
(
image
, &
imageBrushProperties
, &
brushProperties
,
imageBrush
); }
HRESULT
CreateImageBrush
( ) { }
HRESULT
CreateBitmapBrush
( ) { }
HRESULT
CreateBitmapBrush
( ) { }
HRESULT
CreateBitmapBrush
( ) {
return
CreateBitmapBrush
(
bitmap
, &
bitmapBrushProperties
, &
brushProperties
,
bitmapBrush
); }
/// <summary>
/// Draws the output of the effect as an image.
/// </summary>
void
DrawImage
(
D2D1_INTERPOLATION_MODE
interpolationMode
=
D2D1_INTERPOLATION_MODE_LINEAR
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
) {
effect
->
GetOutput
(&
output
);
DrawImage
(
output
,
targetOffset
,
imageRectangle
,
interpolationMode
,
compositeMode
);
output
->
Release
(); }
void
DrawImage
(
D2D1_INTERPOLATION_MODE
interpolationMode
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
) { }
void
DrawImage
(
D2D1_INTERPOLATION_MODE
interpolationMode
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
) { }
void
DrawImage
(
D2D1_POINT_2F
targetOffset
,
D2D1_INTERPOLATION_MODE
interpolationMode
=
D2D1_INTERPOLATION_MODE_LINEAR
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
) { }
void
DrawImage
(
D2D1_POINT_2F
targetOffset
,
D2D1_INTERPOLATION_MODE
interpolationMode
=
D2D1_INTERPOLATION_MODE_LINEAR
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
) { }
void
DrawImage
(
D2D1_POINT_2F
targetOffset
,
D2D1_INTERPOLATION_MODE
interpolationMode
=
D2D1_INTERPOLATION_MODE_LINEAR
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
) {
DrawImage
(
image
, &
targetOffset
, &
imageRectangle
,
interpolationMode
,
compositeMode
); }
void
DrawImage
(
D2D1_POINT_2F
targetOffset
,
D2D1_INTERPOLATION_MODE
interpolationMode
=
D2D1_INTERPOLATION_MODE_LINEAR
,
D2D1_COMPOSITE_MODE
compositeMode
=
D2D1_COMPOSITE_MODE_SOURCE_OVER
) {
DrawImage
(
effect
, &
targetOffset
, &
imageRectangle
,
interpolationMode
,
compositeMode
); }
void
PushLayer
( ) {
PushLayer
(&
layerParameters
,
layer
); }
void
DrawGdiMetafile
(
D2D1_POINT_2F
targetOffset
) {
DrawGdiMetafile
(
gdiMetafile
, &
targetOffset
); }
void
DrawBitmap
(
FLOAT
opacity
,
D2D1_INTERPOLATION_MODE
interpolationMode
, ) {
DrawBitmap
(
bitmap
, &
destinationRectangle
,
opacity
,
interpolationMode
,
sourceRectangle
,
perspectiveTransform
); }
void
DrawBitmap
(
FLOAT
opacity
,
D2D1_INTERPOLATION_MODE
interpolationMode
, ) {
DrawBitmap
(
bitmap
, &
destinationRectangle
,
opacity
,
interpolationMode
, &
sourceRectangle
,
perspectiveTransform
); }
void
DrawBitmap
(
FLOAT
opacity
,
D2D1_INTERPOLATION_MODE
interpolationMode
, ) {
DrawBitmap
(
bitmap
, &
destinationRectangle
,
opacity
,
interpolationMode
, &
sourceRectangle
, &
perspectiveTransform
); }
void
FillOpacityMask
( ) {
FillOpacityMask
(
opacityMask
,
brush
, &
destinationRectangle
,
sourceRectangle
); }
void
FillOpacityMask
( ) {
FillOpacityMask
(
opacityMask
,
brush
, &
destinationRectangle
, &
sourceRectangle
); }
/// <summary>
/// Sets tuning parameters for internal rendering inside the device context.
/// </summary>
void
SetRenderingControls
( ) {
return
SetRenderingControls
(&
renderingControls
); } };
// interface ID2D1DeviceContext
/// <summary>
/// The device defines a resource domain whose objects and device contexts can be
/// used together.
/// </summary>
{
/// <summary>
/// Creates a new device context with no initially assigned target.
/// </summary>
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
/// <summary>
/// Creates a D2D print control.
/// </summary>
/// <summary>
/// Sets the maximum amount of texture memory to maintain before evicting caches.
/// </summary>
UINT64
maximumInBytes
/// <summary>
/// Gets the maximum amount of texture memory to maintain before evicting caches.
/// </summary>
/// <summary>
/// Clears all resources that are cached but not held in use by the application
/// through an interface reference.
/// </summary>
UINT32
millisecondsSinceUse
=
0
HRESULT
CreatePrintControl
( ) {
return
CreatePrintControl
(
wicFactory
,
documentTarget
, &
printControlProperties
,
printControl
); } };
// interface ID2D1Device
/// <summary>
/// Creates Direct2D resources.
/// </summary>
{
/// <summary>
/// This creates a new Direct2D device from the given IDXGIDevice.
/// </summary>
/// <summary>
/// This creates a stroke style with the ability to preserve stroke width in various
/// ways.
/// </summary>
UINT32
dashesCount
,
using
ID2D1Factory
::
CreateStrokeStyle
;
/// <summary>
/// Creates a path geometry with new operational methods.
/// </summary>
using
ID2D1Factory
::
CreatePathGeometry
;
/// <summary>
/// Creates a new drawing state block, this can be used in subsequent
/// SaveDrawingState and RestoreDrawingState operations on the render target.
/// </summary>
using
ID2D1Factory
::
CreateDrawingStateBlock
;
/// <summary>
/// Creates a new GDI metafile.
/// </summary>
/// <summary>
/// This globally registers the given effect. The effect can later be instantiated
/// by using the registered class id. The effect registration is reference counted.
/// </summary>
UINT32
bindingsCount
,
/// <summary>
/// This globally registers the given effect. The effect can later be instantiated
/// by using the registered class id. The effect registration is reference counted.
/// </summary>
UINT32
bindingsCount
,
/// <summary>
/// This unregisters the given effect by its class id, you need to call
/// UnregisterEffect for every call to ID2D1Factory1::RegisterEffectFromStream and
/// ID2D1Factory1::RegisterEffectFromString to completely unregister it.
/// </summary>
/// <summary>
/// This returns all of the registered effects in the process, including any
/// built-in effects.
/// </summary>
/// <param name="effectsReturned">The number of effects returned into the passed in
/// effects array.</param>
/// <param name="effectsRegistered">The number of effects currently registered in
/// the system.</param>
UINT32
effectsCount
,
/// <summary>
/// This retrieves the effect properties for the given effect, all of the effect
/// properties will be set to a default value since an effect is not instantiated to
/// implement the returned property interface.
/// </summary>
HRESULT
CreateStrokeStyle
(
UINT32
dashesCount
, ) {
return
CreateStrokeStyle
(&
strokeStyleProperties
,
dashes
,
dashesCount
,
strokeStyle
); }
HRESULT
CreateDrawingStateBlock
( ) { }
HRESULT
CreateDrawingStateBlock
( ) { } };
// interface ID2D1Factory1
/// <summary>
/// A locking mechanism from a Direct2D factory that Direct2D uses to control
/// exclusive resource access in an app that is uses multiple threads.
/// </summary>
{
/// <summary>
/// Returns whether the D2D factory was created with
/// D2D1_FACTORY_TYPE_MULTI_THREADED.
/// </summary>
/// <summary>
/// Enters the D2D API critical section, if it exists.
/// </summary>
/// <summary>
/// Leaves the D2D API critical section, if it exists.
/// </summary>
};
// interface ID2D1Multithread
#endif
#ifdef D2D_USE_C_DEFINITIONS
typedef interface ID2D1GdiMetafileSink ID2D1GdiMetafileSink;
typedef interface ID2D1GdiMetafile ID2D1GdiMetafile;
typedef interface ID2D1CommandSink ID2D1CommandSink;
typedef interface ID2D1CommandList ID2D1CommandList;
typedef interface ID2D1PrintControl ID2D1PrintControl;
typedef interface ID2D1ImageBrush ID2D1ImageBrush;
typedef interface ID2D1BitmapBrush1 ID2D1BitmapBrush1;
typedef interface ID2D1StrokeStyle1 ID2D1StrokeStyle1;
typedef interface ID2D1PathGeometry1 ID2D1PathGeometry1;
typedef interface ID2D1Properties ID2D1Properties;
typedef interface ID2D1Effect ID2D1Effect;
typedef interface ID2D1Bitmap1 ID2D1Bitmap1;
typedef interface ID2D1ColorContext ID2D1ColorContext;
typedef interface ID2D1GradientStopCollection1 ID2D1GradientStopCollection1;
typedef interface ID2D1DrawingStateBlock1 ID2D1DrawingStateBlock1;
typedef interface ID2D1DeviceContext ID2D1DeviceContext;
typedef interface ID2D1Device ID2D1Device;
typedef interface ID2D1Factory1 ID2D1Factory1;
typedef interface ID2D1Multithread ID2D1Multithread;
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
D2D1CreateDevice
( );
D2D1CreateDeviceContext
( );
D2D1ConvertColorSpace
(
D2D1_COLOR_SPACE
sourceColorSpace
,
D2D1_COLOR_SPACE
destinationColorSpace
, );
D2D1SinCos
( );
D2D1Tan
( );
D2D1Vec3Length
( );
#ifdef __cplusplus
}
#endif
#include <d2d1_1helper.h>
#ifndef D2D_USE_C_DEFINITIONS
inline
HRESULT
D2D1CreateDevice
( ) {
return
D2D1CreateDevice
(
dxgiDevice
, &
creationProperties
,
d2dDevice
); }
inline
HRESULT
D2D1CreateDeviceContext
( ) {
return
D2D1CreateDeviceContext
(
dxgiSurface
, &
creationProperties
,
d2dDeviceContext
); }
#endif // #ifndef D2D_USE_C_DEFINITIONS
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#endif // #ifndef _D2D1_1_H_