diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-07-09 14:41:21 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-09-02 08:38:39 +0200 |
commit | 494b562a69899fdad2d88c1ae2439971acdbee3c (patch) | |
tree | a8bcff1c7ae4b7c082702f38b70e087513324c39 /include/LibreOfficeKit/LibreOfficeKit.hxx | |
parent | sw: disable SearchResultLocatorTest for Windows and MacOS (diff) | |
download | core-494b562a69899fdad2d88c1ae2439971acdbee3c.tar.gz core-494b562a69899fdad2d88c1ae2439971acdbee3c.zip |
indexing: add LOKit API to render the search result into a bitmap
This adds a new LOKit API to render the search result into a bitmap
buffer. It combines the SearchResultLocator to get the location
inside the document of the search result (a series of rectangles)
and the existing LOKit paintTile API to render the result into
a bitmap (byte) buffer.
It also adds a LOKit test to show how the API is used and to render
a search result of a example document.
Change-Id: I4284d90188777fd28158d029daa04151e71022bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118670
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit e1511ce551f27a5560600029193f076fd65ece17)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121110
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'include/LibreOfficeKit/LibreOfficeKit.hxx')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index aab8b94c8aae..ded1cc3da6a9 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -797,6 +797,22 @@ public: mpDoc->pClass->setFreemiumView(mpDoc, nViewId, isFreemium); } + /** + * Render input search result to a bitmap buffer. + * + * @param pSearchResult payload containing the search result data + * @param pBitmapBuffer contains the bitmap; use free to deallocate. + * @param nWidth output bitmap width + * @param nHeight output bitmap height + * @param nByteSize output bitmap byte size + * @return true if successful + */ + bool renderSearchResult(const char* pSearchResult, unsigned char** pBitmapBuffer, + int* pWidth, int* pHeight, size_t* pByteSize) + { + return mpDoc->pClass->renderSearchResult(mpDoc, pSearchResult, pBitmapBuffer, pWidth, pHeight, pByteSize); + } + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; |