30#include "TGLIncludes.h"
41bool IsGradientFill(
Color_t fillColorIndex)
188 return gVirtualX->InheritsFrom(
"TGCocoa");
217 auto pad =
dynamic_cast<TPad *
>(
gPad);
227 Int_t px = 0, py = 0;
229 pad->XYtoAbsPixel(pad->GetX1(), pad->GetY1(), px, py);
231 py =
gPad->GetWh() - py;
236 glViewport(GLint(px * scale), GLint(py * scale),
237 GLsizei(
gPad->GetWw() * pad->GetAbsWNDC() * scale),
238 GLsizei(
gPad->GetWh() * pad->GetAbsHNDC() * scale));
240 glMatrixMode(GL_PROJECTION);
242 glOrtho(pad->GetX1(), pad->GetX2(), pad->GetY1(), pad->GetY2(), -10., 10.);
244 glMatrixMode(GL_MODELVIEW);
246 glTranslated(0., 0., -1.);
248 ::Error(
"TGLPadPainter::SelectDrawable",
249 "function was called not from TPad or TCanvas code\n");
250 throw std::runtime_error(
"");
288 static bool gl_init =
false;
290 int version = gladLoaderLoadGL();
292 Warning(
"TGLPadPainter::InitPainter",
"GL initalization failed.");
294 Info(
"TGLPadPainter::InitPainter",
"GL initalization successful.");
297 glDisable(GL_DEPTH_TEST);
298 glDisable(GL_CULL_FACE);
299 glDisable(GL_LIGHTING);
302 glViewport(0, 0, GLsizei(
gPad->GetWw()), GLsizei(
gPad->GetWh()));
304 glDepthMask(GL_TRUE);
305 glClearColor(1.,1.,1.,1.);
306 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
307 glDepthMask(GL_FALSE);
309 glMatrixMode(GL_PROJECTION);
312 glOrtho(
gPad->GetX1(),
gPad->GetX2(),
gPad->GetY1(),
gPad->GetY2(), -10., 10.);
314 glMatrixMode(GL_MODELVIEW);
316 glTranslated(0., 0., -1.);
329 glMatrixMode(GL_PROJECTION);
332 glOrtho(
gPad->GetX1(),
gPad->GetX2(),
gPad->GetY1(),
gPad->GetY2(), -10., 10.);
334 glMatrixMode(GL_MODELVIEW);
387 glPointSize((GLfloat)pointSize);
389 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
411 gPad->UtoAbsPixel(u2),
gPad->VtoAbsPixel(
v2));
420 glVertex2d(
gPad->GetX1() + u1 * xRange,
gPad->GetY1() +
v1 * yRange);
421 glVertex2d(
gPad->GetX1() + u2 * xRange,
gPad->GetY1() +
v2 * yRange);
454 glBegin(GL_LINE_LOOP);
471 assert(
x !=
nullptr &&
"DrawFillArea, parameter 'x' is null");
472 assert(
y !=
nullptr &&
"DrawFillArea, parameter 'y' is null");
478 ::Error(
"TGLPadPainter::DrawFillArea",
479 "invalid number of points in a polygon");
510 for (
Int_t i = 0; i <
n; ++i) {
512 fVs[i * 3 + 1] =
y[i];
519 gluNextContour(t, (GLenum)GLU_UNKNOWN);
521 for (
Int_t i = 0; i <
n; ++i)
522 gluTessVertex(t, &
fVs[i * 3], &
fVs[i * 3]);
531template<
class ValueType>
536 std::vector<TPoint>
xy(
n);
537 for (
Int_t i = 0; i <
n; ++i) {
548 glBegin(GL_LINE_STRIP);
550 for (
Int_t i = 0; i <
n; ++i)
551 glVertex2d(
x[i],
y[i]);
554 glVertex2d(
x[0],
y[0]);
563 glPointSize((GLfloat)pointSize);
565 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
568 for (
Int_t i = 0; i <
n; ++i)
569 glVertex2d(
x[i],
y[i]);
604 glBegin(GL_LINE_STRIP);
606 for (
Int_t i = 0; i <
n; ++i)
607 glVertex2d(
x1 + u[i] * xRange,
y1 +
v[i] * yRange);
624template<
class ValueType>
627 std::vector<TPoint> poly(
n);
631 for (
Int_t i = 0; i <
n; ++i) {
632 poly[i].fX =
gPad->XtoAbsPixel(
x[i]);
633 poly[i].fY =
gPad->YtoAbsPixel(
y[i]);
642 for (
Int_t i = 0; i <
n; ++i) {
643 poly[i].fX =
gPad->XtoPixel(
x[i]);
644 poly[i].fY = padH -
gPad->YtoPixel(
y[i]);
650 glOrtho(0,
gPad->GetPadWidth(), 0,
gPad->GetPadHeight(), -10., 10.);
652 glMatrixMode(GL_MODELVIEW);
658 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
667 glMatrixMode(GL_MODELVIEW);
699 fontIndex = 20 + shift * 10;
701 fontIndex += shift * 10;
730 glOrtho(0,
gPad->GetAbsWNDC() *
gPad->GetWw(), 0,
gPad->GetAbsHNDC() *
gPad->GetWh(), -10., 10.);
732 glMatrixMode(GL_MODELVIEW);
750 glMatrixMode(GL_MODELVIEW);
818 glMatrixMode(GL_PROJECTION);
829 glMatrixMode(GL_PROJECTION);
840 glMatrixMode(GL_MODELVIEW);
851 glMatrixMode(GL_MODELVIEW);
860 glGetIntegerv(GL_VIEWPORT,
fVp);
890 auto canvas = pad ? pad->
GetCanvas() :
nullptr;
891 if (!canvas || !image)
895 Int_t x0 = 0, y0 = 0;
901 if (!pad_width || !pad_height) {
902 Error(
"FillImageFromPad",
"Pad dimensions are zero");
908 if ((x0 + pad_width >
width) || (y0 + pad_height >
height)) {
909 Error(
"FillImageFromPad",
"Pad dimensions exceed canvas size");
914 y0 =
height - (y0 + pad_height);
921 Int_t update_arg = 101;
928 canvas->GetCanvasImp()->UpdateDisplay(update_arg,
kFALSE);
932 glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
935 glPixelStorei(GL_PACK_ALIGNMENT, 1);
936 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
937 glReadBuffer(GL_BACK);
944 glReadPixels(x0, y0,
width,
height, GL_RGBA, GL_UNSIGNED_BYTE, (
char *) buff.data());
949 for (
auto &
pix : buff)
950 pix = ((
pix & 0xff) << 16) | (
pix & 0xff00) | ((
pix & 0xff0000) >> 16) | (
pix & 0xff000000);
968 ::Error(
"TGLPadPainter::DrawPixels",
"pixel data is null");
972 if (std::numeric_limits<UInt_t>::digits >= 32) {
981 ::Error(
"TGLPadPainter::DrawPixels",
"invalid width");
987 ::Error(
"TGLPadPainter::DrawPixels",
"invalid height");
996 const Double_t rasterX =
Double_t(dstX) / (pad->GetAbsWNDC() * pad->GetWw()) *
997 (pad->GetX2() - pad->GetX1()) + pad->GetX1();
999 const Double_t yRange = pad->GetY2() - pad->GetY1();
1000 const Double_t rasterY = yRange -
Double_t(dstY +
height) / (pad->GetAbsHNDC() * pad->GetWh()) * yRange +
1003 GLdouble oldPos[4] = {};
1005 glGetDoublev(GL_CURRENT_RASTER_POSITION, oldPos);
1007 glRasterPos2d(rasterX, rasterY);
1009 std::vector<unsigned char> upsideDownImage(4 *
width *
height);
1010 const unsigned char *srcLine = pixelData + 4 *
width * (
height - 1);
1011 unsigned char *dstLine = &upsideDownImage[0];
1013 std::copy(srcLine, srcLine + 4 *
width, dstLine);
1015 if (enableBlending) {
1017 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1023 glDisable(GL_BLEND);
1026 glRasterPos2d(oldPos[0], oldPos[1]);
1028 ::Error(
"TGLPadPainter::DrawPixels",
"no pad found to draw");
1040 assert(
n > 2 &&
"DrawPolygonWithGradient, invalid number of points");
1041 assert(
x !=
nullptr &&
"DrawPolygonWithGradient, parameter 'x' is null");
1042 assert(
y !=
nullptr &&
"DrawPolygonWithGradient, parameter 'y' is null");
1045 assert(grad !=
nullptr &&
"DrawPolygonWithGradient, the current fill color is not a gradient fill");
1056 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
1058 glStencilFunc(GL_NEVER, 1, 0xFF);
1059 glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
1061 glStencilMask(0xFF);
1062 glClear(GL_STENCIL_BUFFER_BIT);
1067 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
1068 glStencilMask(0x00);
1070 glStencilFunc(GL_EQUAL, 0, 0xFF);
1072 glStencilFunc(GL_EQUAL, 1, 0xFF);
1083 assert(lGrad !=
nullptr &&
"DrawPolygonWithGradient, unknown gradient type");
1093 assert(grad !=
nullptr &&
"DrawGradient, parameter 'grad' is null");
1094 assert(nPoints > 2 &&
"DrawGradient, invalid number of points");
1095 assert(xs !=
nullptr &&
"DrawGradient, parameter 'xs' is null");
1096 assert(ys !=
nullptr &&
"DrawGradient, parameter 'ys' is null");
1099 ::Warning(
"TGLPadPainter::DrawGradient",
1100 "extended radial gradient is not supported");
1111 radius *=
TMath::Max(bbox.fWidth, bbox.fHeight);
1112 center.fX = bbox.fWidth * center.fX + bbox.fXMin;
1113 center.fY = bbox.fHeight * center.fY + bbox.fYMin;
1115 const auto w =
gPad->GetX2() -
gPad->GetX1();
1116 const auto h =
gPad->GetY2() -
gPad->GetY1();
1123 const auto pixelW =
gPad->GetAbsWNDC() *
gPad->GetWw();
1124 const auto pixelH =
gPad->GetAbsHNDC() *
gPad->GetWh();
1129 glMatrixMode(GL_PROJECTION);
1132 glOrtho(0., pixelW, 0., pixelH, -10., 10.);
1135 center.fX =
gPad->XtoPixel(center.fX);
1136 center.fY = pixelH -
gPad->YtoPixel(center.fY);
1142 const Double_t yMin = pixelH -
gPad->YtoPixel(bbox.fYMin);
1143 const Double_t yMax = pixelH -
gPad->YtoPixel(bbox.fYMax);
1150 maxR =
TMath::Sqrt(maxDistX * maxDistX + maxDistY * maxDistY);
1155 const Bool_t solidFillAfter = maxR > radius;
1158 const UInt_t nSlices = 500;
1163 const auto nCircles = nColors + 1 + solidFillAfter;
1169 std::vector<Double_t> circles(nSlices * nCircles * 2);
1173 for (
UInt_t i = 0; i < nColors; ++i) {
1174 const auto circle = &circles[i * nSlices * 2];
1176 const auto r = radius * locations[i];
1177 for (
UInt_t j = 0,
e = nSlices * 2 - 2; j <
e; j += 2) {
1182 circle[(nSlices - 1) * 2] = circle[0];
1183 circle[(nSlices - 1) * 2 + 1] = circle[1];
1188 const auto circle = &circles[nColors * nSlices * 2];
1189 for (
UInt_t j = 0,
e = nSlices * 2 - 2; j <
e; j += 2) {
1194 circle[(nSlices - 1) * 2] = circle[0];
1195 circle[(nSlices - 1) * 2 + 1] = circle[1];
1198 if (solidFillAfter) {
1200 const auto circle = &circles[(nCircles - 1) * nSlices * 2];
1201 for (
UInt_t j = 0,
e = nSlices * 2 - 2; j <
e; j += 2) {
1206 circle[(nSlices - 1) * 2] = circle[0];
1207 circle[(nSlices - 1) * 2 + 1] = circle[1];
1222 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1225 glBegin(GL_TRIANGLE_FAN);
1227 glVertex2d(center.fX, center.fY);
1229 for (
UInt_t i = 0,
e = nSlices * 2; i <
e; i += 2)
1230 glVertex2dv(&circles[i]);
1235 for (
UInt_t i = 0; i < nColors - 1; ++i) {
1236 const Double_t *
const inner = &circles[i * nSlices * 2];
1237 const auto innerRGBA = rgba + i * 4;
1238 const auto outerRGBA = rgba + (i + 1) * 4;
1239 const Double_t *
const outer = &circles[(i + 1) * nSlices * 2];
1246 const Double_t *
const inner = &circles[nSlices * (nColors - 1) * 2];
1247 const auto solidRGBA = rgba + (nColors - 1) * 4;
1248 const Double_t *
const outer = &circles[nSlices * nColors * 2];
1253 if (solidFillAfter) {
1254 const Double_t *
const inner = &circles[nSlices * nColors * 2];
1255 const auto solidRGBA = rgba + (nColors - 1) * 4;
1256 const Double_t *
const outer = &circles[nSlices * (nColors + 1) * 2];
1270 assert(grad !=
nullptr &&
"DrawGradient, parameter 'grad' is null");
1271 assert(
n > 2 &&
"DrawGradient, invalid number of points");
1272 assert(
x !=
nullptr &&
"DrawGradient, parameter 'x' is null");
1273 assert(
y !=
nullptr &&
"DrawGradient, parameter 'y' is null");
1289 glMatrixMode(GL_PROJECTION);
1294 glOrtho(0., pixelW, 0., pixelH, -10., 10.);
1297 glMatrixMode(GL_MODELVIEW);
1309 start.
fX = start.
fX *
w;
1310 start.
fY = start.
fY *
h;
1311 end.
fX = end.
fX *
w;
1312 end.
fY = end.
fY *
h;
1314 start.
fX = start.
fX * bbox.fWidth + bbox.fXMin;
1315 start.
fY = start.
fY * bbox.fHeight + bbox.fYMin;
1316 end.
fX = end.
fX * bbox.fWidth + bbox.fXMin;
1317 end.
fY = end.
fY * bbox.fHeight + bbox.fYMin;
1324 start.
fX =
gPad->XtoPixel(start.
fX);
1325 start.
fY = pixelH -
gPad->YtoPixel(start.
fY);
1327 end.
fY = pixelH -
gPad->YtoPixel(end.
fY);
1330 const Double_t yMin = pixelH -
gPad->YtoPixel(bbox.fYMin);
1331 const Double_t yMax = pixelH -
gPad->YtoPixel(bbox.fYMax);
1341 (end.
fY - start.
fY) * (end.
fY - start.
fY));
1348 gradBoxes[0] = start.
fY -
h;
1350 gradBoxes[i] = startEndLength * colorPositions[i - 1] + start.
fY;
1357 if (end.
fX > start.
fX)
1360 glTranslated(start.
fX, start.
fY, 0.);
1361 glRotated(
angle, 0., 0., 1.);
1362 glTranslated(-start.
fX, -start.
fY, 0.);
1366 const unsigned nEdges = gradBoxes.size();
1372 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1376 rgba + (nColors - 1) * 4, rgba + (nColors - 1) * 4);
1378 for (
unsigned i = 1; i < nEdges - 2; ++i)
1380 xRight, rgba + (i - 1) * 4, rgba + i * 4);
1390 assert(
n > 2 &&
"DrawTesselation, invalid number of points");
1391 assert(
x !=
nullptr &&
"DrawTesselation, parameter 'x' is null");
1392 assert(
y !=
nullptr &&
"DrawTesselation, parameter 'y' is null");
1397 for (
Int_t i = 0; i <
n; ++i) {
1399 fVs[i * 3 + 1] =
y[i];
1400 fVs[i * 3 + 2] = 0.;
1407 gluNextContour(t, (GLenum)GLU_UNKNOWN);
1409 for (
Int_t i = 0; i <
n; ++i)
1410 gluTessVertex(t, &
fVs[i * 3], &
fVs[i * 3]);
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
short Width_t
Line width (short)
float Float_t
Float 4 bytes (float)
short Font_t
Font number (short)
double Double_t
Double 8 bytes.
short SCoord_t
Screen coordinates (short)
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
const Double_t lineWidthTS
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pix
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 percent
Option_t Option_t TPoint TPoint DrawText
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
Double_t GetMaxLineWidth() const
Double_t GetMaxPointSize() const
static void DrawMarkers(UInt_t n, const TPoint *xy, const TAttMarker &attr)
Auxiliary class to draw markers in a gl-pad.
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Width_t GetLineWidth() const
Return the line width.
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
TColorGradient extends basic TColor.
const Double_t * GetColors() const
Get colors.
SizeType_t GetNumberOfSteps() const
Get number of steps.
ECoordinateMode GetCoordinateMode() const
Get coordinate mode.
const Double_t * GetColorPositions() const
Get color positions.
void RegisterFont(Int_t size, Int_t file, TGLFont::EMode mode, TGLFont &out)
Provide font with given size, file and FTGL class.
static Int_t GetExtendedFontStartIndex()
static const char * GetFontNameFromId(Int_t)
Get font name from TAttAxis font id.
static TObjArray * GetFontFileArray()
Get id to file name map.
void SetTextAlign(UInt_t align)
void Render(const char *txt, Double_t x, Double_t y, Double_t angle, Double_t mgn) const
virtual void PostRender() const
Reset GL state after FTFont rendering.
virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const
Set-up GL state before FTFont rendering.
void DrawText(Double_t x, Double_t y, const char *text, ETextMode mode) override
Draw text.
void DrawPolyMarkerHelper(Int_t n, const ValueType *x, const ValueType *y)
Poly-marker drawing.
void SetDrawMode(Int_t device, Int_t mode) override
Set drawing mode for specified device.
void DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height, Int_t dstX, Int_t dstY, Bool_t enableBlending) override
Int_t ResizeDrawable(Int_t device, UInt_t w, UInt_t h) override
Resize a gVirtualX Pixmap.
void DestroyDrawable(Int_t device) override
Not required at the moment.
void DrawGradient(const TLinearGradient *gradient, Int_t n, const Double_t *x, const Double_t *y)
Rgl::Pad::Tesselator fTess
void SelectGLFont(Font_t font, Float_t size)
Select specified font/size.
void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2) override
Draw line segment in NDC coordinates.
void DrawTextHelper(Double_t x, Double_t y, const Char_t *text, ETextMode mode)
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode) override
Draw filled or hollow box.
void SetAttLine(const TAttLine &att) override
Set line attributes.
void DrawPolygonWithGradient(Int_t n, const Double_t *x, const Double_t *y)
At the moment I assume both linear and radial gradients will work the same way - using a stencil buff...
Bool_t IsInvertMode()
Returns true when invert mode is configured and painter in locked state Used when non-opaque of objec...
void InvalidateCS() override
When TPad::Range for gPad is called, projection must be changed in OpenGL.
void ClearDrawable() override
Do nothing, sub-pads not cleared in GL.
void ClearWindow(Int_t device) override
Clear specified window - calling gVirtualX->ClearWindowW.
void DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v) override
Poly line in NDC.
void OnPad(TVirtualPad *) override
Select pad where current painting will be performed.
void DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y) override
Draw poly-line in user coordinates.
void DrawImage(TImage *img, Int_t x, Int_t y, Int_t flags=0) override
Draw image on the GL window.
Rgl::Pad::GLLimits fLimits
void SetOpacity(Int_t percent) override
Delegate to gVirtualX.
void DrawTextNDC(Double_t x, Double_t y, const char *text, ETextMode mode) override
Draw text in NDC.
void SetAttFill(const TAttFill &att) override
Set fill attributes.
void InitPainter() override
Init gl-pad painter:
void SelectDrawable(Int_t device) override
For gVirtualX this means select pixmap (or window) and all subsequent drawings will go into this pixm...
Rgl::Pad::PolygonStippleSet fSSet
void SaveViewport()
Extract and save the current viewport.
void CopyDrawable(Int_t device, Int_t px, Int_t py) override
Not required at the moment.
Bool_t IsX11() const override
Returns true when X11 backend is used.
void DrawFillArea(Int_t n, const Double_t *x, const Double_t *y) override
Draw tesselated polygon (probably, outline only).
void DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y) override
Poly-marker.
void DrawPolyLineHelper(Int_t n, const ValueType *x, const ValueType *y)
Draw poly-line in user coordinates.
Bool_t FillImageFromPad(TImage *image, TVirtualPad *pad) const override
Fill image object with the pixel data from the pad Implements special handling for X11 where ASImage ...
void UpdateDrawable(Int_t mode) override
Call low-level update of selected drawable, redirect to gVirtualX.
void RestoreProjectionMatrix() const
Restore the projection matrix.
void SetAttMarker(const TAttMarker &att) override
Set marker attributes.
void LockPainter() override
Locked state of painter means, that GL context can be invalid, so no GL calls can be executed.
Float_t GetTextMagnitude() const override
Delegate to gVirtualX.
void DrawTesselation(Int_t n, const Double_t *x, const Double_t *y)
Bool_t HasTTFonts() const override
Indicate that TTF can be used for text metrics Drawing done with FTGL which is based on Freetype libr...
Int_t CreateDrawable(UInt_t w, UInt_t h) override
Not required at the moment.
void RestoreModelviewMatrix() const
Restore the modelview matrix.
std::vector< Double_t > fVs
void SaveProjectionMatrix() const
Save the projection matrix.
void DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw line segment.
Bool_t IsCocoa() const override
Returns true when cocoa backend is used.
void SaveModelviewMatrix() const
Save the modelview matrix.
void RestoreViewport()
Restore the saved viewport.
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
static void SwapPixelBuffer(UChar_t *buf, UInt_t width, UInt_t height)
Swap rows in pixel buffer returned by glReadPixels function To be able create ASImage from it.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
An abstract interface to image processing library.
virtual UInt_t * GetArgbArray()
virtual UInt_t GetWidth() const
virtual Bool_t IsValid() const
virtual void FromBitmap(const UChar_t *, UInt_t, UInt_t)
virtual UInt_t GetHeight() const
const Point & GetEnd() const
Get end.
const Point & GetStart() const
Get start.
void SetAttFill(const TAttFill &att) override
Set fill attributes.
Color_t GetMarkerColor() const override
const TAttText & GetAttText() const override
Get text attributes.
Short_t GetTextAlign() const override
const TAttMarker & GetAttMarker() const override
Get marker attributes.
Style_t GetMarkerStyle() const override
Font_t GetTextFont() const override
Width_t GetLineWidth() const override
Bool_t fFullyTransparent
if transformed fill attributes fully transparent
void SetAttMarker(const TAttMarker &att) override
Set marker attributes.
void SetAttLine(const TAttLine &att) override
Set line attributes.
Float_t GetTextAngle() const override
TAttFill GetAttFillInternal(Bool_t with_transparency)
Returns fill attributes after modification Checks for special fill styles 4000 .
Color_t GetTextColor() const override
Style_t GetLineStyle() const override
const TAttLine & GetAttLine() const override
Get line attributes.
Float_t GetTextSize() const override
The most important graphics class in the ROOT system.
Double_t GetRadius() const
Get radius.
const Point & GetCenter() const
Get center.
EGradientType GetGradientType() const
Get gradient type.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual Int_t UtoAbsPixel(Double_t u) const =0
virtual UInt_t GetPadWidth() const =0
virtual UInt_t GetPadHeight() const =0
virtual Int_t VtoAbsPixel(Double_t v) const =0
virtual Int_t GetCanvasID() const =0
virtual TCanvas * GetCanvas() const =0
BoundingRect< ValueType > FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys)
void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
void DrawQuadStripWithRadialGradientFill(unsigned nPoints, const Double_t *inner, const Double_t *innerRGBA, const Double_t *outer, const Double_t *outerRGBA)
TODO: is it possible to use GLdouble to avoid problems with Double_t/GLdouble if they are not the sam...
void DrawBoxWithGradientFill(Double_t y1, Double_t y2, Double_t x1, Double_t x2, const Double_t *rgba1, const Double_t *rgba2)
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
constexpr Double_t TwoPi()