Logo ROOT   6.14/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 
15 Save canvas as an image (GIF, JPEG, PNG, XPM, TIFF etc.).
16 
17 Example:
18 ~~~ {.cpp}
19  $ root -b
20  root [0] .x hsimple.C
21  root [1] c1->Print("c1.gif");
22 ~~~
23 TImageDump 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 
73 TImageDump::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 
83 void 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 
127  fImage->BeginPaint();
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 
202  fImage->BeginPaint();
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 
292  fImage->BeginPaint();
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 
320  // Draw the marker according to the type
321  Short_t ix,iy;
322  for (Int_t i=0;i<n;i++) {
323  ix = XtoPixel(xw[i]);
324  iy = YtoPixel(yw[i]);
325 
326  switch (ms) {
327  // Dots (.) big, medium and small
328  case 7:
329  fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy-1, col->AsHexString());
330  fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy+1, col->AsHexString());
331  fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy+1, col->AsHexString());
332  fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy-1, col->AsHexString());
333  case 6:
334  fImage->PutPixel((UInt_t)ix, (UInt_t)iy-1, col->AsHexString());
335  fImage->PutPixel((UInt_t)ix, (UInt_t)iy+1, col->AsHexString());
336  fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy, col->AsHexString());
337  fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy, col->AsHexString());
338  case 1:
339  fImage->PutPixel((UInt_t)ix, (UInt_t)iy, col->AsHexString());
340  break;
341  // Plus (+)
342  case 2:
343  fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString());
344  fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString());
345  break;
346  // X shape (X)
347  case 5:
348  fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(ix+m2), UInt_t(iy+m2), col->AsHexString());
349  fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy+m2), UInt_t(ix+m2), UInt_t(iy-m2), col->AsHexString());
350  break;
351  // Asterisk shape (*)
352  case 3:
353  case 31:
354  fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString());
355  fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString());
356  fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(ix+m2), UInt_t(iy+m2), col->AsHexString());
357  fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy+m2), UInt_t(ix+m2), UInt_t(iy-m2), col->AsHexString());
358  break;
359  // Circle
360  case 4:
361  case 24:
362  fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), 1);
363  break;
364  // Circle
365  case 8:
366  case 20:
367  fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), -1);
368  break;
369  // Square
370  case 21:
371  fImage->FillRectangle(col->AsHexString(), UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m));
372  break;
373  case 25:
374  fImage->DrawRectangle(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m), col->AsHexString());
375  break;
376  // Down triangle
377  case 23:
378  case 32:
379  pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
380  pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
381  pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
382  pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy-m2);
383  ms == 32 ? fImage->DrawPolyLine(4, pt, col->AsHexString()) :
384  fImage->FillPolygon(3, pt, col->AsHexString());
385  break;
386  // Up triangle
387  case 22:
388  case 26:
389  pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
390  pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy+m2);
391  pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m2);
392  pt[3].fX = Short_t(ix); pt[3].fY = Short_t(iy-m2);
393  ms == 26 ? fImage->DrawPolyLine(4, pt, col->AsHexString()) :
394  fImage->FillPolygon(3, pt, col->AsHexString());
395  break;
396  case 27:
397  case 33:
398  pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy-m2);
399  pt[1].fX = Short_t(ix+m3); pt[1].fY = Short_t(iy);
400  pt[2].fX = Short_t(ix); pt[2].fY = Short_t(iy+m2);
401  pt[3].fX = Short_t(ix-m3); pt[3].fY = Short_t(iy);
402  pt[4].fX = Short_t(ix); pt[4].fY = Short_t(iy-m2);
403  ms == 27 ? fImage->DrawPolyLine(5, pt, col->AsHexString()) :
404  fImage->FillPolygon(4, pt, col->AsHexString());
405  break;
406  case 28:
407  case 34:
408  pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6);
409  pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
410  pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
411  pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
412  pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
413  pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
414  pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
415  pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
416  pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
417  pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
418  pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
419  pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
420  pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6);
421  ms == 28 ? fImage->DrawPolyLine(13, pt, col->AsHexString()) :
422  fImage->FillPolygon(12, pt, col->AsHexString());
423  break;
424  case 29:
425  case 30:
426  pt[0].fX = Short_t(ix); pt[0].fY = Short_t(iy+m2);
427  pt[1].fX = Short_t(ix+0.112255*m); pt[1].fY = Short_t(iy+0.15451*m);
428  pt[2].fX = Short_t(ix+0.47552*m); pt[2].fY = Short_t(iy+0.15451*m);
429  pt[3].fX = Short_t(ix+0.181635*m); pt[3].fY = Short_t(iy-0.05902*m);
430  pt[4].fX = Short_t(ix+0.29389*m); pt[4].fY = Short_t(iy-0.40451*m);
431  pt[5].fX = Short_t(ix); pt[5].fY = Short_t(iy-0.19098*m);
432  pt[6].fX = Short_t(ix-0.29389*m); pt[6].fY = Short_t(iy-0.40451*m);
433  pt[7].fX = Short_t(ix-0.181635*m); pt[7].fY = Short_t(iy-0.05902*m);
434  pt[8].fX = Short_t(ix-0.47552*m); pt[8].fY = Short_t(iy+0.15451*m);
435  pt[9].fX = Short_t(ix-0.112255*m); pt[9].fY = Short_t(iy+0.15451*m);
436  pt[10].fX = Short_t(ix); pt[10].fY = Short_t(iy+m2);
437  ms == 30 ? fImage->DrawPolyLine(11, pt, col->AsHexString()) :
438  fImage->DrawFillArea(10, pt, col->AsHexString());
439  break;
440  case 35:
441  pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
442  pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
443  pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m2);
444  pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy+m2);
445  pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m2);
446  pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m2);
447  pt[6].fX = Short_t(ix-m2); pt[6].fY = Short_t(iy+m2);
448  pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m2);
449  fImage->DrawPolyLine(8, pt, col->AsHexString()) ;
450  break;
451  case 36:
452  pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
453  pt[1].fX = Short_t(ix ); pt[1].fY = Short_t(iy-m2);
454  pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy );
455  pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy+m2);
456  pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy );
457  pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy );
458  pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy+m2);
459  pt[7].fX = Short_t(ix ); pt[7].fY = Short_t(iy-m2);
460  fImage->DrawPolyLine(8, pt, col->AsHexString()) ;
461  break;
462  case 37:
463  case 39:
464  pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
465  pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
466  pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
467  pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy );
468  pt[4].fX = Short_t(ix-m4); pt[4].fY = Short_t(iy-m2);
469  pt[5].fX = Short_t(ix+m4); pt[5].fY = Short_t(iy-m2);
470  pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy );
471  pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy );
472  pt[8].fX = Short_t(ix+m4); pt[8].fY = Short_t(iy+m2);
473  pt[9].fX = Short_t(ix ); pt[9].fY = Short_t(iy );
474  ms == 37 ? fImage->DrawPolyLine(10, pt, col->AsHexString()) :
475  fImage->DrawFillArea(9, pt, col->AsHexString());
476  break;
477  case 38:
478  pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy );
479  pt[1].fX = Short_t(ix-m2); pt[1].fY = Short_t(iy-m4);
480  pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy-m2);
481  pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
482  pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
483  pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m4);
484  pt[6].fX = Short_t(ix+m4); pt[6].fY = Short_t(iy+m2);
485  pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy+m2);
486  pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
487  pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy );
488  pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy );
489  pt[11].fX = Short_t(ix ); pt[11].fY = Short_t(iy );
490  pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy-m2);
491  pt[13].fX = Short_t(ix ); pt[13].fY = Short_t(iy+m2);
492  pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy );
493  fImage->DrawPolyLine(15, pt, col->AsHexString()) ;
494  break;
495  case 40:
496  case 41:
497  pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
498  pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
499  pt[2].fX = Short_t(ix+m2); pt[2].fY = Short_t(iy+m4);
500  pt[3].fX = Short_t(ix ); pt[3].fY = Short_t(iy );
501  pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m4);
502  pt[5].fX = Short_t(ix+m4); pt[5].fY = Short_t(iy-m2);
503  pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy );
504  pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
505  pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy-m4);
506  pt[9].fX = Short_t(ix ); pt[9].fY = Short_t(iy );
507  pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m4);
508  pt[11].fX = Short_t(ix-m4); pt[11].fY = Short_t(iy+m2);
509  pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy );
510  ms == 40 ? fImage->DrawPolyLine(13, pt, col->AsHexString()) :
511  fImage->DrawFillArea(12, pt, col->AsHexString());
512  break;
513  case 42:
514  case 43:
515  pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m2);
516  pt[1].fX = Short_t(ix-m8); pt[1].fY = Short_t(iy+m8);
517  pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy );
518  pt[3].fX = Short_t(ix-m8); pt[3].fY = Short_t(iy-m8);
519  pt[4].fX = Short_t(ix ); pt[4].fY = Short_t(iy-m2);
520  pt[5].fX = Short_t(ix+m8); pt[5].fY = Short_t(iy-m8);
521  pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy );
522  pt[7].fX = Short_t(ix+m8); pt[7].fY = Short_t(iy+m8);
523  pt[8].fX = Short_t(ix ); pt[8].fY = Short_t(iy+m2);
524  ms == 42 ? fImage->DrawPolyLine(9, pt, col->AsHexString()) :
525  fImage->DrawFillArea(8, pt, col->AsHexString());
526  break;
527  case 44:
528  pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy );
529  pt[1].fX = Short_t(ix+m4); pt[1].fY = Short_t(iy+m2);
530  pt[2].fX = Short_t(ix-m4); pt[2].fY = Short_t(iy+m2);
531  pt[3].fX = Short_t(ix+m4); pt[3].fY = Short_t(iy-m2);
532  pt[4].fX = Short_t(ix-m4); pt[4].fY = Short_t(iy-m2);
533  pt[5].fX = Short_t(ix ); pt[5].fY = Short_t(iy );
534  pt[6].fX = Short_t(ix+m2); pt[6].fY = Short_t(iy+m4);
535  pt[7].fX = Short_t(ix+m2); pt[7].fY = Short_t(iy-m4);
536  pt[8].fX = Short_t(ix-m2); pt[8].fY = Short_t(iy+m4);
537  pt[9].fX = Short_t(ix-m2); pt[9].fY = Short_t(iy-m4);
538  pt[10].fX = Short_t(ix ); pt[10].fY = Short_t(iy );
539  fImage->DrawPolyLine(11, pt, col->AsHexString()) ;
540  break;
541  case 45:
542  pt[0].fX = Short_t(ix+m0); pt[0].fY = Short_t(iy+m0);
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-m0); pt[3].fY = Short_t(iy+m0);
546  pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy+m4);
547  pt[5].fX = Short_t(ix-m2); pt[5].fY = Short_t(iy-m4);
548  pt[6].fX = Short_t(ix-m0); pt[6].fY = Short_t(iy-m0);
549  pt[7].fX = Short_t(ix-m4); pt[7].fY = Short_t(iy-m2);
550  pt[8].fX = Short_t(ix+m4); pt[8].fY = Short_t(iy-m2);
551  pt[9].fX = Short_t(ix+m0); pt[9].fY = Short_t(iy-m0);
552  pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy-m4);
553  pt[11].fX = Short_t(ix+m2); pt[11].fY = Short_t(iy+m4);
554  pt[12].fX = Short_t(ix+m0); pt[12].fY = Short_t(iy+m0);
555  fImage->DrawFillArea(13, pt, col->AsHexString());
556  break;
557  case 46:
558  case 47:
559  pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4);
560  pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
561  pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
562  pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
563  pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
564  pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
565  pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
566  pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
567  pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
568  pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
569  pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
570  pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
571  pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4);
572  ms == 46 ? fImage->DrawPolyLine(13, pt, col->AsHexString()) :
573  fImage->DrawFillArea(12, pt, col->AsHexString());
574  break;
575  case 48:
576  pt[0].fX = Short_t(ix ); pt[0].fY = Short_t(iy+m4*1.005);
577  pt[1].fX = Short_t(ix-m4); pt[1].fY = Short_t(iy+m2);
578  pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m4);
579  pt[3].fX = Short_t(ix-m4); pt[3].fY = Short_t(iy );
580  pt[4].fX = Short_t(ix-m2); pt[4].fY = Short_t(iy-m4);
581  pt[5].fX = Short_t(ix-m4); pt[5].fY = Short_t(iy-m2);
582  pt[6].fX = Short_t(ix ); pt[6].fY = Short_t(iy-m4);
583  pt[7].fX = Short_t(ix+m4); pt[7].fY = Short_t(iy-m2);
584  pt[8].fX = Short_t(ix+m2); pt[8].fY = Short_t(iy-m4);
585  pt[9].fX = Short_t(ix+m4); pt[9].fY = Short_t(iy );
586  pt[10].fX = Short_t(ix+m2); pt[10].fY = Short_t(iy+m4);
587  pt[11].fX = Short_t(ix+m4); pt[11].fY = Short_t(iy+m2);
588  pt[12].fX = Short_t(ix ); pt[12].fY = Short_t(iy+m4*0.995);
589  pt[13].fX = Short_t(ix+m4*0.995); pt[13].fY = Short_t(iy );
590  pt[14].fX = Short_t(ix ); pt[14].fY = Short_t(iy-m4*0.995);
591  pt[15].fX = Short_t(ix-m4*0.995); pt[15].fY = Short_t(iy );
592  pt[16].fX = Short_t(ix ); pt[16].fY = Short_t(iy+m4*0.995);
593  fImage->DrawFillArea(17, pt, col->AsHexString());
594  break;
595  case 49:
596  pt[0].fX = Short_t(ix-m6); pt[0].fY = Short_t(iy-m6*1.005);
597  pt[1].fX = Short_t(ix-m6); pt[1].fY = Short_t(iy-m2);
598  pt[2].fX = Short_t(ix+m6); pt[2].fY = Short_t(iy-m2);
599  pt[3].fX = Short_t(ix+m6); pt[3].fY = Short_t(iy-m6);
600  pt[4].fX = Short_t(ix+m2); pt[4].fY = Short_t(iy-m6);
601  pt[5].fX = Short_t(ix+m2); pt[5].fY = Short_t(iy+m6);
602  pt[6].fX = Short_t(ix+m6); pt[6].fY = Short_t(iy+m6);
603  pt[7].fX = Short_t(ix+m6); pt[7].fY = Short_t(iy+m2);
604  pt[8].fX = Short_t(ix-m6); pt[8].fY = Short_t(iy+m2);
605  pt[9].fX = Short_t(ix-m6); pt[9].fY = Short_t(iy+m6);
606  pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
607  pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
608  pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6*0.995);
609  pt[13].fX = Short_t(ix-m6); pt[13].fY = Short_t(iy+m6);
610  pt[14].fX = Short_t(ix+m6); pt[14].fY = Short_t(iy+m6);
611  pt[15].fX = Short_t(ix+m6); pt[15].fY = Short_t(iy-m6);
612  pt[16].fX = Short_t(ix-m6); pt[16].fY = Short_t(iy-m6*1.005);
613  fImage->DrawFillArea(17, pt, col->AsHexString());
614  break;
615  default:
616  fImage->PutPixel(UInt_t(ix), UInt_t(iy), col->AsHexString());
617  break;
618  }
619  }
620 }
621 
622 ////////////////////////////////////////////////////////////////////////////////
623 /// This function defines a path with xw and yw and draw it according the
624 /// value of nn:
625 ///
626 /// - If nn > 0 a line is drawn.
627 /// - If nn < 0 a closed polygon is drawn.
628 
630 {
631  if (!gPad || !fImage || !nn) {
632  return;
633  }
634 
635  fImage->BeginPaint();
636 
637  TColor *col = 0;
638  Int_t fais = 0 , fasi = 0;
639  Bool_t line = nn > 1;
640  UInt_t n = TMath::Abs(nn);
641 
642  fais = fFillStyle/1000;
643  fasi = fFillStyle%1000;
644 
645  Short_t px1, py1, px2, py2;
646  static const UInt_t gCachePtSize = 200;
647  static TPoint gPointCache[gCachePtSize];
648  Bool_t del = kTRUE;
649 
650 
651  // SetLineStyle
652  Int_t ndashes = 0;
653  char *dash = 0;
654  static char dashList[10];
655  Int_t dashLength = 0;
656  Int_t dashSize = 0;
657 
658  if (line) {
659  if (fLineWidth<=0) return;
660  // dash lines
661  if (fLineStyle > 1) {
663  TObjArray *tokens = st.Tokenize(" ");
664  ndashes = tokens->GetEntries();
665  dash = new char[ndashes];
666 
667  for (int j = 0; j < ndashes; j++) {
668  Int_t it;
669  sscanf(((TObjString*)tokens->At(j))->GetName(), "%d", &it);
670  dash[j] = (char)(it/4);
671  }
672 
673  dashSize = TMath::Min((int)sizeof(dashList), ndashes);
674  dashLength = 0;
675  for (int i = 0; i < dashSize; i++ ) {
676  dashList[i] = dash[i];
677  dashLength += dashList[i];
678  }
679  delete tokens;
680  delete [] dash;
681  }
682 
683  // SetLineColor
684  col = gROOT->GetColor(fLineColor);
685  if (!col) { // no color, make it black
686  fLineColor = 1;
687  col = gROOT->GetColor(fLineColor);
688  if (!col) return;
689  }
690  }
691 
692  if (n == 1) { // point
693  col = gROOT->GetColor(fFillColor);
694  if (!col) { // no color, make it black
695  fFillColor = 1;
696  col = gROOT->GetColor(fFillColor);
697  if (!col) return;
698  }
699  px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
700  fImage->PutPixel(px1, py1, col->AsHexString());
701  return;
702  }
703 
704  if (n == 2) { // line
705  px1 = XtoPixel(x[0]); py1 = YtoPixel(y[0]);
706  px2 = XtoPixel(x[1]); py2 = YtoPixel(y[1]);
707 
708  // SetLineColor
709  col = gROOT->GetColor(fLineColor);
710  if (!col) { // no color, make it black
711  fLineColor = 1;
712  col = gROOT->GetColor(fLineColor);
713  if (!col) return;
714  }
715  if (fLineStyle < 2) {
716  fImage->DrawLine(px1, py1, px2, py2, col->AsHexString(), fLineWidth);
717  } else {
718  fImage->DrawDashLine(px1, py1, px2, py2, dashSize, (const char*)dashList,
719  col->AsHexString(), fLineWidth);
720  }
721  return;
722  }
723 
724  if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100) ) {
725  return;
726  }
727 
728  TPoint *pt = 0;
729  if (n+1 < gCachePtSize) {
730  pt = (TPoint*)&gPointCache;
731  del = kFALSE;
732  } else {
733  pt = new TPoint[n+1];
734  del = kTRUE;
735  }
736 
737  TColor *fcol = gROOT->GetColor(fFillColor);
738  if (!fcol) { // no color, set it white
739  fFillColor = 10;
740  fcol = gROOT->GetColor(fFillColor);
741  }
742 
743  TColor *lcol = gROOT->GetColor(fLineColor);
744  if (!lcol) { // no color, make it black
745  fLineColor = 1;
746  lcol = gROOT->GetColor(fLineColor);
747  }
748 
749  for (UInt_t i = 0; i < n; i++) {
750  pt[i].fX = XtoPixel(x[i]);
751  pt[i].fY = YtoPixel(y[i]);
752  }
753  pt[n].fX = pt[0].fX;
754  pt[n].fY = pt[0].fY;
755 
756  const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : 0;
757 
758  // filled polygon
759  if (!line && fFillStyle && (fFillStyle != 4000)) {
760  if (!fcol) return;
761 
762  if (n < 5) { // convex
763  fImage->FillPolygon(n, pt, fcol->AsHexString(), stipple);
764  } else { // non-convex fill area
765  fImage->DrawFillArea(n, pt, fcol->AsHexString(), stipple);
766  }
767  }
768 
769  // hollow polygon or polyline is drawn
770  if (line || !fFillStyle || (fFillStyle == 4000)) {
771  if (!lcol) return;
772  if (!line) {
773  fImage->DrawPolyLine(n+1, pt, fcol->AsHexString(), 1);
774  } else {
775  if (fLineStyle < 2) { // solid
776  fImage->DrawPolyLine(n, pt, lcol->AsHexString(), fLineWidth);
777  } else { // dashed
778  DrawDashPolyLine(n, pt, dashSize, (const char*)dashList,
779  lcol->AsHexString(), fLineWidth);
780  }
781  }
782  }
783  if (del) delete [] pt;
784 }
785 
786 ////////////////////////////////////////////////////////////////////////////////
787 /// not used
788 
790 {
791  if (!gPad || !fImage) {
792  return;
793  }
794 }
795 
796 ////////////////////////////////////////////////////////////////////////////////
797 /// draw dashed polyline
798 
800  const char* pDash, const char* col, UInt_t thick)
801 {
802  Int_t x0 = xy[0].GetX();
803  Int_t y0 = xy[0].GetY();
804  Int_t x = 0;
805  Int_t y = 0;
806 
807  for (Int_t i = 1; i < nn; i++) {
808  x = xy[i].GetX();
809  y = xy[i].GetY();
810 
811  fImage->DrawDashLine(x0, y0, x, y, nDash, pDash, col, thick);
812 
813  x0 = x;
814  y0 = y;
815  }
816 }
817 
818 ////////////////////////////////////////////////////////////////////////////////
819 /// new page
820 
822 {
823  if (gPad && fImage) {
824  UInt_t w = UInt_t(gPad->GetWw()*gPad->GetWNDC()) * gStyle->GetImageScaling();
825  UInt_t h = UInt_t(gPad->GetWh()*gPad->GetHNDC()) * gStyle->GetImageScaling();
826  fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
827  }
828  return;
829 }
830 
831 ////////////////////////////////////////////////////////////////////////////////
832 /// Draw text
833 ///
834 /// - x: x position of the text
835 /// - y: y position of the text
836 
837 void TImageDump::Text(Double_t x, Double_t y, const char *chars)
838 {
839  if (!gPad || !fImage) {
840  return;
841  }
842 
843  fImage->BeginPaint();
844 
845  TText t(x, y, chars);
851  fImage->DrawText(&t, XtoPixel(x), YtoPixel(y));
852 }
853 
854 ////////////////////////////////////////////////////////////////////////////////
855 /// Draw text
856 ///
857 /// - x: x position of the text
858 /// - y: y position of the text
859 
860 void TImageDump::Text(Double_t x, Double_t y, const wchar_t *chars)
861 {
862  if (!gPad || !fImage) {
863  return;
864  }
865 
866  fImage->BeginPaint();
867 
868  TText t(x, y, chars);
874  fImage->DrawText(&t, XtoPixel(x), YtoPixel(y));
875 }
876 
877 
878 ////////////////////////// CellArray code ////////////////////////////////////
880 static Int_t gCellArrayN = 0;
881 static Int_t gCellArrayW = 0;
882 static Int_t gCellArrayH = 0;
883 static Int_t gCellArrayX1 = 0;
884 static Int_t gCellArrayX2 = 0;
885 static Int_t gCellArrayY1 = 0;
886 static Int_t gCellArrayY2 = 0;
887 static Int_t gCellArrayIdx = 0;
888 
889 ////////////////////////////////////////////////////////////////////////////////
890 ///cell array begin
891 
893  Double_t y1, Double_t y2)
894 {
895  if (!gPad || !fImage || (w <= 0) || (h <= 0)) {
896  return;
897  }
898 
899  if (gCellArrayColors) {
900  delete [] gCellArrayColors;
901  }
902 
903  fImage->BeginPaint();
904 
905  gCellArrayN = w * h;
906  gCellArrayW = w;
907  gCellArrayH = h;
909 
910  gCellArrayX1 = x1 < x2 ? XtoPixel(x1) : XtoPixel(x2);
911  gCellArrayX2 = x1 > x2 ? XtoPixel(x2) : XtoPixel(x1);
912  gCellArrayY1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
913  gCellArrayY2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);
914 
915  gCellArrayIdx = 0;
916 }
917 
918 ////////////////////////////////////////////////////////////////////////////////
919 /// Cell array fill
920 
922 {
923  if (gCellArrayIdx >= gCellArrayN) return;
924 
925  fImage->BeginPaint();
926 
927  gCellArrayColors[gCellArrayIdx] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
928  gCellArrayIdx++;
929 }
930 
931 ////////////////////////////////////////////////////////////////////////////////
932 /// Cell array end
933 
935 {
936  if (!fImage || !gCellArrayColors || !gCellArrayW || !gCellArrayH) {
937  return;
938  }
939 
940  fImage->BeginPaint();
941 
944 
945  delete [] gCellArrayColors;
946  gCellArrayColors = 0;
947  gCellArrayN = 0;
948  gCellArrayW = 0;
949  gCellArrayH = 0;
950  gCellArrayX1 = 0;
951  gCellArrayX2 = 0;
952  gCellArrayY1 = 0;
953  gCellArrayY2 = 0;
954  gCellArrayIdx = 0;
955 }
956 
957 ////////////////////////////////////////////////////////////////////////////////
958 /// Set color with its R G B components
959 ///
960 /// - r: % of red in [0,1]
961 /// - g: % of green in [0,1]
962 /// - b: % of blue in [0,1]
963 
964 void TImageDump::SetColor(Float_t /*r*/, Float_t /*g*/, Float_t /*b*/)
965 {
966 }
967 
968 ////////////////////////////////////////////////////////////////////////////////
969 /// x to pixel
970 
972 {
973  return gPad->XtoAbsPixel(x)*gStyle->GetImageScaling();
974 }
975 
976 ////////////////////////////////////////////////////////////////////////////////
977 /// y to pixel
978 
980 {
981  return gPad->YtoAbsPixel(y)*gStyle->GetImageScaling();
982 }
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:799
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:892
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
void CellArrayEnd()
Cell array end.
Definition: TImageDump.cxx:934
static UInt_t * gCellArrayColors
Definition: TImageDump.cxx:879
An array of TObjects.
Definition: TObjArray.h:37
void Close(Option_t *opt="")
Close a image file.
Definition: TImageDump.cxx:107
auto * m
Definition: textangle.C:8
TImage * fImage
Image.
Definition: TImageDump.h:24
virtual void DrawCellArray(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, UInt_t *)
Definition: TImage.h:217
TLine * line
virtual void DrawBox(Int_t, Int_t, Int_t, Int_t, const char *="#000000", UInt_t=1, Int_t=0)
Definition: TImage.h:188
Collectable string class.
Definition: TObjString.h:28
float Float_t
Definition: RtypesCore.h:53
virtual void PutPixel(Int_t, Int_t, const char *="#000000")
Definition: TImage.h:196
const char Option_t
Definition: RtypesCore.h:62
#define g(i)
Definition: RSha256.hxx:105
virtual Bool_t IsValid() const
Definition: TImage.h:230
R__EXTERN TStyle * gStyle
Definition: TStyle.h:406
virtual void WriteImage(const char *, EImageFileTypes=TImage::kUnknown)
Definition: TImage.h:115
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
Float_t GetImageScaling() const
Definition: TStyle.h:226
SCoord_t fX
Definition: TPoint.h:35
Size_t fMarkerSize
Marker size.
Definition: TAttMarker.h:24
#define gROOT
Definition: TROOT.h:410
void Text(Double_t x, Double_t y, const char *string)
Draw text.
Definition: TImageDump.cxx:837
SCoord_t fY
Definition: TPoint.h:36
Basic string class.
Definition: TString.h:131
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:168
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
SCoord_t GetY() const
Definition: TPoint.h:48
SCoord_t GetX() const
Definition: TPoint.h:47
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
Short_t Abs(Short_t d)
Definition: TMathBase.h:108
static Int_t gCellArrayIdx
Definition: TImageDump.cxx:887
virtual void DrawPolyLine(UInt_t, TPoint *, const char *="#000000", UInt_t=1, TImage::ECoordMode=kCoordModeOrigin)
Definition: TImage.h:194
static Int_t gCellArrayY1
Definition: TImageDump.cxx:885
virtual void FillRectangle(const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition: TImage.h:192
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition: TAttText.h:45
static Int_t gCellArrayW
Definition: TImageDump.cxx:881
static const double x2[5]
Double_t x[n]
Definition: legend1.C:17
void NewPage()
new page
Definition: TImageDump.cxx:821
static Int_t gCellArrayN
Definition: TImageDump.cxx:880
static constexpr double m3
TImageDump()
Default constructor.
Definition: TImageDump.cxx:54
virtual void DrawRectangle(UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
Definition: TImage.h:190
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
not used
Definition: TImageDump.cxx:789
Base class for several text objects.
Definition: TText.h:23
void SetColor(Float_t r, Float_t g, Float_t b)
Set color with its R G B components.
Definition: TImageDump.cxx:964
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition: TAttText.h:41
Definition: TPoint.h:31
Style_t fMarkerStyle
Marker style.
Definition: TAttMarker.h:23
Int_t XtoPixel(Double_t x)
x to pixel
Definition: TImageDump.cxx:971
static Int_t gCellArrayX1
Definition: TImageDump.cxx:883
Float_t fTextAngle
Text angle.
Definition: TAttText.h:21
static Int_t gCellArrayX2
Definition: TImageDump.cxx:884
Style_t fLineStyle
Line style.
Definition: TAttLine.h:22
TPaveText * pt
ROOT::R::TRInterface & r
Definition: Object.C:4
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition: TStyle.cxx:970
Color_t fLineColor
Line color.
Definition: TAttLine.h:21
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
Definition: TAttText.h:42
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
unsigned int UInt_t
Definition: RtypesCore.h:42
Width_t fLineWidth
Line width.
Definition: TAttLine.h:23
virtual ~TImageDump()
destructor
Definition: TImageDump.cxx:94
short Short_t
Definition: RtypesCore.h:35
static constexpr double m2
std::ofstream * fStream
Definition: TVirtualPS.h:41
Save canvas as an image (GIF, JPEG, PNG, XPM, TIFF etc.).
Definition: TImageDump.h:22
Int_t fType
PostScript workstation type.
Definition: TImageDump.h:25
Font_t fTextFont
Text font.
Definition: TAttText.h:25
static constexpr double ms
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
const unsigned char gStipples[26][32]
Definition: RStipples.h:26
#define h(i)
Definition: RSha256.hxx:106
const Bool_t kFALSE
Definition: RtypesCore.h:88
void Open(const char *filename, Int_t type=-111)
Open a image file.
Definition: TImageDump.cxx:83
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2172
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
static const double x1[5]
#define ClassImp(name)
Definition: Rtypes.h:359
static Int_t gCellArrayH
Definition: TImageDump.cxx:882
double Double_t
Definition: RtypesCore.h:55
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
not used
Definition: TImageDump.cxx:276
int type
Definition: TGX11.cxx:120
Double_t y[n]
Definition: legend1.C:17
The color creation and management class.
Definition: TColor.h:19
virtual void FillPolygon(UInt_t, TPoint *, const char *="#000000", const char *=0, UInt_t=16, UInt_t=16)
Definition: TImage.h:204
Float_t fTextSize
Text size.
Definition: TAttText.h:22
virtual void DrawLine(UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
Definition: TImage.h:184
static Int_t gCellArrayY2
Definition: TImageDump.cxx:886
Color_t fFillColor
Fill area color.
Definition: TAttFill.h:22
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
R__EXTERN TVirtualPS * gVirtualPS
Definition: TVirtualPS.h:81
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
#define gPad
Definition: TVirtualPad.h:285
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition: TAttText.h:43
float type_of_call hi(const int &, const int &)
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:30
virtual void DrawCircle(Int_t, Int_t, Int_t, const char *="#000000", Int_t=1)
Definition: TImage.h:221
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:46
static TImage * Create()
Create an image.
Definition: TImage.cxx:36
const char * AsHexString() const
Return color as hexadecimal string.
Definition: TColor.cxx:1203
Int_t YtoPixel(Double_t y)
y to pixel
Definition: TImageDump.cxx:979
virtual void DrawFillArea(UInt_t, TPoint *, const char *="#000000", const char *=0, UInt_t=16, UInt_t=16)
Definition: TImage.h:208
Color_t fMarkerColor
Marker color.
Definition: TAttMarker.h:22
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
const Bool_t kTRUE
Definition: RtypesCore.h:87
Color_t fTextColor
Text color.
Definition: TAttText.h:24
const Int_t n
Definition: legend1.C:16
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Cell array fill.
Definition: TImageDump.cxx:921
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
Definition: TImageDump.cxx:121
Style_t fFillStyle
Fill area style.
Definition: TAttFill.h:23
Short_t fTextAlign
Text alignment.
Definition: TAttText.h:23
virtual void BeginPaint(Bool_t=kTRUE)
Definition: TImage.h:182