Skip to content

SysWin Direct2D Interfaces

Paul Squires edited this page Oct 31, 2026 · 1 revision

Home › All Categories › sys/win › sys/win/direct2d › Direct2D interfaces and types

Direct2D interfaces and types

Lists the Direct2D interfaces, structures and enumerations that sys/win/direct2d declares.

These are the Windows Direct2D declarations themselves, from Direct2D 1.0 to the latest ID2D1Factory8, the built-in effects and the SVG interfaces, so any method Microsoft documents can be called. The wrapper classes hold the most used ones and release them for you; this page is for everything else.

Interfaces. Each interface is a type that extends its base interface and declares the methods in their vtable order, down to ComUnknown, the IUnknown of sys/win/com. The type itself is named with a trailing underscore, ID2D1Factory_, and the plain name is an alias of it, so write ID2D1Factory ptr. Call methods with ->: pFactory->CreateEllipseGeometry( ... ). A pointer converts to its base interface on its own, so an ID2D1SolidColorBrush ptr can be passed where an ID2D1Brush ptr is wanted. Every interface you are handed — by a factory, a Create method or QueryInterface — holds a reference you must give back with ->Release() or D2D1_SafeRelease.

Each interface has its identifier as a shared GUID, IID_ followed by its name (IID_ID2D1Factory1), for D2D1CreateFactory and QueryInterface.

Methods that return a structure. Where the Windows method returns a structure by value (GetSize, GetPixelSize, GetPixelFormat, GetColor …), the tiko declaration is a sub that fills a variable you pass: pTarget->GetSize( sz ).

Out parameters. An interface a method creates comes back through a byref pointer argument; pass the pointer variable itself, as in the example below.

IDWriteTextFormat, IDWriteFontFace, IWICBitmap, IWICBitmapSource, IDXGISurface and the other DirectWrite, WIC and DXGI names that Direct2D methods take are declared on their own pages: DirectWrite interfaces, WIC interfaces and DXGI interfaces.

Importing

#import "sys/win"
#import "sys/win/direct2d"
using win, direct2d

Example

A factory, a geometry measured without any window, and a newer factory interface asked for with QueryInterface:

#import "sys/win"
#import "sys/win/direct2d"
using win, direct2d

dim pFactory as ID2D1Factory ptr
if D2D1CreateFactory( D2D1_FACTORY_TYPE_SINGLE_THREADED, IID_ID2D1Factory, byval NULL, pFactory ) <> S_OK then end 1

' a factory resource: an ellipse geometry, measured without any window
dim pEllipse as ID2D1EllipseGeometry ptr
pFactory->CreateEllipseGeometry( D2D1_EllipseF( 100, 100, 50, 25 ), pEllipse )

dim bounds as D2D1_RECT_F, area as single
pEllipse->GetBounds( D2D1_IdentityMatrix(), bounds )
pEllipse->ComputeArea( D2D1_IdentityMatrix(), D2D1_DEFAULT_FLATTENING_TOLERANCE, area )
print "bounds"; bounds.left; bounds.top; bounds.right; bounds.bottom
print "area"; int( area )

' the same interface under a newer version: ask the factory for ID2D1Factory1
dim pFactory1 as ID2D1Factory1 ptr
if pFactory->QueryInterface( @IID_ID2D1Factory1, cast( any ptr ptr, @pFactory1 ) ) = S_OK then print "ID2D1Factory1 available"

D2D1_SafeRelease( pFactory1 )
D2D1_SafeRelease( pEllipse )
D2D1_SafeRelease( pFactory )

On Windows 11 it prints:

bounds 50 75 150 125
area 3910
ID2D1Factory1 available

The area is a little under π · 50 · 25 ≈ 3927 because the ellipse is measured as flattened line segments.

Types

Interfaces

Direct2D 1.0

Interface Declared as Extends Wrapper What it is
ID2D1Resource ID2D1Resource_ ComUnknown Base of every Direct2D resource; reports the factory that made it.
ID2D1Image ID2D1Image_ ID2D1Resource Base of anything that can be drawn as an image: bitmaps, effects, command lists.
ID2D1Bitmap ID2D1Bitmap_ ID2D1Image Bitmaps A bitmap bound to a render target.
ID2D1GradientStopCollection ID2D1GradientStopCollection_ ID2D1Resource Brushes The colours and positions of a gradient, shared by gradient brushes.
ID2D1Brush ID2D1Brush_ ID2D1Resource Base of all brushes: opacity and brush transform.
ID2D1BitmapBrush ID2D1BitmapBrush_ ID2D1Brush Brushes Paints with a bitmap, tiled or clamped.
ID2D1SolidColorBrush ID2D1SolidColorBrush_ ID2D1Brush Brushes Paints with one colour.
ID2D1LinearGradientBrush ID2D1LinearGradientBrush_ ID2D1Brush Brushes Paints a gradient along a line.
ID2D1RadialGradientBrush ID2D1RadialGradientBrush_ ID2D1Brush Brushes Paints a gradient out from a centre to an ellipse.
ID2D1StrokeStyle ID2D1StrokeStyle_ ID2D1Resource Stroke styles Caps, joins and dashes used when an outline is stroked.
ID2D1Geometry ID2D1Geometry_ ID2D1Resource CID2D1Geometry Base of all geometries: bounds, hit tests, combining, measuring.
ID2D1RectangleGeometry ID2D1RectangleGeometry_ ID2D1Geometry Geometries A rectangle as a geometry.
ID2D1RoundedRectangleGeometry ID2D1RoundedRectangleGeometry_ ID2D1Geometry Geometries A rounded rectangle as a geometry.
ID2D1EllipseGeometry ID2D1EllipseGeometry_ ID2D1Geometry Geometries An ellipse as a geometry.
ID2D1GeometryGroup ID2D1GeometryGroup_ ID2D1Geometry Geometries Several geometries filled as one.
ID2D1TransformedGeometry ID2D1TransformedGeometry_ ID2D1Geometry Geometries Another geometry seen through a transform.
ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink_ ComUnknown Geometries Receives lines and Bézier curves describing a geometry.
ID2D1GeometrySink ID2D1GeometrySink_ ID2D1SimplifiedGeometrySink Geometries Receives figures of lines, arcs and curves; fills a path geometry.
ID2D1TessellationSink ID2D1TessellationSink_ ComUnknown Receives the triangles of a tessellated geometry.
ID2D1PathGeometry ID2D1PathGeometry_ ID2D1Geometry Geometries A geometry built from figures written through a geometry sink.
ID2D1Mesh ID2D1Mesh_ ID2D1Resource A set of triangles, filled with a brush.
ID2D1Layer ID2D1Layer_ ID2D1Resource Off-screen surface used to clip, mask or fade a group of drawing calls.
ID2D1DrawingStateBlock ID2D1DrawingStateBlock_ ID2D1Resource Render targets Saved antialias mode, tags, transform and text parameters of a render target.
ID2D1RenderTarget ID2D1RenderTarget_ ID2D1Resource CID2D1RenderTarget Base of all render targets: makes resources and draws.
ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget_ ID2D1RenderTarget Render targets Off-screen render target whose result is read back as a bitmap.
ID2D1HwndRenderTarget ID2D1HwndRenderTarget_ ID2D1RenderTarget Render targets Renders into a window.
ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget_ ComUnknown Render targets Lends a GDI device context for a render target, for mixed drawing.
ID2D1DCRenderTarget ID2D1DCRenderTarget_ ID2D1RenderTarget Render targets Renders into a GDI device context.
ID2D1Factory ID2D1Factory_ ComUnknown CD2D1Factory Creates render targets, geometries, stroke styles and drawing state blocks.

Direct2D 1.1 (Windows 8)

Interface Declared as Extends Wrapper What it is
ID2D1GdiMetafileSink ID2D1GdiMetafileSink_ ComUnknown Receives the records of an enhanced metafile.
ID2D1GdiMetafile ID2D1GdiMetafile_ ID2D1Resource An enhanced metafile that can be drawn.
ID2D1CommandSink ID2D1CommandSink_ ComUnknown Receives the drawing commands played back from a command list.
ID2D1CommandList ID2D1CommandList_ ID2D1Image Records drawing commands to replay or stream later.
ID2D1PrintControl ID2D1PrintControl_ ComUnknown Sends Direct2D drawing to a print document target.
ID2D1ImageBrush ID2D1ImageBrush_ ID2D1Brush Brushes Paints with any image, not only a bitmap.
ID2D1BitmapBrush1 ID2D1BitmapBrush1_ ID2D1BitmapBrush Brushes Bitmap brush with high-quality interpolation modes.
ID2D1StrokeStyle1 ID2D1StrokeStyle1_ ID2D1StrokeStyle Stroke styles Stroke style that can keep a fixed width under transforms.
ID2D1PathGeometry1 ID2D1PathGeometry1_ ID2D1PathGeometry Geometries Path geometry that can report a point and tangent along its length.
ID2D1Properties ID2D1Properties_ ComUnknown Reads and sets the named, typed properties of an effect.
ID2D1Effect ID2D1Effect_ ID2D1Properties An image effect: inputs, properties and an output image.
ID2D1Bitmap1 ID2D1Bitmap1_ ID2D1Bitmap Bitmaps Bitmap with options, colour context and CPU mapping.
ID2D1ColorContext ID2D1ColorContext_ ID2D1Resource Bitmaps A colour space, from an ICC profile or a known space.
ID2D1GradientStopCollection1 ID2D1GradientStopCollection1_ ID2D1GradientStopCollection Brushes Gradient stops with colour-space and buffer-precision control.
ID2D1DrawingStateBlock1 ID2D1DrawingStateBlock1_ ID2D1DrawingStateBlock Render targets Drawing state with primitive blend and unit mode.
ID2D1DeviceContext ID2D1DeviceContext_ ID2D1RenderTarget Render target for effects, command lists and DXGI surfaces.
ID2D1Device ID2D1Device_ ID2D1Resource A Direct2D device over a DXGI device; makes device contexts.
ID2D1Factory1 ID2D1Factory1_ ID2D1Factory CD2D1Factory (CD2D1Factory1) Factory that makes devices, registers custom effects and makes Direct2D 1.1 resources.
ID2D1Multithread ID2D1Multithread_ ComUnknown Stroke styles and multithreading Locks a multithreaded factory against other threads.

Direct2D 1.2 (Windows 8.1)

Interface Declared as Extends Wrapper What it is
ID2D1GeometryRealization ID2D1GeometryRealization_ ID2D1Resource A geometry pre-tessellated for fast repeated drawing.
ID2D1DeviceContext1 ID2D1DeviceContext1_ ID2D1DeviceContext Device context that makes and draws geometry realizations.
ID2D1Device1 ID2D1Device1_ ID2D1Device Device with a rendering priority.
ID2D1Factory2 ID2D1Factory2_ ID2D1Factory1 CD2D1Factory (CD2D1Factory2) Factory that makes ID2D1Device1 devices.
ID2D1CommandSink1 ID2D1CommandSink1_ ID2D1CommandSink Command sink that receives primitive blend changes.

Direct2D 1.3 and later (Windows 10 and 11)

Interface Declared as Extends Wrapper What it is
ID2D1InkStyle ID2D1InkStyle_ ID2D1Resource The nib shape and transform of ink strokes.
ID2D1Ink ID2D1Ink_ ID2D1Resource An ink stroke of variable width.
ID2D1GradientMesh ID2D1GradientMesh_ ID2D1Resource A gradient mesh of tensor patches.
ID2D1ImageSource ID2D1ImageSource_ ID2D1Image An image source that can release and reload its memory.
ID2D1ImageSourceFromWic ID2D1ImageSourceFromWic_ ID2D1ImageSource Image source made from a WIC bitmap source, decoded on demand.
ID2D1TransformedImageSource ID2D1TransformedImageSource_ ID2D1Image An image source drawn scaled and oriented.
ID2D1LookupTable3D ID2D1LookupTable3D_ ID2D1Resource A 3D colour lookup table for the lookup-table effect.
ID2D1DeviceContext2 ID2D1DeviceContext2_ ID2D1DeviceContext1 Device context for ink, gradient meshes and image sources.
ID2D1Device2 ID2D1Device2_ ID2D1Device1 Device that flushes its contexts and returns its DXGI device.
ID2D1Factory3 ID2D1Factory3_ ID2D1Factory2 CD2D1Factory (CD2D1Factory3) Factory that makes ID2D1Device2 devices.
ID2D1CommandSink2 ID2D1CommandSink2_ ID2D1CommandSink1 Command sink that receives ink, gradient mesh and metafile commands.
ID2D1GdiMetafile1 ID2D1GdiMetafile1_ ID2D1GdiMetafile Enhanced metafile with DPI and source bounds.
ID2D1GdiMetafileSink1 ID2D1GdiMetafileSink1_ ID2D1GdiMetafileSink Metafile sink that also receives record flags.
ID2D1SpriteBatch ID2D1SpriteBatch_ ID2D1Resource A batch of sprites from one bitmap, drawn in one call.
ID2D1DeviceContext3 ID2D1DeviceContext3_ ID2D1DeviceContext2 Device context that makes and draws sprite batches.
ID2D1Device3 ID2D1Device3_ ID2D1Device2 Device that makes ID2D1DeviceContext3 contexts.
ID2D1Factory4 ID2D1Factory4_ ID2D1Factory3 CD2D1Factory (CD2D1Factory4) Factory that makes ID2D1Device3 devices.
ID2D1CommandSink3 ID2D1CommandSink3_ ID2D1CommandSink2 Command sink that receives sprite batch commands.
ID2D1SvgGlyphStyle ID2D1SvgGlyphStyle_ ID2D1Resource Fill and stroke used for SVG colour glyphs.
ID2D1DeviceContext4 ID2D1DeviceContext4_ ID2D1DeviceContext3 Device context that draws colour and SVG glyphs.
ID2D1Device4 ID2D1Device4_ ID2D1Device3 Device with a limit on its colour glyph cache.
ID2D1Factory5 ID2D1Factory5_ ID2D1Factory4 CD2D1Factory (CD2D1Factory5) Factory that makes ID2D1Device4 devices.
ID2D1CommandSink4 ID2D1CommandSink4_ ID2D1CommandSink3 Command sink that receives the extended primitive blend modes.
ID2D1ColorContext1 ID2D1ColorContext1_ ID2D1ColorContext Bitmaps Colour context from a DXGI colour space or a simple profile.
ID2D1DeviceContext5 ID2D1DeviceContext5_ ID2D1DeviceContext4 Device context that makes and draws SVG documents and makes colour contexts.
ID2D1Device5 ID2D1Device5_ ID2D1Device4 Device that makes ID2D1DeviceContext5 contexts.
ID2D1Factory6 ID2D1Factory6_ ID2D1Factory5 CD2D1Factory (CD2D1Factory6) Factory that makes ID2D1Device5 devices.
ID2D1CommandSink5 ID2D1CommandSink5_ ID2D1CommandSink4 Command sink that receives blend-image commands.
ID2D1DeviceContext6 ID2D1DeviceContext6_ ID2D1DeviceContext5 Device context that draws an image with a blend mode.
ID2D1Device6 ID2D1Device6_ ID2D1Device5 Device that makes ID2D1DeviceContext6 contexts.
ID2D1Factory7 ID2D1Factory7_ ID2D1Factory6 CD2D1Factory (CD2D1Factory7) Factory that makes ID2D1Device6 devices.
ID2D1DeviceContext7 ID2D1DeviceContext7_ ID2D1DeviceContext6 Device context with paint feature levels for COLR fonts.
ID2D1Device7 ID2D1Device7_ ID2D1Device6 Device that makes ID2D1DeviceContext7 contexts.
ID2D1Factory8 ID2D1Factory8_ ID2D1Factory7 CD2D1Factory (CD2D1Factory8) Factory that makes ID2D1Device7 devices.

Custom effects

Interface Declared as Extends Wrapper What it is
ID2D1VertexBuffer ID2D1VertexBuffer_ ComUnknown Vertex data for a custom effect transform.
ID2D1ResourceTexture ID2D1ResourceTexture_ ComUnknown Texture data a custom effect shader can read.
ID2D1RenderInfo ID2D1RenderInfo_ ComUnknown Base of the render information a transform fills in.
ID2D1DrawInfo ID2D1DrawInfo_ ID2D1RenderInfo Pixel and vertex shader set-up of a draw transform.
ID2D1ComputeInfo ID2D1ComputeInfo_ ID2D1RenderInfo Compute shader set-up of a compute transform.
ID2D1TransformNode ID2D1TransformNode_ ComUnknown Base of a node in an effect's transform graph.
ID2D1TransformGraph ID2D1TransformGraph_ ComUnknown The graph of transforms a custom effect is built from.
ID2D1Transform ID2D1Transform_ ID2D1TransformNode A transform node that maps rectangles between input and output.
ID2D1DrawTransform ID2D1DrawTransform_ ID2D1Transform Transform that renders with a pixel or vertex shader.
ID2D1ComputeTransform ID2D1ComputeTransform_ ID2D1Transform Transform that renders with a compute shader.
ID2D1AnalysisTransform ID2D1AnalysisTransform_ ComUnknown Transform that receives its input's analysis data.
ID2D1SourceTransform ID2D1SourceTransform_ ID2D1Transform Transform that produces image data on the CPU.
ID2D1ConcreteTransform ID2D1ConcreteTransform_ ID2D1TransformNode Built-in transform node with output buffer settings.
ID2D1BlendTransform ID2D1BlendTransform_ ID2D1ConcreteTransform Built-in transform that blends its inputs.
ID2D1BorderTransform ID2D1BorderTransform_ ID2D1ConcreteTransform Built-in transform that extends its input's edges.
ID2D1OffsetTransform ID2D1OffsetTransform_ ID2D1TransformNode Built-in transform that shifts its input by whole pixels.
ID2D1BoundsAdjustmentTransform ID2D1BoundsAdjustmentTransform_ ID2D1TransformNode Built-in transform that changes its input's bounds.
ID2D1EffectImpl ID2D1EffectImpl_ ComUnknown What a custom effect implements to be hosted by Direct2D.
ID2D1EffectContext ID2D1EffectContext_ ComUnknown The services Direct2D gives a custom effect while it runs.
ID2D1EffectContext1 (same) ID2D1EffectContext Effect context that can make 3D lookup tables.
ID2D1EffectContext2 (same) ID2D1EffectContext1 Effect context with colour contexts from DXGI spaces and simple profiles.

SVG

Interface Declared as Extends Wrapper What it is
ID2D1SvgAttribute ID2D1SvgAttribute_ ID2D1Resource Base of the object-valued SVG attributes.
ID2D1SvgPaint ID2D1SvgPaint_ ID2D1SvgAttribute An SVG fill or stroke paint.
ID2D1SvgStrokeDashArray ID2D1SvgStrokeDashArray_ ID2D1SvgAttribute An SVG stroke-dasharray value.
ID2D1SvgPointCollection ID2D1SvgPointCollection_ ID2D1SvgAttribute The points of an SVG polyline or polygon.
ID2D1SvgPathData ID2D1SvgPathData_ ID2D1SvgAttribute The data of an SVG path element.
ID2D1SvgElement ID2D1SvgElement_ ID2D1Resource An element of an SVG document tree.
ID2D1SvgDocument ID2D1SvgDocument_ ID2D1Resource An SVG document that can be drawn and edited.

Structures

Structure What it holds
D3DCOLORVALUE A colour as four floats, red, green, blue and alpha, each 0 to 1; D2D1_COLOR_F is this type.
D2D_MATRIX_3X2_F A 2D affine transform (D2D1_MATRIX_3X2_F).
D2D_MATRIX_4X3_F A 4 × 3 matrix (D2D1_MATRIX_4X3_F).
D2D_MATRIX_4X4_F A 4 × 4 matrix for 3D transforms (D2D1_MATRIX_4X4_F).
D2D_MATRIX_5X4_F A 5 × 4 matrix, as used by the colour matrix effect (D2D1_MATRIX_5X4_F).
D2D_POINT_2F A point with single coordinates (D2D1_POINT_2F).
D2D_POINT_2U A point with unsigned 32-bit coordinates (D2D1_POINT_2U).
D2D_RECT_F A rectangle with single edges (D2D1_RECT_F).
D2D_RECT_U A rectangle with unsigned 32-bit edges (D2D1_RECT_U).
D2D_SIZE_F A width and height as single (D2D1_SIZE_F).
D2D_SIZE_U A width and height as unsigned 32-bit values (D2D1_SIZE_U).
D2D_VECTOR_2F Two single components (D2D1_VECTOR_2F).
D2D_VECTOR_3F Three single components (D2D1_VECTOR_3F).
D2D_VECTOR_4F Four single components (D2D1_VECTOR_4F).
DXGI_RATIONAL A rational number, numerator over denominator, such as a refresh rate.
DXGI_SAMPLE_DESC Multisampling count and quality of a resource.
DXGI_RGB Red, green and blue as floats, used in gamma control.
DXGI_GAMMA_CONTROL A gamma curve with scale and offset for an output.
DXGI_GAMMA_CONTROL_CAPABILITIES The gamma control an output supports.
DXGI_MODE_DESC A display mode: size, refresh rate, format, scan-line order and scaling.
DXGI_JPEG_DC_HUFFMAN_TABLE A JPEG DC Huffman table.
DXGI_JPEG_AC_HUFFMAN_TABLE A JPEG AC Huffman table.
DXGI_JPEG_QUANTIZATION_TABLE A JPEG quantization table.
D2D1_PIXEL_FORMAT A pixel format and alpha mode for bitmaps and render targets.
DWRITE_GLYPH_OFFSET How far one glyph is moved from its normal position.
DWRITE_GLYPH_RUN A run of glyphs of one font face and size, for DrawGlyphRun.
D2D1_BITMAP_PROPERTIES Pixel format and DPI of a bitmap.
D2D1_GRADIENT_STOP One colour of a gradient and where it sits, 0 to 1.
D2D1_BRUSH_PROPERTIES Opacity and transform of a brush.
D2D1_BITMAP_BRUSH_PROPERTIES Extend modes and interpolation of a bitmap brush.
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES Start and end points of a linear gradient.
D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES Centre, origin offset and radii of a radial gradient.
D2D1_BEZIER_SEGMENT A cubic Bézier segment: two control points and an end point.
D2D1_TRIANGLE Three points of a triangle, as a tessellation sink receives them.
D2D1_ARC_SEGMENT An elliptical arc segment: end point, radii, rotation, direction and size.
D2D1_QUADRATIC_BEZIER_SEGMENT A quadratic Bézier segment: one control point and an end point.
D2D1_ELLIPSE An ellipse: centre and two radii.
D2D1_ROUNDED_RECT A rectangle and the radii of its corners.
D2D1_STROKE_STYLE_PROPERTIES Caps, line join, miter limit and dash style of a stroke style.
D2D1_LAYER_PARAMETERS Bounds, mask, opacity and options of a layer being pushed.
D2D1_RENDER_TARGET_PROPERTIES Type, pixel format, DPI, usage and minimum feature level of a render target.
D2D1_HWND_RENDER_TARGET_PROPERTIES The window, pixel size and present options of a window render target.
D2D1_DRAWING_STATE_DESCRIPTION Antialias modes, tags and transform saved by a drawing state block.
D2D1_FACTORY_OPTIONS The debug level asked for when a factory is created.
D2D1_BITMAP_PROPERTIES1 Pixel format, DPI, options and colour context of an ID2D1Bitmap1.
D2D1_MAPPED_RECT Pitch and pointer of a bitmap mapped for CPU access.
D2D1_RENDERING_CONTROLS Buffer precision and tile size a device context renders with.
D2D1_EFFECT_INPUT_DESCRIPTION An effect, one of its inputs and a rectangle on that input.
D2D1_POINT_DESCRIPTION A point along a path, its tangent and which segment and figure it is on.
D2D1_IMAGE_BRUSH_PROPERTIES Source rectangle, extend modes and interpolation of an image brush.
D2D1_BITMAP_BRUSH_PROPERTIES1 Extend modes and interpolation of an ID2D1BitmapBrush1.
D2D1_STROKE_STYLE_PROPERTIES1 Stroke style properties plus the stroke transform type.
D2D1_LAYER_PARAMETERS1 Layer parameters with the Direct2D 1.1 layer options.
D2D1_DRAWING_STATE_DESCRIPTION1 Drawing state plus primitive blend and unit mode.
D2D1_PRINT_CONTROL_PROPERTIES Font subsetting, raster DPI and colour space of a print control.
D2D1_CREATION_PROPERTIES Threading mode, debug level and options for a device or device context.
D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES Orientation, scale, interpolation and options of a transformed image source.
D2D1_INK_POINT A point of an ink stroke and its radius.
D2D1_INK_BEZIER_SEGMENT A cubic Bézier segment of an ink stroke.
D2D1_INK_STYLE_PROPERTIES Nib shape and nib transform of an ink style.
D2D1_GRADIENT_MESH_PATCH One tensor patch of a gradient mesh: 16 points, 4 corner colours, 4 edge modes.
D2D1_SIMPLE_COLOR_PROFILE A colour profile given by primaries, white point and gamma.
D2D1_PROPERTY_BINDING_ Binds a custom effect property name to its get and set functions (D2D1_PROPERTY_BINDING).
D2D1_RESOURCE_TEXTURE_PROPERTIES Size, precision, filter and extend modes of a resource texture.
D2D1_INPUT_ELEMENT_DESC One element of a custom vertex layout.
D2D1_VERTEX_BUFFER_PROPERTIES Count, usage and data of a vertex buffer.
D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES Shader signature and layout of a custom vertex buffer.
D2D1_VERTEX_RANGE First vertex and count of a range in a vertex buffer.
D2D1_BLEND_DESCRIPTION The blend state a draw transform renders with.
D2D1_INPUT_DESCRIPTION Filter and level of detail for a transform input.
D2D1_FEATURE_DATA_DOUBLES Whether the device has double-precision shader operations.
D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS Whether the device has compute shaders on Direct3D 10.x hardware.
D2D1_SVG_LENGTH An SVG length: a number and its unit.
D2D1_SVG_PRESERVE_ASPECT_RATIO The SVG preserveAspectRatio value.
D2D1_SVG_VIEWBOX The SVG viewBox rectangle.

Enumerations

Each enumeration is a 32-bit type of that name (type D2D1_CAP_STYLE as long) with its constants at module level, so D2D1_CAP_STYLE_ROUND is written bare.

Enumeration Values for
DXGI_COLOR_SPACE_TYPE Colour spaces of DXGI surfaces: range, gamma, siting and primaries.
DXGI_FORMAT Pixel and resource formats (DXGI_FORMAT_B8G8R8A8_UNORM …).
DXGI_MODE_SCANLINE_ORDER How a display mode draws scan lines.
DXGI_MODE_SCALING How an image is stretched to a display mode.
DXGI_MODE_ROTATION Rotation of an output.
D3D_FEATURE_LEVEL Direct3D feature levels a device can target.
DWRITE_MEASURING_MODE How text is measured: natural, GDI classic or GDI natural.
DWRITE_GLYPH_IMAGE_FORMATS Image formats a glyph can have (outline, COLR, SVG, PNG …).
D2D1_ALPHA_MODE How the alpha channel is read: premultiplied, straight, ignored.
D2D1_GAMMA Gamma space gradient colours are interpolated in.
D2D1_OPACITY_MASK_CONTENT What an opacity mask holds: graphics or text.
D2D1_EXTEND_MODE What a brush paints outside its area: clamp, wrap, mirror.
D2D1_ANTIALIAS_MODE Antialiasing of geometry edges.
D2D1_TEXT_ANTIALIAS_MODE Antialiasing of text: ClearType, grayscale, aliased.
D2D1_BITMAP_INTERPOLATION_MODE Interpolation when a bitmap is scaled or rotated.
D2D1_DRAW_TEXT_OPTIONS Options for drawing text: no snapping, clipping, colour fonts.
D2D1_ARC_SIZE Whether an arc sweeps more or less than 180 degrees.
D2D1_CAP_STYLE Shape at the end of a line or dash.
D2D1_DASH_STYLE Dash pattern of a stroke.
D2D1_LINE_JOIN How two stroked segments are joined.
D2D1_COMBINE_MODE How two geometries are combined: union, intersect, xor, exclude.
D2D1_GEOMETRY_RELATION How one geometry relates to another: disjoint, contains …
D2D1_GEOMETRY_SIMPLIFICATION_OPTION Whether simplification keeps cubic curves or uses lines only.
D2D1_FIGURE_BEGIN Whether a new figure is filled or hollow.
D2D1_FIGURE_END Whether a figure is closed or left open.
D2D1_PATH_SEGMENT Whether a segment is stroked and joined smoothly.
D2D1_SWEEP_DIRECTION Direction an arc is drawn: clockwise or counter-clockwise.
D2D1_FILL_MODE Which parts of overlapping figures are inside: alternate or winding.
D2D1_LAYER_OPTIONS Options of a layer, such as ClearType text.
D2D1_WINDOW_STATE Whether a window render target's window is occluded.
D2D1_RENDER_TARGET_TYPE Whether a render target uses hardware or software.
D2D1_FEATURE_LEVEL Minimum Direct3D feature level a render target needs.
D2D1_RENDER_TARGET_USAGE How a render target will be used: remoting, GDI compatible.
D2D1_PRESENT_OPTIONS How a window render target presents: keep contents, do not wait for vsync.
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS Whether a compatible render target must be GDI compatible.
D2D1_DC_INITIALIZE_MODE Whether the GDI device context starts with the target's contents or cleared.
D2D1_DEBUG_LEVEL How much debug output the Direct2D debug layer gives.
D2D1_FACTORY_TYPE Whether a factory is single-threaded or multithreaded.
DWRITE_FACTORY_TYPE Whether a DirectWrite factory is shared or isolated.
D2D1_PROPERTY_TYPE Data type of an effect property.
D2D1_PROPERTY Properties every effect has: class id, name, author, inputs …
D2D1_SUBPROPERTY Sub-properties of an effect property: display name, range, default …
D2D1_BITMAP_OPTIONS How an ID2D1Bitmap1 can be used: target, CPU read, GDI compatible …
D2D1_COMPOSITE_MODE Porter-Duff composite modes for drawing an image.
D2D1_BUFFER_PRECISION Bits per channel of intermediate buffers.
D2D1_MAP_OPTIONS Access asked for when a bitmap is mapped: read, write, discard.
D2D1_INTERPOLATION_MODE Interpolation modes of Direct2D 1.1, cubic and high-quality included.
D2D1_UNIT_MODE Whether a device context works in DIPs or pixels.
D2D1_COLOR_SPACE Colour spaces of colour conversion: custom, sRGB, scRGB.
D2D1_DEVICE_CONTEXT_OPTIONS Options of a device context, such as multithreaded optimisations.
D2D1_STROKE_TRANSFORM_TYPE Whether a stroke scales with the transform, stays fixed or is a hairline.
D2D1_PRIMITIVE_BLEND How drawn primitives blend with the target: source-over, copy, min, add, max.
D2D1_THREADING_MODE Threading of a device made with D2D1CreateDevice.
D2D1_COLOR_INTERPOLATION_MODE Whether gradient colours interpolate straight or premultiplied.
D2D1_LAYER_OPTIONS1 Options of a Direct2D 1.1 layer: initialise from background, ignore alpha.
D2D1_PRINT_FONT_SUBSET_MODE How fonts are subset when printing.
D2D1_RENDERING_PRIORITY Rendering priority of a device: normal or low.
D2D1_INK_NIB_SHAPE Shape of an ink nib: round or square.
D2D1_ORIENTATION Flips and rotations of an image (EXIF orientations).
D2D1_IMAGE_SOURCE_LOADING_OPTIONS Options for loading an image source from WIC.
D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS Options for an image source made from DXGI surfaces.
D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS Options of a transformed image source, such as no DPI scaling.
D2D1_PATCH_EDGE_MODE How an edge of a gradient mesh patch is antialiased.
D2D1_SPRITE_OPTIONS Options for drawing a sprite batch.
D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION Whether colour bitmap glyphs are snapped to pixels.
D2D1_GAMMA1 Gamma of a simple colour profile: 2.2, 1.0 or ST.2084.
D2D1_COLOR_CONTEXT_TYPE Where a colour context comes from: ICC, simple profile, DXGI.
D2D1_BLEND_MODE Blend modes of the blend effect and BlendImage: multiply, screen, darken …
DWRITE_PAINT_FEATURE_LEVEL Levels of COLR colour-font painting a device context supports.
D2D1_BORDER_MODE Whether an effect softens or keeps hard edges at its output border.
D2D1_CHANNEL_SELECTOR A colour channel: R, G, B or A.
D2D1_BITMAPSOURCE_ORIENTATION Orientations the bitmap source effect can apply.
D2D1_GAUSSIANBLUR_OPTIMIZATION Speed and quality trade-off of the Gaussian blur effect.
D2D1_DIRECTIONALBLUR_OPTIMIZATION Speed and quality trade-off of the directional blur effect.
D2D1_SHADOW_OPTIMIZATION Speed and quality trade-off of the shadow effect.
D2D1_COLORMATRIX_ALPHA_MODE Alpha mode of the colour matrix effect.
D2D1_BITMAPSOURCE_INTERPOLATION_MODE Interpolation of the bitmap source effect.
D2D1_BITMAPSOURCE_ALPHA_MODE Alpha mode of the bitmap source effect.
D2D1_3DTRANSFORM_INTERPOLATION_MODE Interpolation of the 3D transform effect.
D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE Interpolation of the 3D perspective transform effect.
D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE Interpolation of the 2D affine transform effect.
D2D1_DPICOMPENSATION_INTERPOLATION_MODE Interpolation of the DPI compensation effect.
D2D1_SCALE_INTERPOLATION_MODE Interpolation of the scale effect.
D2D1_TURBULENCE_NOISE Noise function of the turbulence effect.
D2D1_COLORMANAGEMENT_ALPHA_MODE Alpha mode of the colour management effect.
D2D1_COLORMANAGEMENT_QUALITY Quality level of the colour management effect.
D2D1_COLORMANAGEMENT_RENDERING_INTENT ICC rendering intent of the colour management effect.
D2D1_POINTSPECULAR_SCALE_MODE Interpolation of the point-specular effect's surface scale.
D2D1_SPOTSPECULAR_SCALE_MODE Interpolation of the spot-specular effect's surface scale.
D2D1_DISTANTSPECULAR_SCALE_MODE Interpolation of the distant-specular effect's surface scale.
D2D1_POINTDIFFUSE_SCALE_MODE Interpolation of the point-diffuse effect's surface scale.
D2D1_SPOTDIFFUSE_SCALE_MODE Interpolation of the spot-diffuse effect's surface scale.
D2D1_DISTANTDIFFUSE_SCALE_MODE Interpolation of the distant-diffuse effect's surface scale.
D2D1_CONVOLVEMATRIX_SCALE_MODE Interpolation of the convolve matrix effect.
D2D1_BORDER_EDGE_MODE How the border effect extends edges: clamp, wrap, mirror.
D2D1_MORPHOLOGY_MODE Erode or dilate, for the morphology effect.
D2D1_YCBCR_CHROMA_SUBSAMPLING Chroma subsampling of the YCbCr effect's input.
D2D1_YCBCR_INTERPOLATION_MODE Interpolation of the YCbCr effect.
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE Output space of the RGB-to-hue effect: HSV or HSL.
D2D1_HUETORGB_INPUT_COLOR_SPACE Input space of the hue-to-RGB effect: HSV or HSL.
D2D1_STRAIGHTEN_SCALE_MODE Interpolation of the straighten effect.
D2D1_EDGEDETECTION_MODE Kernel of the edge detection effect: Sobel or Prewitt.
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA Gamma of the highlights-and-shadows effect's input.
D2D1_HDRTONEMAP_DISPLAY_MODE Display the HDR tone map effect targets: SDR or HDR.
D2D1_CHANGE_TYPE What changed since a custom effect was last prepared.
D2D1_PIXEL_OPTIONS Options of a pixel shader in a draw transform.
D2D1_VERTEX_OPTIONS Options of a vertex buffer in a draw transform.
D2D1_VERTEX_USAGE Whether a vertex buffer is static or dynamic.
D2D1_BLEND_OPERATION Blend operation of a blend transform: add, subtract, min, max.
D2D1_BLEND Blend factors of a blend transform.
D2D1_CHANNEL_DEPTH Number of channels in a transform's output buffer.
D2D1_FILTER Texture filtering of a transform input.
D2D1_FEATURE Device features a custom effect can query.
D2D1_SVG_PAINT_TYPE Kind of an SVG paint: none, colour, current colour, URI.
D2D1_SVG_LENGTH_UNITS Units of an SVG length: number or percentage.
D2D1_SVG_DISPLAY The SVG display property: inline or none.
D2D1_SVG_VISIBILITY The SVG visibility property.
D2D1_SVG_OVERFLOW The SVG overflow property.
D2D1_SVG_LINE_CAP The SVG stroke-linecap property.
D2D1_SVG_LINE_JOIN The SVG stroke-linejoin property.
D2D1_SVG_ASPECT_ALIGN Alignment part of preserveAspectRatio.
D2D1_SVG_ASPECT_SCALING Meet or slice part of preserveAspectRatio.
D2D1_SVG_PATH_COMMAND Commands of SVG path data: move, line, curve, arc, close.
D2D1_SVG_UNIT_TYPE Coordinate system of SVG units: user space or bounding box.
D2D1_SVG_ATTRIBUTE_STRING_TYPE Kind of string an SVG attribute holds.
D2D1_SVG_ATTRIBUTE_POD_TYPE Plain data types an SVG attribute can be read as.

Effect property indices

One enumeration per built-in effect: the index of each of its properties, for ID2D1Properties SetValue and GetValue (D2D1_GAUSSIANBLUR_PROP_STANDARD_DEVIATION …).

Enumeration Properties of the
D2D1_GAUSSIANBLUR_PROP Gaussian blur effect
D2D1_DIRECTIONALBLUR_PROP directional blur effect
D2D1_SHADOW_PROP shadow effect
D2D1_BLEND_PROP blend effect
D2D1_SATURATION_PROP saturation effect
D2D1_HUEROTATION_PROP hue rotation effect
D2D1_COLORMATRIX_PROP colour matrix effect
D2D1_BITMAPSOURCE_PROP bitmap source effect
D2D1_COMPOSITE_PROP composite effect
D2D1_3DTRANSFORM_PROP 3D transform effect
D2D1_3DPERSPECTIVETRANSFORM_PROP 3D perspective transform effect
D2D1_2DAFFINETRANSFORM_PROP 2D affine transform effect
D2D1_DPICOMPENSATION_PROP DPI compensation effect
D2D1_SCALE_PROP scale effect
D2D1_TURBULENCE_PROP turbulence effect
D2D1_DISPLACEMENTMAP_PROP displacement map effect
D2D1_COLORMANAGEMENT_PROP colour management effect
D2D1_HISTOGRAM_PROP histogram effect
D2D1_POINTSPECULAR_PROP point-specular lighting effect
D2D1_SPOTSPECULAR_PROP spot-specular lighting effect
D2D1_DISTANTSPECULAR_PROP distant-specular lighting effect
D2D1_POINTDIFFUSE_PROP point-diffuse lighting effect
D2D1_SPOTDIFFUSE_PROP spot-diffuse lighting effect
D2D1_DISTANTDIFFUSE_PROP distant-diffuse lighting effect
D2D1_FLOOD_PROP flood effect
D2D1_LINEARTRANSFER_PROP linear transfer effect
D2D1_GAMMATRANSFER_PROP gamma transfer effect
D2D1_TABLETRANSFER_PROP table transfer effect
D2D1_DISCRETETRANSFER_PROP discrete transfer effect
D2D1_CONVOLVEMATRIX_PROP convolve matrix effect
D2D1_BRIGHTNESS_PROP brightness effect
D2D1_ARITHMETICCOMPOSITE_PROP arithmetic composite effect
D2D1_CROP_PROP crop effect
D2D1_BORDER_PROP border effect
D2D1_MORPHOLOGY_PROP morphology effect
D2D1_TILE_PROP tile effect
D2D1_ATLAS_PROP atlas effect
D2D1_OPACITYMETADATA_PROP opacity metadata effect
D2D1_YCBCR_PROP YCbCr effect
D2D1_CONTRAST_PROP contrast effect
D2D1_RGBTOHUE_PROP RGB-to-hue effect
D2D1_HUETORGB_PROP hue-to-RGB effect
D2D1_CHROMAKEY_PROP chroma-key effect
D2D1_EMBOSS_PROP emboss effect
D2D1_EXPOSURE_PROP exposure effect
D2D1_POSTERIZE_PROP posterize effect
D2D1_SEPIA_PROP sepia effect
D2D1_SHARPEN_PROP sharpen effect
D2D1_STRAIGHTEN_PROP straighten effect
D2D1_TEMPERATUREANDTINT_PROP temperature and tint effect
D2D1_VIGNETTE_PROP vignette effect
D2D1_EDGEDETECTION_PROP edge detection effect
D2D1_HIGHLIGHTSANDSHADOWS_PROP highlights and shadows effect
D2D1_LOOKUPTABLE3D_PROP 3D lookup table effect
D2D1_OPACITY_PROP opacity effect
D2D1_CROSSFADE_PROP cross-fade effect
D2D1_TINT_PROP tint effect
D2D1_WHITELEVELADJUSTMENT_PROP white level adjustment effect
D2D1_HDRTONEMAP_PROP HDR tone map effect

Callback types

Type Is
PD2D1_EFFECT_FACTORY function( byref effectImpl as IUnknown ptr ) as HRESULT: makes an instance of a custom effect, for RegisterEffectFromString.
PD2D1_PROPERTY_SET_FUNCTION Sets a custom effect property from raw bytes.
PD2D1_PROPERTY_GET_FUNCTION Reads a custom effect property into raw bytes.

Functions

The functions Direct2D itself exports, declared alongside the types. The helpers call several of them.

Function Does
D2D1CreateFactory ( factoryType, riid, factoryOptions, pIFactory ) as HRESULT: makes a factory, the start of every Direct2D program. Pass byval NULL for the options.
D2D1MakeRotateMatrix Fills a 3 × 2 rotation about a point.
D2D1MakeSkewMatrix Fills a 3 × 2 skew about a point.
D2D1IsMatrixInvertible Tells whether a 3 × 2 matrix can be inverted.
D2D1InvertMatrix Inverts a 3 × 2 matrix in place; false if it cannot.
D2D1CreateDevice Makes an ID2D1Device over a DXGI device.
D2D1CreateDeviceContext Makes an ID2D1DeviceContext over a DXGI surface.
D2D1ConvertColorSpace Declared as a sub with the colour spaces byref and the result in a fourth argument; called that way it leaves the result argument at 0 and writes over the source colour-space variable.
D2D1SinCos Returns the sine and cosine of an angle in radians: D2D1SinCos( pi / 6, s, c ) gives 0.5 and 0.8660254.
D2D1Tan Returns the tangent of an angle in radians.
D2D1Vec3Length Returns the length of a 3D vector: D2D1Vec3Length( 2, 3, 6 ) is 7.
D2D1ComputeMaximumScaleFactor Returns the largest scale a 3 × 2 transform applies in any direction.
D2D1GetGradientMeshInteriorPointsFromCoonsPatch Works out the four inner points of a Coons patch; D2D1_GradientMeshPatchFromCoonsPatch calls it.
DWriteCreateFactory Makes a DirectWrite factory, for text formats and layouts.

See also

Clone this wiki locally