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 = 0;
56 fImage = 0;
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 = 0;
86 fType = type;
87 SetName(fname);
88}
89
90////////////////////////////////////////////////////////////////////////////////
91/// destructor
92
94{
95 Close();
96
97 delete fImage;
98 fImage = 0;
99
100 gVirtualPS = 0;
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 = 0;
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 Bool_t del = kTRUE;
662
663
664 // SetLineStyle
665 Int_t ndashes = 0;
666 char *dash = 0;
667 static char dashList[10];
668 Int_t dashLength = 0;
669 Int_t dashSize = 0;
670
671 if (line) {
672 if (fLineWidth<=0) return;
673 // dash lines
674 if (fLineStyle > 1) {
676 TObjArray *tokens = st.Tokenize(" ");
677 ndashes = tokens->GetEntries();
678 dash = new char[ndashes];
679
680 for (int j = 0; j < ndashes; j++) {
681 Int_t it;
682 sscanf(((TObjString*)tokens->At(j))->GetName(), "%d", &it);
683 dash[j] = (char)(it/4);
684 }
685
686 dashSize = TMath::Min((int)sizeof(dashList), ndashes);
687 dashLength = 0;
688 for (int i = 0; i < dashSize; i++ ) {
689 dashList[i] = dash[i];
690 dashLength += dashList[i];
691 }
692 delete tokens;
693 delete [] dash;
694 }
695
696 // SetLineColor
697 col = gROOT->GetColor(fLineColor);
698 if (!col) { // no color, make it black
699 fLineColor = 1;
700 col = gROOT->GetColor(fLineColor);
701 if (!col) return;
702 }
703 }
704
705 if (n == 1) { // point
706 col = gROOT->GetColor(fFillColor);
707 if (!col) { // no color, make it black
708 fFillColor = 1;
709 col = gROOT->GetColor(fFillColor);
710 if (!col) return;
711 }
712 px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
713 fImage->PutPixel(px1, py1, col->AsHexString());
714 return;
715 }
716
717 if (n == 2) { // line
718 px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
719 px2 = XtoPixel(x[1]); py2 = YtoPixel(y[1]);
720
721 // SetLineColor
722 col = gROOT->GetColor(fLineColor);
723 if (!col) { // no color, make it black
724 fLineColor = 1;
725 col = gROOT->GetColor(fLineColor);
726 if (!col) return;
727 }
728 if (fLineStyle < 2) {
729 fImage->DrawLine(px1, py1, px2, py2, col->AsHexString(), fLineWidth);
730 } else {
731 fImage->DrawDashLine(px1, py1, px2, py2, dashSize, (const char*)dashList,
732 col->AsHexString(), fLineWidth);
733 }
734 return;
735 }
736
737 if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100) ) {
738 return;
739 }
740
741 TPoint *pt = 0;
742 if (n+1 < gCachePtSize) {
743 pt = (TPoint*)&gPointCache;
744 del = kFALSE;
745 } else {
746 pt = new TPoint[n+1];
747 del = kTRUE;
748 }
749
751 if (!fcol) { // no color, set it white
752 fFillColor = 10;
753 fcol = gROOT->GetColor(fFillColor);
754 }
755
757 if (!lcol) { // no color, make it black
758 fLineColor = 1;
759 lcol = gROOT->GetColor(fLineColor);
760 }
761
762 for (UInt_t i = 0; i < n; i++) {
763 pt[i].fX = XtoPixel(x[i]);
764 pt[i].fY = YtoPixel(y[i]);
765 }
766 pt[n].fX = pt[0].fX;
767 pt[n].fY = pt[0].fY;
768
769 const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : 0;
770
771 // filled polygon
772 if (!line && fFillStyle && (fFillStyle != 4000)) {
773 if (!fcol) return;
774
775 if (n < 5) { // convex
776 fImage->FillPolygon(n, pt, fcol->AsHexString(), stipple);
777 } else { // non-convex fill area
778 fImage->DrawFillArea(n, pt, fcol->AsHexString(), stipple);
779 }
780 }
781
782 // hollow polygon or polyline is drawn
783 if (line || !fFillStyle || (fFillStyle == 4000)) {
784 if (!lcol) return;
785 if (!line) {
786 fImage->DrawPolyLine(n+1, pt, fcol->AsHexString(), 1);
787 } else {
788 if (fLineStyle < 2) { // solid
790 } else { // dashed
791 DrawDashPolyLine(n, pt, dashSize, (const char*)dashList,
792 lcol->AsHexString(), fLineWidth);
793 }
794 }
795 }
796 if (del) delete [] pt;
797}
798
799////////////////////////////////////////////////////////////////////////////////
800/// not used
801
803{
804 if (!gPad || !fImage) {
805 return;
806 }
807}
808
809////////////////////////////////////////////////////////////////////////////////
810/// draw dashed polyline
811
813 const char* pDash, const char* col, UInt_t thick)
814{
815 Int_t x0 = xy[0].GetX();
816 Int_t y0 = xy[0].GetY();
817 Int_t x = 0;
818 Int_t y = 0;
819
820 for (Int_t i = 1; i < nn; i++) {
821 x = xy[i].GetX();
822 y = xy[i].GetY();
823
824 fImage->DrawDashLine(x0, y0, x, y, nDash, pDash, col, thick);
825
826 x0 = x;
827 y0 = y;
828 }
829}
830
831////////////////////////////////////////////////////////////////////////////////
832/// new page
833
835{
836 if (gPad && fImage) {
837 UInt_t w = UInt_t(gPad->GetWw()*gPad->GetWNDC()) * gStyle->GetImageScaling();
838 UInt_t h = UInt_t(gPad->GetWh()*gPad->GetHNDC()) * gStyle->GetImageScaling();
839 fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
840 }
841 return;
842}
843
844////////////////////////////////////////////////////////////////////////////////
845/// Draw text
846///
847/// - x: x position of the text
848/// - y: y position of the text
849
850void TImageDump::Text(Double_t x, Double_t y, const char *chars)
851{
852 if (!gPad || !fImage) {
853 return;
854 }
855
857
858 TText t(x, y, chars);
865}
866
867////////////////////////////////////////////////////////////////////////////////
868/// Draw text
869///
870/// - x: x position of the text
871/// - y: y position of the text
872
873void TImageDump::Text(Double_t x, Double_t y, const wchar_t *chars)
874{
875 if (!gPad || !fImage) {
876 return;
877 }
878
880
881 TText t(x, y, chars);
888}
889
890
891////////////////////////// CellArray code ////////////////////////////////////
901
902////////////////////////////////////////////////////////////////////////////////
903///cell array begin
904
906 Double_t y1, Double_t y2)
907{
908 if (!gPad || !fImage || (w <= 0) || (h <= 0)) {
909 return;
910 }
911
912 if (gCellArrayColors) {
913 delete [] gCellArrayColors;
914 }
915
917
918 gCellArrayN = w * h;
919 gCellArrayW = w;
920 gCellArrayH = h;
922
925 gCellArrayY1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
926 gCellArrayY2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);
927
928 gCellArrayIdx = 0;
929}
930
931////////////////////////////////////////////////////////////////////////////////
932/// Cell array fill
933
935{
936 if (gCellArrayIdx >= gCellArrayN) return;
937
939
940 gCellArrayColors[gCellArrayIdx] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
942}
943
944////////////////////////////////////////////////////////////////////////////////
945/// Cell array end
946
948{
950 return;
951 }
952
954
957
958 delete [] gCellArrayColors;
960 gCellArrayN = 0;
961 gCellArrayW = 0;
962 gCellArrayH = 0;
963 gCellArrayX1 = 0;
964 gCellArrayX2 = 0;
965 gCellArrayY1 = 0;
966 gCellArrayY2 = 0;
967 gCellArrayIdx = 0;
968}
969
970////////////////////////////////////////////////////////////////////////////////
971/// Set color with its R G B components
972///
973/// - r: % of red in [0,1]
974/// - g: % of green in [0,1]
975/// - b: % of blue in [0,1]
976
978{
979}
980
981////////////////////////////////////////////////////////////////////////////////
982/// x to pixel
983
985{
986 return gPad->XtoAbsPixel(x)*gStyle->GetImageScaling();
987}
988
989////////////////////////////////////////////////////////////////////////////////
990/// y to pixel
991
993{
994 return gPad->YtoAbsPixel(y)*gStyle->GetImageScaling();
995}
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:24
static const double x2[5]
static const double x1[5]
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:92
short Width_t
Definition RtypesCore.h:82
short Short_t
Definition RtypesCore.h:39
double Double_t
Definition RtypesCore.h:59
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
int type
Definition TGX11.cxx:121
XPoint xy[kMAXMK]
Definition TGX11.cxx:123
#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:406
R__EXTERN TStyle * gStyle
Definition TStyle.h:412
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: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
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:1769
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.
virtual ~TImageDump()
destructor
void NewPage()
new page
void Text(Double_t x, Double_t y, const char *string)
Draw text.
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 SetColor(Float_t r, Float_t g, Float_t b)
Set color with its R G B components.
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Cell array fill.
void Close(Option_t *opt="")
Close a image file.
void Open(const char *filename, Int_t type=-111)
Open a image file.
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
not used
void CellArrayEnd()
Cell array end.
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
not used
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.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
cell array begin
Int_t fType
PostScript workstation type.
Definition TImageDump.h:25
Int_t XtoPixel(Double_t x)
x to pixel
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: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 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.
TObject * At(Int_t idx) const
Definition TObjArray.h:166
Collectable string class.
Definition TObjString.h:28
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
Basic string class.
Definition TString.h:136
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition TString.cxx:2217
Float_t GetImageScaling() const
Definition TStyle.h:230
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: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)
Definition TMath.h:703
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