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 fImage = nullptr;
55 gVirtualPS = this;
56 fType = 0;
57 SetTitle("IMG");
58}
59
60////////////////////////////////////////////////////////////////////////////////
61/// Initialize batch image interface
62///
63/// fname : image file name
64///
65/// The possible workstation types are:
66/// - 111 - Portrait
67/// - 112 - Landscape
68/// - 114 - preview, keep in memory (do not write on delete)
69
71{
73 gVirtualPS = this;
74 SetTitle("IMG");
75}
76
77////////////////////////////////////////////////////////////////////////////////
78/// Open a image file
79
80void TImageDump::Open(const char *fname, Int_t type)
81{
83 fType = type;
85}
86
87////////////////////////////////////////////////////////////////////////////////
88/// destructor
89
91{
92 Close();
93
94 delete fImage;
95 fImage = nullptr;
96
97 gVirtualPS = nullptr;
98}
99
100////////////////////////////////////////////////////////////////////////////////
101/// Close a image file
102
104{
105 // if fType == 114 - do not write image
106 if (!fImage || (fType == 114)) {
107 return;
108 }
109
110 //if (fType == 112) fImage->Flip(90);
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Draw a Box
116
118{
119 if (!gPad || !fImage)
120 return;
121
123
124 Double_t x[4], y[4];
125 Int_t ix1 = x1 < x2 ? XtoPixel(x1) : XtoPixel(x2);
126 Int_t ix2 = x1 < x2 ? XtoPixel(x2) : XtoPixel(x1);
127 Int_t iy1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
128 Int_t iy2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);
129
130 if (ix1<0 || ix2 <0 || iy1 < 0 || iy2 <0) return; // box is not visible
131
132 if (TMath::Abs(ix2-ix1) < 1) ix2 = ix1+1;
133 if (TMath::Abs(iy1-iy2) < 1) iy1 = iy2+1;
134
135 Int_t fillis = fFillStyle/1000;
136 Int_t fillsi = fFillStyle%1000;
137
139 if (!col) { // no color, set it white
140 fFillColor = 10;
141 col = gROOT->GetColor(fFillColor);
142 if (!col) return;
143 }
144
145 TColor *linecol = gROOT->GetColor(fLineColor);
146 if (!linecol) { // no color, set it to black
147 fLineColor = 1;
148 linecol = gROOT->GetColor(fLineColor);
149 }
150
151 if ((fillis == 3) || (fillis == 2)) {
152 if (fillsi > 99) {
153 x[0] = x1; y[0] = y1;
154 x[1] = x2; y[1] = y1;
155 x[2] = x2; y[2] = y2;
156 x[3] = x1; y[3] = y2;
157 return;
158 }
159 if ((fillsi > 0) && (fillsi < 26)) {
160 x[0] = x1; y[0] = y1;
161 x[1] = x2; y[1] = y1;
162 x[2] = x2; y[2] = y2;
163 x[3] = x1; y[3] = y2;
164 DrawPS(-4, &x[0], &y[0]);
165 }
166 if (fillsi == -3) {
167 // fill style = -3 ... which is NEVER used now
168 }
169 }
170
171 if (fillis == 1) {
173 }
174
175 if (fillis == 0) {
176 if (fLineWidth<=0) return;
178 }
179}
180
181////////////////////////////////////////////////////////////////////////////////
182/// Draw a Frame around a box
183///
184/// - mode = -1 the box looks as it is behind the screen
185/// - mode = 1 the box looks as it is in front of the screen
186/// border is the border size in already pre-computed dark is the
187/// color for the dark part of the frame light is the color for the light
188/// part of the frame
189
192{
193 if (!gPad || !fImage) {
194 return;
195 }
196
198
199 bordersize = bordersize < 1 ? 1 : bordersize;
200
201 TColor *col;
202 TColor *lo = gROOT->GetColor(dark);
203 if (!lo) {
204 lo = gROOT->GetColor(10);
205 }
207 if (!hi) {
208 hi = gROOT->GetColor(10);
209 }
210
211 Short_t pxl,pyl,pxt,pyt,px1,py1,px2,py2;
212
213 px1 = XtoPixel(x1); py1 = YtoPixel(y1);
214 px2 = XtoPixel(x2); py2 = YtoPixel(y2);
215 if (px1 < px2) {pxl = px1; pxt = px2;}
216 else {pxl = px2; pxt = px1;}
217 if (py1 > py2) {pyl = py1; pyt = py2;}
218 else {pyl = py2; pyt = py1;}
219
220 if (bordersize == 1) {
221 col = gROOT->GetColor(fLineColor);
222 if (!col) {
223 fLineColor = 1;
224 col = gROOT->GetColor(fLineColor);
225 if (!col) return;
226 }
228 return;
229 }
230
231 if (!fImage->IsValid()) {
232 col = gROOT->GetColor(light);
233 if (!col) {
234 col = gROOT->GetColor(10);
235 if (!col) return;
236 }
237 fImage->DrawBox(pxl, pyl, pxt, pyt, // force image creation and resizing
238 "#ffffffff", 1, TVirtualX::kFilled);
239 }
240
241 TPoint frame[6];
242
243 frame[0].fX = pxl; frame[0].fY = pyl;
244 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
245 frame[2].fX = pxl + bordersize; frame[2].fY = pyt + bordersize;
246 frame[3].fX = pxt - bordersize; frame[3].fY = pyt + bordersize;
247 frame[4].fX = pxt; frame[4].fY = pyt;
248 frame[5].fX = pxl; frame[5].fY = pyt;
249
250 if (mode == -1) col = lo;
251 else col = hi;
252
253 fImage->DrawFillArea(6, frame, col->AsHexString());
254
255 frame[0].fX = pxl; frame[0].fY = pyl;
256 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
257 frame[2].fX = pxt - bordersize; frame[2].fY = frame[1].fY;
258 frame[3].fX = frame[2].fX; frame[3].fY = pyt + bordersize;
259 frame[4].fX = pxt; frame[4].fY = pyt;
260 frame[5].fX = pxt; frame[5].fY = pyl;
261
262 if (mode == -1) col = hi;
263 else col = lo;
264
265 fImage->DrawFillArea(6, frame, col->AsHexString());
266}
267
268////////////////////////////////////////////////////////////////////////////////
269/// not used
270
272{
273 if (!gPad || !fImage) {
274 return;
275 }
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// draw polymarker
280
282{
283 if (!gPad || !fImage)
284 return;
285
287
290 TPoint pt[20];
291
292 if (ms == 4)
293 ms = 24;
294 else if (ms == 8)
295 ms = 20;
296 else if (ms >= 9 && ms <= 19)
297 ms = 1;
298
299 // Define the marker size
300 const Int_t kBASEMARKER = 8;
302 if (ms == 6) msize *= 0.2;
303 if (ms == 7) msize *= 0.3;
304 Double_t m = msize;
305 Double_t m2 = m/2;
306 Double_t m3 = m/3;
307 Double_t m6 = m/6;
308 Double_t m4 = m/4;
309 Double_t m8 = m/8;
310 Double_t m0 = m*0.1;
311
313 if (!col) { // no color
314 fMarkerColor = 1;
316 if (!col) return;
317 }
318 if (col->GetAlpha()<1.) {
319 if (ms==8) ms = 108;
320 if (ms==20) ms = 120;
321 }
322
324
325 // Draw the marker according to the type
326 Short_t ix,iy;
327 for (Int_t i=0;i<n;i++) {
328 ix = XtoPixel(xw[i]);
329 iy = YtoPixel(yw[i]);
330
331 switch (ms) {
332 // Dots (.) big, medium and small
333 case 7:
334 fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy-1, col->AsHexString());
335 fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy+1, col->AsHexString());
336 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy+1, col->AsHexString());
337 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy-1, col->AsHexString());
338 case 6:
339 fImage->PutPixel((UInt_t)ix, (UInt_t)iy-1, col->AsHexString());
340 fImage->PutPixel((UInt_t)ix, (UInt_t)iy+1, col->AsHexString());
341 fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy, col->AsHexString());
342 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy, col->AsHexString());
343 case 1:
344 fImage->PutPixel((UInt_t)ix, (UInt_t)iy, col->AsHexString());
345 break;
346 // Plus (+)
347 case 2:
348 fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString(), mlinewidth);
349 fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString(), mlinewidth);
350 break;
351 // X shape (X)
352 case 5:
353 fImage->DrawLine(UInt_t(ix-m2*0.707), UInt_t(iy-m2*0.707), UInt_t(ix+m2*0.707), UInt_t(iy+m2*0.707), col->AsHexString(), mlinewidth);
354 fImage->DrawLine(UInt_t(ix-m2*0.707), UInt_t(iy+m2*0.707), UInt_t(ix+m2*0.707), UInt_t(iy-m2*0.707), col->AsHexString(), mlinewidth);
355 break;
356 // Asterisk shape (*)
357 case 3:
358 case 31:
359 fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString(), mlinewidth);
360 fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString(), mlinewidth);
361 fImage->DrawLine(UInt_t(ix-m2*0.707), UInt_t(iy-m2*0.707), UInt_t(ix+m2*0.707), UInt_t(iy+m2*0.707), col->AsHexString(), mlinewidth);
362 fImage->DrawLine(UInt_t(ix-m2*0.707), UInt_t(iy+m2*0.707), UInt_t(ix+m2*0.707), UInt_t(iy-m2*0.707), col->AsHexString(), mlinewidth);
363 break;
364 // Circle
365 case 4:
366 case 24:
367 fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), mlinewidth);
368 break;
369 // Circle
370 case 8:
371 case 20:
372 fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), -1);
373 break;
374 case 108:
375 case 120:
376 for (int idx=Int_t(msize/2); idx>0; idx--) fImage->DrawCircle(ix, iy, idx, col->AsHexString(), 1);
377 fImage->PutPixel((UInt_t)ix, (UInt_t)iy, col->AsHexString());
378 break;
379 // Square
380 case 21:
381 fImage->FillRectangle(col->AsHexString(), UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m));
382 break;
383 case 25:
384 fImage->DrawRectangle(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m), col->AsHexString(), mlinewidth);
385 break;
386 // Down triangle
387 case 23:
388 case 32:
389 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
390 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
391 pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
392 pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy-m2);
393 ms == 32 ? fImage->DrawPolyLine(4, pt, col->AsHexString(), mlinewidth) :
394 fImage->FillPolygon(3, pt, col->AsHexString());
395 break;
396 // Up triangle
397 case 22:
398 case 26:
399 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
400 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy+m2);
401 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m2);
402 pt[3].fX = Short_t(ix); pt[3].fY = Short_t(iy-m2);
403 ms == 26 ? fImage->DrawPolyLine(4, pt, col->AsHexString(), mlinewidth) :
404 fImage->FillPolygon(3, pt, col->AsHexString());
405 break;
406 case 27:
407 case 33:
408 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
409 pt[1].fX = Short_t(ix+m3); pt[1].fY = Short_t(iy);
410 pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
411 pt[3].fX = Short_t(ix-m3); pt[3].fY = Short_t(iy);
412 pt[4].fX = Short_t(ix); pt[4].fY = Short_t(iy-m2);
413 ms == 27 ? fImage->DrawPolyLine(5, pt, col->AsHexString(), mlinewidth) :
414 fImage->FillPolygon(4, pt, col->AsHexString());
415 break;
416 case 28:
417 case 34:
418 pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6);
419 pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
420 pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
421 pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
422 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
423 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
424 pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
425 pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
426 pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
427 pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
428 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
429 pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
430 pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6);
431 ms == 28 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
432 fImage->FillPolygon(12, pt, col->AsHexString());
433 break;
434 case 29:
435 case 30:
436 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy+m2);
437 pt[1].fX = Short_t(ix+0.112255*m); pt[1].fY = Short_t(iy+0.15451*m);
438 pt[2].fX = Short_t(ix+0.47552*m); pt[2].fY = Short_t(iy+0.15451*m);
439 pt[3].fX = Short_t(ix+0.181635*m); pt[3].fY = Short_t(iy-0.05902*m);
440 pt[4].fX = Short_t(ix+0.29389*m); pt[4].fY = Short_t(iy-0.40451*m);
441 pt[5].fX = Short_t(ix); pt[5].fY = Short_t(iy-0.19098*m);
442 pt[6].fX = Short_t(ix-0.29389*m); pt[6].fY = Short_t(iy-0.40451*m);
443 pt[7].fX = Short_t(ix-0.181635*m); pt[7].fY = Short_t(iy-0.05902*m);
444 pt[8].fX = Short_t(ix-0.47552*m); pt[8].fY = Short_t(iy+0.15451*m);
445 pt[9].fX = Short_t(ix-0.112255*m); pt[9].fY = Short_t(iy+0.15451*m);
446 pt[10].fX = Short_t(ix); pt[10].fY = Short_t(iy+m2);
447 ms == 30 ? fImage->DrawPolyLine(11, pt, col->AsHexString(), mlinewidth) :
448 fImage->DrawFillArea(10, pt, col->AsHexString());
449 break;
450 case 35:
451 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
452 pt[1].fX = Short_t(ix ); pt[1].fY = Short_t(iy-m2);
453 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy );
454 pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy+m2);
455 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy );
456 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy );
457 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy+m2);
458 pt[7].fX = Short_t(ix ); pt[7].fY = Short_t(iy-m2);
460 break;
461 case 36:
462 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
463 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
464 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m2);
465 pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy+m2);
466 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m2);
467 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m2);
468 pt[6].fX = Short_t(ix-m2); pt[6].fY = Short_t(iy+m2);
469 pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m2);
471 break;
472 case 37:
473 case 39:
474 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
475 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy-m2);
476 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
477 pt[3].fX = Short_t(ix+m2); pt[3].fY = Short_t(iy );
478 pt[4].fX = Short_t(ix+m4); pt[4].fY = Short_t(iy-m2);
479 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy+m2);
480 pt[6].fX = Short_t(ix+m4); pt[6].fY = Short_t(iy+m2);
481 pt[7].fX = Short_t(ix ); pt[7].fY = Short_t(iy );
482 ms == 37 ? fImage->DrawPolyLine(8, pt, col->AsHexString(), mlinewidth) :
483 fImage->DrawFillArea(7, pt, col->AsHexString());
484 break;
485 case 38:
486 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
487 pt[1].fX = Short_t(ix-m2); pt[1].fY = Short_t(iy-m4);
488 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy-m2);
489 pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
490 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
491 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m4);
492 pt[6].fX = Short_t(ix+m4); pt[6].fY = Short_t(iy+m2);
493 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy+m2);
494 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
495 pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy );
496 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy );
497 pt[11].fX = Short_t(ix ); pt[11].fY = Short_t(iy );
498 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy-m2);
499 pt[13].fX = Short_t(ix ); pt[13].fY = Short_t(iy+m2);
500 pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy );
502 break;
503 case 40:
504 case 41:
505 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
506 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
507 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m4);
508 pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy );
509 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
510 pt[5].fX = Short_t(ix+m4); pt[5].fY = Short_t(iy-m2);
511 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy );
512 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
513 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy-m4);
514 pt[9].fX = Short_t(ix ); pt[9].fY = Short_t(iy );
515 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m4);
516 pt[11].fX = Short_t(ix-m4); pt[11].fY = Short_t(iy+m2);
517 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy );
518 ms == 40 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
519 fImage->DrawFillArea(12, pt, col->AsHexString());
520 break;
521 case 42:
522 case 43:
523 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m2);
524 pt[1].fX = Short_t(ix-m8); pt[1].fY = Short_t(iy+m8);
525 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
526 pt[3].fX = Short_t(ix-m8); pt[3].fY = Short_t(iy-m8);
527 pt[4].fX = Short_t(ix ); pt[4].fY = Short_t(iy-m2);
528 pt[5].fX = Short_t(ix+m8); pt[5].fY = Short_t(iy-m8);
529 pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy );
530 pt[7].fX = Short_t(ix+m8); pt[7].fY = Short_t(iy+m8);
531 pt[8].fX = Short_t(ix ); pt[8].fY = Short_t(iy+m2);
532 ms == 42 ? fImage->DrawPolyLine(9, pt, col->AsHexString(), mlinewidth) :
533 fImage->DrawFillArea(8, pt, col->AsHexString());
534 break;
535 case 44:
536 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
537 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
538 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy+m2);
539 pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
540 pt[4].fX = Short_t(ix-m4); pt[4].fY = Short_t(iy-m2);
541 pt[5].fX = Short_t(ix ); pt[5].fY = Short_t(iy );
542 pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy+m4);
543 pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m4);
544 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
545 pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy-m4);
546 pt[10].fX = Short_t(ix ); pt[10].fY = Short_t(iy );
548 break;
549 case 45:
550 pt[0].fX = Short_t(ix+m0); pt[0].fY = Short_t(iy+m0);
551 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
552 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy+m2);
553 pt[3].fX = Short_t(ix-m0); pt[3].fY = Short_t(iy+m0);
554 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy+m4);
555 pt[5].fX = Short_t(ix-m2); pt[5].fY = Short_t(iy-m4);
556 pt[6].fX = Short_t(ix-m0); pt[6].fY = Short_t(iy-m0);
557 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
558 pt[8].fX = Short_t(ix+m4); pt[8].fY = Short_t(iy-m2);
559 pt[9].fX = Short_t(ix+m0); pt[9].fY = Short_t(iy-m0);
560 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy-m4);
561 pt[11].fX = Short_t(ix+m2); pt[11].fY = Short_t(iy+m4);
562 pt[12].fX = Short_t(ix+m0); pt[12].fY = Short_t(iy+m0);
563 fImage->DrawFillArea(13, pt, col->AsHexString());
564 break;
565 case 46:
566 case 47:
567 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4);
568 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
569 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
570 pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
571 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
572 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
573 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
574 pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
575 pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
576 pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
577 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
578 pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
579 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4);
580 ms == 46 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
581 fImage->DrawFillArea(12, pt, col->AsHexString());
582 break;
583 case 48:
584 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4*1.005);
585 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
586 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
587 pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
588 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
589 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
590 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
591 pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
592 pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
593 pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
594 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
595 pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
596 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4*0.995);
597 pt[13].fX = Short_t(ix+m4*0.995); pt[13].fY = Short_t(iy );
598 pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy-m4*0.995);
599 pt[15].fX = Short_t(ix-m4*0.995); pt[15].fY = Short_t(iy );
600 pt[16].fX = Short_t(ix ); pt[16].fY = Short_t(iy+m4*0.995);
601 fImage->DrawFillArea(17, pt, col->AsHexString());
602 break;
603 case 49:
604 pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6*1.005);
605 pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
606 pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
607 pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
608 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
609 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
610 pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
611 pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
612 pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
613 pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
614 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
615 pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
616 pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6*0.995);
617 pt[13].fX = Short_t(ix-m6); pt[13].fY = Short_t(iy+m6);
618 pt[14].fX = Short_t(ix+m6); pt[14].fY = Short_t(iy+m6);
619 pt[15].fX = Short_t(ix+m6); pt[15].fY = Short_t(iy-m6);
620 pt[16].fX = Short_t(ix-m6); pt[16].fY = Short_t(iy-m6*1.005);
621 fImage->DrawFillArea(17, pt, col->AsHexString());
622 break;
623 default:
624 fImage->PutPixel(UInt_t(ix), UInt_t(iy), col->AsHexString());
625 break;
626 }
627 }
628}
629
630////////////////////////////////////////////////////////////////////////////////
631/// This function defines a path with xw and yw and draw it according the
632/// value of nn:
633///
634/// - If nn > 0 a line is drawn.
635/// - If nn < 0 a closed polygon is drawn.
636
638{
639 if (!gPad || !fImage || !nn)
640 return;
641
643
644 Bool_t line = nn > 1;
646 Int_t fais = fFillStyle / 1000;
647 Int_t fasi = fFillStyle % 1000;
648
649 // SetLineStyle
650 std::vector<char> dashList;
651
652 TColor *fcol = gROOT->GetColor(fFillColor);
653 if (!fcol) { // no color, set it white
654 fFillColor = 10;
655 fcol = gROOT->GetColor(fFillColor);
656 }
657
658 TColor *lcol = gROOT->GetColor(fLineColor);
659 if (!lcol) { // no color, make it black
660 fLineColor = 1;
661 lcol = gROOT->GetColor(fLineColor);
662 }
663
664 if (line) {
665 if (fLineWidth <= 0)
666 return;
667 // dash lines
668 if (fLineStyle > 1) {
670 std::unique_ptr<TObjArray> tokens(st.Tokenize(" "));
671
672 if (tokens)
673 for (int j = 0; j < tokens->GetEntries(); j++) {
674 Int_t it;
675 sscanf(tokens->At(j)->GetName(), "%d", &it);
676 dashList.emplace_back((char)(it/4));
677 }
678 }
679 }
680
681 if (n == 1) { // point
682 auto px1 = XtoPixel(x[0]);
683 auto py1 = YtoPixel(y[0]);
684 if (fcol)
685 fImage->PutPixel(px1, py1, fcol->AsHexString());
686 return;
687 }
688
689 if (n == 2) { // line
690 auto px1 = XtoPixel(x[0]);
691 auto py1 = YtoPixel(y[0]);
692 auto px2 = XtoPixel(x[1]);
693 auto py2 = YtoPixel(y[1]);
694
695 // SetLineColor
696 if (lcol) {
697 if (fLineStyle < 2) {
698 fImage->DrawLine(px1, py1, px2, py2, lcol->AsHexString(), fLineWidth);
699 } else {
700 fImage->DrawDashLine(px1, py1, px2, py2, dashList.size(), dashList.data(),
701 lcol->AsHexString(), fLineWidth);
702 }
703 }
704 return;
705 }
706
707 if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100))
708 return;
709
710 std::vector<TPoint> pt(n+1);
711
712 for (UInt_t i = 0; i < n; i++) {
713 pt[i].fX = XtoPixel(x[i]);
714 pt[i].fY = YtoPixel(y[i]);
715 }
716 pt[n].fX = pt[0].fX;
717 pt[n].fY = pt[0].fY;
718
719 const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : nullptr;
720
721 // filled polygon
722 if (!line && fFillStyle && (fFillStyle != 4000) && fcol) {
723 if (n < 5) // convex
724 fImage->FillPolygon(n, pt.data(), fcol->AsHexString(), stipple);
725 else // non-convex fill area
726 fImage->DrawFillArea(n, pt.data(), fcol->AsHexString(), stipple);
727 }
728
729 // hollow polygon or polyline is drawn
730 if (line || !fFillStyle || (fFillStyle == 4000)) {
731 if (!line) {
732 if (fcol)
733 fImage->DrawPolyLine(n+1, pt.data(), fcol->AsHexString(), 1);
734 } else if (lcol) {
735 if (fLineStyle < 2) { // solid
736 fImage->DrawPolyLine(n, pt.data(), lcol->AsHexString(), fLineWidth);
737 } else { // dashed
738 DrawDashPolyLine(n, pt.data(), dashList.size(), dashList.data(),
739 lcol->AsHexString(), fLineWidth);
740 }
741 }
742 }
743}
744
745////////////////////////////////////////////////////////////////////////////////
746/// not used
747
749{
750 if (!gPad || !fImage) {
751 return;
752 }
753}
754
755////////////////////////////////////////////////////////////////////////////////
756/// draw dashed polyline
757
759 const char* pDash, const char* col, UInt_t thick)
760{
761 Int_t x0 = xy[0].GetX();
762 Int_t y0 = xy[0].GetY();
763
764 for (Int_t i = 1; i < nn; i++) {
765 Int_t x = xy[i].GetX();
766 Int_t y = xy[i].GetY();
767
768 fImage->DrawDashLine(x0, y0, x, y, nDash, pDash, col, thick);
769
770 x0 = x;
771 y0 = y;
772 }
773}
774
775////////////////////////////////////////////////////////////////////////////////
776/// new page
777
779{
780 fX0 = fY0 = 0;
781 if (gPad && fImage) {
782 UInt_t w = gPad->GetWw() * gStyle->GetImageScaling();
783 UInt_t h = gPad->GetWh() * gStyle->GetImageScaling();
784 if (gPad != gPad->GetMother()) {
785 fX0 = gPad->XtoAbsPixel(gPad->GetX1())* gStyle->GetImageScaling();
786 fY0 = gPad->YtoAbsPixel(gPad->GetY2())* gStyle->GetImageScaling();
787 w = w * gPad->GetAbsWNDC();
788 h = h * gPad->GetAbsHNDC();
789 }
790 fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
791 }
792}
793
794////////////////////////////////////////////////////////////////////////////////
795/// Draw text
796///
797/// - x: x position of the text
798/// - y: y position of the text
799
801{
802 if (!gPad || !fImage)
803 return;
804
806
807 TText t(x, y, chars);
814}
815
816////////////////////////////////////////////////////////////////////////////////
817/// Draw text
818///
819/// - x: x position of the text
820/// - y: y position of the text
821
823{
824 if (!gPad || !fImage)
825 return;
826
828
829 TText t(x, y, chars);
836}
837
838////////////////////////////////////////////////////////////////////////////////
839/// Draw text with URL. Same as Text.
840///
841
842void TImageDump::TextUrl(Double_t x, Double_t y, const char *chars, const char *)
843{
844 Text(x, y, chars);
845}
846
847////////////////////////////////////////////////////////////////////////////////
848///cell array begin
849
852{
853 if (!gPad || !fImage || (w <= 0) || (h <= 0))
854 return;
855
857
858 fCellArrayW = w;
859 fCellArrayH = h;
860 fCellArrayColors.resize(w * h);
861 fCellArrayIdx = 0;
862
867}
868
869////////////////////////////////////////////////////////////////////////////////
870/// Cell array fill
871
873{
874 if (fCellArrayIdx >= fCellArrayColors.size())
875 return;
876
878
879 fCellArrayColors[fCellArrayIdx++] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
880}
881
882////////////////////////////////////////////////////////////////////////////////
883/// Cell array end
884
886{
887 if (!fImage || fCellArrayColors.empty() || !fCellArrayW || !fCellArrayH)
888 return;
889
891
894
895 fCellArrayColors.clear();
896 fCellArrayIdx = 0;
897 fCellArrayW = 0;
898 fCellArrayH = 0;
899 fCellArrayX1 = 0;
900 fCellArrayX2 = 0;
901 fCellArrayY1 = 0;
902 fCellArrayY2 = 0;
903}
904
905////////////////////////////////////////////////////////////////////////////////
906/// Set color with its R G B components
907///
908/// - r: % of red in [0,1]
909/// - g: % of green in [0,1]
910/// - b: % of blue in [0,1]
911
913{
914}
915
916////////////////////////////////////////////////////////////////////////////////
917/// x to pixel
918
920{
921 return gPad->XtoAbsPixel(x)*gStyle->GetImageScaling() - fX0;
922}
923
924////////////////////////////////////////////////////////////////////////////////
925/// y to pixel
926
928{
929 return gPad->YtoAbsPixel(y)*gStyle->GetImageScaling() - fY0;
930}
#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
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
short Width_t
Line width (short)
Definition RtypesCore.h:98
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:53
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
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:426
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
R__EXTERN TVirtualPS * gVirtualPS
Definition TVirtualPS.h:87
#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
Color_t fMarkerColor
Marker color.
Definition TAttMarker.h:24
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
Size_t fMarkerSize
Marker size.
Definition TAttMarker.h:26
Style_t fMarkerStyle
Marker style.
Definition TAttMarker.h:25
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
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:1926
const char * AsHexString() const
Return color as hexadecimal string.
Definition TColor.cxx:1330
Float_t GetAlpha() const
Definition TColor.h:67
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
not used
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 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
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
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 FillRectangle(const char *=nullptr, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition TImage.h:192
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 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:30
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
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Definition TMath.h:691
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122
TMarker m
Definition textangle.C:8