Overview
The Curion Direct2D Library is primarily a collection of Direct2D path, text, and matrix routines as well as some point routines. They are designed to be composable in that you can use one or more routines to build more complex shapes. In general the library was built by composing these routines. The progression from lowest level to highest level is: Points, Stroke, Figure, Path, Paths. In the future classes will put all the artifacts required to do something together.
When rendering Transforms place and scale paths while Palettes fill and outline paths. Classes combine paths, transforms, and palettes into useable objects.
Routine names use the following convention: (thing)(type)(operation)_c2d. For example: BoxPathNew_c2d where Box is the thing, Path is the type, and New is the operation. Generally There are the following types:
- Point - work with values.
- Stroke - A squiggle of some sort. Intended to be part of some figure.
- Figure - A completed figure containing zero or more squiggles.
- Path - A closed path containing zero or more figures.
- Paths - An array of closed paths, each containing zero or more figures
- Transform - Matrix transformations
- Palette - A collection of colored brushes
- Type - A structure (or type).
- Enum - An enumeration.
In Direct2D a path is created by obtaining a sink and then adding things to the sink. Once the sink is closed, it can't be changed. Figures and Strokes are designed to be added to an open sink. A Path is a closed Path geometry.
Some common operations are: New (which creates something) and Add (which adds to an existing thing).
The names were changed in this version to make simple function browsers more effective. By starting with the thing you can get to the routines of a particular type fairly rapidly. For example to get to the Tombstone routines, in the PB IDE you press the F2 key followed by the letters T and O. You can then use the arrow keys to select one of the four tombstone routines.
The direct2D interfaces currently used in this project are:
Device independent
- ID2D1EllipseGeometry
- ID2D1Factory - A generic factory
- ID2D1GeometrySink - A generic geometry sink (path/figure sink)
- ID2D1PathGeometry - A path geometry (contains paths/figures)
- ID2D1TransformedGeometry - A transformed geometry (doesn't affect strokes)
- IDWriteFactory - used to manipulate text
- IWICImagingFactory - used to manipulate images.
Device dependent
- ID2D1HwndRenderTarget - used to display things.
- ID2D1SolidColorBrush - Paints with a solid color
Other Direct2D interfaces.
Over time I expect more of these to have key roles in the library.
- ID2D1DrawingStateBlock
- ID2D1Geometry
- ID2D1GeometryGroup
- ID2D1Layer
- ID2D1Mesh
- ID2D1RectangleGeometry
- ID2D1RoundedRectangleGeometry
- ID2D1SimplifiedGeometrySink
- ID2D1TessellationSink
- ID2D1RenderTarget
- ID2D1BitmapRenderTarget
- ID2D1GdiInteropRenderTarget
- ID2D1DCRenderTarget
- ID2D1Brush - Generic brush
- ID2D1BitmapBrush - Paints with a bitmap
- ID2D1GradientStopCollection - Gradient stops for a gradient brush
- ID2D1Bitmap - A bitmap
- ID2D1LinearGradientBrush - A linear gradient brush
- ID2D1RadialGradientBrush - A radial gradient brush
- ID2D1StrokeStyle - Style of a line stroke.