cinder::msw Namespace Reference

Classes

class  ComOStream
 Wraps a cinder::OStream with a COM IStream. More...
class  basic_debugbuf
class  basic_dostream

Typedefs

typedef basic_dostream< char > dostream
typedef basic_dostream< wchar_t > wdostream

Functions

Surface8u convertHBitmap (HBITMAP hbitmap)
Vec2f toVec2f (const ::POINTFX &p)
 Converts a Win32 POINTFX fixed point point to a cinder::Vec2f.
void ComDelete (void *p)
 A free function designed to interact with makeComShared.
template<typename T >
std::shared_ptr< T > makeComShared (T *p)
 Creates a shared_ptr whose deleter will properly decrement the reference count of a COM object.
void initializeCom (DWORD params=COINIT_APARTMENTTHREADED|COINIT_DISABLE_OLE1DDE)
 Initializes COM on this thread. Uses Boost's thread local storage to prevent multiple initializations per thread.
Surface8u convertGdiplusBitmap (Gdiplus::Bitmap &bitmap)
Gdiplus::PixelFormat surfaceChannelOrderToGdiplusPixelFormat (const SurfaceChannelOrder &sco, bool premultiplied)
void gdiplusPixelFormatToSurfaceChannelOrder (Gdiplus::PixelFormat format, SurfaceChannelOrder *resultChannelOrder, bool *resultPremultiplied)
Gdiplus::Bitmap * createGdiplusBitmap (const Surface8u &surface)

Variables

boost::thread_specific_ptr
< ComInitializer > 
threadComInitializer

Typedef Documentation


Function Documentation

Surface8u cinder::msw::convertHBitmap ( HBITMAP  hbitmap  ) 

Converts a Win32 HBITMAP to a cinder::Surface8u

Note:
Currently always copies the alpha channel
Vec2f cinder::msw::toVec2f ( const ::POINTFX &  p  ) 

Converts a Win32 POINTFX fixed point point to a cinder::Vec2f.

void cinder::msw::ComDelete ( void *  p  ) 

A free function designed to interact with makeComShared.

template<typename T >
std::shared_ptr<T> cinder::msw::makeComShared ( T *  p  ) 

Creates a shared_ptr whose deleter will properly decrement the reference count of a COM object.

void cinder::msw::initializeCom ( DWORD  params = COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE  ) 

Initializes COM on this thread. Uses Boost's thread local storage to prevent multiple initializations per thread.

Surface8u cinder::msw::convertGdiplusBitmap ( Gdiplus::Bitmap &  bitmap  ) 

Copies the contents of a Gdiplus::Bitmap to a new Surface8u.

Gdiplus::PixelFormat cinder::msw::surfaceChannelOrderToGdiplusPixelFormat ( const SurfaceChannelOrder &  sco,
bool  premultiplied 
)

Translates a cinder::SurfaceChannelOrder into a Gdiplus::PixelFormat. Supports BGR, BGRX, BGRA. Returns PixelFormatUndefined on failure

void cinder::msw::gdiplusPixelFormatToSurfaceChannelOrder ( Gdiplus::PixelFormat  format,
SurfaceChannelOrder *  resultChannelOrder,
bool *  resultPremultiplied 
)

Translates a Gdiplus::PixelFormat format to a a SurfaceChannelOrder. Sets resultPremultiplied based on whether format is premultiplied.

Gdiplus::Bitmap * cinder::msw::createGdiplusBitmap ( const Surface8u &  surface  ) 

Creates a Gdiplus::Bitmap which wraps a Surface8u. Requires surface to confrom to SurfaceConstraintsGdiPlus and throw SurfaceConstraintsExc if it does not. Caller is responsible for deleting the result.


Variable Documentation

boost::thread_specific_ptr<ComInitializer> cinder::msw::threadComInitializer