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
48
49////////////////////////////////////////////////////////////////////////////////
50/// Default constructor
51
53{
54 gVirtualPS = this;
55 SetTitle("IMG");
56}
57
58////////////////////////////////////////////////////////////////////////////////
59/// Initialize batch image interface
60///
61/// fname : image file name
62///
63/// The possible workstation types are:
64/// - 111 - Portrait
65/// - 112 - Landscape
66/// - 114 - preview, keep in memory (do not write on delete)
67
69{
71 gVirtualPS = this;
72 SetTitle("IMG");
73}
74
75////////////////////////////////////////////////////////////////////////////////
76/// Open a image file
77
78void TImageDump::Open(const char *fname, Int_t type)
79{
81 fType = type;
83}
84
85////////////////////////////////////////////////////////////////////////////////
86/// destructor
87
89{
90 Close();
91
92 delete fImage;
93 fImage = nullptr;
94
95 gVirtualPS = nullptr;
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Close a image file
100
102{
103 // if fType == 114 - do not write image
104 if (!fImage || (fType == 114)) {
105 return;
106 }
107
108 //if (fType == 112) fImage->Flip(90);
110}
111
112////////////////////////////////////////////////////////////////////////////////
113/// Draw a Box
114
116{
117 if (!gPad || !fImage)
118 return;
119
121
122 Double_t x[4], y[4];
123 Int_t ix1 = x1 < x2 ? XtoPixel(x1) : XtoPixel(x2);
124 Int_t ix2 = x1 < x2 ? XtoPixel(x2) : XtoPixel(x1);
125 Int_t iy1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
126 Int_t iy2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);
127
128 if (ix1<0 || ix2 <0 || iy1 < 0 || iy2 <0) return; // box is not visible
129
130 if (TMath::Abs(ix2-ix1) < 1) ix2 = ix1+1;
131 if (TMath::Abs(iy1-iy2) < 1) iy1 = iy2+1;
132
133 Int_t fillis = fFillStyle/1000;
134 Int_t fillsi = fFillStyle%1000;
135
137 if (!col) { // no color, set it white
138 fFillColor = 10;
139 col = gROOT->GetColor(fFillColor);
140 if (!col) return;
141 }
142
143 TColor *linecol = gROOT->GetColor(fLineColor);
144 if (!linecol) { // no color, set it to black
145 fLineColor = 1;
146 linecol = gROOT->GetColor(fLineColor);
147 }
148
149 if ((fillis == 3) || (fillis == 2)) {
150 if (fillsi > 99) {
151 x[0] = x1; y[0] = y1;
152 x[1] = x2; y[1] = y1;
153 x[2] = x2; y[2] = y2;
154 x[3] = x1; y[3] = y2;
155 return;
156 }
157 if ((fillsi > 0) && (fillsi < 26)) {
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 DrawPS(-4, &x[0], &y[0]);
163 }
164 if (fillsi == -3) {
165 // fill style = -3 ... which is NEVER used now
166 }
167 }
168
169 if (fillis == 1) {
171 }
172
173 if (fillis == 0) {
174 if (fLineWidth<=0) return;
176 }
177}
178
179////////////////////////////////////////////////////////////////////////////////
180/// Draw a Frame around a box
181///
182/// - mode = -1 the box looks as it is behind the screen
183/// - mode = 1 the box looks as it is in front of the screen
184/// border is the border size in already pre-computed dark is the
185/// color for the dark part of the frame light is the color for the light
186/// part of the frame
187
190{
191 if (!gPad || !fImage) {
192 return;
193 }
194
196
197 bordersize = bordersize < 1 ? 1 : bordersize;
198
199 TColor *col;
200 TColor *lo = gROOT->GetColor(dark);
201 if (!lo) {
202 lo = gROOT->GetColor(10);
203 }
205 if (!hi) {
206 hi = gROOT->GetColor(10);
207 }
208
209 Short_t pxl,pyl,pxt,pyt,px1,py1,px2,py2;
210
211 px1 = XtoPixel(x1); py1 = YtoPixel(y1);
212 px2 = XtoPixel(x2); py2 = YtoPixel(y2);
213 if (px1 < px2) {pxl = px1; pxt = px2;}
214 else {pxl = px2; pxt = px1;}
215 if (py1 > py2) {pyl = py1; pyt = py2;}
216 else {pyl = py2; pyt = py1;}
217
218 if (bordersize == 1) {
219 col = gROOT->GetColor(fLineColor);
220 if (!col) {
221 fLineColor = 1;
222 col = gROOT->GetColor(fLineColor);
223 if (!col) return;
224 }
226 return;
227 }
228
229 if (!fImage->IsValid()) {
230 col = gROOT->GetColor(light);
231 if (!col) {
232 col = gROOT->GetColor(10);
233 if (!col) return;
234 }
235 fImage->DrawBox(pxl, pyl, pxt, pyt, // force image creation and resizing
236 "#ffffffff", 1, TVirtualX::kFilled);
237 }
238
239 TPoint frame[6];
240
241 frame[0].fX = pxl; frame[0].fY = pyl;
242 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
243 frame[2].fX = pxl + bordersize; frame[2].fY = pyt + bordersize;
244 frame[3].fX = pxt - bordersize; frame[3].fY = pyt + bordersize;
245 frame[4].fX = pxt; frame[4].fY = pyt;
246 frame[5].fX = pxl; frame[5].fY = pyt;
247
248 if (mode == -1) col = lo;
249 else col = hi;
250
251 fImage->DrawFillArea(6, frame, col->AsHexString());
252
253 frame[0].fX = pxl; frame[0].fY = pyl;
254 frame[1].fX = pxl + bordersize; frame[1].fY = pyl - bordersize;
255 frame[2].fX = pxt - bordersize; frame[2].fY = frame[1].fY;
256 frame[3].fX = frame[2].fX; frame[3].fY = pyt + bordersize;
257 frame[4].fX = pxt; frame[4].fY = pyt;
258 frame[5].fX = pxt; frame[5].fY = pyl;
259
260 if (mode == -1) col = hi;
261 else col = lo;
262
263 fImage->DrawFillArea(6, frame, col->AsHexString());
264}
265
266////////////////////////////////////////////////////////////////////////////////
267/// not used
268
272
273////////////////////////////////////////////////////////////////////////////////
274/// draw polymarker
275
277{
278 if (!gPad || !fImage)
279 return;
280
282 if (!col)
283 col = gROOT->GetColor(1);
284
285 if (!col)
286 return;
287 TString colHex = col->AsHexString();
288
290
291 auto markerLineWidth = TAttMarker::GetMarkerLineWidth(GetMarkerStyle());
292 Int_t markerSize = 0; ///< size of simple markers
293 std::vector<TPoint> markerShape; ///< marker shape points
294 // prefer to use triangles while image not always correctly fill complex polygon
295 auto markerType = GetMarkerShape(markerSize, markerShape, gStyle->GetImageScaling(), kTRUE);
296
297 // workaround of ASImage error - it is not able to draw circle with transparent color
298 if ((markerType == TAttMarker::kShapeFilledCircle) && (col->GetAlpha() < 1.)) {
299 Double_t r = markerSize / 2;
300 const int pts = 100;
301 const Double_t delta = TMath::TwoPi() / pts;
302 markerShape.reserve(pts + 1);
303 Double_t angle = 0.;
304 for (int i = 0; i <= pts; ++i, angle += delta)
305 markerShape.emplace_back(std::round(r * TMath::Cos(angle)), std::round(r * TMath::Sin(angle)));
306 markerType = TAttMarker::kShapeFilledArea;
307 }
308
309 for (Int_t i = 0; i < n; i++) {
310 auto ix = XtoPixel(xw[i]);
311 auto iy = YtoPixel(yw[i]);
312 for (auto &pnt : markerShape) {
313 pnt.fX += ix;
314 pnt.fY += iy;
315 }
316 switch(markerType) {
318 fImage->PutPixel(ix, iy, colHex.Data());
319 break;
321 // hollow circle
322 fImage->DrawCircle(ix, iy, markerSize/2, colHex.Data(), markerLineWidth);
323 break;
325 // filled circle
326 fImage->DrawCircle(ix, iy, markerSize/2, colHex.Data(), -1);
327 break;
329 // hollow polygon
330 fImage->DrawPolyLine(markerShape.size(), markerShape.data(), colHex.Data(), markerLineWidth);
331 break;
333 // filled polygon
334 fImage->FillPolygon(markerShape.size(), markerShape.data(), colHex.Data());
335 break;
337 // segmented line
338 for (std::size_t s = 0; s < markerShape.size(); s += 2)
339 fImage->DrawLine(markerShape[s].fX, markerShape[s].fY, markerShape[s + 1].fX, markerShape[s + 1].fY, colHex.Data(), markerLineWidth);
340 break;
342 // filled triangles
343 for (std::size_t t = 0; t < markerShape.size(); t += 3)
344 fImage->FillPolygon(3, markerShape.data() + t, colHex.Data());
345 break;
346 }
347 for (auto &pnt : markerShape) {
348 pnt.fX -= ix;
349 pnt.fY -= iy;
350 }
351 }
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// This function defines a path with xw and yw and draw it according the
356/// value of nn:
357///
358/// - If nn > 0 a line is drawn.
359/// - If nn < 0 a closed polygon is drawn.
360
362{
363 if (!gPad || !fImage || !nn)
364 return;
365
367
368 Bool_t line = nn > 1;
370 Int_t fais = fFillStyle / 1000;
371 Int_t fasi = fFillStyle % 1000;
372
373 // SetLineStyle
374 std::vector<char> dashList;
375
376 TColor *fcol = gROOT->GetColor(fFillColor);
377 if (!fcol) { // no color, set it white
378 fFillColor = 10;
379 fcol = gROOT->GetColor(fFillColor);
380 }
381
382 TColor *lcol = gROOT->GetColor(fLineColor);
383 if (!lcol) { // no color, make it black
384 fLineColor = 1;
385 lcol = gROOT->GetColor(fLineColor);
386 }
387
388 if (line) {
389 if (fLineWidth <= 0)
390 return;
391 // dash lines
392 if (fLineStyle > 1) {
394 std::unique_ptr<TObjArray> tokens(st.Tokenize(" "));
395
396 if (tokens)
397 for (int j = 0; j < tokens->GetEntries(); j++) {
398 Int_t it;
399 sscanf(tokens->At(j)->GetName(), "%d", &it);
400 dashList.emplace_back((char)(it/4));
401 }
402 }
403 }
404
405 if (n == 1) { // point
406 auto px1 = XtoPixel(x[0]);
407 auto py1 = YtoPixel(y[0]);
408 if (fcol)
409 fImage->PutPixel(px1, py1, fcol->AsHexString());
410 return;
411 }
412
413 if (n == 2) { // line
414 auto px1 = XtoPixel(x[0]);
415 auto py1 = YtoPixel(y[0]);
416 auto px2 = XtoPixel(x[1]);
417 auto py2 = YtoPixel(y[1]);
418
419 // SetLineColor
420 if (lcol) {
421 if (fLineStyle < 2) {
422 fImage->DrawLine(px1, py1, px2, py2, lcol->AsHexString(), fLineWidth);
423 } else {
424 fImage->DrawDashLine(px1, py1, px2, py2, dashList.size(), dashList.data(),
425 lcol->AsHexString(), fLineWidth);
426 }
427 }
428 return;
429 }
430
431 if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100))
432 return;
433
434 std::vector<TPoint> pt(n+1);
435
436 for (UInt_t i = 0; i < n; i++) {
437 pt[i].fX = XtoPixel(x[i]);
438 pt[i].fY = YtoPixel(y[i]);
439 }
440 pt[n].fX = pt[0].fX;
441 pt[n].fY = pt[0].fY;
442
443 const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : nullptr;
444
445 // filled polygon
446 if (!line && fFillStyle && (fFillStyle != 4000) && fcol) {
447 if (n < 5) // convex
448 fImage->FillPolygon(n, pt.data(), fcol->AsHexString(), stipple);
449 else // non-convex fill area
450 fImage->DrawFillArea(n, pt.data(), fcol->AsHexString(), stipple);
451 }
452
453 // hollow polygon or polyline is drawn
454 if (line || !fFillStyle || (fFillStyle == 4000)) {
455 if (!line) {
456 if (fcol)
457 fImage->DrawPolyLine(n+1, pt.data(), fcol->AsHexString(), 1);
458 } else if (lcol) {
459 if (fLineStyle < 2) { // solid
460 fImage->DrawPolyLine(n, pt.data(), lcol->AsHexString(), fLineWidth);
461 } else { // dashed
462 DrawDashPolyLine(n, pt.data(), dashList.size(), dashList.data(),
463 lcol->AsHexString(), fLineWidth);
464 }
465 }
466 }
467}
468
469////////////////////////////////////////////////////////////////////////////////
470/// not used
471
473{
474 if (!gPad || !fImage) {
475 return;
476 }
477}
478
479////////////////////////////////////////////////////////////////////////////////
480/// draw dashed polyline
481
483 const char* pDash, const char* col, UInt_t thick)
484{
485 Int_t x0 = xy[0].GetX();
486 Int_t y0 = xy[0].GetY();
487
488 for (Int_t i = 1; i < nn; i++) {
489 Int_t x = xy[i].GetX();
490 Int_t y = xy[i].GetY();
491
492 fImage->DrawDashLine(x0, y0, x, y, nDash, pDash, col, thick);
493
494 x0 = x;
495 y0 = y;
496 }
497}
498
499////////////////////////////////////////////////////////////////////////////////
500/// new page
501
503{
504 fX0 = fY0 = 0;
505 if (gPad && fImage) {
506 UInt_t w = gPad->GetWw() * gStyle->GetImageScaling();
507 UInt_t h = gPad->GetWh() * gStyle->GetImageScaling();
508 if (gPad != gPad->GetMother()) {
509 fX0 = gPad->XtoAbsPixel(gPad->GetX1())* gStyle->GetImageScaling();
510 fY0 = gPad->YtoAbsPixel(gPad->GetY2())* gStyle->GetImageScaling();
511 w = w * gPad->GetAbsWNDC();
512 h = h * gPad->GetAbsHNDC();
513 }
514 fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
515 }
516}
517
518////////////////////////////////////////////////////////////////////////////////
519/// Draw text
520///
521/// - x: x position of the text
522/// - y: y position of the text
523
525{
526 if (!gPad || !fImage)
527 return;
528
530
531 TText t(x, y, chars);
538}
539
540////////////////////////////////////////////////////////////////////////////////
541/// Draw text
542///
543/// - x: x position of the text
544/// - y: y position of the text
545
547{
548 if (!gPad || !fImage)
549 return;
550
552
553 TText t(x, y, chars);
560}
561
562////////////////////////////////////////////////////////////////////////////////
563/// Draw text with URL. Same as Text.
564///
565
566void TImageDump::TextUrl(Double_t x, Double_t y, const char *chars, const char *)
567{
568 Text(x, y, chars);
569}
570
571////////////////////////////////////////////////////////////////////////////////
572///cell array begin
573
576{
577 if (!gPad || !fImage || (w <= 0) || (h <= 0))
578 return;
579
581
582 fCellArrayW = w;
583 fCellArrayH = h;
584 fCellArrayColors.resize(w * h);
585 fCellArrayIdx = 0;
586
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Cell array fill
595
597{
598 if (fCellArrayIdx >= fCellArrayColors.size())
599 return;
600
602
603 fCellArrayColors[fCellArrayIdx++] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Cell array end
608
610{
611 if (!fImage || fCellArrayColors.empty() || !fCellArrayW || !fCellArrayH)
612 return;
613
615
618
619 fCellArrayColors.clear();
620 fCellArrayIdx = 0;
621 fCellArrayW = 0;
622 fCellArrayH = 0;
623 fCellArrayX1 = 0;
624 fCellArrayX2 = 0;
625 fCellArrayY1 = 0;
626 fCellArrayY2 = 0;
627}
628
629////////////////////////////////////////////////////////////////////////////////
630/// Set color with its R G B components
631///
632/// - r: % of red in [0,1]
633/// - g: % of green in [0,1]
634/// - b: % of blue in [0,1]
635
637{
638}
639
640////////////////////////////////////////////////////////////////////////////////
641/// x to pixel
642
644{
645 return gPad->XtoAbsPixel(x)*gStyle->GetImageScaling() - fX0;
646}
647
648////////////////////////////////////////////////////////////////////////////////
649/// y to pixel
650
652{
653 return gPad->YtoAbsPixel(y)*gStyle->GetImageScaling() - fY0;
654}
#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
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:54
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char y1
#define hi
#define gROOT
Definition TROOT.h:417
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
R__EXTERN TVirtualPS * gVirtualPS
Definition TVirtualPS.h:88
#define gPad
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:25
Color_t fFillColor
Fill area color.
Definition TAttFill.h:24
Width_t fLineWidth
Line width.
Definition TAttLine.h:26
Style_t fLineStyle
Line style.
Definition TAttLine.h:25
Color_t fLineColor
Line color.
Definition TAttLine.h:24
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition TAttMarker.h:35
virtual Color_t GetMarkerColor() const
Return the marker color.
Definition TAttMarker.h:34
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
EMarkerShape GetMarkerShape(Int_t &sz, std::vector< TPoint > &points, Float_t scale=1., Bool_t prefer_triangles=kFALSE) const
Return marker shape.
@ kShapeTriangles
Definition TAttMarker.h:48
@ kShapeFilledArea
Definition TAttMarker.h:48
@ kShapeFilledCircle
Definition TAttMarker.h:48
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:48
Color_t fTextColor
Text color.
Definition TAttText.h:27
Float_t fTextAngle
Text angle.
Definition TAttText.h:24
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
Definition TAttText.h:49
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition TAttText.h:50
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:52
Font_t fTextFont
Text font.
Definition TAttText.h:28
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:53
Short_t fTextAlign
Text alignment.
Definition TAttText.h:26
Float_t fTextSize
Text size.
Definition TAttText.h:25
The color creation and management class.
Definition TColor.h:22
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:1926
const char * AsHexString() const
Return color as hexadecimal string.
Definition TColor.cxx:1330
Float_t GetAlpha() const
Definition TColor.h:67
Int_t fCellArrayY1
Definition TImageDump.h:33
void NewPage() override
new page
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
void CellArrayEnd() override
Cell array end.
std::vector< UInt_t > fCellArrayColors
Definition TImageDump.h:28
void DrawDashPolyLine(Int_t npoints, TPoint *pt, UInt_t nDash, const char *pDash, const char *col, UInt_t thick)
draw dashed polyline
TImageDump()
Default constructor.
Int_t YtoPixel(Double_t y)
y to pixel
TImage * fImage
Image.
Definition TImageDump.h:24
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Cell array fill.
~TImageDump() override
destructor
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
not used
Int_t fCellArrayX1
Definition TImageDump.h:31
void Open(const char *filename, Int_t type=-111) override
Open a image file.
Int_t fX0
Definition TImageDump.h:26
void Close(Option_t *opt="") override
Close a image file.
Int_t fCellArrayX2
Definition TImageDump.h:32
Int_t fCellArrayH
Definition TImageDump.h:30
Int_t fCellArrayY2
Definition TImageDump.h:34
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
not used
UInt_t fCellArrayIdx
Definition TImageDump.h:35
void Text(Double_t x, Double_t y, const char *string) override
Draw text.
void SetColor(Float_t r, Float_t g, Float_t b) override
Set color with its R G B components.
Int_t fCellArrayW
Definition TImageDump.h:29
void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light) override
Draw a Frame around a box.
Int_t fType
PostScript workstation type.
Definition TImageDump.h:25
Int_t XtoPixel(Double_t x)
x to pixel
Int_t fY0
offset of selected pad to canvas
Definition TImageDump.h:26
void TextUrl(Double_t x, Double_t y, const char *string, const char *url) override
Draw text with URL.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override
cell array begin
virtual void DrawFillArea(UInt_t, TPoint *, const char *="#000000", const char *=nullptr, UInt_t=16, UInt_t=16)
Definition TImage.h:209
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:218
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:34
virtual void DrawLine(UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
Definition TImage.h:184
virtual void WriteImage(const char *, EImageFileTypes=TImage::kUnknown)
Definition TImage.h:115
virtual void FillPolygon(UInt_t, TPoint *, const char *="#000000", const char *=nullptr, UInt_t=16, UInt_t=16)
Definition TImage.h:205
virtual Bool_t IsValid() const
Definition TImage.h:231
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:222
virtual void BeginPaint(Bool_t=kTRUE)
Definition TImage.h:182
virtual void DrawTextOnPad(TText *, Int_t=0, Int_t=0, TVirtualPad *=nullptr, Int_t=0, Int_t=0)
Draw text on specified pad, check pad clipping rules.
Definition TImage.cxx:193
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
SCoord_t GetY() const
Definition TPoint.h:47
SCoord_t GetX() const
Definition TPoint.h:46
Basic string class.
Definition TString.h:138
Float_t GetImageScaling() const
Definition TStyle.h:241
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition TStyle.cxx:1167
Base class for several text objects.
Definition TText.h:22
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition TVirtualPS.h:30
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 Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:607
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:601
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122
constexpr Double_t TwoPi()
Definition TMath.h:47