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