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 fStream = nullptr;
55 fImage = nullptr;
56 gVirtualPS = this;
57 fType = 0;
58 SetTitle("IMG");
59}
60
61////////////////////////////////////////////////////////////////////////////////
62/// Initialize batch image interface
63///
64/// fname : image file name
65///
66/// The possible workstation types are:
67/// - 111 - Portrait
68/// - 112 - Landscape
69/// - 114 - preview, keep in memory (do not write on delete)
70
72{
74 gVirtualPS = this;
75 SetTitle("IMG");
76}
77
78////////////////////////////////////////////////////////////////////////////////
79/// Open a image file
80
81void TImageDump::Open(const char *fname, Int_t type)
82{
83 fStream = nullptr;
85 fType = type;
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// destructor
91
93{
94 Close();
95
96 delete fImage;
97 fImage = nullptr;
98
99 gVirtualPS = nullptr;
100}
101
102////////////////////////////////////////////////////////////////////////////////
103/// Close a image file
104
106{
107 // if fType == 114 - do not write image
108 if (!fImage || (fType == 114)) {
109 return;
110 }
111
112 //if (fType == 112) fImage->Flip(90);
114}
115
116////////////////////////////////////////////////////////////////////////////////
117/// Draw a Box
118
120{
121 if (!gPad || !fImage) {
122 return;
123 }
124
126
127 static Double_t x[4], y[4];
128 Int_t ix1 = x1 < x2 ? XtoPixel(x1) : XtoPixel(x2);
129 Int_t ix2 = x1 < x2 ? XtoPixel(x2) : XtoPixel(x1);
130 Int_t iy1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
131 Int_t iy2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);
132
133 if (ix1<0 || ix2 <0 || iy1 < 0 || iy2 <0) return; // box is not visible
134
135 if (TMath::Abs(ix2-ix1) < 1) ix2 = ix1+1;
136 if (TMath::Abs(iy1-iy2) < 1) iy1 = iy2+1;
137
138 Int_t fillis = fFillStyle/1000;
139 Int_t fillsi = fFillStyle%1000;
140
142 if (!col) { // no color, set it white
143 fFillColor = 10;
144 col = gROOT->GetColor(fFillColor);
145 if (!col) return;
146 }
147
148 TColor *linecol = gROOT->GetColor(fLineColor);
149 if (!linecol) { // no color, set it to black
150 fLineColor = 1;
151 linecol = gROOT->GetColor(fLineColor);
152 }
153
154 if ((fillis == 3) || (fillis == 2)) {
155 if (fillsi > 99) {
156 x[0] = x1; y[0] = y1;
157 x[1] = x2; y[1] = y1;
158 x[2] = x2; y[2] = y2;
159 x[3] = x1; y[3] = y2;
160 return;
161 }
162 if ((fillsi > 0) && (fillsi < 26)) {
163 x[0] = x1; y[0] = y1;
164 x[1] = x2; y[1] = y1;
165 x[2] = x2; y[2] = y2;
166 x[3] = x1; y[3] = y2;
167 DrawPS(-4, &x[0], &y[0]);
168 }
169 if (fillsi == -3) {
170 // fill style = -3 ... which is NEVER used now
171 }
172 }
173
174 if (fillis == 1) {
176 }
177
178 if (fillis == 0) {
179 if (fLineWidth<=0) return;
181 }
182}
183
184////////////////////////////////////////////////////////////////////////////////
185/// Draw a Frame around a box
186///
187/// - mode = -1 the box looks as it is behind the screen
188/// - mode = 1 the box looks as it is in front of the screen
189/// border is the border size in already pre-computed dark is the
190/// color for the dark part of the frame light is the color for the light
191/// part of the frame
192
195{
196 if (!gPad || !fImage) {
197 return;
198 }
199
201
202 bordersize = bordersize < 1 ? 1 : bordersize;
203
204 TColor *col;
205 TColor *lo = gROOT->GetColor(dark);
206 if (!lo) {
207 lo = gROOT->GetColor(10);
208 }
210 if (!hi) {
211 hi = gROOT->GetColor(10);
212 }
213
214 Short_t pxl,pyl,pxt,pyt,px1,py1,px2,py2;
215
216 px1 = XtoPixel(x1); py1 = YtoPixel(y1);
217 px2 = XtoPixel(x2); py2 = YtoPixel(y2);
218 if (px1 < px2) {pxl = px1; pxt = px2;}
219 else {pxl = px2; pxt = px1;}
220 if (py1 > py2) {pyl = py1; pyt = py2;}
221 else {pyl = py2; pyt = py1;}
222
223 if (bordersize == 1) {
224 col = gROOT->GetColor(fLineColor);
225 if (!col) {
226 fLineColor = 1;
227 col = gROOT->GetColor(fLineColor);
228 if (!col) return;
229 }
231 return;
232 }
233
234 if (!fImage->IsValid()) {
235 col = gROOT->GetColor(light);
236 if (!col) {
237 col = gROOT->GetColor(10);
238 if (!col) return;
239 }
240 fImage->DrawBox(pxl, pyl, pxt, pyt, // force image creation and resizing
241 "#ffffffff", 1, TVirtualX::kFilled);
242 }
243
244 TPoint frame[6];
245
246 frame[0].fX = pxl; frame[0].fY = pyl;
247 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
248 frame[2].fX = pxl + bordersize; frame[2].fY = pyt + bordersize;
249 frame[3].fX = pxt - bordersize; frame[3].fY = pyt + bordersize;
250 frame[4].fX = pxt; frame[4].fY = pyt;
251 frame[5].fX = pxl; frame[5].fY = pyt;
252
253 if (mode == -1) col = lo;
254 else col = hi;
255
256 fImage->DrawFillArea(6, frame, col->AsHexString());
257
258 frame[0].fX = pxl; frame[0].fY = pyl;
259 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
260 frame[2].fX = pxt - bordersize; frame[2].fY = frame[1].fY;
261 frame[3].fX = frame[2].fX; frame[3].fY = pyt + bordersize;
262 frame[4].fX = pxt; frame[4].fY = pyt;
263 frame[5].fX = pxt; frame[5].fY = pyl;
264
265 if (mode == -1) col = hi;
266 else col = lo;
267
268 fImage->DrawFillArea(6, frame, col->AsHexString());
269}
270
271////////////////////////////////////////////////////////////////////////////////
272/// not used
273
275{
276 if (!gPad || !fImage) {
277 return;
278 }
279}
280
281////////////////////////////////////////////////////////////////////////////////
282/// draw polymarker
283
285{
286 if (!gPad || !fImage) {
287 return;
288 }
289
291
294 static TPoint pt[20];
295
296 if (ms == 4)
297 ms = 24;
298 else if (ms == 8)
299 ms = 20;
300 else if (ms >= 9 && ms <= 19)
301 ms = 1;
302
303 // Define the marker size
304 const Int_t kBASEMARKER = 8;
306 if (ms == 6) msize *= 0.2;
307 if (ms == 7) msize *= 0.3;
308 Double_t m = msize;
309 Double_t m2 = m/2;
310 Double_t m3 = m/3;
311 Double_t m6 = m/6;
312 Double_t m4 = m/4;
313 Double_t m8 = m/8;
314 Double_t m0 = m*0.1;
315
317 if (!col) { // no color
318 fMarkerColor = 1;
320 if (!col) return;
321 }
322 if (col->GetAlpha()<1.) {
323 if (ms==8) ms = 108;
324 if (ms==20) ms = 120;
325 }
326
328
329 // Draw the marker according to the type
330 Short_t ix,iy;
331 for (Int_t i=0;i<n;i++) {
332 ix = XtoPixel(xw[i]);
333 iy = YtoPixel(yw[i]);
334
335 switch (ms) {
336 // Dots (.) big, medium and small
337 case 7:
338 fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy-1, col->AsHexString());
339 fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy+1, col->AsHexString());
340 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy+1, col->AsHexString());
341 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy-1, col->AsHexString());
342 case 6:
343 fImage->PutPixel((UInt_t)ix, (UInt_t)iy-1, col->AsHexString());
344 fImage->PutPixel((UInt_t)ix, (UInt_t)iy+1, col->AsHexString());
345 fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy, col->AsHexString());
346 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy, col->AsHexString());
347 case 1:
348 fImage->PutPixel((UInt_t)ix, (UInt_t)iy, col->AsHexString());
349 break;
350 // Plus (+)
351 case 2:
352 fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString(), mlinewidth);
353 fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString(), mlinewidth);
354 break;
355 // X shape (X)
356 case 5:
357 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);
358 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);
359 break;
360 // Asterisk shape (*)
361 case 3:
362 case 31:
363 fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString(), mlinewidth);
364 fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString(), mlinewidth);
365 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);
366 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);
367 break;
368 // Circle
369 case 4:
370 case 24:
371 fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), mlinewidth);
372 break;
373 // Circle
374 case 8:
375 case 20:
376 fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), -1);
377 break;
378 case 108:
379 case 120:
380 for (int idx=Int_t(msize/2); idx>0; idx--) fImage->DrawCircle(ix, iy, idx, col->AsHexString(), 1);
381 fImage->PutPixel((UInt_t)ix, (UInt_t)iy, col->AsHexString());
382 break;
383 // Square
384 case 21:
385 fImage->FillRectangle(col->AsHexString(), UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m));
386 break;
387 case 25:
388 fImage->DrawRectangle(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m), col->AsHexString(), mlinewidth);
389 break;
390 // Down triangle
391 case 23:
392 case 32:
393 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
394 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
395 pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
396 pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy-m2);
397 ms == 32 ? fImage->DrawPolyLine(4, pt, col->AsHexString(), mlinewidth) :
398 fImage->FillPolygon(3, pt, col->AsHexString());
399 break;
400 // Up triangle
401 case 22:
402 case 26:
403 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
404 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy+m2);
405 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m2);
406 pt[3].fX = Short_t(ix); pt[3].fY = Short_t(iy-m2);
407 ms == 26 ? fImage->DrawPolyLine(4, pt, col->AsHexString(), mlinewidth) :
408 fImage->FillPolygon(3, pt, col->AsHexString());
409 break;
410 case 27:
411 case 33:
412 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
413 pt[1].fX = Short_t(ix+m3); pt[1].fY = Short_t(iy);
414 pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
415 pt[3].fX = Short_t(ix-m3); pt[3].fY = Short_t(iy);
416 pt[4].fX = Short_t(ix); pt[4].fY = Short_t(iy-m2);
417 ms == 27 ? fImage->DrawPolyLine(5, pt, col->AsHexString(), mlinewidth) :
418 fImage->FillPolygon(4, pt, col->AsHexString());
419 break;
420 case 28:
421 case 34:
422 pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6);
423 pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
424 pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
425 pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
426 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
427 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
428 pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
429 pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
430 pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
431 pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
432 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
433 pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
434 pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6);
435 ms == 28 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
436 fImage->FillPolygon(12, pt, col->AsHexString());
437 break;
438 case 29:
439 case 30:
440 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy+m2);
441 pt[1].fX = Short_t(ix+0.112255*m); pt[1].fY = Short_t(iy+0.15451*m);
442 pt[2].fX = Short_t(ix+0.47552*m); pt[2].fY = Short_t(iy+0.15451*m);
443 pt[3].fX = Short_t(ix+0.181635*m); pt[3].fY = Short_t(iy-0.05902*m);
444 pt[4].fX = Short_t(ix+0.29389*m); pt[4].fY = Short_t(iy-0.40451*m);
445 pt[5].fX = Short_t(ix); pt[5].fY = Short_t(iy-0.19098*m);
446 pt[6].fX = Short_t(ix-0.29389*m); pt[6].fY = Short_t(iy-0.40451*m);
447 pt[7].fX = Short_t(ix-0.181635*m); pt[7].fY = Short_t(iy-0.05902*m);
448 pt[8].fX = Short_t(ix-0.47552*m); pt[8].fY = Short_t(iy+0.15451*m);
449 pt[9].fX = Short_t(ix-0.112255*m); pt[9].fY = Short_t(iy+0.15451*m);
450 pt[10].fX = Short_t(ix); pt[10].fY = Short_t(iy+m2);
451 ms == 30 ? fImage->DrawPolyLine(11, pt, col->AsHexString(), mlinewidth) :
452 fImage->DrawFillArea(10, pt, col->AsHexString());
453 break;
454 case 35:
455 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
456 pt[1].fX = Short_t(ix ); pt[1].fY = Short_t(iy-m2);
457 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy );
458 pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy+m2);
459 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy );
460 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy );
461 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy+m2);
462 pt[7].fX = Short_t(ix ); pt[7].fY = Short_t(iy-m2);
464 break;
465 case 36:
466 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
467 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
468 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m2);
469 pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy+m2);
470 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m2);
471 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m2);
472 pt[6].fX = Short_t(ix-m2); pt[6].fY = Short_t(iy+m2);
473 pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m2);
475 break;
476 case 37:
477 case 39:
478 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
479 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy-m2);
480 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
481 pt[3].fX = Short_t(ix+m2); pt[3].fY = Short_t(iy );
482 pt[4].fX = Short_t(ix+m4); pt[4].fY = Short_t(iy-m2);
483 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy+m2);
484 pt[6].fX = Short_t(ix+m4); pt[6].fY = Short_t(iy+m2);
485 pt[7].fX = Short_t(ix ); pt[7].fY = Short_t(iy );
486 ms == 37 ? fImage->DrawPolyLine(8, pt, col->AsHexString(), mlinewidth) :
487 fImage->DrawFillArea(7, pt, col->AsHexString());
488 break;
489 case 38:
490 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
491 pt[1].fX = Short_t(ix-m2); pt[1].fY = Short_t(iy-m4);
492 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy-m2);
493 pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
494 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
495 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m4);
496 pt[6].fX = Short_t(ix+m4); pt[6].fY = Short_t(iy+m2);
497 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy+m2);
498 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
499 pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy );
500 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy );
501 pt[11].fX = Short_t(ix ); pt[11].fY = Short_t(iy );
502 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy-m2);
503 pt[13].fX = Short_t(ix ); pt[13].fY = Short_t(iy+m2);
504 pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy );
506 break;
507 case 40:
508 case 41:
509 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
510 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
511 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m4);
512 pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy );
513 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
514 pt[5].fX = Short_t(ix+m4); pt[5].fY = Short_t(iy-m2);
515 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy );
516 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
517 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy-m4);
518 pt[9].fX = Short_t(ix ); pt[9].fY = Short_t(iy );
519 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m4);
520 pt[11].fX = Short_t(ix-m4); pt[11].fY = Short_t(iy+m2);
521 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy );
522 ms == 40 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
523 fImage->DrawFillArea(12, pt, col->AsHexString());
524 break;
525 case 42:
526 case 43:
527 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m2);
528 pt[1].fX = Short_t(ix-m8); pt[1].fY = Short_t(iy+m8);
529 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
530 pt[3].fX = Short_t(ix-m8); pt[3].fY = Short_t(iy-m8);
531 pt[4].fX = Short_t(ix ); pt[4].fY = Short_t(iy-m2);
532 pt[5].fX = Short_t(ix+m8); pt[5].fY = Short_t(iy-m8);
533 pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy );
534 pt[7].fX = Short_t(ix+m8); pt[7].fY = Short_t(iy+m8);
535 pt[8].fX = Short_t(ix ); pt[8].fY = Short_t(iy+m2);
536 ms == 42 ? fImage->DrawPolyLine(9, pt, col->AsHexString(), mlinewidth) :
537 fImage->DrawFillArea(8, pt, col->AsHexString());
538 break;
539 case 44:
540 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
541 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
542 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy+m2);
543 pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
544 pt[4].fX = Short_t(ix-m4); pt[4].fY = Short_t(iy-m2);
545 pt[5].fX = Short_t(ix ); pt[5].fY = Short_t(iy );
546 pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy+m4);
547 pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m4);
548 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
549 pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy-m4);
550 pt[10].fX = Short_t(ix ); pt[10].fY = Short_t(iy );
552 break;
553 case 45:
554 pt[0].fX = Short_t(ix+m0); pt[0].fY = Short_t(iy+m0);
555 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
556 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy+m2);
557 pt[3].fX = Short_t(ix-m0); pt[3].fY = Short_t(iy+m0);
558 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy+m4);
559 pt[5].fX = Short_t(ix-m2); pt[5].fY = Short_t(iy-m4);
560 pt[6].fX = Short_t(ix-m0); pt[6].fY = Short_t(iy-m0);
561 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
562 pt[8].fX = Short_t(ix+m4); pt[8].fY = Short_t(iy-m2);
563 pt[9].fX = Short_t(ix+m0); pt[9].fY = Short_t(iy-m0);
564 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy-m4);
565 pt[11].fX = Short_t(ix+m2); pt[11].fY = Short_t(iy+m4);
566 pt[12].fX = Short_t(ix+m0); pt[12].fY = Short_t(iy+m0);
567 fImage->DrawFillArea(13, pt, col->AsHexString());
568 break;
569 case 46:
570 case 47:
571 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4);
572 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
573 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
574 pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
575 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
576 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
577 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
578 pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
579 pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
580 pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
581 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
582 pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
583 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4);
584 ms == 46 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
585 fImage->DrawFillArea(12, pt, col->AsHexString());
586 break;
587 case 48:
588 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4*1.005);
589 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
590 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
591 pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
592 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
593 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
594 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
595 pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
596 pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
597 pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
598 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
599 pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
600 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4*0.995);
601 pt[13].fX = Short_t(ix+m4*0.995); pt[13].fY = Short_t(iy );
602 pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy-m4*0.995);
603 pt[15].fX = Short_t(ix-m4*0.995); pt[15].fY = Short_t(iy );
604 pt[16].fX = Short_t(ix ); pt[16].fY = Short_t(iy+m4*0.995);
605 fImage->DrawFillArea(17, pt, col->AsHexString());
606 break;
607 case 49:
608 pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6*1.005);
609 pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
610 pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
611 pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
612 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
613 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
614 pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
615 pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
616 pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
617 pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
618 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
619 pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
620 pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6*0.995);
621 pt[13].fX = Short_t(ix-m6); pt[13].fY = Short_t(iy+m6);
622 pt[14].fX = Short_t(ix+m6); pt[14].fY = Short_t(iy+m6);
623 pt[15].fX = Short_t(ix+m6); pt[15].fY = Short_t(iy-m6);
624 pt[16].fX = Short_t(ix-m6); pt[16].fY = Short_t(iy-m6*1.005);
625 fImage->DrawFillArea(17, pt, col->AsHexString());
626 break;
627 default:
628 fImage->PutPixel(UInt_t(ix), UInt_t(iy), col->AsHexString());
629 break;
630 }
631 }
632}
633
634////////////////////////////////////////////////////////////////////////////////
635/// This function defines a path with xw and yw and draw it according the
636/// value of nn:
637///
638/// - If nn > 0 a line is drawn.
639/// - If nn < 0 a closed polygon is drawn.
640
642{
643 if (!gPad || !fImage || !nn) {
644 return;
645 }
646
648
649 TColor *col = nullptr;
650 Int_t fais = 0 , fasi = 0;
651 Bool_t line = nn > 1;
653
654 fais = fFillStyle/1000;
655 fasi = fFillStyle%1000;
656
657 Short_t px1, py1, px2, py2;
658 static const UInt_t gCachePtSize = 200;
660
661 // SetLineStyle
662 Int_t ndashes = 0;
663 static char dashList[10];
664 Int_t dashSize = 0;
665
666 if (line) {
667 if (fLineWidth<=0) return;
668 // dash lines
669 if (fLineStyle > 1) {
671 TObjArray *tokens = st.Tokenize(" ");
672 ndashes = tokens->GetEntries();
673 char *dash = new char[ndashes];
674
675 for (int j = 0; j < ndashes; j++) {
676 Int_t it;
677 sscanf(((TObjString*)tokens->At(j))->GetName(), "%d", &it);
678 dash[j] = (char)(it/4);
679 }
680
681 dashSize = TMath::Min((int)sizeof(dashList), ndashes);
682 for (int i = 0; i < dashSize; i++ ) {
683 dashList[i] = dash[i];
684 }
685 delete tokens;
686 delete [] dash;
687 }
688
689 // SetLineColor
690 col = gROOT->GetColor(fLineColor);
691 if (!col) { // no color, make it black
692 fLineColor = 1;
693 col = gROOT->GetColor(fLineColor);
694 if (!col) return;
695 }
696 }
697
698 if (n == 1) { // point
699 col = gROOT->GetColor(fFillColor);
700 if (!col) { // no color, make it black
701 fFillColor = 1;
702 col = gROOT->GetColor(fFillColor);
703 if (!col) return;
704 }
705 px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
706 fImage->PutPixel(px1, py1, col->AsHexString());
707 return;
708 }
709
710 if (n == 2) { // line
711 px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
712 px2 = XtoPixel(x[1]); py2 = YtoPixel(y[1]);
713
714 // SetLineColor
715 col = gROOT->GetColor(fLineColor);
716 if (!col) { // no color, make it black
717 fLineColor = 1;
718 col = gROOT->GetColor(fLineColor);
719 if (!col) return;
720 }
721 if (fLineStyle < 2) {
722 fImage->DrawLine(px1, py1, px2, py2, col->AsHexString(), fLineWidth);
723 } else {
724 fImage->DrawDashLine(px1, py1, px2, py2, dashSize, (const char*)dashList,
725 col->AsHexString(), fLineWidth);
726 }
727 return;
728 }
729
730 if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100) ) {
731 return;
732 }
733
734 TPoint *pt = nullptr;
735 Bool_t del = kTRUE;
736
737 if (n+1 < gCachePtSize) {
738 pt = (TPoint*)&gPointCache;
739 del = kFALSE;
740 } else {
741 pt = new TPoint[n+1];
742 del = kTRUE;
743 }
744
745 TColor *fcol = gROOT->GetColor(fFillColor);
746 if (!fcol) { // no color, set it white
747 fFillColor = 10;
748 fcol = gROOT->GetColor(fFillColor);
749 }
750
751 TColor *lcol = gROOT->GetColor(fLineColor);
752 if (!lcol) { // no color, make it black
753 fLineColor = 1;
754 lcol = gROOT->GetColor(fLineColor);
755 }
756
757 for (UInt_t i = 0; i < n; i++) {
758 pt[i].fX = XtoPixel(x[i]);
759 pt[i].fY = YtoPixel(y[i]);
760 }
761 pt[n].fX = pt[0].fX;
762 pt[n].fY = pt[0].fY;
763
764 const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : nullptr;
765
766 // filled polygon
767 if (!line && fFillStyle && (fFillStyle != 4000)) {
768 if (!fcol) {
769 if (del) delete [] pt;
770 return;
771 }
772
773 if (n < 5) { // convex
774 fImage->FillPolygon(n, pt, fcol->AsHexString(), stipple);
775 } else { // non-convex fill area
776 fImage->DrawFillArea(n, pt, fcol->AsHexString(), stipple);
777 }
778 }
779
780 // hollow polygon or polyline is drawn
781 if (line || !fFillStyle || (fFillStyle == 4000)) {
782 if (!lcol) {
783 if (del)
784 delete [] pt;
785 return;
786 }
787 if (!line) {
788 fImage->DrawPolyLine(n+1, pt, fcol->AsHexString(), 1);
789 } else {
790 if (fLineStyle < 2) { // solid
791 fImage->DrawPolyLine(n, pt, lcol->AsHexString(), fLineWidth);
792 } else { // dashed
793 DrawDashPolyLine(n, pt, dashSize, (const char*)dashList,
794 lcol->AsHexString(), fLineWidth);
795 }
796 }
797 }
798 if (del)
799 delete [] pt;
800}
801
802////////////////////////////////////////////////////////////////////////////////
803/// not used
804
806{
807 if (!gPad || !fImage) {
808 return;
809 }
810}
811
812////////////////////////////////////////////////////////////////////////////////
813/// draw dashed polyline
814
816 const char* pDash, const char* col, UInt_t thick)
817{
818 Int_t x0 = xy[0].GetX();
819 Int_t y0 = xy[0].GetY();
820 Int_t x = 0;
821 Int_t y = 0;
822
823 for (Int_t i = 1; i < nn; i++) {
824 x = xy[i].GetX();
825 y = xy[i].GetY();
826
827 fImage->DrawDashLine(x0, y0, x, y, nDash, pDash, col, thick);
828
829 x0 = x;
830 y0 = y;
831 }
832}
833
834////////////////////////////////////////////////////////////////////////////////
835/// new page
836
838{
839 if (gPad && fImage) {
840 UInt_t w = UInt_t(gPad->GetWw()*gPad->GetWNDC()) * gStyle->GetImageScaling();
841 UInt_t h = UInt_t(gPad->GetWh()*gPad->GetHNDC()) * gStyle->GetImageScaling();
842 fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
843 }
844 return;
845}
846
847////////////////////////////////////////////////////////////////////////////////
848/// Draw text
849///
850/// - x: x position of the text
851/// - y: y position of the text
852
854{
855 if (!gPad || !fImage) {
856 return;
857 }
858
860
861 TText t(x, y, chars);
868}
869
870////////////////////////////////////////////////////////////////////////////////
871/// Draw text
872///
873/// - x: x position of the text
874/// - y: y position of the text
875
877{
878 if (!gPad || !fImage) {
879 return;
880 }
881
883
884 TText t(x, y, chars);
891}
892
893
894////////////////////////// CellArray code ////////////////////////////////////
895static UInt_t *gCellArrayColors = nullptr;
904
905////////////////////////////////////////////////////////////////////////////////
906///cell array begin
907
910{
911 if (!gPad || !fImage || (w <= 0) || (h <= 0)) {
912 return;
913 }
914
915 if (gCellArrayColors) {
916 delete [] gCellArrayColors;
917 }
918
920
921 gCellArrayN = w * h;
922 gCellArrayW = w;
923 gCellArrayH = h;
925
930
931 gCellArrayIdx = 0;
932}
933
934////////////////////////////////////////////////////////////////////////////////
935/// Cell array fill
936
938{
939 if (gCellArrayIdx >= gCellArrayN) return;
940
942
943 gCellArrayColors[gCellArrayIdx] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
945}
946
947////////////////////////////////////////////////////////////////////////////////
948/// Cell array end
949
951{
953 return;
954 }
955
957
960
961 delete [] gCellArrayColors;
962 gCellArrayColors = nullptr;
963 gCellArrayN = 0;
964 gCellArrayW = 0;
965 gCellArrayH = 0;
966 gCellArrayX1 = 0;
967 gCellArrayX2 = 0;
968 gCellArrayY1 = 0;
969 gCellArrayY2 = 0;
970 gCellArrayIdx = 0;
971}
972
973////////////////////////////////////////////////////////////////////////////////
974/// Set color with its R G B components
975///
976/// - r: % of red in [0,1]
977/// - g: % of green in [0,1]
978/// - b: % of blue in [0,1]
979
981{
982}
983
984////////////////////////////////////////////////////////////////////////////////
985/// x to pixel
986
988{
989 return gPad->XtoAbsPixel(x)*gStyle->GetImageScaling();
990}
991
992////////////////////////////////////////////////////////////////////////////////
993/// y to pixel
994
996{
997 return gPad->YtoAbsPixel(y)*gStyle->GetImageScaling();
998}
#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
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:53
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
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
static Int_t gCellArrayX2
static Int_t gCellArrayX1
static UInt_t * gCellArrayColors
static Int_t gCellArrayW
static Int_t gCellArrayN
static Int_t gCellArrayH
static Int_t gCellArrayIdx
static Int_t gCellArrayY2
static Int_t gCellArrayY1
#define gROOT
Definition TROOT.h:411
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
R__EXTERN TVirtualPS * gVirtualPS
Definition TVirtualPS.h:81
#define gPad
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:24
Color_t fFillColor
Fill area color.
Definition TAttFill.h:23
Width_t fLineWidth
Line width.
Definition TAttLine.h:25
Style_t fLineStyle
Line style.
Definition TAttLine.h:24
Color_t fLineColor
Line color.
Definition TAttLine.h:23
Color_t fMarkerColor
Marker color.
Definition TAttMarker.h:23
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:25
Style_t fMarkerStyle
Marker style.
Definition TAttMarker.h:24
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:44
Color_t fTextColor
Text color.
Definition TAttText.h:26
Float_t fTextAngle
Text angle.
Definition TAttText.h:23
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
Definition TAttText.h:45
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition TAttText.h:46
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:48
Font_t fTextFont
Text font.
Definition TAttText.h:27
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:49
Short_t fTextAlign
Text alignment.
Definition TAttText.h:25
Float_t fTextSize
Text size.
Definition TAttText.h:24
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
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.
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
void Open(const char *filename, Int_t type=-111) override
Open a image file.
void Close(Option_t *opt="") override
Close a image file.
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
not used
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.
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 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:208
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 DrawText(Int_t=0, Int_t=0, const char *="", Int_t=12, const char *=nullptr, const char *="fixed", EText3DType=TImage::kPlain, const char *=nullptr, Float_t=0)
Definition TImage.h:200
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:217
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:204
virtual Bool_t IsValid() const
Definition TImage.h:230
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:221
virtual void BeginPaint(Bool_t=kTRUE)
Definition TImage.h:182
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
An array of TObjects.
Definition TObjArray.h:31
Collectable string class.
Definition TObjString.h:28
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
std::ofstream * fStream
Definition TVirtualPS.h:41
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 Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:199
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124
TMarker m
Definition textangle.C:8