[Libreoffice-commits] core.git: vcl/workben

Caolán McNamara caolanm at redhat.com
Fri Jun 24 08:39:00 UTC 2016


 vcl/workben/fftester.cxx |   80 +++++++++++++++++++++++++++++++++--------------
 1 file changed, 57 insertions(+), 23 deletions(-)

New commits:
commit 17189e8e63254dbe5e4c9c755a4817664e4ee0d5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 24 09:37:34 2016 +0100

    tweak fftester to upscale everything to 24bits...
    
    to flush out color index problems
    
    Change-Id: Ifc7a56e0938eb10d82dc880e94ac09062d239ce1

diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 13acc9a..dda8367 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -106,42 +106,54 @@ try_again:
                 GDIMetaFile aGDIMetaFile;
                 SvFileStream aFileStream(out, StreamMode::READ);
                 ret = (int) ReadWindowMetafile(aFileStream, aGDIMetaFile);
+                BitmapEx aTarget;
+                aGDIMetaFile.CreateThumbnail(aTarget);
             }
             else if (strcmp(argv[2], "jpg") == 0)
             {
                 Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
                 ret = (int) ImportJPEG(aFileStream, aGraphic, nullptr, GraphicFilterImportFlags::NONE);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "gif") == 0)
             {
                 SvFileStream aFileStream(out, StreamMode::READ);
                 Graphic aGraphic;
                 ret = (int) ImportGIF(aFileStream, aGraphic);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "xbm") == 0)
             {
                 Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
                 ret = (int) ImportXBM(aFileStream, aGraphic);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "xpm") == 0)
             {
                 Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
                 ret = (int) ImportXPM(aFileStream, aGraphic);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "png") == 0)
             {
                 SvFileStream aFileStream(out, StreamMode::READ);
                 vcl::PNGReader aReader(aFileStream);
-                aReader.Read();
+                BitmapEx aTarget = aReader.Read();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "bmp") == 0)
             {
                 Bitmap aTarget;
                 SvFileStream aFileStream(out, StreamMode::READ);
                 ret = (int) ReadDIB(aTarget, aFileStream, true);
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "svm") == 0)
             {
@@ -160,9 +172,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "dxf") == 0)
             {
@@ -175,9 +189,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "met") == 0)
             {
@@ -190,9 +206,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if ((strcmp(argv[2], "pbm") == 0) || strcmp(argv[2], "ppm") == 0)
             {
@@ -205,9 +223,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "psd") == 0)
             {
@@ -220,9 +240,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "eps") == 0)
             {
@@ -235,9 +257,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "pct") == 0)
             {
@@ -250,9 +274,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "pcx") == 0)
             {
@@ -265,9 +291,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "ras") == 0)
             {
@@ -280,9 +308,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "tga") == 0)
             {
@@ -295,9 +325,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if (strcmp(argv[2], "tif") == 0)
             {
@@ -310,9 +342,11 @@ try_again:
                         aLibrary.getFunctionSymbol("GraphicImport"));
                     aLibrary.release();
                 }
-                Graphic aTarget;
+                Graphic aGraphic;
                 SvFileStream aFileStream(out, StreamMode::READ);
-                ret = (int) (*pfnImport)(aFileStream, aTarget, nullptr);
+                ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
+                BitmapEx aTarget = aGraphic.GetBitmapEx();
+                aTarget.Convert(BMP_CONVERSION_24BIT);
             }
             else if ( (strcmp(argv[2], "doc") == 0) ||
                       (strcmp(argv[2], "ww8") == 0) ||


More information about the Libreoffice-commits mailing list