Logo ROOT  
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
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 "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
296 static TPoint pt[20];
297
298 if (ms == 4)
299 ms = 24;
300 else if (ms == 8)
301 ms = 20;
302 else if (ms >= 9 && ms <= 19)
303 ms = 1;
304
305 // Define the marker size
306 const Int_t kBASEMARKER = 8;
308 if (ms == 6) msize *= 0.2;
309 if (ms == 7) msize *= 0.3;
310 Double_t m = msize;
311 Double_t m2 = m/2;
312 Double_t m3 = m/3;
313 Double_t m6 = m/6;
314 Double_t m4 = m/4;
315 Double_t m8 = m/8;
316 Double_t m0 = m*0.1;
317
318 TColor *col = gROOT->GetColor(fMarkerColor);
319 if (!col) { // no color
320 fMarkerColor = 1;
321 col = gROOT->GetColor(fMarkerColor);
322 if (!col) return;
323 }
324 if (col->GetAlpha()<1.) {
325 if (ms==8) ms = 108;
326 if (ms==20) ms = 120;
327 }
328
330
331 // Draw the marker according to the type
332 Short_t ix,iy;
333 for (Int_t i=0;i<n;i++) {
334 ix = XtoPixel(xw[i]);
335 iy = YtoPixel(yw[i]);
336
337 switch (ms) {
338 // Dots (.) big, medium and small
339 case 7:
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 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy-1, col->AsHexString());
344 case 6:
345 fImage->PutPixel((UInt_t)ix, (UInt_t)iy-1, col->AsHexString());
346 fImage->PutPixel((UInt_t)ix, (UInt_t)iy+1, col->AsHexString());
347 fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy, col->AsHexString());
348 fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy, col->AsHexString());
349 case 1:
350 fImage->PutPixel((UInt_t)ix, (UInt_t)iy, col->AsHexString());
351 break;
352 // Plus (+)
353 case 2:
354 fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString(), mlinewidth);
355 fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString(), mlinewidth);
356 break;
357 // X shape (X)
358 case 5:
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 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);
361 break;
362 // Asterisk shape (*)
363 case 3:
364 case 31:
365 fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString(), mlinewidth);
366 fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), 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 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);
369 break;
370 // Circle
371 case 4:
372 case 24:
373 fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), mlinewidth);
374 break;
375 // Circle
376 case 8:
377 case 20:
378 fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), -1);
379 break;
380 case 108:
381 case 120:
382 for (int idx=Int_t(msize/2); idx>0; idx--) fImage->DrawCircle(ix, iy, idx, col->AsHexString(), 1);
383 fImage->PutPixel((UInt_t)ix, (UInt_t)iy, col->AsHexString());
384 break;
385 // Square
386 case 21:
388 break;
389 case 25:
390 fImage->DrawRectangle(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m), col->AsHexString(), mlinewidth);
391 break;
392 // Down triangle
393 case 23:
394 case 32:
395 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
396 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
397 pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
398 pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy-m2);
399 ms == 32 ? fImage->DrawPolyLine(4, pt, col->AsHexString(), mlinewidth) :
400 fImage->FillPolygon(3, pt, col->AsHexString());
401 break;
402 // Up triangle
403 case 22:
404 case 26:
405 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
406 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy+m2);
407 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m2);
408 pt[3].fX = Short_t(ix); pt[3].fY = Short_t(iy-m2);
409 ms == 26 ? fImage->DrawPolyLine(4, pt, col->AsHexString(), mlinewidth) :
410 fImage->FillPolygon(3, pt, col->AsHexString());
411 break;
412 case 27:
413 case 33:
414 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
415 pt[1].fX = Short_t(ix+m3); pt[1].fY = Short_t(iy);
416 pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
417 pt[3].fX = Short_t(ix-m3); pt[3].fY = Short_t(iy);
418 pt[4].fX = Short_t(ix); pt[4].fY = Short_t(iy-m2);
419 ms == 27 ? fImage->DrawPolyLine(5, pt, col->AsHexString(), mlinewidth) :
420 fImage->FillPolygon(4, pt, col->AsHexString());
421 break;
422 case 28:
423 case 34:
424 pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6);
425 pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
426 pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
427 pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
428 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
429 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
430 pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
431 pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
432 pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
433 pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
434 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
435 pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
436 pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6);
437 ms == 28 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
438 fImage->FillPolygon(12, pt, col->AsHexString());
439 break;
440 case 29:
441 case 30:
442 pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy+m2);
443 pt[1].fX = Short_t(ix+0.112255*m); pt[1].fY = Short_t(iy+0.15451*m);
444 pt[2].fX = Short_t(ix+0.47552*m); pt[2].fY = Short_t(iy+0.15451*m);
445 pt[3].fX = Short_t(ix+0.181635*m); pt[3].fY = Short_t(iy-0.05902*m);
446 pt[4].fX = Short_t(ix+0.29389*m); pt[4].fY = Short_t(iy-0.40451*m);
447 pt[5].fX = Short_t(ix); pt[5].fY = Short_t(iy-0.19098*m);
448 pt[6].fX = Short_t(ix-0.29389*m); pt[6].fY = Short_t(iy-0.40451*m);
449 pt[7].fX = Short_t(ix-0.181635*m); pt[7].fY = Short_t(iy-0.05902*m);
450 pt[8].fX = Short_t(ix-0.47552*m); pt[8].fY = Short_t(iy+0.15451*m);
451 pt[9].fX = Short_t(ix-0.112255*m); pt[9].fY = Short_t(iy+0.15451*m);
452 pt[10].fX = Short_t(ix); pt[10].fY = Short_t(iy+m2);
453 ms == 30 ? fImage->DrawPolyLine(11, pt, col->AsHexString(), mlinewidth) :
454 fImage->DrawFillArea(10, pt, col->AsHexString());
455 break;
456 case 35:
457 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
458 pt[1].fX = Short_t(ix ); pt[1].fY = Short_t(iy-m2);
459 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy );
460 pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy+m2);
461 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy );
462 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy );
463 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy+m2);
464 pt[7].fX = Short_t(ix ); pt[7].fY = Short_t(iy-m2);
465 fImage->DrawPolyLine(8, pt, col->AsHexString(), mlinewidth) ;
466 break;
467 case 36:
468 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
469 pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
470 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m2);
471 pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy+m2);
472 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m2);
473 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m2);
474 pt[6].fX = Short_t(ix-m2); pt[6].fY = Short_t(iy+m2);
475 pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m2);
476 fImage->DrawPolyLine(8, pt, col->AsHexString(), mlinewidth) ;
477 break;
478 case 37:
479 case 39:
480 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
481 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy-m2);
482 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
483 pt[3].fX = Short_t(ix+m2); pt[3].fY = Short_t(iy );
484 pt[4].fX = Short_t(ix+m4); pt[4].fY = Short_t(iy-m2);
485 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy+m2);
486 pt[6].fX = Short_t(ix+m4); pt[6].fY = Short_t(iy+m2);
487 pt[7].fX = Short_t(ix ); pt[7].fY = Short_t(iy );
488 ms == 37 ? fImage->DrawPolyLine(8, pt, col->AsHexString(), mlinewidth) :
489 fImage->DrawFillArea(7, pt, col->AsHexString());
490 break;
491 case 38:
492 pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
493 pt[1].fX = Short_t(ix-m2); pt[1].fY = Short_t(iy-m4);
494 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy-m2);
495 pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
496 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
497 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m4);
498 pt[6].fX = Short_t(ix+m4); pt[6].fY = Short_t(iy+m2);
499 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy+m2);
500 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
501 pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy );
502 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy );
503 pt[11].fX = Short_t(ix ); pt[11].fY = Short_t(iy );
504 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy-m2);
505 pt[13].fX = Short_t(ix ); pt[13].fY = Short_t(iy+m2);
506 pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy );
507 fImage->DrawPolyLine(15, pt, col->AsHexString(), mlinewidth) ;
508 break;
509 case 40:
510 case 41:
511 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
512 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
513 pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m4);
514 pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy );
515 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
516 pt[5].fX = Short_t(ix+m4); pt[5].fY = Short_t(iy-m2);
517 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy );
518 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
519 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy-m4);
520 pt[9].fX = Short_t(ix ); pt[9].fY = Short_t(iy );
521 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m4);
522 pt[11].fX = Short_t(ix-m4); pt[11].fY = Short_t(iy+m2);
523 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy );
524 ms == 40 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
525 fImage->DrawFillArea(12, pt, col->AsHexString());
526 break;
527 case 42:
528 case 43:
529 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m2);
530 pt[1].fX = Short_t(ix-m8); pt[1].fY = Short_t(iy+m8);
531 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
532 pt[3].fX = Short_t(ix-m8); pt[3].fY = Short_t(iy-m8);
533 pt[4].fX = Short_t(ix ); pt[4].fY = Short_t(iy-m2);
534 pt[5].fX = Short_t(ix+m8); pt[5].fY = Short_t(iy-m8);
535 pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy );
536 pt[7].fX = Short_t(ix+m8); pt[7].fY = Short_t(iy+m8);
537 pt[8].fX = Short_t(ix ); pt[8].fY = Short_t(iy+m2);
538 ms == 42 ? fImage->DrawPolyLine(9, pt, col->AsHexString(), mlinewidth) :
539 fImage->DrawFillArea(8, pt, col->AsHexString());
540 break;
541 case 44:
542 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
543 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
544 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy+m2);
545 pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
546 pt[4].fX = Short_t(ix-m4); pt[4].fY = Short_t(iy-m2);
547 pt[5].fX = Short_t(ix ); pt[5].fY = Short_t(iy );
548 pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy+m4);
549 pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m4);
550 pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
551 pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy-m4);
552 pt[10].fX = Short_t(ix ); pt[10].fY = Short_t(iy );
553 fImage->DrawPolyLine(11, pt, col->AsHexString(), mlinewidth) ;
554 break;
555 case 45:
556 pt[0].fX = Short_t(ix+m0); pt[0].fY = Short_t(iy+m0);
557 pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
558 pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy+m2);
559 pt[3].fX = Short_t(ix-m0); pt[3].fY = Short_t(iy+m0);
560 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy+m4);
561 pt[5].fX = Short_t(ix-m2); pt[5].fY = Short_t(iy-m4);
562 pt[6].fX = Short_t(ix-m0); pt[6].fY = Short_t(iy-m0);
563 pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
564 pt[8].fX = Short_t(ix+m4); pt[8].fY = Short_t(iy-m2);
565 pt[9].fX = Short_t(ix+m0); pt[9].fY = Short_t(iy-m0);
566 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy-m4);
567 pt[11].fX = Short_t(ix+m2); pt[11].fY = Short_t(iy+m4);
568 pt[12].fX = Short_t(ix+m0); pt[12].fY = Short_t(iy+m0);
569 fImage->DrawFillArea(13, pt, col->AsHexString());
570 break;
571 case 46:
572 case 47:
573 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4);
574 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
575 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
576 pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
577 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
578 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
579 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
580 pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
581 pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
582 pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
583 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
584 pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
585 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4);
586 ms == 46 ? fImage->DrawPolyLine(13, pt, col->AsHexString(), mlinewidth) :
587 fImage->DrawFillArea(12, pt, col->AsHexString());
588 break;
589 case 48:
590 pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4*1.005);
591 pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
592 pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
593 pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
594 pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
595 pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
596 pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
597 pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
598 pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
599 pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
600 pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
601 pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
602 pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4*0.995);
603 pt[13].fX = Short_t(ix+m4*0.995); pt[13].fY = Short_t(iy );
604 pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy-m4*0.995);
605 pt[15].fX = Short_t(ix-m4*0.995); pt[15].fY = Short_t(iy );
606 pt[16].fX = Short_t(ix ); pt[16].fY = Short_t(iy+m4*0.995);
607 fImage->DrawFillArea(17, pt, col->AsHexString());
608 break;
609 case 49:
610 pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6*1.005);
611 pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
612 pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
613 pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
614 pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
615 pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
616 pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
617 pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
618 pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
619 pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
620 pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
621 pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
622 pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6*0.995);
623 pt[13].fX = Short_t(ix-m6); pt[13].fY = Short_t(iy+m6);
624 pt[14].fX = Short_t(ix+m6); pt[14].fY = Short_t(iy+m6);
625 pt[15].fX = Short_t(ix+m6); pt[15].fY = Short_t(iy-m6);
626 pt[16].fX = Short_t(ix-m6); pt[16].fY = Short_t(iy-m6*1.005);
627 fImage->DrawFillArea(17, pt, col->AsHexString());
628 break;
629 default:
630 fImage->PutPixel(UInt_t(ix), UInt_t(iy), col->AsHexString());
631 break;
632 }
633 }
634}
635
636////////////////////////////////////////////////////////////////////////////////
637/// This function defines a path with xw and yw and draw it according the
638/// value of nn:
639///
640/// - If nn > 0 a line is drawn.
641/// - If nn < 0 a closed polygon is drawn.
642
644{
645 if (!gPad || !fImage || !nn) {
646 return;
647 }
648
650
651 TColor *col = 0;
652 Int_t fais = 0 , fasi = 0;
653 Bool_t line = nn > 1;
654 UInt_t n = TMath::Abs(nn);
655
656 fais = fFillStyle/1000;
657 fasi = fFillStyle%1000;
658
659 Short_t px1, py1, px2, py2;
660 static const UInt_t gCachePtSize = 200;
661 static TPoint gPointCache[gCachePtSize];
662 Bool_t del = kTRUE;
663
664
665 // SetLineStyle
666 Int_t ndashes = 0;
667 char *dash = 0;
668 static char dashList[10];
669 Int_t dashLength = 0;
670 Int_t dashSize = 0;
671
672 if (line) {
673 if (fLineWidth<=0) return;
674 // dash lines
675 if (fLineStyle > 1) {
677 TObjArray *tokens = st.Tokenize(" ");
678 ndashes = tokens->GetEntries();
679 dash = new char[ndashes];
680
681 for (int j = 0; j < ndashes; j++) {
682 Int_t it;
683 sscanf(((TObjString*)tokens->At(j))->GetName(), "%d", &it);
684 dash[j] = (char)(it/4);
685 }
686
687 dashSize = TMath::Min((int)sizeof(dashList), ndashes);
688 dashLength = 0;
689 for (int i = 0; i < dashSize; i++ ) {
690 dashList[i] = dash[i];
691 dashLength += dashList[i];
692 }
693 delete tokens;
694 delete [] dash;
695 }
696
697 // SetLineColor
698 col = gROOT->GetColor(fLineColor);
699 if (!col) { // no color, make it black
700 fLineColor = 1;
701 col = gROOT->GetColor(fLineColor);
702 if (!col) return;
703 }
704 }
705
706 if (n == 1) { // point
707 col = gROOT->GetColor(fFillColor);
708 if (!col) { // no color, make it black
709 fFillColor = 1;
710 col = gROOT->GetColor(fFillColor);
711 if (!col) return;
712 }
713 px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
714 fImage->PutPixel(px1, py1, col->AsHexString());
715 return;
716 }
717
718 if (n == 2) { // line
719 px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
720 px2 = XtoPixel(x[1]); py2 = YtoPixel(y[1]);
721
722 // SetLineColor
723 col = gROOT->GetColor(fLineColor);
724 if (!col) { // no color, make it black
725 fLineColor = 1;
726 col = gROOT->GetColor(fLineColor);
727 if (!col) return;
728 }
729 if (fLineStyle < 2) {
730 fImage->DrawLine(px1, py1, px2, py2, col->AsHexString(), fLineWidth);
731 } else {
732 fImage->DrawDashLine(px1, py1, px2, py2, dashSize, (const char*)dashList,
733 col->AsHexString(), fLineWidth);
734 }
735 return;
736 }
737
738 if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100) ) {
739 return;
740 }
741
742 TPoint *pt = 0;
743 if (n+1 < gCachePtSize) {
744 pt = (TPoint*)&gPointCache;
745 del = kFALSE;
746 } else {
747 pt = new TPoint[n+1];
748 del = kTRUE;
749 }
750
751 TColor *fcol = gROOT->GetColor(fFillColor);
752 if (!fcol) { // no color, set it white
753 fFillColor = 10;
754 fcol = gROOT->GetColor(fFillColor);
755 }
756
757 TColor *lcol = gROOT->GetColor(fLineColor);
758 if (!lcol) { // no color, make it black
759 fLineColor = 1;
760 lcol = gROOT->GetColor(fLineColor);
761 }
762
763 for (UInt_t i = 0; i < n; i++) {
764 pt[i].fX = XtoPixel(x[i]);
765 pt[i].fY = YtoPixel(y[i]);
766 }
767 pt[n].fX = pt[0].fX;
768 pt[n].fY = pt[0].fY;
769
770 const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : 0;
771
772 // filled polygon
773 if (!line && fFillStyle && (fFillStyle != 4000)) {
774 if (!fcol) return;
775
776 if (n < 5) { // convex
777 fImage->FillPolygon(n, pt, fcol->AsHexString(), stipple);
778 } else { // non-convex fill area
779 fImage->DrawFillArea(n, pt, fcol->AsHexString(), stipple);
780 }
781 }
782
783 // hollow polygon or polyline is drawn
784 if (line || !fFillStyle || (fFillStyle == 4000)) {
785 if (!lcol) return;
786 if (!line) {
787 fImage->DrawPolyLine(n+1, pt, fcol->AsHexString(), 1);
788 } else {
789 if (fLineStyle < 2) { // solid
791 } else { // dashed
792 DrawDashPolyLine(n, pt, dashSize, (const char*)dashList,
793 lcol->AsHexString(), fLineWidth);
794 }
795 }
796 }
797 if (del) delete [] pt;
798}
799
800////////////////////////////////////////////////////////////////////////////////
801/// not used
802
804{
805 if (!gPad || !fImage) {
806 return;
807 }
808}
809
810////////////////////////////////////////////////////////////////////////////////
811/// draw dashed polyline
812
814 const char* pDash, const char* col, UInt_t thick)
815{
816 Int_t x0 = xy[0].GetX();
817 Int_t y0 = xy[0].GetY();
818 Int_t x = 0;
819 Int_t y = 0;
820
821 for (Int_t i = 1; i < nn; i++) {
822 x = xy[i].GetX();
823 y = xy[i].GetY();
824
825 fImage->DrawDashLine(x0, y0, x, y, nDash, pDash, col, thick);
826
827 x0 = x;
828 y0 = y;
829 }
830}
831
832////////////////////////////////////////////////////////////////////////////////
833/// new page
834
836{
837 if (gPad && fImage) {
838 UInt_t w = UInt_t(gPad->GetWw()*gPad->GetWNDC()) * gStyle->GetImageScaling();
839 UInt_t h = UInt_t(gPad->GetWh()*gPad->GetHNDC()) * gStyle->GetImageScaling();
840 fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
841 }
842 return;
843}
844
845////////////////////////////////////////////////////////////////////////////////
846/// Draw text
847///
848/// - x: x position of the text
849/// - y: y position of the text
850
851void TImageDump::Text(Double_t x, Double_t y, const char *chars)
852{
853 if (!gPad || !fImage) {
854 return;
855 }
856
858
859 TText t(x, y, chars);
866}
867
868////////////////////////////////////////////////////////////////////////////////
869/// Draw text
870///
871/// - x: x position of the text
872/// - y: y position of the text
873
874void TImageDump::Text(Double_t x, Double_t y, const wchar_t *chars)
875{
876 if (!gPad || !fImage) {
877 return;
878 }
879
881
882 TText t(x, y, chars);
889}
890
891
892////////////////////////// CellArray code ////////////////////////////////////
902
903////////////////////////////////////////////////////////////////////////////////
904///cell array begin
905
907 Double_t y1, Double_t y2)
908{
909 if (!gPad || !fImage || (w <= 0) || (h <= 0)) {
910 return;
911 }
912
913 if (gCellArrayColors) {
914 delete [] gCellArrayColors;
915 }
916
918
919 gCellArrayN = w * h;
920 gCellArrayW = w;
921 gCellArrayH = h;
923
926 gCellArrayY1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
927 gCellArrayY2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);
928
929 gCellArrayIdx = 0;
930}
931
932////////////////////////////////////////////////////////////////////////////////
933/// Cell array fill
934
936{
937 if (gCellArrayIdx >= gCellArrayN) return;
938
940
941 gCellArrayColors[gCellArrayIdx] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
943}
944
945////////////////////////////////////////////////////////////////////////////////
946/// Cell array end
947
949{
951 return;
952 }
953
955
958
959 delete [] gCellArrayColors;
961 gCellArrayN = 0;
962 gCellArrayW = 0;
963 gCellArrayH = 0;
964 gCellArrayX1 = 0;
965 gCellArrayX2 = 0;
966 gCellArrayY1 = 0;
967 gCellArrayY2 = 0;
968 gCellArrayIdx = 0;
969}
970
971////////////////////////////////////////////////////////////////////////////////
972/// Set color with its R G B components
973///
974/// - r: % of red in [0,1]
975/// - g: % of green in [0,1]
976/// - b: % of blue in [0,1]
977
979{
980}
981
982////////////////////////////////////////////////////////////////////////////////
983/// x to pixel
984
986{
987 return gPad->XtoAbsPixel(x)*gStyle->GetImageScaling();
988}
989
990////////////////////////////////////////////////////////////////////////////////
991/// y to pixel
992
994{
995 return gPad->YtoAbsPixel(y)*gStyle->GetImageScaling();
996}
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:43
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
short Width_t
Definition: RtypesCore.h:80
short Short_t
Definition: RtypesCore.h:37
double Double_t
Definition: RtypesCore.h:57
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
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:898
static Int_t gCellArrayX1
Definition: TImageDump.cxx:897
static UInt_t * gCellArrayColors
Definition: TImageDump.cxx:893
static Int_t gCellArrayW
Definition: TImageDump.cxx:895
static Int_t gCellArrayN
Definition: TImageDump.cxx:894
static Int_t gCellArrayH
Definition: TImageDump.cxx:896
static Int_t gCellArrayIdx
Definition: TImageDump.cxx:901
static Int_t gCellArrayY2
Definition: TImageDump.cxx:900
static Int_t gCellArrayY1
Definition: TImageDump.cxx:899
#define gROOT
Definition: TROOT.h:406
R__EXTERN TStyle * gStyle
Definition: TStyle.h:410
R__EXTERN TVirtualPS * gVirtualPS
Definition: TVirtualPS.h:81
#define gPad
Definition: TVirtualPad.h:287
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)
Definition: TAttMarker.cxx:297
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 ...
Definition: TAttMarker.cxx:246
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:1212
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:835
void Text(Double_t x, Double_t y, const char *string)
Draw text.
Definition: TImageDump.cxx:851
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:813
TImageDump()
Default constructor.
Definition: TImageDump.cxx:54
Int_t YtoPixel(Double_t y)
y to pixel
Definition: TImageDump.cxx:993
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:978
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Cell array fill.
Definition: TImageDump.cxx:935
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:803
void CellArrayEnd()
Cell array end.
Definition: TImageDump.cxx:948
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:906
Int_t fType
PostScript workstation type.
Definition: TImageDump.h:25
Int_t XtoPixel(Double_t x)
x to pixel
Definition: TImageDump.cxx:985
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:523
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:228
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition: TStyle.cxx:1113
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
Double_t Floor(Double_t x)
Definition: TMath.h:693
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