Harlinn.Windows 0.1
|
Represents a bitmap that can be used as a surface for a DeviceContext or mapped into system memory, and can contain additional color context information. More...
#include <HWGraphics.h>
Public Types | |
using | Base = Bitmap |
![]() | |
typedef IUnknown | InterfaceType |
Public Member Functions | |
void | GetColorContext (ID2D1ColorContext **colorContext) const |
Retrieves the color context information associated with the bitmap. | |
ColorContext | GetColorContext () const |
D2D1_BITMAP_OPTIONS | GetOptions () const |
Retrieves the bitmap options used when creating the API. | |
void | GetSurface (IDXGISurface **dxgiSurface) const |
Retrieves the DXGI surface from the corresponding bitmap, if the bitmap was created from a device derived from a D3D device. | |
DXGI::Surface | GetSurface () const |
void | Map (D2D1_MAP_OPTIONS options, D2D1_MAPPED_RECT *mappedRect) const |
Maps the given bitmap into memory. The bitmap must have been created with the D2D1_BITMAP_OPTIONS_CPU_READ flag. | |
void | Unmap () const |
Unmaps the given bitmap from memory. | |
![]() | |
D2D1_SIZE_F | GetSize () const |
D2D1_SIZE_U | GetPixelSize () const |
D2D1_PIXEL_FORMAT | GetPixelFormat () const |
void | GetDpi (FLOAT *dpiX, FLOAT *dpiY) const |
void | GetDpi (FLOAT &dpiX, FLOAT &dpiY) const |
D2D1_SIZE_F | GetDpi () const |
void | CopyFromBitmap (const D2D1_POINT_2U *destPoint, ID2D1Bitmap *bitmap, const D2D1_RECT_U *srcRect) const |
void | CopyFromRenderTarget (const D2D1_POINT_2U *destPoint, ID2D1RenderTarget *renderTarget, const D2D1_RECT_U *srcRect) const |
void | CopyFromMemory (const D2D1_RECT_U *dstRect, const void *srcData, UINT32 pitch) const |
![]() | |
template<typename T = Factory> requires std::is_base_of_v< Factory, T> | |
T | GetFactory () |
![]() | |
constexpr | Unknown () noexcept |
Unknown (IUnknown *unknown, bool addref=false) noexcept | |
Unknown (REFIID iid, const Unknown &unknown, bool throwIfNoInterface=true) | |
Unknown (const Unknown &other) noexcept | |
Unknown (Unknown &&other) noexcept | |
~Unknown () noexcept | |
constexpr | operator bool () const noexcept |
Unknown & | operator= (const Unknown &other) noexcept |
Unknown & | operator= (Unknown &&other) noexcept |
void | swap (Unknown &other) noexcept |
void | ResetPtr (IUnknown *other=nullptr, bool addRef=false) noexcept |
Unknown & | operator= (nullptr_t) |
IUnknown * | Detach () |
template<typename T > requires std::is_base_of_v<Unknown, T > | |
T | As () const |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
bool | Is () const noexcept |
template<typename T > requires std::is_base_of_v<IUnknown, T> | |
ComPtr< T > | As () const |
template<typename T > requires std::is_base_of_v<IUnknown, T> | |
bool | Is () const noexcept |
This function can be used to detect if an object supports a particular COM interface derived from IUnknown. | |
template<typename T = IUnknown> | |
T * | GetInterfacePointer () const noexcept |
bool | QueryInterface (REFIID riid, void **itf) const |
Queries a COM object for a pointer to one of its interface; identifying the interface by a reference to its interface identifier (IID). If the COM object implements the interface, then it returns a pointer to that interface after calling IUnknown::AddRef on it. | |
template<typename T > requires std::is_base_of_v<IUnknown, T> | |
bool | QueryInterface (T **itf) const |
constexpr bool | operator== (const Unknown &other) const noexcept |
constexpr bool | operator!= (const Unknown &other) const noexcept |
constexpr bool | operator== (const IUnknown *other) const noexcept |
constexpr bool | operator!= (const IUnknown *other) const noexcept |
Additional Inherited Members | |
![]() | |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromClassId (const CLSID &clsid, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromClassId (const wchar_t *clsid, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromClassId (const WideString &clsid, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromProgId (const wchar_t *progId, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromProgId (const WideString &progId, DWORD classContext=CLSCTX_INPROC_SERVER) |
template<typename T > requires std::is_base_of_v<Unknown, T> | |
static T | CoCreateInstanceFromDll (const ModuleHandle &dll, const CLSID &clsid) |
![]() | |
IUnknown * | unknown_ |
Represents a bitmap that can be used as a surface for a DeviceContext or mapped into system memory, and can contain additional color context information.
|
inline |
|
inline |
Retrieves the color context information associated with the bitmap.
colorContext | When this method returns, contains the address of a pointer to the color context interface associated with the bitmap. |
|
inline |
Retrieves the bitmap options used when creating the API.
|
inline |
|
inline |
Retrieves the DXGI surface from the corresponding bitmap, if the bitmap was created from a device derived from a D3D device.
dxgiSurface | The underlying DXGI surface for the bitmap. |
The bitmap used must have been created from a DXGI surface render target, a derived render target, or a device context created from an ID2D1Device.
The returned surface can be used with Microsoft Direct3D or any other API that interoperates with shared surfaces. The application must transitively ensure that the surface is usable on the Direct3D device that is used in this context. For example, if using the surface with Direct2D then the Direct2D render target must have been created through Graphics::Factory::CreateDxgiSurfaceRenderTarget or on a device context created on the same device.
|
inline |
Maps the given bitmap into memory. The bitmap must have been created with the D2D1_BITMAP_OPTIONS_CPU_READ flag.
options | The options used in mapping the bitmap into memory. |
mappedRect | When this method returns, contains a reference to the rectangle that is mapped into memory. |
You can't use bitmaps for some purposes while mapped. Particularly, the Bitmap::CopyFromBitmap method doesn't work if either the source or destination bitmap is mapped.
The bitmap must have been created with the D2D1_BITMAP_OPTIONS_CPU_READ flag specified.
|
inline |
Unmaps the given bitmap from memory.
Any memory returned from the Map call is now invalid and may be reclaimed by the operating system or used for other purposes.
The bitmap must have been previously mapped.