Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TImageDump.cxx
Go to the documentation of this file.
1// @(#)root/postscript:$Id$
2// Author: Valeriy Onuchin
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TImageDump
13\ingroup PS
14
15\brief Save canvas as an image (GIF, JPEG, PNG, XPM, TIFF etc.).
16
17Example:
18~~~ {.cpp}
19 $ root -b
20 root [0] .x hsimple.C
21 root [1] c1->Print("c1.gif");
22~~~
23TImageDump can be used in any mode (batch, interactive) as follows
24~~~ {.cpp}
25 TCanvas *c1;
26 TImageDump *imgdump = new TImageDump("test.png");
27 c1->Paint();
28 imgdump->Close();
29~~~
30*/
31
32#include "TImageDump.h"
33#include "TImage.h"
34#include "TMath.h"
35#include "TPoint.h"
36#include "TColor.h"
37#include "TVirtualPad.h"
38#include "TVirtualX.h"
39#include "TROOT.h"
40#include "TText.h"
41#include "RStipples.h"
42#include "TList.h"
43#include "TStyle.h"
44#include "TObjString.h"
45#include "TObjArray.h"
46
47
48
49////////////////////////////////////////////////////////////////////////////////
50/// Default constructor
51
53{
54 gVirtualPS = this;
55 SetTitle("IMG");
56}
57
58////////////////////////////////////////////////////////////////////////////////
59/// Initialize batch image interface
60///
61/// fname : image file name
62///
63/// The possible workstation types are:
64/// - 111 - Portrait
65/// - 112 - Landscape
66/// - 114 - preview, keep in memory (do not write on delete)
67
69{
71 gVirtualPS = this;
72 SetTitle("IMG");
73}
74
75////////////////////////////////////////////////////////////////////////////////
76/// Open a image file
77
78void TImageDump::Open(const char *fname, Int_t type)
79{
81 fType = type;
83}
84
85////////////////////////////////////////////////////////////////////////////////
86/// destructor
87
89{
90 Close();
91
92 delete fImage;
93 fImage = nullptr;
94
95 gVirtualPS = nullptr;
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Close a image file
100
102{
103 // if fType == 114 - do not write image
104 if (!fImage || (fType == 114)) {
105 return;
106 }
107
108 //if (fType == 112) fImage->Flip(90);
110}
111
112////////////////////////////////////////////////////////////////////////////////
113/// Draw a Box
114
116{
117 if (!gPad || !fImage)
118 return;
119
121
122 Double_t x[4], y[4];
123 Int_t ix1 = x1 < x2 ? XtoPixel(x1) : XtoPixel(x2);
124 Int_t ix2 = x1 < x2 ? XtoPixel(x2) : XtoPixel(x1);
125 Int_t iy1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
126 Int_t iy2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);
127
128 if (ix1<0 || ix2 <0 || iy1 < 0 || iy2 <0) return; // box is not visible
129
130 if (TMath::Abs(ix2-ix1) < 1) ix2 = ix1+1;
131 if (TMath::Abs(iy1-iy2) < 1) iy1 = iy2+1;
132
133 Int_t fillis = fFillStyle/1000;
134 Int_t fillsi = fFillStyle%1000;
135
136 TColor *col = gROOT->GetColor(fFillColor);
137 if (!col) { // no color, set it white
138 fFillColor = 10;
139 col = gROOT->GetColor(fFillColor);
140 if (!col) return;
141 }
142
143 TColor *linecol = gROOT->GetColor(fLineColor);
144 if (!linecol) { // no color, set it to black
145 fLineColor = 1;
146 linecol = gROOT->GetColor(fLineColor);
147 }
148
149 if ((fillis == 3) || (fillis == 2)) {
150 if (fillsi > 99) {
151 x[0] = x1; y[0] = y1;
152 x[1] = x2; y[1] = y1;
153 x[2] = x2; y[2] = y2;
154 x[3] = x1; y[3] = y2;
155 return;
156 }
157 if ((fillsi > 0) && (fillsi < 26)) {
158 x[0] = x1; y[0] = y1;
159 x[1] = x2; y[1] = y1;
160 x[2] = x2; y[2] = y2;
161 x[3] = x1; y[3] = y2;
162 DrawPS(-4, &x[0], &y[0]);
163 }
164 if (fillsi == -3) {
165 // fill style = -3 ... which is NEVER used now
166 }
167 }
168
169 if (fillis == 1) {
170 fImage->DrawBox(ix1, iy1, ix2, iy2, col->AsHexString(), 1, TVirtualX::kFilled);
171 }
172
173 if (fillis == 0) {
174 if (fLineWidth<=0) return;
176 }
177}
178
179////////////////////////////////////////////////////////////////////////////////
180/// Draw a Frame around a box
181///
182/// - mode = -1 the box looks as it is behind the screen
183/// - mode = 1 the box looks as it is in front of the screen
184/// border is the border size in already pre-computed dark is the
185/// color for the dark part of the frame light is the color for the light
186/// part of the frame
187
190{
191 if (!gPad || !fImage) {
192 return;
193 }
194
196
197 bordersize = bordersize < 1 ? 1 : bordersize;
198
199 TColor *col;
200 TColor *lo = gROOT->GetColor(dark);
201 if (!lo) {
202 lo = gROOT->GetColor(10);
203 }
205 if (!hi) {
206 hi = gROOT->GetColor(10);
207 }
208
209 Short_t pxl,pyl,pxt,pyt,px1,py1,px2,py2;
210
211 px1 = XtoPixel(x1); py1 = YtoPixel(y1);
212 px2 = XtoPixel(x2); py2 = YtoPixel(y2);
213 if (px1 < px2) {pxl = px1; pxt = px2;}
214 else {pxl = px2; pxt = px1;}
215 if (py1 > py2) {pyl = py1; pyt = py2;}
216 else {pyl = py2; pyt = py1;}
217
218 if (bordersize == 1) {
219 col = gROOT->GetColor(fLineColor);
220 if (!col) {
221 fLineColor = 1;
222 col = gROOT->GetColor(fLineColor);
223 if (!col) return;
224 }
225 fImage->DrawBox(pxl, pyl, pxt, pyt-1, col->AsHexString(), TVirtualX::kFilled);
226 return;
227 }
228
229 if (!fImage->IsValid()) {
230 col = gROOT->GetColor(light);
231 if (!col) {
232 col = gROOT->GetColor(10);
233 if (!col) return;
234 }
235 fImage->DrawBox(pxl, pyl, pxt, pyt, // force image creation and resizing
236 "#ffffffff", 1, TVirtualX::kFilled);
237 }
238
239 TPoint frame[6];
240
241 frame[0].fX = pxl; frame[0].fY = pyl;
242 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
243 frame[2].fX = pxl + bordersize; frame[2].fY = pyt + bordersize;
244 frame[3].fX = pxt - bordersize; frame[3].fY = pyt + bordersize;
245 frame[4].fX = pxt; frame[4].fY = pyt;
246 frame[5].fX = pxl; frame[5].fY = pyt;
247
248 if (mode == -1) col = lo;
249 else col = hi;
250
251 fImage->DrawFillArea(6, frame, col->AsHexString());
252
253 frame[0].fX = pxl; frame[0].fY = pyl;
254 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
255 frame[2].fX = pxt - bordersize; frame[2].fY = frame[1].fY;
256 frame[3].fX = frame[2].fX; frame[3].fY = pyt + bordersize;
257 frame[4].fX = pxt; frame[4].fY = pyt;
258 frame[5].fX = pxt; frame[5].fY = pyl;
259
260 if (mode == -1) col = hi;
261 else col = lo;
262
263 fImage->DrawFillArea(6, frame, col->AsHexString());
264}
265
266////////////////////////////////////////////////////////////////////////////////
267/// draw polymarker
268
269template<typename T>
271{
272 if (!gPad || !fImage)
273 return;
274
275 TColor *col = gROOT->GetColor(GetMarkerColor());
276 if (!col)
277 col = gROOT->GetColor(1);
278
279 if (!col)
280 return;
281 TString colHex = col->AsHexString();
282
284
285 auto markerLineWidth = TAttMarker::GetMarkerLineWidth(GetMarkerStyle());
286 Int_t markerSize = 0; ///< size of simple markers
287 std::vector<TPoint> markerShape; ///< marker shape points
288 // prefer to use triangles while image not always correctly fill complex polygon
289 auto markerType = GetMarkerShape(markerSize, markerShape, gStyle->GetImageScaling(), TAttMarker::kPreferTriangles | TAttMarker::kDotAsLines);
290
291 for (Int_t i = 0; i < n; i++) {
292 auto ix = XtoPixel(xw[i]);
293 auto iy = YtoPixel(yw[i]);
294 for (auto &pnt : markerShape) {
295 pnt.fX += ix;
296 pnt.fY += iy;
297 }
298 switch(markerType) {
300 fImage->PutPixel(ix, iy, colHex.Data());
301 break;
303 // hollow circle
304 fImage->DrawCircle(ix, iy, markerSize/2, colHex.Data(), markerLineWidth);
305 break;
307 // filled circle
308 fImage->DrawCircle(ix, iy, markerSize/2, colHex.Data(), -1);
309 break;
311 // hollow polygon
312 fImage->DrawPolyLine(markerShape.size(), markerShape.data(), colHex.Data(), markerLineWidth);
313 break;
315 // filled polygon
316 fImage->FillPolygon(markerShape.size(), markerShape.data(), colHex.Data());
317 break;
319 // segmented line
320 for (std::size_t s = 0; s < markerShape.size(); s += 2)
321 fImage->DrawLine(markerShape[s].fX, markerShape[s].fY, markerShape[s + 1].fX, markerShape[s + 1].fY, colHex.Data(), markerLineWidth);
322 break;
324 // filled triangles
325 for (std::size_t t = 0; t < markerShape.size(); t += 3)
326 fImage->FillPolygon(3, markerShape.data() + t, colHex.Data());
327 break;
328 }
329 for (auto &pnt : markerShape) {
330 pnt.fX -= ix;
331 pnt.fY -= iy;
332 }
333 }
334}
335
336////////////////////////////////////////////////////////////////////////////////
337/// draw polymarker
338
343
344////////////////////////////////////////////////////////////////////////////////
345/// draw polymarker
346
351
352////////////////////////////////////////////////////////////////////////////////
353/// This function defines a path with xw and yw and draw it according the
354/// value of nn:
355///
356/// - If nn > 0 a line is drawn.
357/// - If nn < 0 a closed polygon is drawn.
358
360{
361 if (!gPad || !fImage || !nn)
362 return;
363
365
366 Bool_t line = nn > 1;
367 UInt_t n = TMath::Abs(nn);
368 Int_t fais = fFillStyle / 1000;
369 Int_t fasi = fFillStyle % 1000;
370
371 // SetLineStyle
372 std::vector<char> dashList;
373
374 TColor *fcol = gROOT->GetColor(fFillColor);
375 if (!fcol) { // no color, set it white
376 fFillColor = 10;
377 fcol = gROOT->GetColor(fFillColor);
378 }
379
380 TColor *lcol = gROOT->GetColor(fLineColor);
381 if (!lcol) { // no color, make it black
382 fLineColor = 1;
383 lcol = gROOT->GetColor(fLineColor);
384 }
385
386 if (line) {
387 if (fLineWidth <= 0)
388 return;
389 // dash lines
390 if (fLineStyle > 1) {
392 std::unique_ptr<TObjArray> tokens(st.Tokenize(" "));
393
394 if (tokens)
395 for (int j = 0; j < tokens->GetEntries(); j++) {
396 Int_t it;
397 sscanf(tokens->At(j)->GetName(), "%d", &it);
398 dashList.emplace_back((char)(it/4));
399 }
400 }
401 }
402
403 if (n == 1) { // point
404 auto px1 = XtoPixel(x[0]);
405 auto py1 = YtoPixel(y[0]);
406 if (fcol)
407 fImage->PutPixel(px1, py1, fcol->AsHexString());
408 return;
409 }
410
411 if (n == 2) { // line
412 auto px1 = XtoPixel(x[0]);
413 auto py1 = YtoPixel(y[0]);
414 auto px2 = XtoPixel(x[1]);
415 auto py2 = YtoPixel(y[1]);
416
417 // SetLineColor
418 if (lcol) {
419 if (fLineStyle < 2) {
420 fImage->DrawLine(px1, py1, px2, py2, lcol->AsHexString(), fLineWidth);
421 } else {
422 fImage->DrawDashLine(px1, py1, px2, py2, dashList.size(), dashList.data(),
423 lcol->AsHexString(), fLineWidth);
424 }
425 }
426 return;
427 }
428
429 if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100))
430 return;
431
432 std::vector<TPoint> pt(n+1);
433
434 for (UInt_t i = 0; i < n; i++) {
435 pt[i].fX = XtoPixel(x[i]);
436 pt[i].fY = YtoPixel(y[i]);
437 }
438 pt[n].fX = pt[0].fX;
439 pt[n].fY = pt[0].fY;
440
441 const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : nullptr;
442
443 // filled polygon
444 if (!line && fFillStyle && (fFillStyle != 4000) && fcol) {
445 if (n < 5) // convex
446 fImage->FillPolygon(n, pt.data(), fcol->AsHexString(), stipple);
447 else // non-convex fill area
448 fImage->DrawFillArea(n, pt.data(), fcol->AsHexString(), stipple);
449 }
450
451 // hollow polygon or polyline is drawn
452 if (line || !fFillStyle || (fFillStyle == 4000)) {
453 if (!line) {
454 if (fcol)
455 fImage->DrawPolyLine(n+1, pt.data(), fcol->AsHexString(), 1);
456 } else if (lcol) {
457 if (fLineStyle < 2) { // solid
458 fImage->DrawPolyLine(n, pt.data(), lcol->AsHexString(), fLineWidth);
459 } else { // dashed
460 DrawDashPolyLine(n, pt.data(), dashList.size(), dashList.data(),
461 lcol->AsHexString(), fLineWidth);
462 }
463 }
464 }
465}
466
467////////////////////////////////////////////////////////////////////////////////
468/// not used
469
471{
472 if (!gPad || !fImage) {
473 return;
474 }
475}
476
477////////////////////////////////////////////////////////////////////////////////
478/// draw dashed polyline
479
481 const char* pDash, const char* col, UInt_t thick)
482{
483 Int_t x0 = xy[0].GetX();
484 Int_t y0 = xy[0].GetY();
485
486 for (Int_t i = 1; i < nn; i++) {
487 Int_t x = xy[i].GetX();
488 Int_t y = xy[i].GetY();
489
491
492 x0 = x;
493 y0 = y;
494 }
495}
496
497////////////////////////////////////////////////////////////////////////////////
498/// new page
499
501{
502 fX0 = fY0 = 0;
503 if (gPad && fImage) {
504 UInt_t w = gPad->GetWw() * gStyle->GetImageScaling();
505 UInt_t h = gPad->GetWh() * gStyle->GetImageScaling();
506 if (gPad != gPad->GetMother()) {
507 fX0 = gPad->XtoAbsPixel(gPad->GetX1())* gStyle->GetImageScaling();
508 fY0 = gPad->YtoAbsPixel(gPad->GetY2())* gStyle->GetImageScaling();
509 w = w * gPad->GetAbsWNDC();
510 h = h * gPad->GetAbsHNDC();
511 }
512 fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
513 }
514}
515
516////////////////////////////////////////////////////////////////////////////////
517/// Draw text
518///
519/// - x: x position of the text
520/// - y: y position of the text
521
523{
524 if (!gPad || !fImage)
525 return;
526
528
529 TText t(x, y, chars);
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Draw text
540///
541/// - x: x position of the text
542/// - y: y position of the text
543
545{
546 if (!gPad || !fImage)
547 return;
548
550
551 TText t(x, y, chars);
558}
559
560////////////////////////////////////////////////////////////////////////////////
561/// Draw text with URL. Same as Text.
562///
563
564void TImageDump::TextUrl(Double_t x, Double_t y, const char *chars, const char *)
565{
566 Text(x, y, chars);
567}
568
569////////////////////////////////////////////////////////////////////////////////
570///cell array begin
571
574{
575 if (!gPad || !fImage || (w <= 0) || (h <= 0))
576 return;
577
579
580 fCellArrayW = w;
581 fCellArrayH = h;
582 fCellArrayColors.resize(w * h);
583 fCellArrayIdx = 0;
584
589}
590
591////////////////////////////////////////////////////////////////////////////////
592/// Cell array fill
593
595{
596 if (fCellArrayIdx >= fCellArrayColors.size())
597 return;
598
600
601 fCellArrayColors[fCellArrayIdx++] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
602}
603
604////////////////////////////////////////////////////////////////////////////////
605/// Cell array end
606
608{
609 if (!fImage || fCellArrayColors.empty() || !fCellArrayW || !fCellArrayH)
610 return;
611
613
616
617 fCellArrayColors.clear();
618 fCellArrayIdx = 0;
619 fCellArrayW = 0;
620 fCellArrayH = 0;
621 fCellArrayX1 = 0;
622 fCellArrayX2 = 0;
623 fCellArrayY1 = 0;
624 fCellArrayY2 = 0;
625}
626
627////////////////////////////////////////////////////////////////////////////////
628/// Draw image
629
631{
632 if (fImage)
633 fImage->Merge(img, "alphablend", x, y);
634}
635
636
637////////////////////////////////////////////////////////////////////////////////
638/// Set color with its R G B components
639///
640/// - r: % of red in [0,1]
641/// - g: % of green in [0,1]
642/// - b: % of blue in [0,1]
643
645{
646}
647
648////////////////////////////////////////////////////////////////////////////////
649/// x to pixel
650
652{
653 return gPad->XtoAbsPixel(x)*gStyle->GetImageScaling() - fX0;
654}
655
656////////////////////////////////////////////////////////////////////////////////
657/// y to pixel
658
660{
661 return gPad->YtoAbsPixel(y)*gStyle->GetImageScaling() - fY0;
662}
#define b(i)
Definition RSha256.hxx:100
#define g(i)
Definition RSha256.hxx:105
#define h(i)
Definition RSha256.hxx:106
const unsigned char gStipples[26][32]
Definition RStipples.h:24
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:54
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char y1
#define hi
#define gROOT
Definition TROOT.h:417
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
R__EXTERN TVirtualPS * gVirtualPS
Definition TVirtualPS.h:93
#define gPad
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:25
Color_t fFillColor
Fill area color.
Definition TAttFill.h:24
Width_t fLineWidth
Line width.
Definition TAttLine.h:26
Style_t fLineStyle
Line style.
Definition TAttLine.h:25
Color_t fLineColor
Line color.
Definition TAttLine.h:24
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition TAttMarker.h:35
virtual Color_t GetMarkerColor() const
Return the marker color.
Definition TAttMarker.h:34
@ kPreferTriangles
Definition TAttMarker.h:50
EMarkerShape GetMarkerShape(Int_t &sz, std::vector< TPoint > &points, Float_t scale=1., UInt_t flags=0) const
Return marker shape.
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
@ kShapeTriangles
Definition TAttMarker.h:48
@ kShapeFilledArea
Definition TAttMarker.h:48
@ kShapeFilledCircle
Definition TAttMarker.h:48
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:48
Color_t fTextColor
Text color.
Definition TAttText.h:27
Float_t fTextAngle
Text angle.
Definition TAttText.h:24
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
Definition TAttText.h:49
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition TAttText.h:50
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:52
Font_t fTextFont
Text font.
Definition TAttText.h:28
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:53
Short_t fTextAlign
Text alignment.
Definition TAttText.h:26
Float_t fTextSize
Text size.
Definition TAttText.h:25
The color creation and management class.
Definition TColor.h:22
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1939
Int_t fCellArrayY1
Definition TImageDump.h:33
void NewPage() override
new page
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
void CellArrayEnd() override
Cell array end.
std::vector< UInt_t > fCellArrayColors
Definition TImageDump.h:28
void DrawDashPolyLine(Int_t npoints, TPoint *pt, UInt_t nDash, const char *pDash, const char *col, UInt_t thick)
draw dashed polyline
TImageDump()
Default constructor.
Int_t YtoPixel(Double_t y)
y to pixel
TImage * fImage
Image.
Definition TImageDump.h:24
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Cell array fill.
~TImageDump() override
destructor
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
draw polymarker
Int_t fCellArrayX1
Definition TImageDump.h:31
void Open(const char *filename, Int_t type=-111) override
Open a image file.
Int_t fX0
Definition TImageDump.h:26
void DrawPolyMarkerShape(Int_t n, T *x, T *y)
draw polymarker
void Close(Option_t *opt="") override
Close a image file.
Int_t fCellArrayX2
Definition TImageDump.h:32
Int_t fCellArrayH
Definition TImageDump.h:30
Int_t fCellArrayY2
Definition TImageDump.h:34
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
not used
UInt_t fCellArrayIdx
Definition TImageDump.h:35
void Text(Double_t x, Double_t y, const char *string) override
Draw text.
void SetColor(Float_t r, Float_t g, Float_t b) override
Set color with its R G B components.
Int_t fCellArrayW
Definition TImageDump.h:29
void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light) override
Draw a Frame around a box.
Int_t fType
PostScript workstation type.
Definition TImageDump.h:25
Int_t XtoPixel(Double_t x)
x to pixel
void DrawImage(TImage *img, Int_t x, Int_t y, Int_t flags=0) override
Draw image.
Int_t fY0
offset of selected pad to canvas
Definition TImageDump.h:26
void TextUrl(Double_t x, Double_t y, const char *string, const char *url) override
Draw text with URL.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override
cell array begin
An abstract interface to image processing library.
Definition TImage.h:29
virtual void DrawFillArea(UInt_t, TPoint *, const char *="#000000", const char *=nullptr, UInt_t=16, UInt_t=16)
Definition TImage.h:209
virtual void DrawDashLine(UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, const char *, const char *="#000000", UInt_t=1)
Definition TImage.h:186
virtual void DrawPolyLine(UInt_t, TPoint *, const char *="#000000", UInt_t=1, TImage::ECoordMode=kCoordModeOrigin)
Definition TImage.h:194
virtual void PutPixel(Int_t, Int_t, const char *="#000000")
Definition TImage.h:196
virtual void DrawCellArray(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, UInt_t *)
Definition TImage.h:218
virtual void DrawBox(Int_t, Int_t, Int_t, Int_t, const char *="#000000", UInt_t=1, Int_t=0)
Definition TImage.h:188
static TImage * Create()
Create an image.
Definition TImage.cxx:34
virtual void DrawLine(UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
Definition TImage.h:184
virtual void WriteImage(const char *, EImageFileTypes=TImage::kUnknown)
Definition TImage.h:115
virtual void FillPolygon(UInt_t, TPoint *, const char *="#000000", const char *=nullptr, UInt_t=16, UInt_t=16)
Definition TImage.h:205
virtual Bool_t IsValid() const
Definition TImage.h:231
virtual void DrawRectangle(UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
Definition TImage.h:190
virtual void DrawCircle(Int_t, Int_t, Int_t, const char *="#000000", Int_t=1)
Definition TImage.h:222
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition TImage.h:172
virtual void BeginPaint(Bool_t=kTRUE)
Definition TImage.h:182
virtual void DrawTextOnPad(TText *, Int_t=0, Int_t=0, TVirtualPad *=nullptr, Int_t=0, Int_t=0)
Draw text on specified pad, check pad clipping rules.
Definition TImage.cxx:193
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
SCoord_t GetY() const
Definition TPoint.h:47
SCoord_t GetX() const
Definition TPoint.h:46
Basic string class.
Definition TString.h:138
Float_t GetImageScaling() const
Definition TStyle.h:241
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition TStyle.cxx:1167
Base class for several text objects.
Definition TText.h:22
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition TVirtualPS.h:32
TPaveText * pt
TLine * line
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122