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