aeeef8e255
This patch solves several problems introducing the possibility to specify a row stride bigger than the width (visible pixels) on each image row. Useful in case that we want to align the initial pixel address of each row (if DOC_USE_ALIGNED_PIXELS is defined). This allows us to use some SIMD intrinsics (e.g. SSE2) for some image functions in the future (right now implemented only in the new is_same_image_simd_templ() for is_same_image()). Anyway to avoid breaking some existing code, by default we'll still keep the old behavior: row stride bytes = width bytes (so DOC_USE_ALIGNED_PIXELS is undefined). |
||
---|---|---|
.. | ||
linux | ||
osx | ||
win | ||
CMakeLists.txt | ||
LICENSE.txt | ||
README.md |
Desktop Integration
Windows
On Windows we have to create a COM server in a DLL to provide
thumbnails. The DLL must provide an
IThumbnailProvider
implementation. Our implementation is in
desktop::ThumbnailHandler class, the most
interesting member function is
ThumbnailHandler::GetThumbnail(),
which should return a HBITMAP
of the thumbnail.
Registering the DLL
If you distribute your app in an installer remember to use
regsvr32.exe
to register your DLL which will call your DLL's
DllRegisterServer(), a function that must
create registry keys to associate your file type extension with
your thumbnail handler.
More information in the MSDN.
macOS
On macOS we have to create a QuickLook plugin/extension to display
thumbnails and previews. The plugin is a .qlgenerator
bundle which
can be installed in the ~/Library/QuickLook
,
/System/Library/QuickLook
, or /Library/QuickLook
directories, or
included the in the same app bundle.
macOS pre-10.15,
has a COM-like functionality to load QuickLook plugins: the QuickLook
daemon will use the information in our bundle
Info.plist to know which function to load and call
from our library to create the plugin object. (The function generally
is called QuickLookGeneratorPluginFactory
but can has any name, the
name is specified in a child element of CFPlugInFactories
inside the
Info.plist
file.) Then the created object is used abstractly as a
IUnknown
, and the QLGeneratorInterface
interface is queried to
generate then thumbnails and previews.
We can test our .qlgenerator
without installing it using the
qlmanage
utility.
We target to macOS 10.9, but we should migrate to the new macOS 10.15 API in a near future (or provide both).