summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap
AgeCommit message (Collapse)Author
2021-01-12transparency->alpha in tools::ColorNoel
this just changes the Get/Set methods, the constructor and internal representation of Color is not changed. Change-Id: Idb6e07cc08bbaa5bd55b6bd4b585e648aef507b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-08Remove BitmapColor::GetAlphaNoel
since its implementation is completely wrong - alpha and transparency are not the same thing, they are inverses of each other. Change-Id: Id9e00b8296391befd471345b6c86e0493a9e3f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108964 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-08vcl: followup fix to c8d564094eChris Sherlock
Change-Id: I9dcff185eb3df4c79dcedd27bef488762ea19c3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108959 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-08use more IsTransparentNoel Grandin
Change-Id: I3ef18a2601a51d56614b5da9b56e871bd33ec79e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-08vcl: migrate OutputDevice::DrawShadowBitmapEx() to BitmapShadowFilterChris Sherlock
Change-Id: I5d8b92d91530feed92dcdf2e384448b05eebdb0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108315 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-03Removed duplicated includesAndrea Gelmini
Change-Id: I8d6999d085cdf7eef570d7274f0230b400872c7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108474 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2020-12-29vcl: move local bitmap headers to inc/bitmap directoryChris Sherlock
Change-Id: I72cc28d4df8031e322daa50d79666cabcb6421a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108040 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-12-25Removed duplicated includesAndrea Gelmini
Change-Id: Ie6acee879bea14ea9bf616c9e29c7b6339080a24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108272 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-12-24custom literal for Degree10Noel Grandin
Change-Id: Id13869138a622e62d9ffebf2c89bddccda6aff01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-24vcl: move access functions into appropriate bitmap access filesChris Sherlock
Split class functions into BitmapInfoAccess.cxx, BitmapReadAccess.cxx and BitmapWriteAccess.cxx Split header files into BitmapInfoAccess.hxx and BitmapReadAccess.hxx Change-Id: I7dcbe1d26c5b64d297658a6b809c93d7ad7f053d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108039 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-12-24vcl: merge bitmap.cxx and bitmap3.cxxChris Sherlock
Change-Id: I0bc9cf6d72e15ed9b47c353a3350c6ebd2e8376f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108038 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-12-24vcl: move bitmap files from gdi directory to bitmap directoryChris Sherlock
Change-Id: I9358e2b0fe030d561da6df831c951328b09eab39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108037 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-12-18fix incorrect array access after a removed enum (tdf#138973)Luboš Luňák
c521e614359d236405754134a54e8a05bdb1c44c removed some enum values but didn't remove them from the conversion array. Change-Id: Idf4837c5929feefb11b400fcd1036370534ed26a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107961 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-14loplugin:unusedenumconstantsNoel
Change-Id: I49996ad433409a9189c0f7adc997858e1512f40c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107687 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-10we can use sal_uInt8 instead of intCaolán McNamara
Change-Id: Iefc668fa77ae0cf6ca373360a2512a3776981dbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107514 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-10use size_t instead of sal_uLongCaolán McNamara
Change-Id: Id0b5f95716ba0bd14f634d927ffb7a71c0bc5767 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107505 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-10std::vector seems a more natural containerCaolán McNamara
Change-Id: I5256e05a6f3c4853a81d9c4a94bbcbf27f0a3ae9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107504 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-10tdf#138450 BitmapEx.Replace() is not workingCaolán McNamara
since... commit abd42bdc86904d1b310e8298393c887e0c195499 Date: Thu Nov 12 14:50:16 2020 +0200 tools::Long->sal_Int32 in vcl filters Change-Id: I4a74416547f35a9b5b3fe606de6938245d3ec6c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107503 Tested-by: Jenkins Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-22tdf#123936 Formatting files in module vcl with clang-formatPhilipp Hofer
Change-Id: Ia162ad5b7499c0ddfdbfca59ae76b81335ce2d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105728 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-11-13tools::Long->sal_Int32 in vcl filtersNoel
Change-Id: I39cf98d1dc3f04ca91856f125b0a5b4fe1dfe237 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11convert more long -> tools::LongNoel
found by grepping and changed by hand. Change-Id: I3c720859dba430fde3abc76c6c5cb58269efaf4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11make tools::Long 64-bit on Windows platformNoel Grandin
This is only for the 64-bit windows platform. I don't see the point in messing with the 32-bit platforms, they are (a) become more and more rare (b) unlikely to even have enough available process memory to load extremely large calc spreadsheets The primary problem we are addressing here is bringing Windows-64bit up to same capability as Linux-64bit when it comes to handling very large spreadsheets, which is caused by things like tools::Rectangle using "long", which means that all the work done to make Libreoffice on 64-bit Linux capable of loading large spreadsheets is useless on Windows, where long is 32-bit. The operator<< for tools::Rectangle needs to be inside the tools namespace because of an interaction with the cppunit printing template stuff that I don't understand. SalPoint changed to use sal_Int32, since it needs to be the same definition as the Windows POINT structure. Change-Id: Iab6f1af88847b6c8d46995e8ceda3f82b6722ff7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-05N8BitTcMask is unusedNoel
since commit 77809fba7d4bf5e0b604ffa3937c18d5530c2d56 Author: Luboš Luňák <l.lunak@collabora.com> Date: Fri Oct 9 19:28:49 2020 +0200 implement ImplFastBitmapConversion() for 8bit gray source Change-Id: I730aef10c1705ae6d3141014228cf79b8bfa3c63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105305 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-29ofz#26708: Direct-leakCaolán McNamara
since... commit cd8dd48bf89d800c012afb04b16281ed8b261de9 Date: Tue Aug 21 16:07:55 2018 +0200 tdf#119282 Area tab, Pattern color change Change-Id: If0c988f7532786a4089edef39929f924d8e2ec2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104976 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-28convert some more long -> tools::LongNoel
grepping for stuff in template params this time Change-Id: Ia37bfd85480b3a72c3c465489581d56ad8dde851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21new tools::Degree10 strong typedefNoel Grandin
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-19use tools::Long in vclNoel
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: If7fbb25037343e18081a8ee7064840d75e9a45a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104010 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-01loplugin:reducevarscope in vclNoel
Change-Id: I768aa9bd87913bc20351fb631a6326fe01f777b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103748 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-15remove constructor with plain Bitmap from Graphic, use BitmapExTomaž Vajngerl
Change-Id: Ie429a10a8f54c6779d437ee4bc75a5ea0c427848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100727 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-08-04loplugin:flatten in vclNoel Grandin
Change-Id: I271cc67ecf34acbf0edbda960e33315fb6a1f9dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-23Describe intended usageMike Kaganski
Change-Id: Id2314304a42f762553ac6bb1d15fe80bee653b25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99207 Tested-by: Tor Lillqvist <tml@collabora.com> Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-07-10prefer 8bit bitmap masks to 1bpp masksLuboš Luňák
It's much simpler and more performant to work with 8bpp bytes rather than fiddle with 1bpp bits, and the memory savings don't really matter nowadays. E.g. the soft edges feature performs much worse when operating on 1bpp bitmaps (tdf#134237). I've looked and it seems nothing in LO code actually requires bitmap masks to really be 1bpp. As a next step we could perhaps also leave antiquity and embrace the past by dropping 1bpp masks entirely and using just alpha masks. The change also moves the workaround for #i75531, it was breaking CppunitTest_vcl_svm_test and X11-related hacks belong to the X11 code (especially with the X11 backend becoming more and more niche). Change-Id: I7848f06c8b83bbad2ea35f17f2b65855f8d1f456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97839 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-07-05add generateStripRanges and use that in StackBlur and ScaleSuperTomaž Vajngerl
generateStripRanges divides a range into equally long stripes that is useful for defining scanlines for a thread. This is used in the BitmapFilterStackBlur and BitmapScaleSuperFilter as they are running using a thread pool. Change-Id: Ifb9f70dea3b0233e6aa30ccf20187a2ff58fd5a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97725 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-07-03compute bitmap checksum for proper amount of bytes and bitsLuboš Luňák
Change-Id: Ifee6fae39dd13a36c72674550cd48dc35fdd71ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97761 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: vclStephan Bergmann
Change-Id: I7559ab5c98a22e315549b5dfc651e937697cac22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97742 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-01optimize Bitmap::Erase() for Skia by delaying the erase (tdf#134363)Luboš Luňák
Tdf#134363 causes OutputDevice::DrawTransformBitmapExDirect() to create a huge 1bpp bitmap as mask, and Skia code then tries to convert all the bits to a format Skia would understand. Which is wasteful, as SkShader with the color given will do the same task much more efficiently. Change-Id: If0bba16f56fed9c3720be801b25a1e703054ed8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97488 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-07-01avoid Bitmap::Erase() duplicating codeLuboš Luňák
Change-Id: I68d388175355fe1fcf5acc300730e8473fa559fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97486 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-07-01do not use scanline padding for computing vcl bitmap checksumLuboš Luňák
This idea of checksums is still kind of broken (different RGB order or different scaling algorithm make the checksum different between different VCL backends). But at least don't include undefined garbage. Change-Id: Ia03bb960c50d3da51dad9b37de7a4f709d8ee206 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97484 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-06-30faster conversions from 1bpp mask bitmaps for Skia/GLLuboš Luňák
Tdf#134363 leads to creating a large 1bpp bitmap, and this conversion takes ages. Change-Id: If596d55829698df54f1b205a5f9a5d68cbea40fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97489 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-06-30differentiate between 8bit and any-bit grey palette (tdf#121120)Luboš Luňák
Only the grey palette with 256 colors means that pixel values map directly to color values. Tdf#121120 has an image with 2-bit palette where color index 1 is (255,255,255), but that means the pixel value 1 cannot be just treated as color. Change-Id: Ifbd953af7f291e4fb8032ea0f4c33c0514770856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97283 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-06-30Reduce code duplicationMike Kaganski
Change-Id: Ia5526e61c8dd632fbc5eae2d5c02b46b928f4fa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97430 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-06-29tdf#39593 reduce copy/paste in BitmapScaleSuperFilterMesut Çifci
Change-Id: I1f6387d3ff931b0c885e0cb8ee5b99c880a1484e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94137 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-03vcl: allow BitmapFastScaleFilter for 1xN or Nx1 cases.Mark Hung
Limiting both side to be at least 2px is not necessary, so check for 1px and add test cases. Change-Id: I3c6f6ed5c8842bf24e7983bd8ed27fb8bb9568c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92117 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-05-30Add TODOsMike Kaganski
Change-Id: I6ab5840487f7676d5070ea4be00272f13dd47f96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95162 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-29Allow dumping Bitmap in its dtor in dbgutil buildsMike Kaganski
Change-Id: I81ec9d1c16a07c6c56e51e7e334fb692b963e1e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95054 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-21vcl: change bitmap::loadFromName to be like BitmapEx const.Tomaž Vajngerl
Change-Id: Icb055c55b261514a91d76ce2dcb74862152fca56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94603 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-13Use statics initializers instead of checksMike Kaganski
Change-Id: I8c474a35e3c4b9a202e4003c6b895f18ac88fb09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94001 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-13tdf#49247: draw soft edgesMike Kaganski
This factors out the common code for blurring used both in glow and soft edges into ProcessAndBlurAlphaMask. Also this reverts commit a98bdbae459ad7341bf7f484c402e77e4062cd16, since its use was removed from VclPixelProcessor2D. Change-Id: Icd7fdb06bef3932ff3b9ce7e283b515b15d246a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94087 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-08Fix typoAndrea Gelmini
Change-Id: I8c3d4d467aebbcb1014edb78c21a0e3a58a1884c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93683 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>