diff --git a/graf2d/asimage/src/TASImage.cxx b/graf2d/asimage/src/TASImage.cxx index b6a884d018e76..86f4fb56692cd 100644 --- a/graf2d/asimage/src/TASImage.cxx +++ b/graf2d/asimage/src/TASImage.cxx @@ -1595,9 +1595,6 @@ void TASImage::Paint(Option_t *option) min, max, ndiv, "+L"); } return; - } else if (ps->InheritsFrom("TPDF")) { - Warning("Paint", "PDF not implemented yet"); - return; } else if (ps->InheritsFrom("TSVG")) { paint_as_png = kTRUE; } diff --git a/graf2d/gpad/test/CMakeLists.txt b/graf2d/gpad/test/CMakeLists.txt index 58a34d2ec62d1..92ebf82d71131 100644 --- a/graf2d/gpad/test/CMakeLists.txt +++ b/graf2d/gpad/test/CMakeLists.txt @@ -7,3 +7,7 @@ ROOT_ADD_GTEST(TRatioPlot ratioplot.cxx LIBRARIES Gpad) ROOT_ADD_GTEST(TPad pdftitle.cxx LIBRARIES Gpad) ROOT_ADD_GTEST(TPDF pdfurl.cxx LIBRARIES Gpad) + +if(asimage) + ROOT_ADD_GTEST(TASImagePDF tasimage_pdf.cxx LIBRARIES Gpad ASImage ZLIB::ZLIB) +endif() diff --git a/graf2d/gpad/test/tasimage_pdf.cxx b/graf2d/gpad/test/tasimage_pdf.cxx new file mode 100644 index 0000000000000..6bb1d8da7cf9a --- /dev/null +++ b/graf2d/gpad/test/tasimage_pdf.cxx @@ -0,0 +1,159 @@ +#include "gtest/gtest.h" + +#include "TCanvas.h" +#include "TImage.h" +#include "TString.h" +#include "TSystem.h" + +#include +#include +#include +#include + +namespace { + +// Read a binary file fully into a string. +std::string SlurpFile(const TString &path) +{ + std::ifstream in(path.Data(), std::ios::binary); + std::string data((std::istreambuf_iterator(in)), std::istreambuf_iterator()); + return data; +} + +// FlateDecode the byte range [begin, end) of `pdf`. Returns an empty string if +// the range is not a valid zlib stream. +std::string Inflate(const std::string &pdf, std::size_t begin, std::size_t end) +{ + std::string out; + if (end <= begin) + return out; + z_stream zs{}; + zs.next_in = reinterpret_cast(const_cast(pdf.data() + begin)); + zs.avail_in = static_cast(end - begin); + if (inflateInit(&zs) != Z_OK) + return out; + std::vector buf(64 * 1024); + int rc = Z_OK; + do { + zs.next_out = reinterpret_cast(buf.data()); + zs.avail_out = static_cast(buf.size()); + rc = inflate(&zs, Z_NO_FLUSH); + if (rc == Z_OK || rc == Z_STREAM_END) + out.append(buf.data(), buf.size() - zs.avail_out); + else + break; + } while (rc != Z_STREAM_END); + inflateEnd(&zs); + return out; +} + +// Locate the data range of the "stream ... endstream" block that starts at or +// after `from`. Returns false if none is found. +bool FindStream(const std::string &pdf, std::size_t from, std::size_t &dataBegin, std::size_t &dataEnd, + std::size_t &next) +{ + std::size_t s = pdf.find("stream", from); + if (s == std::string::npos) + return false; + dataBegin = s + 6; // strlen("stream") + if (dataBegin < pdf.size() && pdf[dataBegin] == '\r') + ++dataBegin; + if (dataBegin < pdf.size() && pdf[dataBegin] == '\n') + ++dataBegin; + std::size_t e = pdf.find("endstream", dataBegin); + if (e == std::string::npos) + return false; + dataEnd = e; + if (dataEnd > dataBegin && pdf[dataEnd - 1] == '\n') + --dataEnd; + if (dataEnd > dataBegin && pdf[dataEnd - 1] == '\r') + --dataEnd; + next = e + 9; // strlen("endstream") + return true; +} + +// FlateDecode every stream in the PDF and concatenate the results. The page +// content stream (which carries the painting operators) is among them. +std::string DecodeAllFlateStreams(const std::string &pdf) +{ + std::string out; + std::size_t pos = 0, b, e, next; + while (FindStream(pdf, pos, b, e, next)) { + out += Inflate(pdf, b, e); + pos = next; + } + return out; +} + +// FlateDecode the stream of the first image XObject in the PDF. +std::string DecodeImageXObject(const std::string &pdf) +{ + std::size_t img = pdf.find("/Subtype /Image"); + if (img == std::string::npos) + return {}; + std::size_t b, e, next; + if (!FindStream(pdf, img, b, e, next)) + return {}; + return Inflate(pdf, b, e); +} + +} // namespace + +// Render a small synthetic TImage to a PDF and verify it is embedded as a +// proper PDF image XObject: a "/Subtype /Image" object carrying the pixels, +// referenced from the page content stream by a "/ImN Do" operator. The +// embedded pixels are decoded back and checked against the four colours that +// were drawn, so the test guards pixel fidelity, not just the PDF structure. +// +// This covers the TASImage::Paint -> TPDF::CellArray* path: before the fix it +// emitted only a "PDF not implemented yet" warning and no image data. +TEST(TASImage, PDFEmbedsImageXObject) +{ + const TString pdfFile = "tasimage_pdf_embed.pdf"; + + TImage *img = TImage::Create(); + ASSERT_NE(img, nullptr) << "TImage::Create failed (ASImage plugin missing?)"; + // The first FillRectangle sizes the (initially empty) image, so it must + // cover the whole 80x80 area; the other three then paint the quadrants. + img->FillRectangle("#ff0000", 0, 0, 80, 80); // red base / top-left + img->FillRectangle("#00ff00", 40, 0, 40, 40); // top-right green + img->FillRectangle("#0000ff", 0, 40, 40, 40); // bottom-left blue + img->FillRectangle("#ffff00", 40, 40, 40, 40); // bottom-right yellow + + TCanvas c("tasimage_pdf_canvas", "tasimage_pdf_canvas", 300, 300); + img->Draw("X"); + c.SaveAs(pdfFile); + delete img; + + FileStat_t st; + ASSERT_EQ(gSystem->GetPathInfo(pdfFile, st), 0) << "PDF file was not created."; + ASSERT_GT(st.fSize, 1024) << "PDF is suspiciously small."; + + const std::string pdf = SlurpFile(pdfFile); + ASSERT_FALSE(pdf.empty()); + ASSERT_EQ(pdf.compare(0, 4, "%PDF"), 0) << "File does not look like a PDF."; + + // The bitmap must be stored as its own image XObject, not dropped. + EXPECT_NE(pdf.find("/Subtype /Image"), std::string::npos) + << "No image XObject in the PDF — TASImage::Paint did not embed the bitmap."; + EXPECT_NE(pdf.find("/ColorSpace /DeviceRGB"), std::string::npos) + << "Image XObject colour space declaration missing."; + EXPECT_NE(pdf.find("/BitsPerComponent 8"), std::string::npos) << "Image XObject bit depth declaration missing."; + + // The page content stream must actually paint that XObject. + const std::string content = DecodeAllFlateStreams(pdf); + ASSERT_FALSE(content.empty()) << "No Flate streams could be decoded."; + EXPECT_NE(content.find("/Im1 Do"), std::string::npos) + << "Page content stream does not paint the image XObject (no '/Im1 Do')."; + + // The embedded pixels must match what was drawn: all four colours present. + const std::string pixels = DecodeImageXObject(pdf); + ASSERT_FALSE(pixels.empty()) << "Image XObject stream did not FlateDecode."; + EXPECT_EQ(pixels.size() % 3u, 0u) << "DeviceRGB data is not a whole number of pixels."; + EXPECT_NE(pixels.find(std::string("\xff\x00\x00", 3)), std::string::npos) << "red missing"; + EXPECT_NE(pixels.find(std::string("\x00\xff\x00", 3)), std::string::npos) << "green missing"; + EXPECT_NE(pixels.find(std::string("\x00\x00\xff", 3)), std::string::npos) << "blue missing"; + EXPECT_NE(pixels.find(std::string("\xff\xff\x00", 3)), std::string::npos) << "yellow missing"; + + gSystem->Unlink(pdfFile); +} diff --git a/graf2d/postscript/inc/TPDF.h b/graf2d/postscript/inc/TPDF.h index 23472e27fee5b..7ba79e773ddb8 100644 --- a/graf2d/postscript/inc/TPDF.h +++ b/graf2d/postscript/inc/TPDF.h @@ -65,6 +65,28 @@ class TPDF : public TVirtualPS { Double_t fE = 0.; ///< "e" value of the Current Transformation Matrix (CTM) Double_t fF = 0.; ///< "f" value of the Current Transformation Matrix (CTM) + // Transient scratch state for the in-flight Cell Array: only meaningful + // between a CellArrayBegin and the matching CellArrayEnd, never streamed, + // so every member below is marked transient (/// fCellArrayRGB; /// fData; ///< 8-bit DeviceRGB samples (raw or Flate) + }; + std::vector fImageObjects; /// unsigned char { + if (v < 0) + return 0; + if (v > 255) + return 255; + return static_cast(v); + }; + fCellArrayRGB.push_back(clamp(r)); + fCellArrayRGB.push_back(clamp(g)); + fCellArrayRGB.push_back(clamp(b)); } //////////////////////////////////////////////////////////////////////////////// -/// End the Cell Array painting +/// End the Cell Array painting. +/// +/// The RGB buffer accumulated by CellArrayFill is Flate-compressed and stored +/// as a PDF image XObject (actually emitted later, in Close). The page content +/// stream only receives the placement matrix and a "/ImN Do" operator that +/// paints that XObject. This is both smaller and structurally cleaner than an +/// inline image: the pixel data is compressed once, kept out of the page +/// content stream, and could be reused across pages. void TPDF::CellArrayEnd() { - Warning("CellArrayEnd", "not yet implemented"); + if (fCellArrayW <= 0 || fCellArrayH <= 0 || fCellArrayRGB.empty()) { + fCellArrayW = 0; + fCellArrayH = 0; + fCellArrayRGB.clear(); + return; + } + + const std::size_t expected = 3 * std::size_t(fCellArrayW) * std::size_t(fCellArrayH); + if (fCellArrayRGB.size() < expected) { + // Pad with black if the caller delivered fewer pixels than declared. + fCellArrayRGB.resize(expected, 0); + } else if (fCellArrayRGB.size() > expected) { + fCellArrayRGB.resize(expected); + } + + // Flate-compress the pixels now, so only the compressed form is buffered + // until Close. compress2 emits a zlib stream, exactly what the PDF + // /FlateDecode filter consumes. + PDFImage img; + img.fW = fCellArrayW; + img.fH = fCellArrayH; + uLongf bound = compressBound(static_cast(fCellArrayRGB.size())); + img.fData.resize(bound); + uLongf destLen = bound; + int zerr = compress2(img.fData.data(), &destLen, fCellArrayRGB.data(), static_cast(fCellArrayRGB.size()), + Z_DEFAULT_COMPRESSION); + if (zerr == Z_OK) { + img.fData.resize(destLen); + img.fFlate = kTRUE; + } else { + // Fall back to storing the raw samples uncompressed. + img.fData = fCellArrayRGB; + img.fFlate = kFALSE; + } + fImageObjects.push_back(std::move(img)); + const Int_t imageId = static_cast(fImageObjects.size()); // 1-based /ImN + + // Paint the image XObject. Its unit square (0,0)-(1,1) is mapped onto the + // image rectangle by this cm matrix. Operator separators must be real + // newlines: '@' is only translated when fCompress is false, and a page + // content stream is written with fCompress true. + PrintStr("\nq "); + WriteReal(fCellArrayWpdf); + WriteReal(0.); + WriteReal(0.); + WriteReal(fCellArrayHpdf); + WriteReal(fCellArrayXpdf); + WriteReal(fCellArrayYpdfBot); + PrintStr(" cm /Im"); + WriteInteger(imageId, kFALSE); + PrintStr(" Do Q\n"); + + fCellArrayW = 0; + fCellArrayH = 0; + fCellArrayRGB.clear(); + fCellArrayRGB.shrink_to_fit(); } //////////////////////////////////////////////////////////////////////////////// @@ -289,6 +390,57 @@ void TPDF::Close(Option_t *) if (!fAlphas.empty()) fAlphas.clear(); + // Image XObjects. They are emitted here, once every page's content stream + // has been closed, because a PDF object cannot be opened while another one + // (the page content stream) is still open. Each page's /Resources refers to + // kObjImageList, the name dictionary written just after the images. + std::vector imageObjNum; + imageObjNum.reserve(fImageObjects.size()); + for (const auto &img : fImageObjects) { + Int_t n = static_cast(fObjPos.size()) + 1; + imageObjNum.push_back(n); + NewObject(n); + PrintStr("<<@"); + PrintStr("/Type /XObject@"); + PrintStr("/Subtype /Image@"); + PrintStr("/Width"); + WriteInteger(img.fW); + PrintStr("@"); + PrintStr("/Height"); + WriteInteger(img.fH); + PrintStr("@"); + PrintStr("/ColorSpace /DeviceRGB@"); + PrintStr("/BitsPerComponent 8@"); + if (img.fFlate) + PrintStr("/Filter /FlateDecode@"); + PrintStr("/Length"); + WriteInteger(static_cast(img.fData.size())); + PrintStr("@"); + PrintStr(">>@"); + PrintStr("stream@"); + if (!img.fData.empty()) { + fStream->write(reinterpret_cast(img.fData.data()), img.fData.size()); + fNByte += img.fData.size(); + } + PrintStr("@endstream@"); + EndObject(); + } + + // Name dictionary mapping /ImN to the XObjects above. Always written, even + // when empty, because kObjImageList is referenced by every page's + // /Resources and so must exist in the cross-reference table. + NewObject(kObjImageList); + PrintStr("<<@"); + for (std::size_t i = 0; i < imageObjNum.size(); ++i) { + PrintStr(" /Im"); + WriteInteger(static_cast(i) + 1, kFALSE); + WriteInteger(imageObjNum[i]); + PrintStr(" 0 R"); + } + PrintStr("@>>@"); + EndObject(); + fImageObjects.clear(); + // Cross-Reference Table Int_t refInd = fNByte; PrintStr("xref@"); @@ -1801,6 +1953,10 @@ void TPDF::Open(const char *fname, Int_t wtype) WriteInteger(kObjPatternList); PrintStr(" 0 R"); PrintStr("@"); + PrintStr("/XObject"); + WriteInteger(kObjImageList); + PrintStr(" 0 R"); + PrintStr("@"); PrintStr(">>@"); EndObject(); diff --git a/test/stressGraphics.ref b/test/stressGraphics.ref index c94bd663a397f..14e935b0fee9f 100644 --- a/test/stressGraphics.ref +++ b/test/stressGraphics.ref @@ -1,82 +1,82 @@ Test# PS1Ref# PS1Err# PDFRef# PDFErr# JPGRef# JPGErr# PNGRef# PNGErr# PS2Ref# PS2Err# - tline 529 50 12827 50 23848 3700 3937 100 569 60 - tmarker 4627 600 14566 100 13368 7900 9208 3000 4690 600 - tpolyline 452 50 12754 50 11232 4200 3796 10700 492 50 - hatches 58094 500 50560 600 50500 7000 23208 5000 60079 500 - arrows 1299 50 13149 100 22200 7000 9608 5000 1372 50 - patterns 23617 1500 19446 200 143320 123000 45665 11000 23076 1500 - crown 2780 50 14546 100 19178 9000 7605 4000 2834 50 - piechart 67345 200 77066 200 32180 15000 29168 15000 66962 200 - ttext1 1025 150 12862 200 33468 9900 30846 5000 1072 200 - ttext2 430 50 12729 50 9558 100 5325 700 471 50 - tlatex0 6857 50 15580 50 47722 7000 64693 12000 6890 70 - tlatex1 5130 50 14090 50 16143 1300 12230 500 5170 70 - tlatex2 5442 80 13533 50 18430 700 12398 300 5469 80 - tlatex3 9253 100 14437 150 19851 2400 12199 900 9283 100 - tlatex4 8863 70 13705 100 24343 1100 23278 1700 8894 70 - tlatex5 13686 100 14880 50 34063 2000 32033 1200 13715 150 - kerning 7444 100 13593 100 83557 3000 38505 4000 7494 150 - itbf 5600 400 13302 400 16881 400 15063 800 5638 400 - tmathtext 14190539 4000000 12986 100 23076 9500 25987 3000 14190704 4000000 - transparency 2396 50 14700 100 16514 7000 24701 12000 2554 100 - transpad 15690 5000 17239 200 23076 9500 14232 1500 10437 5000 - statfitparam 28072 400 23580 250 44462 11000 30062 5000 37580 400 - tgaxis1 20444 400 21580 150 27511 11000 16867 600 20721 400 - tgaxis2 15894 100 19365 200 27187 10300 15925 350 15925 100 - tgaxis3 22521 300 42986 250 43868 17000 19232 11000 22729 300 - tgaxis4 3664 600 14497 150 19824 6300 10396 900 4220 600 - tgaxis5 15810 600 13960 150 49440 6300 37586 9000 8128 600 - tgaxis6 5086 600 14253 150 16812 6300 11900 9000 5156 600 - padticks 22400 600 19710 150 37913 15000 18122 8000 22300 600 - labels1 4866 600 14222 100 30889 10050 21311 1800 4845 600 - th1_palette 15555 100 32511 100 29162 12000 35018 15000 16132 300 - thstack1 25066 100 27416 100 46061 15000 23026 10000 25328 100 - th2_cut 14774 600 16239 300 19511 5000 11533 4000 16039 600 - th2_candle 97669 1000 71454 500 136880 40000 51345 20000 110614 1000 - th2_violin 63140 500 84221 500 85037 20000 34733 15000 68613 500 - th2_axlabels 4878 600 14435 100 17419 5000 11709 1800 5770 600 - th2_stats 27107 300 19287 300 30587 14000 16531 7000 27039 500 - tellipse 3578 40 15332 100 34038 2500 12258 1400 3606 40 - feynman 7813 300 23900 150 11085 6000 6973 3100 8081 300 - ratioplot 19153 150 21475 300 14104 14800 7386 2800 14207 150 - tgraph1 4545 150 14601 100 27602 14800 13094 2800 4467 150 - tgraph2 6141 200 16027 100 39594 21600 19331 7000 6087 500 - tgraph3 9110 500 16644 200 21346 21600 10645 7000 8869 500 - tgraph4 7419 500 15172 200 18872 21600 7928 7000 7296 500 - tgraphreverse 31088 1000 25034 1000 94376 20000 39638 15000 30900 2000 - gmultierrors 3313 50 14228 100 23554 15000 9807 5000 3246 50 - tmultigraph1 17016 5500 18258 250 32434 17400 22157 5000 20823 5500 - tmultigraph2 30615 8200 27236 200 50520 18200 35724 5400 36690 8200 - waves 3303861 100 712368 3000 62688 19000 123056 7000 3396789 1000 - tf12 3954 100 14714 300 17378 7800 9629 2000 3794 200 - tspline 9073 100 22210 300 27691 7800 20712 2000 9157 200 - tscatter 15595 200 22620 400 28599 7800 42618 2000 15460 200 - tefficiency 12926 200 24364 300 24021 6800 12637 2000 12584 200 - profile_2d 29664 200 19414 300 23024 6500 12821 2000 31317 200 - profile_2dpoly 26463 400 23542 300 38792 8500 30458 4000 26759 400 - graphpolar 73991 1000 103051 3000 112084 30000 82890 30000 147897 1000 - options2d1 89233 500 48035 300 65532 27800 37314 12000 90600 500 - options2d2 36514 300 17120 200 47408 12700 33739 3700 36399 300 - options2d3 203600 750 87186 750 76094 38000 54717 11000 206469 800 - options2d4 401670 6500 156421 2000 62719 34100 45592 14000 410114 6500 - options2d5 554795 5000 225266 2000 65828 31800 53934 6500 562141 5000 - earth 3670533 35000 1292799 13000 60580 9900 133547 3500 3714805 35000 - thstack2 146947 1000 57941 500 54294 15000 35125 15000 146947 1000 - tgraph2d1 1466028 9000 853253 50000 38425 13500 91242 18100 1463263 7500 - tgraph2d2 38312 200 56937 750 36524 11800 119641 8000 38121 200 - tgraph2derr 19556 1000 32027 1000 36859 10000 37602 8000 19900 3000 - tgraph2dassym 20171 1000 31928 1000 34901 10000 37812 8000 20127 3000 - tprofile3d 693800 10000 154537 5000 38830 10000 25266 6000 721420 15000 - tf3 270825 10000 115560 1000 45496 11000 34685 5000 272950 10000 - basic3d 1239 100 13788 100 17340 10000 11680 5000 1295 100 - annotation3d 547845 3000 193427 3000 32383 12000 58073 20000 547493 3000 - tgraph2d3 15025 3000 29349 500 42525 11300 33336 3900 14787 4000 - ntuple1 254604 5000 383318 7000 55666 30400 46534 6500 259594 7000 - quarks 4846 150 14135 200 33239 600 25303 500 4877 150 - timage 1435879 150000 12897 100 26170 100 365000 15000 1085792 250000 - zoomtf1 5884 500 16637 200 40706 14000 30026 4000 5884 500 - zoomfit 5723 700 15780 200 32236 11000 16916 3200 5670 800 - parallelcoord 1027338 160000 529533 50000 29519 3000 71404 7000 1027338 160000 - clonepad 26983 1700 18867 2500 23765 2000 11196 1000 27409 1900 - hbars 13592 1300 16729 1600 52678 5200 22353 2200 13291 1300 - th2poly 85347 10000 545777 50000 17106 1000 11410 1000 105177 10000 \ No newline at end of file + tline 529 50 12885 50 23848 3700 3937 100 569 60 + tmarker 4627 600 14629 100 13368 7900 9208 3000 4690 600 + tpolyline 452 50 12817 50 11232 4200 3796 10700 492 50 + hatches 58094 500 50941 600 50500 7000 23208 5000 60079 500 + arrows 1299 50 13201 100 22200 7000 9608 5000 1372 50 + patterns 23617 1500 19524 200 143320 123000 45665 11000 23076 1500 + crown 2780 50 14604 100 19178 9000 7605 4000 2834 50 + piechart 67345 200 77137 200 32180 15000 29168 15000 66962 200 + ttext1 1025 150 12987 200 33468 9900 30846 5000 1072 200 + ttext2 430 50 12800 50 9558 100 5325 700 471 50 + tlatex0 6857 50 15646 50 47722 7000 64693 12000 6890 70 + tlatex1 5130 50 14156 50 16143 1300 12230 500 5170 70 + tlatex2 5442 80 13619 50 18430 700 12398 300 5469 80 + tlatex3 9253 100 14488 150 19851 2400 12199 900 9283 100 + tlatex4 8863 70 13797 100 24343 1100 23278 1700 8894 70 + tlatex5 13686 100 14940 50 34063 2000 32033 1200 13715 150 + kerning 7444 100 13647 100 83557 3000 38505 4000 7494 150 + itbf 5600 400 13450 400 16881 400 15063 800 5638 400 + tmathtext 14190539 4000000 13107 100 23076 9500 25987 3000 14190704 4000000 + transparency 2396 50 14768 100 16514 7000 24701 12000 2554 100 + transpad 15690 5000 17467 200 23076 9500 14232 1500 10437 5000 + statfitparam 28072 400 23633 250 44462 11000 30062 5000 37580 400 + tgaxis1 20444 400 21677 150 27511 11000 16867 600 20721 400 + tgaxis2 15894 100 19448 200 27187 10300 15925 350 15925 100 + tgaxis3 22521 300 43013 250 43868 17000 19232 11000 22729 300 + tgaxis4 3664 600 14662 150 19824 6300 10396 900 4220 600 + tgaxis5 15810 600 14055 150 49440 6300 37586 9000 8128 600 + tgaxis6 5086 600 14317 150 16812 6300 11900 9000 5156 600 + padticks 22400 600 19771 150 37913 15000 18122 8000 22300 600 + labels1 4866 600 14334 100 30889 10050 21311 1800 4845 600 + th1_palette 15555 100 32564 100 29162 12000 35018 15000 16132 300 + thstack1 25066 100 27468 100 46061 15000 23026 10000 25328 100 + th2_cut 14774 600 16302 300 19511 5000 11533 4000 16039 600 + th2_candle 97669 1000 71515 500 136880 40000 51345 20000 110614 1000 + th2_violin 63140 500 84284 500 85037 20000 34733 15000 68613 500 + th2_axlabels 4878 600 14505 100 17419 5000 11709 1800 5770 600 + th2_stats 27107 300 19349 300 30587 14000 16531 7000 27039 500 + tellipse 3578 40 15406 100 34038 2500 12258 1400 3606 40 + feynman 7813 300 23965 150 11085 6000 6973 3100 8081 300 + ratioplot 19153 150 21529 300 14104 14800 7386 2800 14207 150 + tgraph1 4545 150 14697 100 27602 14800 13094 2800 4467 150 + tgraph2 6141 200 16137 100 39594 21600 19331 7000 6087 500 + tgraph3 9110 500 16699 200 21346 21600 10645 7000 8869 500 + tgraph4 7419 500 15305 200 18872 21600 7928 7000 7296 500 + tgraphreverse 31088 1000 24786 1000 94376 20000 39638 15000 30900 2000 + gmultierrors 3313 50 14273 100 23554 15000 9807 5000 3246 50 + tmultigraph1 17016 5500 18327 250 32434 17400 22157 5000 20823 5500 + tmultigraph2 30615 8200 27352 200 50520 18200 35724 5400 36690 8200 + waves 3303861 100 712476 3000 62688 19000 123056 7000 3396789 1000 + tf12 3954 100 14767 300 17378 7800 9629 2000 3794 200 + tspline 9073 100 22268 300 27691 7800 20712 2000 9157 200 + tscatter 15595 200 22671 400 28599 7800 42618 2000 15460 200 + tefficiency 12926 200 24425 300 24021 6800 12637 2000 12584 200 + profile_2d 29664 200 19472 300 23024 6500 12821 2000 31317 200 + profile_2dpoly 26463 400 23578 300 38792 8500 30458 4000 26759 400 + graphpolar 73991 1000 103113 3000 112084 30000 82890 30000 147897 1000 + options2d1 89233 500 48094 300 65532 27800 37314 12000 90600 500 + options2d2 36514 300 17136 200 47408 12700 33739 3700 36399 300 + options2d3 203600 750 87209 750 76094 38000 54717 11000 206469 800 + options2d4 401670 6500 156733 2000 62719 34100 45592 14000 410114 6500 + options2d5 554795 5000 225102 2000 65828 31800 53934 6500 562141 5000 + earth 3670533 35000 1293002 13000 60580 9900 133547 3500 3714805 35000 + thstack2 146947 1000 58002 500 54294 15000 35125 15000 146947 1000 + tgraph2d1 1466028 9000 885781 50000 38425 13500 91242 18100 1463263 7500 + tgraph2d2 38312 200 57021 750 36524 11800 119641 8000 38121 200 + tgraph2derr 19556 1000 32086 1000 36859 10000 37602 8000 19900 3000 + tgraph2dassym 20171 1000 31982 1000 34901 10000 37812 8000 20127 3000 + tprofile3d 693800 10000 154591 5000 38830 10000 25266 6000 721420 15000 + tf3 270825 10000 115989 1000 45496 11000 34685 5000 272950 10000 + basic3d 1239 100 13847 100 17340 10000 11680 5000 1295 100 + annotation3d 547845 3000 193492 3000 32383 12000 58073 20000 547493 3000 + tgraph2d3 15025 3000 29874 500 42525 11300 33336 3900 14787 4000 + ntuple1 254604 5000 383731 7000 55666 30400 46534 6500 259594 7000 + quarks 4846 150 14289 200 33239 600 25303 500 4877 150 + timage 1435879 150000 456978 10000 26170 100 365000 15000 1085792 250000 + zoomtf1 5884 500 16856 200 40706 14000 30026 4000 5884 500 + zoomfit 5723 700 15959 200 32236 11000 16916 3200 5670 800 + parallelcoord 1027338 160000 532630 50000 29519 3000 71404 7000 1027338 160000 + clonepad 26983 1700 18953 2500 23765 2000 11196 1000 27409 1900 + hbars 13592 1300 16750 1600 52678 5200 22353 2200 13291 1300 + th2poly 85347 10000 546373 50000 17106 1000 11410 1000 105177 10000 diff --git a/test/stressGraphics_zlibng.ref b/test/stressGraphics_zlibng.ref index da4ccbd7b3a72..f302374455b0c 100644 --- a/test/stressGraphics_zlibng.ref +++ b/test/stressGraphics_zlibng.ref @@ -1,82 +1,82 @@ Test# PS1Ref# PS1Err# PDFRef# PDFErr# JPGRef# JPGErr# PNGRef# PNGErr# PS2Ref# PS2Err# - tline 529 50 12827 50 23758 3700 3937 100 569 60 - tmarker 4627 600 14523 100 13359 7900 9227 3000 4690 600 - tpolyline 452 50 12754 50 11764 4200 4338 10700 492 50 - hatches 58094 500 50397 600 50500 7000 23208 5000 60079 500 - arrows 1304 50 13149 100 22200 7000 9608 5000 1367 50 - patterns 23688 1500 19305 200 143676 123000 47075 11000 23076 1500 - crown 2785 50 14546 100 19178 9000 7605 4000 2829 50 - piechart 67345 200 74560 3000 32180 15000 29168 15000 66962 200 - ttext1 1025 150 12866 150 32266 9900 29901 5000 1072 200 - ttext2 432 50 12743 50 9517 150 5306 700 473 50 - tlatex0 6857 50 15570 100 47722 7000 64693 12000 6890 70 - tlatex1 5140 50 14050 50 16377 1300 12462 500 5170 70 - tlatex2 5488 80 13507 100 18439 700 12061 500 5502 80 - tlatex3 9154 100 14323 150 20441 2400 12143 900 9283 100 - tlatex4 8831 70 13705 100 24251 1100 23337 1700 8862 70 - tlatex5 13686 100 14840 50 33842 2000 32356 1200 13715 150 - kerning 7454 100 13557 50 83044 3000 37165 4100 7504 150 - itbf 5600 400 13302 300 16868 400 15083 800 5638 400 - tmathtext 14193187 4000000 12984 100 27112 9500 25080 3000 14193352 4000000 - transparency 2386 50 14700 100 16514 7000 24701 12000 2554 100 - transpad 16185 5000 17131 350 22801 9500 14232 1000 11271 5000 - statfitparam 27683 400 23370 300 44898 11000 30209 5000 37580 400 - tgaxis1 20424 400 21388 300 27719 11000 16044 600 20704 400 - tgaxis2 15874 100 19140 300 27682 10300 15197 550 15905 100 - tgaxis3 22678 300 42796 200 44177 17000 20788 11000 22866 300 - tgaxis4 3817 600 14405 250 19907 6300 10674 900 4523 600 - tgaxis5 15804 600 13960 150 49201 6300 37054 9000 8125 600 - tgaxis6 5086 600 14253 150 16812 6300 11900 9000 5156 600 - padticks 22400 600 19710 150 37913 15000 18122 8000 22300 600 - labels1 4875 600 14172 150 31268 10050 22053 1800 4849 600 - th1_palette 15555 100 32511 500 29162 12000 35018 15000 16132 300 - thstack1 25066 100 27416 500 46061 15000 23026 10000 25328 100 - th2_cut 14774 600 16239 300 19511 5000 11533 4000 16039 600 - th2_candle 97669 1000 71454 500 136880 40000 51345 20000 110614 1000 - th2_violin 63140 500 83870 500 85037 20000 34733 15000 68613 500 - th2_axlabels 4878 600 14435 100 17419 5000 11709 1800 5770 600 - th2_stats 27107 300 19287 300 30587 14000 16531 7000 27039 500 - tellipse 3583 40 15257 100 34790 2500 12156 1400 3601 40 - feynman 7825 300 23799 150 11087 6000 7008 3100 8097 300 - ratioplot 19153 150 21475 300 13257 14800 6444 2800 14207 150 - tgraph1 4565 150 14508 200 27798 14800 13315 2800 4452 150 - tgraph2 6093 200 15949 200 34556 21600 19438 7000 6087 500 - tgraph3 9088 500 16849 400 21370 21600 10798 7000 8846 500 - tgraph4 7437 500 15107 200 18767 21600 7971 7000 7314 500 - tgraphreverse 31088 1000 25034 1000 94376 20000 39638 15000 30900 2000 - gmultierrors 3313 50 14228 100 23554 15000 9807 5000 3246 50 - tmultigraph1 18751 5500 18130 200 32484 17400 22128 5000 18905 5500 - tmultigraph2 25492 8200 27203 400 50520 18200 35537 5400 32937 8200 - waves 3303861 100 709707 3000 62761 19000 122867 7000 3396789 1000 - tf12 3954 100 14714 300 17378 7800 9629 2000 3794 200 - tspline 9073 100 22210 300 27691 7800 20712 2000 9157 200 - tscatter 15595 200 22420 400 28599 7800 42618 2000 15460 200 - tefficiency 12926 200 24364 300 24021 6800 12637 2000 12584 200 - profile_2d 29664 200 19414 300 23024 6500 12821 2000 31317 200 - profile_2dpoly 26463 400 23542 300 38792 8500 30458 4000 26759 400 - graphpolar 73996 1000 103051 3000 112084 30000 82890 30000 147887 1000 - options2d1 89233 500 48035 300 65532 27800 37314 12000 90600 500 - options2d2 36499 300 16942 200 50206 12700 35399 3700 36389 300 - options2d3 203600 750 86539 1000 73220 38000 56792 11000 206469 800 - options2d4 402315 6500 154916 2000 59500 34100 47446 14000 410778 6500 - options2d5 554795 5000 223361 2000 64725 31800 57072 6500 562141 5000 - earth 3665893 35000 1282543 12000 60908 9900 128011 5500 3710011 35000 - thstack2 146947 1000 57335 700 54294 15000 35125 15000 146947 1000 - tgraph2d1 1456916 9000 886900 50000 37221 13500 91830 18100 1460966 7500 - tgraph2d2 38248 200 56228 1000 34988 11800 119591 8000 38089 200 - tgraph2derr 19556 1000 32027 1000 36859 10000 37602 8000 19900 3000 - tgraph2dassym 20171 1000 31928 1000 34901 10000 37812 8000 20127 3000 - tprofile3d 693800 10000 154537 5000 38830 10000 25266 6000 721420 15000 - tf3 270825 10000 115560 1000 45496 11000 34685 5000 272950 10000 - basic3d 1239 100 13788 100 17340 10000 11680 5000 1295 100 - annotation3d 547845 3000 193427 3000 32383 12000 58073 20000 547493 3000 - tgraph2d3 16675 3000 29541 500 40536 11300 33519 3900 16452 4000 - ntuple1 256544 5000 382044 7000 54446 30400 45002 6500 261593 7000 - quarks 4759 180 14134 100 32913 600 25421 1000 4790 180 - timage 1442666 150000 12900 100 26100 100 374206 15000 1102279 250000 - zoomtf1 6130 500 16528 300 49750 14000 29288 4000 5429 500 - zoomfit 6200 700 15706 200 31219 11000 18280 3200 6113 800 - parallelcoord 1021126 160000 528158 50000 29893 3000 73438 7000 1027338 160000 - clonepad 26983 1700 18867 2500 23765 2000 11196 1000 27409 1900 - hbars 13584 1300 16610 1600 48394 5200 21459 2200 12734 1300 - th2poly 85347 10000 544873 50000 17104 1000 11960 1000 105177 10000 + tline 529 50 12885 50 23758 3700 3937 100 569 60 + tmarker 4627 600 14586 100 13359 7900 9227 3000 4690 600 + tpolyline 452 50 12817 50 11764 4200 4338 10700 492 50 + hatches 58094 500 50778 600 50500 7000 23208 5000 60079 500 + arrows 1304 50 13201 100 22200 7000 9608 5000 1367 50 + patterns 23688 1500 19383 200 143676 123000 47075 11000 23076 1500 + crown 2785 50 14604 100 19178 9000 7605 4000 2829 50 + piechart 67345 200 74631 3000 32180 15000 29168 15000 66962 200 + ttext1 1025 150 12991 150 32266 9900 29901 5000 1072 200 + ttext2 432 50 12814 50 9517 150 5306 700 473 50 + tlatex0 6857 50 15636 100 47722 7000 64693 12000 6890 70 + tlatex1 5140 50 14116 50 16377 1300 12462 500 5170 70 + tlatex2 5488 80 13593 100 18439 700 12061 500 5502 80 + tlatex3 9154 100 14374 150 20441 2400 12143 900 9283 100 + tlatex4 8831 70 13797 100 24251 1100 23337 1700 8862 70 + tlatex5 13686 100 14900 50 33842 2000 32356 1200 13715 150 + kerning 7454 100 13611 50 83044 3000 37165 4100 7504 150 + itbf 5600 400 13450 300 16868 400 15083 800 5638 400 + tmathtext 14193187 4000000 13105 100 27112 9500 25080 3000 14193352 4000000 + transparency 2386 50 14768 100 16514 7000 24701 12000 2554 100 + transpad 16185 5000 17359 350 22801 9500 14232 1000 11271 5000 + statfitparam 27683 400 23423 300 44898 11000 30209 5000 37580 400 + tgaxis1 20424 400 21485 300 27719 11000 16044 600 20704 400 + tgaxis2 15874 100 19223 300 27682 10300 15197 550 15905 100 + tgaxis3 22678 300 42823 200 44177 17000 20788 11000 22866 300 + tgaxis4 3817 600 14570 250 19907 6300 10674 900 4523 600 + tgaxis5 15804 600 14055 150 49201 6300 37054 9000 8125 600 + tgaxis6 5086 600 14317 150 16812 6300 11900 9000 5156 600 + padticks 22400 600 19771 150 37913 15000 18122 8000 22300 600 + labels1 4875 600 14284 150 31268 10050 22053 1800 4849 600 + th1_palette 15555 100 32564 500 29162 12000 35018 15000 16132 300 + thstack1 25066 100 27468 500 46061 15000 23026 10000 25328 100 + th2_cut 14774 600 16302 300 19511 5000 11533 4000 16039 600 + th2_candle 97669 1000 71515 500 136880 40000 51345 20000 110614 1000 + th2_violin 63140 500 83933 500 85037 20000 34733 15000 68613 500 + th2_axlabels 4878 600 14505 100 17419 5000 11709 1800 5770 600 + th2_stats 27107 300 19349 300 30587 14000 16531 7000 27039 500 + tellipse 3583 40 15331 100 34790 2500 12156 1400 3601 40 + feynman 7825 300 23864 150 11087 6000 7008 3100 8097 300 + ratioplot 19153 150 21529 300 13257 14800 6444 2800 14207 150 + tgraph1 4565 150 14604 200 27798 14800 13315 2800 4452 150 + tgraph2 6093 200 16059 200 34556 21600 19438 7000 6087 500 + tgraph3 9088 500 16904 400 21370 21600 10798 7000 8846 500 + tgraph4 7437 500 15240 200 18767 21600 7971 7000 7314 500 + tgraphreverse 31088 1000 24786 1000 94376 20000 39638 15000 30900 2000 + gmultierrors 3313 50 14273 100 23554 15000 9807 5000 3246 50 + tmultigraph1 18751 5500 18199 200 32484 17400 22128 5000 18905 5500 + tmultigraph2 25492 8200 27319 400 50520 18200 35537 5400 32937 8200 + waves 3303861 100 709815 3000 62761 19000 122867 7000 3396789 1000 + tf12 3954 100 14767 300 17378 7800 9629 2000 3794 200 + tspline 9073 100 22268 300 27691 7800 20712 2000 9157 200 + tscatter 15595 200 22471 400 28599 7800 42618 2000 15460 200 + tefficiency 12926 200 24425 300 24021 6800 12637 2000 12584 200 + profile_2d 29664 200 19472 300 23024 6500 12821 2000 31317 200 + profile_2dpoly 26463 400 23578 300 38792 8500 30458 4000 26759 400 + graphpolar 73996 1000 103113 3000 112084 30000 82890 30000 147887 1000 + options2d1 89233 500 48094 300 65532 27800 37314 12000 90600 500 + options2d2 36499 300 16958 200 50206 12700 35399 3700 36389 300 + options2d3 203600 750 86562 1000 73220 38000 56792 11000 206469 800 + options2d4 402315 6500 155228 2000 59500 34100 47446 14000 410778 6500 + options2d5 554795 5000 223197 2000 64725 31800 57072 6500 562141 5000 + earth 3665893 35000 1282746 12000 60908 9900 128011 5500 3710011 35000 + thstack2 146947 1000 57396 700 54294 15000 35125 15000 146947 1000 + tgraph2d1 1456916 9000 919428 50000 37221 13500 91830 18100 1460966 7500 + tgraph2d2 38248 200 56312 1000 34988 11800 119591 8000 38089 200 + tgraph2derr 19556 1000 32086 1000 36859 10000 37602 8000 19900 3000 + tgraph2dassym 20171 1000 31982 1000 34901 10000 37812 8000 20127 3000 + tprofile3d 693800 10000 154591 5000 38830 10000 25266 6000 721420 15000 + tf3 270825 10000 115989 1000 45496 11000 34685 5000 272950 10000 + basic3d 1239 100 13847 100 17340 10000 11680 5000 1295 100 + annotation3d 547845 3000 193492 3000 32383 12000 58073 20000 547493 3000 + tgraph2d3 16675 3000 30066 500 40536 11300 33519 3900 16452 4000 + ntuple1 256544 5000 382457 7000 54446 30400 45002 6500 261593 7000 + quarks 4759 180 14288 100 32913 600 25421 1000 4790 180 + timage 1442666 150000 463176 10000 26100 100 374206 15000 1102279 250000 + zoomtf1 6130 500 16747 300 49750 14000 29288 4000 5429 500 + zoomfit 6200 700 15885 200 31219 11000 18280 3200 6113 800 + parallelcoord 1021126 160000 531255 50000 29893 3000 73438 7000 1027338 160000 + clonepad 26983 1700 18953 2500 23765 2000 11196 1000 27409 1900 + hbars 13584 1300 16631 1600 48394 5200 21459 2200 12734 1300 + th2poly 85347 10000 545469 50000 17104 1000 11960 1000 105177 10000