michael@0: //--------------------------------------------------------------------------- michael@0: // Copyright (c) Microsoft Corporation. All rights reserved. michael@0: // michael@0: // This file is automatically generated. Please do not edit it directly. michael@0: // michael@0: // File name: D2D1_1.h michael@0: //--------------------------------------------------------------------------- michael@0: #pragma once michael@0: michael@0: #ifndef _D2D1_1_H_ michael@0: #ifndef _D2D1_H_ michael@0: #include michael@0: #endif // #ifndef _D2D1_H_ michael@0: michael@0: //+----------------------------------------------------------------------------- michael@0: // michael@0: // Flag: michael@0: // D2D1_LAYER_OPTIONS1 michael@0: // michael@0: // Synopsis: michael@0: // Specifies how the layer contents should be prepared. michael@0: // michael@0: //------------------------------------------------------------------------------ michael@0: typedef enum D2D1_LAYER_OPTIONS1 michael@0: { michael@0: D2D1_LAYER_OPTIONS1_NONE = 0, michael@0: D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1, michael@0: D2D1_LAYER_OPTIONS1_IGNORE_ALPHA = 2, michael@0: D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff michael@0: michael@0: } D2D1_LAYER_OPTIONS1; michael@0: michael@0: //+----------------------------------------------------------------------------- michael@0: // michael@0: // Struct: michael@0: // D2D1_LAYER_PARAMETERS1 michael@0: // michael@0: // Synopsis: michael@0: // All parameters related to pushing a layer. michael@0: // michael@0: //------------------------------------------------------------------------------ michael@0: typedef struct D2D1_LAYER_PARAMETERS1 michael@0: { michael@0: D2D1_RECT_F contentBounds; michael@0: ID2D1Geometry *geometricMask; michael@0: D2D1_ANTIALIAS_MODE maskAntialiasMode; michael@0: D2D1_MATRIX_3X2_F maskTransform; michael@0: FLOAT opacity; michael@0: ID2D1Brush *opacityBrush; michael@0: D2D1_LAYER_OPTIONS1 layerOptions; michael@0: michael@0: } D2D1_LAYER_PARAMETERS1; michael@0: michael@0: DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS1); michael@0: michael@0: #ifndef DX_DECLARE_INTERFACE michael@0: #define DX_DECLARE_INTERFACE(x) DECLSPEC_UUID(x) DECLSPEC_NOVTABLE michael@0: #endif michael@0: michael@0: namespace D2D1 michael@0: { michael@0: D2D1FORCEINLINE michael@0: D2D1_LAYER_PARAMETERS1 michael@0: LayerParameters1( michael@0: CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(), michael@0: ID2D1Geometry *geometricMask = NULL, michael@0: D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, michael@0: D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(), michael@0: FLOAT opacity = 1.0, michael@0: ID2D1Brush *opacityBrush = NULL, michael@0: D2D1_LAYER_OPTIONS1 layerOptions = D2D1_LAYER_OPTIONS1_NONE michael@0: ) michael@0: { michael@0: D2D1_LAYER_PARAMETERS1 layerParameters = { 0 }; michael@0: michael@0: layerParameters.contentBounds = contentBounds; michael@0: layerParameters.geometricMask = geometricMask; michael@0: layerParameters.maskAntialiasMode = maskAntialiasMode; michael@0: layerParameters.maskTransform = maskTransform; michael@0: layerParameters.opacity = opacity; michael@0: layerParameters.opacityBrush = opacityBrush; michael@0: layerParameters.layerOptions = layerOptions; michael@0: michael@0: return layerParameters; michael@0: } michael@0: } michael@0: michael@0: DEFINE_GUID(IID_ID2D1DeviceContext, 0xe8f7fe7a, 0x191c, 0x466d, 0xad, 0x95, 0x97, 0x56, 0x78, 0xbd, 0xa9, 0x98); michael@0: michael@0: //+----------------------------------------------------------------------------- michael@0: // michael@0: // Interface: michael@0: // ID2D1DeviceContext michael@0: // michael@0: // Synopsis: michael@0: // The device context represents a set of state and a command buffer that is used michael@0: // to render to a target bitmap. michael@0: // michael@0: //------------------------------------------------------------------------------ michael@0: interface DX_DECLARE_INTERFACE("e8f7fe7a-191c-466d-ad95-975678bda998") ID2D1DeviceContext : public ID2D1RenderTarget michael@0: { michael@0: michael@0: michael@0: // michael@0: // Creates a bitmap with extended bitmap properties, potentially from a block of michael@0: // memory. michael@0: // michael@0: STDMETHOD(CreateBitmap)() PURE; michael@0: michael@0: // michael@0: // Create a D2D bitmap by copying a WIC bitmap. michael@0: // michael@0: STDMETHOD(CreateBitmapFromWicBitmap)() PURE; michael@0: michael@0: // michael@0: // Creates a color context from a color space. If the space is Custom, the context michael@0: // is initialized from the profile/profileSize arguments. Otherwise the context is michael@0: // initialized with the profile bytes associated with the space and michael@0: // profile/profileSize are ignored. michael@0: // michael@0: STDMETHOD(CreateColorContext)() PURE; michael@0: michael@0: STDMETHOD(CreateColorContextFromFilename)() PURE; michael@0: michael@0: STDMETHOD(CreateColorContextFromWicColorContext)() PURE; michael@0: michael@0: michael@0: // michael@0: // Creates a bitmap from a DXGI surface with a set of extended properties. michael@0: // michael@0: STDMETHOD(CreateBitmapFromDxgiSurface)() PURE; michael@0: michael@0: michael@0: // michael@0: // Create a new effect, the effect must either be built in or previously registered michael@0: // through ID2D1Factory1::RegisterEffectFromStream or michael@0: // ID2D1Factory1::RegisterEffectFromString. michael@0: // michael@0: STDMETHOD(CreateEffect)() PURE; michael@0: michael@0: michael@0: // michael@0: // A gradient stop collection represents a set of stops in an ideal unit length. michael@0: // This is the source resource for a linear gradient and radial gradient brush. michael@0: // michael@0: STDMETHOD(CreateGradientStopCollection)() PURE; michael@0: michael@0: // michael@0: // Creates an image brush, the input image can be any type of image, including a michael@0: // bitmap, effect and a command list. michael@0: // michael@0: STDMETHOD(CreateImageBrush)() PURE; michael@0: michael@0: STDMETHOD(CreateBitmapBrush)() PURE; michael@0: michael@0: // michael@0: // Creates a new command list. michael@0: // michael@0: STDMETHOD(CreateCommandList)() PURE; michael@0: michael@0: michael@0: // michael@0: // Indicates whether the format is supported by D2D. michael@0: // michael@0: STDMETHOD_(BOOL, IsDxgiFormatSupported)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Indicates whether the buffer precision is supported by D2D. michael@0: // michael@0: STDMETHOD_(BOOL, IsBufferPrecisionSupported)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // This retrieves the local-space bounds in DIPs of the current image using the michael@0: // device context DPI. michael@0: // michael@0: STDMETHOD(GetImageLocalBounds)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // This retrieves the world-space bounds in DIPs of the current image using the michael@0: // device context DPI. michael@0: // michael@0: STDMETHOD(GetImageWorldBounds)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Retrieves the world-space bounds in DIPs of the glyph run using the device michael@0: // context DPI. michael@0: // michael@0: STDMETHOD(GetGlyphRunWorldBounds)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Retrieves the device associated with this device context. michael@0: // michael@0: STDMETHOD_(void, GetDevice)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Sets the target for this device context to point to the given image. The image michael@0: // can be a command list or a bitmap created with the D2D1_BITMAP_OPTIONS_TARGET michael@0: // flag. michael@0: // michael@0: STDMETHOD_(void, SetTarget)() PURE; michael@0: michael@0: michael@0: // michael@0: // Gets the target that this device context is currently pointing to. michael@0: // michael@0: STDMETHOD_(void, GetTarget)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Sets tuning parameters for internal rendering inside the device context. michael@0: // michael@0: STDMETHOD_(void, SetRenderingControls)() PURE; michael@0: michael@0: michael@0: // michael@0: // This retrieves the rendering controls currently selected into the device michael@0: // context. michael@0: // michael@0: STDMETHOD_(void, GetRenderingControls)() CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Changes the primitive blending mode for all of the rendering operations. michael@0: // michael@0: STDMETHOD_(void, SetPrimitiveBlend)() PURE; michael@0: michael@0: michael@0: // michael@0: // Returns the primitive blend currently selected into the device context. michael@0: // michael@0: STDMETHOD_(void, GetPrimitiveBlend)( michael@0: ) CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Changes the units used for all of the rendering operations. michael@0: // michael@0: STDMETHOD_(void, SetUnitMode)() PURE; michael@0: michael@0: michael@0: // michael@0: // Returns the unit mode currently set on the device context. michael@0: // michael@0: STDMETHOD_(void, GetUnitMode)( michael@0: ) CONST PURE; michael@0: michael@0: michael@0: // michael@0: // Draws the glyph run with an extended description to describe the glyphs. michael@0: // michael@0: STDMETHOD_(void, DrawGlyphRun)() PURE; michael@0: michael@0: // michael@0: // Draw an image to the device context. The image represents either a concrete michael@0: // bitmap or the output of an effect graph. michael@0: // michael@0: STDMETHOD_(void, DrawImage)() PURE; michael@0: michael@0: michael@0: // michael@0: // Draw a metafile to the device context. michael@0: // michael@0: STDMETHOD_(void, DrawGdiMetafile)() PURE; michael@0: michael@0: STDMETHOD_(void, DrawBitmap)() PURE; michael@0: michael@0: michael@0: // michael@0: // Push a layer on the device context. michael@0: // michael@0: STDMETHOD_(void, PushLayer)( michael@0: _In_ CONST D2D1_LAYER_PARAMETERS1 *layerParameters, michael@0: _In_opt_ ID2D1Layer *layer michael@0: ) PURE; michael@0: michael@0: using ID2D1RenderTarget::PushLayer; michael@0: michael@0: michael@0: // michael@0: // This indicates that a portion of an effect's input is invalid. This method can michael@0: // be called many times. michael@0: // michael@0: STDMETHOD(InvalidateEffectInputRectangle)() PURE; michael@0: michael@0: michael@0: // michael@0: // Gets the number of invalid ouptut rectangles that have accumulated at the michael@0: // effect. michael@0: // michael@0: STDMETHOD(GetEffectInvalidRectangleCount)() PURE; michael@0: michael@0: michael@0: // michael@0: // Gets the invalid rectangles that are at the output of the effect. michael@0: // michael@0: STDMETHOD(GetEffectInvalidRectangles)() PURE; michael@0: michael@0: michael@0: // michael@0: // Gets the maximum region of each specified input which would be used during a michael@0: // subsequent rendering operation michael@0: // michael@0: STDMETHOD(GetEffectRequiredInputRectangles)() PURE; michael@0: michael@0: michael@0: // michael@0: // Fill using the alpha channel of the supplied opacity mask bitmap. The brush michael@0: // opacity will be modulated by the mask. The render target antialiasing mode must michael@0: // be set to aliased. michael@0: // michael@0: STDMETHOD_(void, FillOpacityMask)() PURE; michael@0: michael@0: michael@0: HRESULT CreateBitmap1() { return S_OK; } michael@0: HRESULT CreateBitmap2() { return S_OK; } michael@0: HRESULT CreateBitmap3() { return S_OK; } michael@0: HRESULT CreateBitmap4() { return S_OK; } michael@0: michael@0: HRESULT CreateImageBrush1() { return S_OK; } michael@0: HRESULT CreateImageBrush2() { return S_OK; } michael@0: michael@0: HRESULT CreateBitmapBrush1() { return S_OK; } michael@0: HRESULT CreateBitmapBrush2() { return S_OK; } michael@0: HRESULT CreateBitmapBrush3() { return S_OK; } michael@0: michael@0: // michael@0: // Draws the output of the effect as an image. michael@0: // michael@0: void DrawImage1() {} michael@0: void DrawImage2() {} michael@0: void DrawImage3() {} michael@0: void DrawImage4() {} michael@0: void DrawImage5() {} michael@0: void DrawImage6() {} michael@0: void DrawImage7() {} michael@0: michael@0: void michael@0: PushLayer( michael@0: CONST D2D1_LAYER_PARAMETERS1 &layerParameters, michael@0: _In_opt_ ID2D1Layer *layer michael@0: ) michael@0: { michael@0: PushLayer(&layerParameters, layer); michael@0: } michael@0: michael@0: void DrawGdiMetafile1() {} michael@0: michael@0: void DrawBitmap1() {} michael@0: void DrawBitmap2() {} michael@0: void DrawBitmap3() {} michael@0: michael@0: void FillOpacityMask1() {} michael@0: void FillOpacityMask2() {} michael@0: michael@0: // michael@0: // Sets tuning parameters for internal rendering inside the device context. michael@0: // michael@0: void SetRenderingControls1() {} michael@0: }; // interface ID2D1DeviceContext michael@0: michael@0: #endif // #ifndef _D2D1_1_H_