summaryrefslogtreecommitdiff
path: root/include/vcl/BitmapTools.hxx
AgeCommit message (Collapse)Author
2019-11-21These functions don't need to be VCL_DLLPUBLICStephan Bergmann
They were exported with 86ea64f216819696cd86d1926aff0a138ace2baf "Support for native 32bit Bitmap in VCL and SVP (cairo) backend" but appear to only be used within Library_vcl. Change-Id: I03595c8345b289676e6260e7bd88b6b146ac002d Reviewed-on: https://gerrit.libreoffice.org/83385 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-22loplugin:constmethod in vclNoel Grandin
Change-Id: I20545527b117c9562b91076b748fb3e2659d2497 Reviewed-on: https://gerrit.libreoffice.org/77944 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-17remove or change salbtype.hxx includesTomaž Vajngerl
Change-Id: Ibd28b8fa92e98ebeb482a9081fbeae24defe4adb Reviewed-on: https://gerrit.libreoffice.org/70826 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-09remove some usages of BitmapColor outside of VCLTomaž Vajngerl
You get BitmapColor only from reading pixels from a Bitmap and we want to avoid usage of Bitmap outside of VCL (and use BitmapEx as the alternative which will eventually replace Bitmap). Change-Id: Iddfa3ef739bfdd4dce5fb47fd9f67a5a36f3388b Reviewed-on: https://gerrit.libreoffice.org/70447 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-03Support for native 32bit Bitmap in VCL and SVP (cairo) backendTomaž Vajngerl
This adds basic support for 32bit bitmaps for the SVP backend. For other backends the support is disabled for now as we need to add it for each backend separately and enable support. When this patch is applied it is possible to a Bitmap with bit count 32, but currently no input filter uses this with the exception of the new PngImageReader(libpng based), which is used only for the icons. For a general support more things need to be implemented and tested: - conversion back and fourth between 32-bit and 24-bit + 8bit alpha (or other supported pairs) - 'raw' export of the bitmap needs to be handeled properly (like in SVM import/export) so it creates the correct image. - input filters need to be checked and converted if this is necessary - look for possible bugs when drawing transparent bitmaps - check of UNO API Change-Id: I7a7be0e6134dfdd9a7aeaef897131bb6e710ae7e Reviewed-on: https://gerrit.libreoffice.org/69289 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-12-05Revert "Compute (un-)premultiply_table at compile time"Stephan Bergmann
This reverts commit 644188bf7f3a07222f2b58a3794348197fb8ad24. It has been found to cause compilation failure ("vcl/source/bitmap/BitmapTools.cxx(1078): error C2131: expression did not evaluate to a constant") with Visual Studio 2017 version 15.9, as discussed in the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2018-December/081500.html> "Windows build failure - C2131: expression did not evaluate to a constant" (and Mike thankfully filed a bug upstream, <https://developercommunity.visualstudio.com/content/problem/398218/ c2131-error-with-stdarray-and-stdmake-integer-sequ.html>). Also, Jenkins node tb39 which runs the "Gerrit Windows" sub-job of Jenkins' "Gerrit for master" job apparently has such a Visual Studio 2017 version 15.9 installed, so keeps failing that job. Change-Id: I87d25863f2e07474fbb2df3c8f72cd2bcc89582e Reviewed-on: https://gerrit.libreoffice.org/64618 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-03Compute (un-)premultiply_table at compile timeStephan Bergmann
Change-Id: I34e624fcd5d11d02c26e775f5acdddec1fca9d87 Reviewed-on: https://gerrit.libreoffice.org/64428 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-02use same [un]premultiplyCaolán McNamara
Change-Id: Idd1ca1243b64a9ec606382a0895e11376a2ec186 Reviewed-on: https://gerrit.libreoffice.org/64406 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-21tdf#42949 Fix IWYU warnings in include/vcl/[B-E]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iabe571aa8f00492902c499094bea8365a3e17fca Reviewed-on: https://gerrit.libreoffice.org/63623 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-09-14loplugin:constfields in vclNoel Grandin
Change-Id: I1072642be4fdfa720e61f2d7bad3c2701eb81610 Reviewed-on: https://gerrit.libreoffice.org/60430 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-21tdf#119282 Area tab, Pattern color changeNoel Grandin
regression from commit ccd316d1cb310734848bd20244f509024b549b8c use VirtualDevice in createHistorical8x8FromArray Move the code inside vcl so we don't need to expose BitmapWriteAccess. I tried to detect this thing by counting the number of independent colors in the bitmap, but that didn't work. It is used from more than one place, and appears to be very determined that it needs a 2-color palette to work properly. Change-Id: Id11dd9ea78e5e522a6083d6a799e801cac81fd5b Reviewed-on: https://gerrit.libreoffice.org/59331 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
2018-04-17loplugin:constparamsNoel Grandin
Change-Id: I3d1b88dbd0ff73fddc08d52f50e0efb42daab89b Reviewed-on: https://gerrit.libreoffice.org/52756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-05ofz#7365 Integer overflowCaolán McNamara
Change-Id: If56db771976a82399dc49fd90845e6569cbd2e8e Reviewed-on: https://gerrit.libreoffice.org/52400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-28tdf#116646 Slideshows with transitions page swap rendering issuesNoel Grandin
regression from commit 5b75a1697250d8b2b6003c37067f39270a5ad828 move cairo extract bitmap code from canvas to vcl Change-Id: Ic8d7cd9d54010ae272073877da18a985e931e22a Reviewed-on: https://gerrit.libreoffice.org/52005 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-19move bitmap copy code from CanvasBitmapHelper to vclNoel Grandin
part of making GetAlpha/GetMask an internal detail of vcl Change-Id: Ie1740df3d6435d9f0f2de3297e7f224d2c6b3cc5 Reviewed-on: https://gerrit.libreoffice.org/51436 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-16move cairo extract bitmap code from canvas to vclNoel Grandin
part of making GetMask/GetAlpha an internal detail of vcl Change-Id: I45c2e9fdae08d7f444a64e8e04a6f65bb525cbd1 Reviewed-on: https://gerrit.libreoffice.org/51417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-16move framework/toolkit use of BitmapEx::GetMask inside vclNoel Grandin
Change-Id: I2a942377d6e9b8b09673e5ad2804e0e7fb2bb943 Reviewed-on: https://gerrit.libreoffice.org/51387 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-15move emf code to vclNoel Grandin
part of making ScopedWriteAccess an internal detail of vcl Change-Id: If66de7c248d442a860508bbddf68e390983da240 Reviewed-on: https://gerrit.libreoffice.org/51309 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-03-15move some GDI import code from svx to vclNoel Grandin
part of making ScopedWriteAccess an internal detail of vcl Change-Id: I916f2ca05c9d7c17b62c91e113df6d8454bb4351 Reviewed-on: https://gerrit.libreoffice.org/51283 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-14loplugin:unusedmethodsNoel Grandin
Change-Id: I7c780be3e2740fd9b03c39ebe16935d61caf4f7e Reviewed-on: https://gerrit.libreoffice.org/51257 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-13make transformBitmap code from canvas to vclNoel Grandin
part of making ScopedWriteAccess an internal detail of vcl Change-Id: Ida03bc73fe746cde97f6fcb5cde2f066b63d92e9 Reviewed-on: https://gerrit.libreoffice.org/51216 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-10move canvas helper code into vclNoel Grandin
part of making BitmapWriteAccess an internal feature of vcl Change-Id: Iee94f47e120d82a23e57342952d04e9b2792cd1a Reviewed-on: https://gerrit.libreoffice.org/50999 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-01tdf#116001 Incorrect Colors in Chart Wall AreaNoel Grandin
regression from commit b10c7022f1be6e4825269bd5872575b5b53744ef "use RawBitmap in BPixelRasterToBitmapEx" we need to implement alpha support in vcl::bitmap::CreateFromData Change-Id: I68bebbe1dd15e3bb04de312309c1631d6bb7fe2d Reviewed-on: https://gerrit.libreoffice.org/50556 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-15ofz#6372 fix bitmap decoding of pattern in LwpBackgroundStuffNoel Grandin
after commit b90e098a354323b635bab3ee8f9c79deb1e734fe use BitmapEx in LwpBackgroundStuff <caolan> maybe the lotuswordpro original stride is really 4 after all (as a common stride), with the first byte on each line containing the 8bits for each row The original code in GetPattern() looked pretty dodgy since it was copying 32-bytes into an 8 byte buffer. Assume that the reversing part is right, and that the format is really a 1bit packed 8x8 image. Also fix the decoding of such a image in CreateFromData to assume packed format, which is more predictable. Also fix the bug in createDefaultCross_3x3 which changing the assert revealed. Change-Id: I7196ae601429bbe0f842399df61c8b858e022d3e Reviewed-on: https://gerrit.libreoffice.org/49808 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-15move cairo surface code from canvas to BitmapToolsNoel Grandin
part of making Bitmap an implementation detail of vcl/ Change-Id: Ic4b8d114a8091041374a083b3b7ca2fa68757ab1 Reviewed-on: https://gerrit.libreoffice.org/49719 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-14use RawBitmap in PSDReaderNoel Grandin
part of making Bitmap an internal detail of vcl Change-Id: Icdb7a7474b19e304950fcf75ef2b85006b7755e9 Reviewed-on: https://gerrit.libreoffice.org/49664 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-14use Color, not BitmapColor in RawBitmapNoel Grandin
because we don't want palette images Change-Id: If087e51503714bf8474ae320381f80196092ceb0 Reviewed-on: https://gerrit.libreoffice.org/49662 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-13use RawBitmap and BitmapEx in DffPropertyReaderNoel Grandin
part of making Bitmap an internal feature of vcl Change-Id: I2945005b9070bc13844c02f8ecaa349920d151fe Reviewed-on: https://gerrit.libreoffice.org/49579 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-12fix pixel address calculation in RawBitmapNoel Grandin
Change-Id: I42476a8049330ff02c555ecba49b49f3cf012086 Reviewed-on: https://gerrit.libreoffice.org/49599 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-10use RawBitmap and BitmapEx in icgm filterNoel Grandin
Change-Id: Icaffda666c27f733c0d490905e91a68b72073bcb Reviewed-on: https://gerrit.libreoffice.org/49502 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-07move Bitmap::SetToData to BitmapToolsNoel Grandin
Change-Id: I0fc62d29d2044c2aa8af3742d4aeb9d782793713 Reviewed-on: https://gerrit.libreoffice.org/49280 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-11-29loplugin:countusersofdefaultparams in include/oox..vclNoel Grandin
Change-Id: If831bce4cd1fe2c5233159b31c239b813629e0de Reviewed-on: https://gerrit.libreoffice.org/45420 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-27loadFromResource is now unusedCaolán McNamara
Change-Id: Ibea3defdf8d2642c4ba523db7f4fc8fbc2473488
2016-12-19vcl: separate ImplImageTree - ImageTree singleton and public ifaceTomaž Vajngerl
ImplImageTree was used outside of VCL which is not consistent with the name and the header also contains a lot of implementation detail. This separates the implementation to ImplImageTree and the public interface and singleton to ImageTree only. Change-Id: I3a26444f0f6971a6b1d83472e9cef19c93192d3e Reviewed-on: https://gerrit.libreoffice.org/32134 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-12-09split markers for galaxy theme, when scaling use splitted markersTomaž Vajngerl
For markers (resize markers, anchors,...) we contain them all in one image atlas. This was generally done because of resource limitiations in Windows 95/98 which aren't a problem anymore in present systems. This is however problematic in HiDPI as we scale the image and the coordinates of aren't correct anymore. Another problem is that it uses its own cache instead of common cache in ImplImageTree. So this commit extracts all the markers into its own images for galaxy theme and uses them when we scale. In the future when we extracted all the markers to its own images for all icon themes we can remvoe the old code with the image atlas. Change-Id: Ibee181b529d30e20050df8cd396d338bd53532c0
2016-10-29vcl: add bitmap::loadFromResource with additional flagsTomaž Vajngerl
Sometimes we want to surpress automatic scaling and converting for dark theme. This adds a loadFromResource function with additional flags which makes this possible. Change-Id: I893cee82ad6942644755f0c5b772fb5f073bbf00 Reviewed-on: https://gerrit.libreoffice.org/30341 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-29tdf#51733 support SVG icon theme, disk cache and scaling / darkenTomaž Vajngerl
Also resolves tdf#92248 This extends icon name resolving so that is in addition tries to find an icon with the "svg" extension and load that instead of stated (mostly "png") extension. If the filename extension is "svg" we load the icon with the SVG filter instead. This also adds icon scaling and conversion for HiDPI or when a dark theme is wanted. If the SVG icon is available, we render it at a higher resolution instead of scaling As loading of SVG icons can be computatunally expensive, a icon disk cache was added. This saves the rendered SVG as a PNG image into the "cache" folder. The same caching is also used for HiDPI and dark theme converted icons so we don't always scale or convert the icons. In addition some style changes and DRY fixes were made to the ImplImageTree source code. Change-Id: I9e421395a342ffe8da9facea7ea06e5db2778b26 Reviewed-on: https://gerrit.libreoffice.org/30339 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-02-26loplugin:unuseddefaultparms in include/vcl (part2)Noel Grandin
including a fix for a rather glaring bug in BitmapTools.cxx Change-Id: Id9db990b993cfeea9039c5fbaaa91996adeae22a Reviewed-on: https://gerrit.libreoffice.org/22713 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-08support to load SVG images when loading from Image resourceTomaž Vajngerl
Change-Id: Ieda1c334d8d995c774381c52fa1d9aa11751c5ef