60#include "RConfigure.h"
98# include "Windows4root.h"
102# define X_DISPLAY_MISSING 1
104# include <afterbase.h>
106# define X_DISPLAY_MISSING 1
107# include <afterbase.h>
109# include <afterimage.h>
129static char *
gIconPaths[7] = {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
136#if defined(__GNUC__) && __GNUC__ >= 4 && ((__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >= 1) || (__GNUC_MINOR__ >= 3)) && !__INTEL_COMPILER
137#pragma GCC diagnostic ignored "-Wstrict-aliasing"
158#define _alphaBlend(bot, top) {\
159 __argb32__ *T = (__argb32__*)(top);\
160 __argb32__ *B = (__argb32__*)(bot);\
165 B->a = ((B->a*aa)>>8) + T->a;\
166 B->r = (B->r*aa + T->r*T->a)>>8;\
167 B->g = (B->g*aa + T->g*T->a)>>8;\
168 B->b = (B->b*aa + T->b*T->a)>>8;\
244 fImage = create_asimage(
w ?
w : 20,
h ?
h : 20, 0);
315 if (
this != &img && img.
IsValid()) {
355 fImage->alt.argb32 = (ARGB32*)safemalloc(
size);
392 const char *delim =
":";
394 const char *delim =
";";
396 while (icon_path.
Tokenize(token, from, delim) && cnt < 6) {
412 FILE *fp = fopen(file,
"rb");
413 const char *ret =
"";
415 if (!fp)
return nullptr;
417 if (!fread(&magic, 1, 1, fp)) {
425 if (!fread(&magic, 1, 1, fp)) {
429 if (!fread(&magic, 1, 1, fp)) {
434 ret = (magic == 1) ?
"ico" :
"cur";
439 if (!fread(&magic, 1, 1, fp)) {
446 else if (magic == 0x50)
497 Warning(
"ReadImage",
"Visual not initiated");
514 set_output_threshold(0);
516 static ASImageImportParams iparams;
520 iparams.filter = SCL_DO_ALL;
521 iparams.gamma = SCREEN_GAMMA;
522 iparams.gamma_table = NULL;
524 iparams.format = ASA_ASImage;
526 iparams.subimage = 0;
527 iparams.return_animation_delay = -1;
533 ASImage *image =
nullptr;
544 iparams.subimage = ext.
Atoi();
546 ext = strrchr(fname.
Data(),
'.') + 1;
549 image = file2ASImage_extra(fname.
Data(), &iparams);
561 unsigned char *
bitmap =
nullptr;
567 if (!handler || ((handler->
LoadPlugin() == -1))) {
586 image = bitmap2asimage(
bitmap,
w,
h, 0,
nullptr);
665 Error(
"WriteImage",
"no image in memory. Draw something first");
669 if (!file || !*file) {
670 Error(
"WriteImage",
"no file name specified");
675 if ((s = strrchr(file,
'.'))) {
679 Error(
"WriteImage",
"cannot determine a valid file type");
687 Error(
"WriteImage",
"not a valid file type was specified");
693 ASImageFileTypes atype = (ASImageFileTypes)mytype;
701 static ASImageExportParams parms;
706 parms.xpm.type = atype;
707 parms.xpm.flags = EXPORT_ALPHA;
708 parms.xpm.dither = 4;
709 parms.xpm.opaque_threshold = 127;
710 parms.xpm.max_colors = 512;
713 ASImage2bmp(im, fname.
Data(),
nullptr);
716 ASImage2xcf(im, fname.
Data(),
nullptr);
719 parms.png.type = atype;
720 parms.png.flags = EXPORT_ALPHA;
724 parms.jpeg.type = atype;
725 parms.jpeg.flags = 0;
726 parms.jpeg.quality = aquality;
729 parms.gif.type = atype;
730 parms.gif.flags = EXPORT_ALPHA;
731 parms.gif.dither = 0;
732 parms.gif.opaque_threshold = 0;
736 parms.gif.type = atype;
737 parms.gif.flags = EXPORT_ALPHA | EXPORT_APPEND;
738 parms.gif.dither = 0;
739 parms.gif.opaque_threshold = 0;
740 parms.gif.animate_repeats = 0;
753 parms.gif.flags |= EXPORT_ANIMATION_REPEATS;
754 parms.gif.animate_repeats = 0;
755 }
else if(sufix==
"") {
772 parms.gif.flags |= EXPORT_ANIMATION_REPEATS;
773 parms.gif.animate_repeats = atoi(s);
782 parms.gif.flags |= EXPORT_ANIMATION_REPEATS;
783 parms.gif.animate_repeats = 0;
784 }
else if(sLength>3 && sufix.
CountChar(
'+')==2 &&
TString(sufix(1,sLength-2)).Contains(
"++")) {
790 delay = atoi(sDelay);
791 parms.gif.flags |= EXPORT_ANIMATION_REPEATS;
792 parms.gif.animate_repeats = atoi(sRepeats);
794 Error(
"WriteImage",
"gif suffix %s not yet supported", s);
798 parms.gif.animate_delay = delay;
800 int i1 = fname.
Index(
"gif+");
802 fname = fname(0, i1 + 3);
805 Error(
"WriteImage",
"unexpected gif extension structure %s", fname.
Data());
811 parms.tiff.type = atype;
812 parms.tiff.flags = EXPORT_ALPHA;
813 parms.tiff.rows_per_strip = 0;
814 parms.tiff.compression_type = aquality <= 50 ? TIFF_COMPRESSION_JPEG :
815 TIFF_COMPRESSION_NONE;
816 parms.tiff.jpeg_quality = 100;
817 parms.tiff.opaque_threshold = 0;
820 Error(
"WriteImage",
"file type %s not yet supported", s);
824 if (!ASImage2file(im,
nullptr, fname.
Data(), atype, &parms)) {
825 Error(
"WriteImage",
"error writing file %s", file);
843 if (s ==
"jpg" || s ==
"jpeg")
882 astype = ASIT_Xpm;
break;
884 astype = ASIT_ZCompressedXpm;
break;
886 astype = ASIT_GZCompressedXpm;
break;
888 astype = ASIT_Png;
break;
890 astype = ASIT_Jpeg;
break;
892 astype = ASIT_Xcf;
break;
894 astype = ASIT_Ppm;
break;
896 astype = ASIT_Pnm;
break;
898 astype = ASIT_Bmp;
break;
900 astype = ASIT_Ico;
break;
902 astype = ASIT_Cur;
break;
904 astype = ASIT_Gif;
break;
906 astype = ASIT_Gif;
break;
908 astype = ASIT_Tiff;
break;
910 astype = ASIT_Xbm;
break;
912 astype = ASIT_Targa;
break;
914 astype = ASIT_XMLScript;
break;
916 astype = ASIT_Unknown;
922 case ASIT_ZCompressedXpm:
924 case ASIT_GZCompressedXpm:
967 asquality = 25;
break;
969 asquality = 75;
break;
971 asquality = 50;
break;
973 asquality = 100;
break;
979 if (asquality > 0 && asquality <= 25)
981 if (asquality > 26 && asquality <= 50)
983 if (asquality > 51 && asquality <= 75)
985 if (asquality > 76 && asquality <= 100)
1005 Warning(
"SetImage",
"Visual not initiated");
1022 ASVectorPalette asPalette;
1026 for (col = 0; col < 4; col++)
1027 asPalette.channels[col] =
new UShort_t[asPalette.npoints];
1034 asPalette.points =
new Double_t[asPalette.npoints];
1035 for (
Int_t point = 0; point <
Int_t(asPalette.npoints); point++)
1039 height, &asPalette, ASA_ASImage,
1042 delete [] asPalette.points;
1043 for (col = 0; col < 4; col++)
1044 delete [] asPalette.channels[col];
1088 Error(
"FromPad",
"pad cannot be 0");
1093 Warning(
"FromPad",
"Visual not initiated");
1110 if (itmp && itmp->
fImage) {
1119 if (itmp && itmp->
fImage && (itmp !=
this)) {
1121 if (itmp->
fImage->alt.argb32) {
1123 fImage->alt.argb32 = (ARGB32*)safemalloc(sz*
sizeof(ARGB32));
1124 memcpy(
fImage->alt.argb32, itmp->
fImage->alt.argb32, sz*4);
1153 Error(
"Draw",
"no image set");
1181 gPad->Range(-left / (1.0 - left - right),
1182 -bottom / (1.0 - top - bottom),
1183 1 + right / (1.0 - left - right),
1184 1 + top / ( 1.0 - top - bottom));
1185 gPad->RangeAxis(0, 0, 1, 1);
1209 wsrc = wsrc ? wsrc : im->width;
1210 hsrc = hsrc ? hsrc : im->height;
1212 static int x11 =
gVirtualX->InheritsFrom(
"TGX11");
1219 UInt_t ww = wsrc - ow + (ow ? 8 : 0);
1223 std::vector<char> bits(ww*hh);
1225 ASImageDecoder *imdec = start_image_decoding(
fgVisual, im, SCL_DO_ALPHA,
1226 xsrc, ysrc, ww, 0,
nullptr);
1228 for (
UInt_t yy = 0; yy < hh; yy++) {
1229 imdec->decode_image_scanline(imdec);
1230 CARD32 *
a = imdec->buffer.alpha;
1232 for (
UInt_t xx = 0; xx < ww; xx++) {
1247 stop_image_decoding(&imdec);
1250 bits.data(), ww, hh);
1268 asimage2drawable(
fgVisual,
wid, im, (GC)
gc, xsrc, ysrc,
x,
y, wsrc, hsrc, 1);
1270 ASImage *img =
nullptr;
1271 unsigned char *bits = (
unsigned char *)im->alt.argb32;
1273 img = tile_asimage(
fgVisual, im, xsrc, ysrc, wsrc, hsrc,
1274 0, ASA_ARGB32, 0, ASIMAGE_QUALITY_DEFAULT);
1276 bits = (
unsigned char *)img->alt.argb32;
1285 if (!
option.Contains(
"opaque")) {
1295 destroy_asimage(&img);
1322 xsrc, ysrc, wsrc, hsrc, opt);
1341 Error(
"Paint",
"no image set");
1346 Warning(
"Paint",
"Visual not initiated");
1350 Int_t tile_x = 0, tile_y = 0;
1351 CARD32 tile_tint = 0;
1360 if (sscanf(opt.
Data() + opt.
Index(
"t"),
"t%d,%d,%s", &tile_x, &tile_y,
1363 if (parse_argb_color(stint, (CARD32*)&tile_tint) == stint)
1366 Error(
"Paint",
"tile option error");
1374 if (!
fImage->alt.vector) {
1390 to_h = (
Int_t)(to_h * (1.0 -
gPad->GetBottomMargin() -
gPad->GetTopMargin() ) + 0.5);
1391 to_w = (
Int_t)(to_w * (1.0 -
gPad->GetLeftMargin() -
gPad->GetRightMargin() ) + 0.5);
1394 if ((to_w < 25 || to_h < 25) && !expand) {
1395 Error(
"Paint",
"pad too small to display an image");
1407 Int_t pal_Ax = to_w +
gPad->UtoAbsPixel(
gPad->GetLeftMargin()) +
1408 (
gPad->UtoAbsPixel(
gPad->GetRightMargin()) / 10);
1410 Int_t pal_x = to_w +
gPad->UtoPixel(
gPad->GetLeftMargin()) +
1411 (
gPad->UtoPixel(
gPad->GetRightMargin()) / 10);
1416 ASImage *grad_im =
nullptr;
1424 grad.type = GRADIENT_Top2Bottom;
1425 grad.color =
new ARGB32[grad.npoints];
1426 grad.offset =
new double[grad.npoints];
1429 Int_t oldPt = grad.npoints -
pt -1;
1430 grad.offset[
pt] = 1 - pal.
fPoints[oldPt];
1431 grad.color[
pt] = (((ARGB32)(pal.
fColorBlue[oldPt] & 0xff00)) >> 8) |
1433 (((ARGB32)(pal.
fColorRed[oldPt] & 0xff00)) << 8) |
1434 (((ARGB32)(pal.
fColorAlpha[oldPt] & 0xff00)) << 16);
1438 pal_h, SCL_DO_COLOR,
1441 delete [] grad.color;
1442 delete [] grad.offset;
1450 to_w, to_h, tile_tint, ASA_ASImage,
1485 destroy_asimage(&tmpImage);
1500 Error(
"Paint",
"image could not be rendered to display");
1504 int tox = expand ? 0 :
int(
gPad->UtoPixel(1.) *
gPad->GetLeftMargin());
1505 int toy = expand ? 0 :
int(
gPad->VtoPixel(0.) *
gPad->GetTopMargin());
1507 auto pp =
gPad->GetPainter();
1517 pp->DrawImage(&pimg, pal_x, pal_y, flags);
1528 axis.
PaintAxis(pal_Xpos,
gPad->PixeltoY(pal_Ay + pal_h - 1),
1529 pal_Xpos,
gPad->PixeltoY(pal_Ay),
1530 min, max, ndiv,
"+LU");
1537 pal_Xpos,
gPad->AbsPixeltoY(pal_Ay + 1),
1538 min, max, ndiv,
"+L");
1542 destroy_asimage(&grad_im);
1550 Int_t pxl, pyl, pxt, pyt;
1557 if (px1 < px2) {pxl = px1; pxt = px2;}
1558 else {pxl = px2; pxt = px1;}
1559 if (py1 < py2) {pyl = py1; pyt = py2;}
1560 else {pyl = py2; pyt = py1;}
1562 if ((px > pxl && px < pxt) && (py > pyl && py < pyt))
1613 auto &parent = *
gPad;
1616 parent.ExecuteEvent(
event, px, py);
1620 parent.SetCursor(
kCross);
1637 inter->PaintBox(parent);
1643 Int_t imgX1 = 0, imgY1 = 0, imgW = 0, imgH = 0;
1648 inter->PerformMove(px, py);
1650 imgX1 = inter->zx1 - parent.XtoAbsPixel(0);
1651 imgY1 = image->height - 1 - inter->
zy1 + parent.YtoAbsPixel(1);
1652 imgW = inter->
zx2 - inter->zx1;
1653 imgH = inter->zy1 - inter->zy2;
1655 parent.FreeInteractive(
this);
1658 if ((imgW >= 5) && (imgH >= 5)) {
1665 imgW = (
Int_t)(imgW / xfact);
1666 imgH = (
Int_t)(imgH / yfact);
1668 Zoom(imgX1, imgY1, imgW + 1, imgH + 1);
1684 static char info[64];
1690 px -=
gPad->XtoAbsPixel(0);
1691 py -=
gPad->YtoAbsPixel(1);
1694 if (px < 0 || py < 0)
return info;
1698 if (px >= (
int)image->width || py >= (
int)image->height)
1701 py = image->height - 1 - py;
1708 if (
fImage->alt.vector) {
1709 snprintf(info,64,
"x: %d y: %d %.5g",
1712 snprintf(info,64,
"x: %d y: %d", px, py);
1728 Warning(
"SetPalette",
"Visual not initiated");
1733 Warning(
"SetPalette",
"Image not valid");
1743 ASVectorPalette asPalette;
1745 asPalette.channels[0] =
new CARD16 [asPalette.npoints];
1746 asPalette.channels[1] =
new CARD16 [asPalette.npoints];
1747 asPalette.channels[2] =
new CARD16 [asPalette.npoints];
1748 asPalette.channels[3] =
new CARD16 [asPalette.npoints];
1754 asPalette.points =
new double[asPalette.npoints];
1755 for (
Int_t point = 0; point <
Int_t(asPalette.npoints); point++)
1761 delete [] asPalette.points;
1762 for (
Int_t col = 0; col < 4; col++)
1763 delete [] asPalette.channels[col];
1780 Warning(
"Scale",
"Image not initiated");
1785 Warning(
"Scale",
"Visual not initiated");
1793 if (toWidth > 30000)
1795 if (toHeight > 30000)
1798 ASImage *img = scale_asimage(
fgVisual,
fImage, toWidth, toHeight,
1815 Warning(
"Slice",
"Image not initiated");
1820 Warning(
"Slice",
"Visual not initiated");
1828 if (toWidth > 30000)
1830 if (toHeight > 30000)
1834 yStart, yEnd, toWidth, toHeight,
1850 Warning(
"Tile",
"Image not initiated");
1855 Warning(
"Tile",
"Visual not initiated");
1863 if (toWidth > 30000)
1865 if (toHeight > 30000)
1868 ASImage *img = tile_asimage(
fgVisual,
fImage, 0, 0, toWidth, toHeight, 0,
1890 Warning(
"Zoom",
"Image not valid");
1912 Warning(
"UnZoom",
"Image not valid");
1939 Warning(
"Flip",
"Image not valid");
1943 Warning(
"Flip",
"Visual not initiated");
1947 if (
fImage->alt.vector) {
1948 Warning(
"Flip",
"flip does not work for data images");
1952 Int_t rflip = flip/90;
1986 Warning(
"Mirror",
"Image not valid");
1992 Warning(
"Mirror",
"Visual not initiated");
1996 if (
fImage->alt.vector) {
1997 Warning(
"Mirror",
"mirror does not work for data images");
2001 ASImage *img = mirror_asimage(vis,
fImage, 0, 0,
2078 Display *disp = (Display*)
gVirtualX->GetDisplay();
2084 static ASVisual *vis_x =
nullptr;
2086 if (vis &&
cmap && !noX) {
2088 vis_x = create_asvisual_for_id(disp, screen, depth,
2089 XVisualIDFromVisual(vis),
cmap,
nullptr);
2113 Warning(caller,
"Visual not initiated");
2122 if (!
fImage->alt.argb32) {
2126 if (!
fImage->alt.argb32) {
2127 Warning(caller,
"Failed to get argb32 pixel array");
2139 Warning(
"StartPaletteEditor",
"Image not valid");
2142 if (!
fImage->alt.vector) {
2143 Warning(
"StartPaletteEditor",
"palette can be modified only for data images");
2160 Warning(
"GetPixmap",
"Visual not initiated");
2174 Error(
"GetPixmap",
"ARGB array is not exists");
2189 Warning(
"GetMaskBits",
"Visual not initiated");
2196 Warning(
"GetMaskBits",
"No image");
2201 UInt_t ow = img->width % 8;
2202 width = img->width - ow + (ow ? 8 : 0);
2204 ASImageDecoder *imdec = start_image_decoding(
fgVisual, img, SCL_DO_ALPHA,
2205 0, 0,
width, 0,
nullptr);
2213 imdec->decode_image_scanline(imdec);
2214 CARD32 *
a = imdec->buffer.alpha;
2229 stop_image_decoding(&imdec);
2244 std::vector<char> bits;
2246 pixmap =
gVirtualX->CreateBitmap(
gVirtualX->GetDefaultRootWindow(), bits.data(), ww, hh);
2258 Warning(
"SetImage",
"Visual not initiated");
2284 fImage = bitmap2asimage(bits,
w,
h, 0,
nullptr);
2289 fImage = bitmap2asimage(bits,
w,
h, 0, mask_bits);
2290 delete [] mask_bits;
2301 Warning(
"GetPixels",
"Wrong Image");
2306 ASImageDecoder *imdec;
2320 if ((
x >= (
int)img->width) || (
y >= (
int)img->height)) {
2324 if ((
int)(
x +
width) > (
int)img->width) {
2328 if ((
int)(
y +
height) > (
int)img->height) {
2332 if ((imdec = start_image_decoding(
nullptr,
fImage, SCL_DO_ALL, 0,
y,
2333 img->width,
height,
nullptr)) ==
nullptr) {
2334 Warning(
"GetPixels",
"Failed to create image decoder");
2343 imdec->decode_image_scanline(imdec);
2346 if ((
r == (
Int_t)imdec->buffer.red[i]) &&
2347 (
g == (
Int_t)imdec->buffer.green[i]) &&
2348 (
b == (
Int_t)imdec->buffer.blue[i])) {
2350 r = (
Int_t)imdec->buffer.red[i];
2351 g = (
Int_t)imdec->buffer.green[i];
2352 b = (
Int_t)imdec->buffer.blue[i];
2359 stop_image_decoding(&imdec);
2371 Warning(
"GetVecArray",
"Bad Image");
2374 if (
fImage->alt.vector) {
2375 return fImage->alt.vector;
2393 Warning(
"GetArray",
"Bad Image");
2399 if (
fImage->alt.vector) {
2404 ASImageDecoder *imdec;
2415 if ((imdec = start_image_decoding(
nullptr, img, SCL_DO_ALL, 0, 0,
2416 img->width, 0,
nullptr)) ==
nullptr) {
2417 Warning(
"GetArray",
"Failed to create image decoder");
2422 CARD32
r = 0,
g = 0,
b = 0;
2426 for (
UInt_t k = 0; k <
h; k++) {
2427 imdec->decode_image_scanline(imdec);
2429 for (
UInt_t i = 0; i <
w; ++i) {
2430 if ((
r == imdec->buffer.red[i]) &&
2431 (
g == imdec->buffer.green[i]) &&
2432 (
b == imdec->buffer.blue[i])) {
2434 r = imdec->buffer.red[i];
2435 g = imdec->buffer.green[i];
2436 b = imdec->buffer.blue[i];
2444 stop_image_decoding(&imdec);
2467 const char *color,
const char *font_name,
2471 ARGB32 text_color = ARGB32_Black;
2472 ASImage *fore_im =
nullptr;
2473 ASImage *text_im =
nullptr;
2484 if (fn.
Last(
'/') == 0)
2485 fn = fn(1, fn.
Length() - 1);
2497 parse_argb_color(color, &text_color);
2510 Warning(
"DrawText",
"cannot create Font Manager");
2519 Warning(
"DrawText",
"cannot find a font %s", font_name);
2531 text_im = draw_text(
text, font, (ASText3DType)
type, 0);
2536 ASImage *tmp = file2ASImage(fore_file, 0xFFFFFFFF, SCREEN_GAMMA, 0, 0);
2538 if ((tmp->width !=
width) || (tmp->height !=
height)) {
2542 destroy_asimage(&tmp);
2549 move_asimage_channel(fore_im, IC_ALPHA, text_im, IC_ALPHA);
2550 destroy_asimage(&text_im);
2558 ASImage *rendered_im;
2559 ASImageLayer layers[2];
2561 init_image_layers(&(layers[0]), 2);
2562 fore_im->back_color = text_color;
2563 layers[0].im = rimg;
2564 layers[0].dst_x = 0;
2565 layers[0].dst_y = 0;
2566 layers[0].clip_width = rimg->width;
2567 layers[0].clip_height = rimg->height;
2568 layers[0].bevel =
nullptr;
2569 layers[1].im = fore_im;
2570 layers[1].dst_x =
x;
2571 layers[1].dst_y =
y;
2572 layers[1].clip_width = fore_im->width;
2573 layers[1].clip_height = fore_im->height;
2575 rendered_im = merge_layers(
fgVisual, &(layers[0]), 2, rimg->width, rimg->height,
2578 destroy_asimage(&fore_im);
2611 Warning(
"Merge",
"Visual not initiated");
2615 ASImage *rendered_im;
2616 ASImageLayer layers[2];
2618 init_image_layers(&(layers[0]), 2);
2620 layers[0].dst_x = 0;
2621 layers[0].dst_y = 0;
2622 layers[0].clip_width =
fImage->width;
2623 layers[0].clip_height =
fImage->height;
2624 layers[0].bevel =
nullptr;
2625 layers[1].im = ((
TASImage*)im)->fImage;
2626 layers[1].dst_x =
x;
2627 layers[1].dst_y =
y;
2628 layers[1].clip_width = im->
GetWidth();
2629 layers[1].clip_height = im->
GetHeight();
2630 layers[1].merge_scanlines = blend_scanlines_name2func(op ? op :
"add");
2648 Warning(
"Blur",
"Visual not initiated");
2653 fImage = create_asimage(100, 100, 0);
2656 Warning(
"Blur",
"Failed to create image");
2663 ASImage *rendered_im = blur_asimage_gauss(
fgVisual,
fImage, hr > 0 ? hr : 3,
2664 vr > 0 ? vr : 3, SCL_DO_ALL,
2678 newimg->SetName(newname);
2679 newimg->CloneImageData(*
this);
2680 newimg->fEditable =
kFALSE;
2698 Warning(
"Vectorize",
"Visual not initiated");
2703 fImage = create_asimage(100, 100, 0);
2706 Warning(
"Vectorize",
"Failed to create image");
2717 dither = dither > 7 ? 7 : dither;
2719 res = colormap_asimage(
fImage, &
cmap, max_colors, dither, opaque_threshold);
2731 g = INDEX_SHIFT_GREEN(
cmap.entries[res[i]].green);
2732 b = INDEX_SHIFT_BLUE(
cmap.entries[res[i]].blue);
2733 r = INDEX_SHIFT_RED(
cmap.entries[res[i]].red);
2735 v = MAKE_INDEXED_COLOR24(
r,
g,
b);
2746 g = INDEX_SHIFT_GREEN(
cmap.entries[j].green);
2747 b = INDEX_SHIFT_BLUE(
cmap.entries[j].blue);
2748 r = INDEX_SHIFT_RED(
cmap.entries[j].red);
2749 v = MAKE_INDEXED_COLOR24(
r,
g,
b);
2751 v = (
v>>12) & 0x0FFF;
2763 fImage->alt.vector = vec;
2766 if (res) safefree(res);
2812 Warning(
"HSV",
"Visual not initiated");
2820 Warning(
"HSV",
"Failed to create image");
2832 ASImage *rendered_im =
nullptr;
2836 hue, radius, H, S, V, ASA_ASImage, 100,
2837 ASIMAGE_QUALITY_TOP);
2840 Warning(
"HSV",
"Failed to create rendered image");
2878 Warning(
"Gradient",
"Visual not initiated");
2882 ASImage *rendered_im =
nullptr;
2883 ASGradient gradient;
2885 int reverse = 0, npoints1 = 0, npoints2 = 0;
2892 if ((
angle > 2 * 180 * 15 / 16) || (
angle < 2 * 180 * 1 / 16)) {
2893 gradient.type = GRADIENT_Left2Right;
2894 }
else if (
angle < 2 * 180 * 3 / 16) {
2895 gradient.type = GRADIENT_TopLeft2BottomRight;
2896 }
else if (
angle < 2 * 180 * 5 / 16) {
2897 gradient.type = GRADIENT_Top2Bottom;
2898 }
else if (
angle < 2 * 180 * 7 / 16) {
2899 gradient.type = GRADIENT_BottomLeft2TopRight; reverse = 1;
2900 }
else if (
angle < 2 * 180 * 9 / 16) {
2901 gradient.type = GRADIENT_Left2Right; reverse = 1;
2902 }
else if (
angle < 2 * 180 * 11 / 16) {
2903 gradient.type = GRADIENT_TopLeft2BottomRight; reverse = 1;
2904 }
else if (
angle < 2 * 180 * 13 / 16) {
2905 gradient.type = GRADIENT_Top2Bottom; reverse = 1;
2907 gradient.type = GRADIENT_BottomLeft2TopRight;
2910 for (
p = (
char*)colors; isspace((
int)*
p);
p++) { }
2912 for (npoints1 = 0; *
p; npoints1++) {
2914 for ( ; *
p && !isspace((
int)*
p);
p++) { }
2916 for ( ; isspace((
int)*
p);
p++) { }
2919 for (
p = (
char*)offsets; isspace((
int)*
p);
p++) { }
2921 for (npoints2 = 0; *
p; npoints2++) {
2923 for ( ; *
p && !isspace((
int)*
p);
p++) { }
2925 for ( ; isspace((
int)*
p);
p++) { }
2930 if (offsets && (npoints1 > npoints2)) npoints1 = npoints2;
2939 gradient.color =
new ARGB32[npoints1];
2940 gradient.offset =
new double[npoints1];
2942 for (
p = (
char*)colors; isspace((
int)*
p);
p++) { }
2944 for (npoints1 = 0; *
p; ) {
2948 for ( ; *
p && !isspace((
int)*
p);
p++) { }
2950 for ( ; isspace((
int)*
p);
p++) { }
2952 col = str(pb - colors,
p - pb);
2954 if (parse_argb_color(col.
Data(), gradient.color + npoints1) != col) {
2957 Warning(
"Gradient",
"Failed to parse color [%s] - defaulting to black", pb);
2962 for (
p = (
char*)offsets; isspace((
int)*
p);
p++) { }
2964 for (npoints2 = 0; *
p; ) {
2968 for ( ; *
p && !isspace((
int)*
p);
p++) { }
2971 gradient.offset[npoints2] = strtod(pb, &pb);
2973 if (pb ==
p) npoints2++;
2975 for ( ; isspace((
int)*
p);
p++) { }
2978 for (npoints2 = 0; npoints2 < npoints1; npoints2++) {
2979 gradient.offset[npoints2] = (
double)npoints2 / (npoints1 - 1);
2982 gradient.npoints = npoints1;
2984 if (npoints2 && (gradient.npoints > npoints2)) {
2985 gradient.npoints = npoints2;
2988 for (i = 0; i < gradient.npoints/2; i++) {
2989 int i2 = gradient.npoints - 1 - i;
2990 ARGB32
c = gradient.color[i];
2991 double o = gradient.offset[i];
2992 gradient.color[i] = gradient.color[i2];
2993 gradient.color[i2] =
c;
2994 gradient.offset[i] = gradient.offset[i2];
2995 gradient.offset[i2] = o;
2997 for (i = 0; i < gradient.npoints; i++) {
2998 gradient.offset[i] = 1.0 - gradient.offset[i];
3004 delete [] gradient.color;
3005 delete [] gradient.offset;
3009 Warning(
"Gradient",
"Failed to create gradient image");
3018 ASImageLayer layers[2];
3020 init_image_layers(&(layers[0]), 2);
3022 layers[0].dst_x = 0;
3023 layers[0].dst_y = 0;
3024 layers[0].clip_width =
fImage->width;
3025 layers[0].clip_height =
fImage->height;
3026 layers[0].bevel =
nullptr;
3027 layers[1].im = rendered_im;
3028 layers[1].dst_x =
x;
3029 layers[1].dst_y =
y;
3030 layers[1].clip_width =
width;
3031 layers[1].clip_height =
height;
3032 layers[1].merge_scanlines = alphablend_scanlines;
3037 Warning(
"Gradient",
"Failed to create merged image");
3041 destroy_asimage(&rendered_im);
3056 cmp = (cmp * 12) / 10;
3058 return (cmp > 255) ? 255 : cmp;
3079 return (background >> 1) & 0x7F7F7F7F;
3090 a = ARGB32_ALPHA8(
foreground) + ARGB32_ALPHA8(background);
3092 r = ARGB32_RED8(
foreground) + ARGB32_RED8(background);
3094 g = ARGB32_GREEN8(
foreground) + ARGB32_GREEN8(background);
3096 b = ARGB32_BLUE8(
foreground) + ARGB32_BLUE8(background);
3099 return MAKE_ARGB32(
a,
r,
g,
b);
3115 const char *hi_color,
const char *lo_color,
UShort_t thick,
3119 Warning(
"Bevel",
"Visual not initiated");
3126 ARGB32
hi=ARGB32_White, lo=ARGB32_White;
3127 parse_argb_color(hi_color, &
hi);
3128 parse_argb_color(lo_color, &lo);
3131 bevel.lo_color =
hi;
3133 bevel.hi_color = lo;
3136 bevel.hi_color =
hi;
3138 bevel.lo_color = lo;
3143 int extra_hilite = 2;
3144 bevel.left_outline = bevel.top_outline = bevel.right_outline = bevel.bottom_outline = thick;
3145 bevel.left_inline = bevel.top_inline = bevel.right_inline = bevel.bottom_inline = extra_hilite + 1;
3147 if (bevel.top_outline > 1) {
3148 bevel.top_inline += bevel.top_outline - 1;
3151 if (bevel.left_outline > 1) {
3152 bevel.left_inline += bevel.left_outline - 1;
3155 if (bevel.right_outline > 1) {
3156 bevel.right_inline += bevel.right_outline - 1;
3159 if (bevel.bottom_outline > 1) {
3160 bevel.bottom_inline += bevel.bottom_outline - 1;
3164 ARGB32 fill = ((
hi>>24) != 0xff) || ((lo>>24) != 0xff) ? bevel.hilo_color : (bevel.hilo_color | 0xff000000);
3170 Warning(
"Bevel",
"Failed to create image");
3182 ASImageLayer layers[2];
3183 init_image_layers(&(layers[0]), 2);
3186 layers[0].dst_x = 0;
3187 layers[0].dst_y = 0;
3188 layers[0].clip_width =
fImage->width;
3189 layers[0].clip_height =
fImage->height;
3190 layers[0].bevel =
nullptr;
3192 UInt_t w =
width - (bevel.left_outline + bevel.right_outline);
3193 UInt_t h =
height - (bevel.top_outline + bevel.bottom_outline);
3194 ASImage *bevel_im = create_asimage(
w,
h, 0);
3197 Warning(
"Bevel",
"Failed to create bevel image");
3201 layers[1].im = bevel_im;
3202 fill_asimage(
fgVisual, bevel_im, 0, 0,
w,
h, fill);
3204 layers[1].dst_x =
x;
3205 layers[1].dst_y =
y;
3206 layers[1].clip_width =
width;
3207 layers[1].clip_height =
height;
3208 layers[1].bevel = &bevel;
3209 layers[1].merge_scanlines = alphablend_scanlines;
3213 destroy_asimage(&bevel_im);
3216 Warning(
"Bevel",
"Failed to image");
3236 Warning(
"Pad",
"Visual not initiated");
3241 fImage = create_asimage(100, 100, 0);
3244 Warning(
"Pad",
"Failed to create image");
3251 ARGB32 color = ARGB32_White;
3252 parse_argb_color(col, &color);
3263 Warning(
"Pad",
"Failed to create output image");
3280 Warning(
"Crop",
"Visual not initiated");
3293 Warning(
"Crop",
"specified x/y position larger than image");
3301 Warning(
"Crop",
"specified size larger than image");
3305 ASImageDecoder *imdec = start_image_decoding(
fgVisual,
fImage, SCL_DO_ALL,
3309 Warning(
"Crop",
"Failed to start image decoding");
3316 stop_image_decoding(&imdec);
3317 Warning(
"Crop",
"Failed to create image");
3321 ASImageOutput *imout = start_image_output(
fgVisual, img, ASA_ASImage,
3325 Warning(
"Crop",
"Failed to start image output");
3326 destroy_asimage(&img);
3327 stop_image_decoding(&imdec);
3336 imdec->decode_image_scanline(imdec);
3337 imout->output_image_scanline(imout, &(imdec->buffer), 1);
3340 stop_image_decoding(&imdec);
3341 stop_image_output(&imout);
3365 Warning(
"Append",
"Visual not initiated");
3371 if (
auto asimg =
dynamic_cast<const TASImage *
>(im))
3385 }
else if (opt ==
"/") {
3406 Warning(
"BeginPaint",
"Visual not initiated");
3421 0, ASA_ARGB32, 0, ASIMAGE_QUALITY_DEFAULT);
3424 Warning(
"BeginPaint",
"Failed to create image");
3438 Warning(
"EndPaint",
"no image");
3442 if (!
fImage->alt.argb32)
return;
3445 0, ASA_ASImage, 0, ASIMAGE_QUALITY_DEFAULT);
3448 Warning(
"EndPaint",
"Failed to create image");
3465 Warning(
"GetArgbArray",
"no image");
3470 if (!img)
return nullptr;
3472 if (!img->alt.argb32) {
3482 return (
UInt_t *)img->alt.argb32;
3493 Warning(
"GetRgbaArray",
"no image");
3498 if (!img)
return nullptr;
3500 if (!img->alt.argb32) {
3517 for (i = 0; i < img->height; i++) {
3518 for (j = 0; j < img->width; j++) {
3520 argb = img->alt.argb32[idx];
3522 rgb = argb & 0x00ffffff;
3523 rgba = (rgb << 8) +
a;
3540 Warning(
"GetScanline",
"no image");
3544 ASImageDecoder *imdec = start_image_decoding(
fgVisual, img, SCL_DO_ALL,
3545 0,
y, img->width, 1,
nullptr);
3548 Warning(
"GetScanline",
"Failed to start image decoding");
3552 CARD32 *ret =
new CARD32[img->width];
3558 imdec->decode_image_scanline(imdec);
3559 memcpy(imdec->buffer.buffer, ret, img->width*
sizeof(CARD32));
3560 stop_image_decoding(&imdec);
3575#if defined(R__GNU) && defined(__i386__) && !defined(__sun)
3576#define _MEMSET_(dst, lng, val) __asm__("movl %0,%%eax \n"\
3577 "movl %1,%%edi \n" \
3578 "movl %2,%%ecx \n" \
3583 :"g" (val), "g" (dst), "g" (lng) \
3584 :"eax","edi","ecx" \
3588 #define _MEMSET_(dst, lng, val) do {\
3589 for( UInt_t j=0; j < lng; j++) *((dst)+j) = val; } while (0)
3593#define FillSpansInternal(npt, ppt, widths, color) do {\
3594 UInt_t yy = ppt[0].fY*fImage->width;\
3595 for (UInt_t i = 0; i < npt; i++) {\
3596 _MEMSET_(&fImage->alt.argb32[Idx(yy + ppt[i].fX)], widths[i], color);\
3597 yy += ((i+1 < npt) && (ppt[i].fY != ppt[i+1].fY) ? fImage->width : 0);\
3608 if (!
InitImage(
"FillRectangleInternal")) {
3612 ARGB32 color = (ARGB32)col;
3626 Bool_t has_alpha = (color & 0xff000000) != 0xff000000;
3634 if (!
fImage->alt.argb32) {
3639 ARGB32 *p0 =
fImage->alt.argb32 + yyy +
x;
3671 Warning(
"FillRectangle",
"Visual not initiated");
3675 ARGB32 color = ARGB32_White;
3678 parse_argb_color(col, &color);
3700 ARGB32 color = (ARGB32)col;
3703 if (!thick) thick = 1;
3711 thick += (
x - half);
3722 if (
x + w < fImage->
width) {
3739 ARGB32 color = (ARGB32)col;
3742 if (!thick) thick = 1;
3750 thick += (
y - half);
3773 const char *col,
UInt_t thick)
3775 ARGB32 color = ARGB32_White;
3776 parse_argb_color(col, &color);
3788 int x,
y, xend, yend;
3798 ARGB32 color = (ARGB32)col;
3803 if (!dx && !dy)
return;
3825 i2 = i1 - (dx << 1);
3842 q = (
y2 -
y1) * ydir;
3875 i2 = i1 - (dy << 1);
3892 q = (
x2 -
x1) * xdir;
3930 const char *col,
UInt_t thick)
3933 Warning(
"DrawRectangle",
"Visual not initiated");
3945 if (!
fImage->alt.argb32) {
3949 if (!
fImage->alt.argb32) {
3950 Warning(
"DrawRectangle",
"Failed to get argb32 pixel array");
3954 ARGB32 color = ARGB32_White;
3955 parse_argb_color(col, &color);
3975 ARGB32 color = ARGB32_White;
3986 parse_argb_color(col, &color);
3992 parse_argb_color(col, &color);
4026 ARGB32 color = (ARGB32)col;
4036 thick += (
y - half);
4039 thick = thick <= 0 ? 1 : thick;
4048 x2 =
x2 < tmp ? tmp :
x2;
4060 if (i >= pDash[iDash]) {
4064 if (iDash >= nDash) {
4083 ARGB32 color = (ARGB32)col;
4093 thick += (
x - half);
4096 thick = thick <= 0 ? 1 : thick;
4104 y2 =
y2 < tmp ? tmp :
y2;
4111 if (
x + w < fImage->
width) {
4119 if (i >= pDash[iDash]) {
4123 if (iDash >= nDash) {
4142 int x,
y, xend, yend;
4152 char *pDash =
new char[nDash];
4157 for (i = 0; i < (
int)nDash; i++) {
4163 i2 = i1 - (dx << 1);
4181 q = (
y2 -
y1) * ydir;
4186 if ((iDash%2) == 0) {
4198 if (i >= pDash[iDash]) {
4202 if (iDash >= nDash) {
4210 if ((iDash%2) == 0) {
4222 if (i >= pDash[iDash]) {
4226 if (iDash >= nDash) {
4235 for (i = 0; i < (
int)nDash; i++) {
4241 i2 = i1 - (dy << 1);
4259 q = (
x2 -
x1) * xdir;
4264 if ((iDash%2) == 0) {
4278 if (i >= pDash[iDash]) {
4282 if (iDash >= nDash) {
4290 if ((iDash%2) == 0) {
4304 if (i >= pDash[iDash]) {
4308 if (iDash >= nDash) {
4329 double x,
y, xend=0, yend=0, x0, y0;
4337 double *xDash =
new double[nDash];
4338 double *yDash =
new double[nDash];
4343 for (i = 0; i < (
int)nDash; i++) {
4344 xDash[i] = tDash[i] * ac;
4345 yDash[i] = tDash[i] * as;
4349 xDash[i] = xDash[i]/2;
4350 yDash[i] = yDash[i]/2;
4352 xDash[i] = xDash[i]*2;
4353 yDash[i] = yDash[i]*2;
4370 q = (
y2 -
y1) * ydir;
4377 while ((
x < xend) && (
y < yend)) {
4381 if ((iDash%2) == 0) {
4391 if (iDash >= nDash) {
4396 while ((
x < xend) && (
y > yend)) {
4400 if ((iDash%2) == 0) {
4410 if (iDash >= nDash) {
4429 q = (
x2 -
x1) * xdir;
4436 while ((
x < xend) && (
y < yend)) {
4440 if ((iDash%2) == 0) {
4450 if (iDash >= nDash) {
4455 while ((
x > xend) && (
y < yend)) {
4459 if ((iDash%2) == 0) {
4469 if (iDash >= nDash) {
4483 const char *pDash,
const char *col,
UInt_t thick)
4490 if ((nDash < 2) || !pDash || (nDash%2)) {
4491 Warning(
"DrawDashLine",
"Wrong input parameters n=%d %ld", nDash, (
Long_t)
sizeof(pDash)-1);
4495 ARGB32 color = ARGB32_White;
4496 parse_argb_color(col, &color);
4500 }
else if (
y1 ==
y2) {
4514 ARGB32 color = ARGB32_White;
4515 parse_argb_color(col, &color);
4522 for (
UInt_t i = 1; i < nn; i++) {
4543 parse_argb_color(col, &color);
4545 if ((
x < 0) || (
y < 0) || (
x >= (
int)
fImage->width) || (
y >= (
int)
fImage->height)) {
4546 Warning(
"PutPixel",
"Out of range width=%d x=%d, height=%d y=%d",
4563 Warning(
"PolyPoint",
"No points specified");
4570 parse_argb_color(col, &color);
4576 for (i = 0; i < npt; i++) {
4577 ipt[i].
fX += ppt[i].
fX;
4578 ipt[i].
fY += ppt[i].
fY;
4583 for (i = 0; i < npt; i++) {
4584 x = ipt ? ipt[i].
fX : ppt[i].
fX;
4585 y = ipt ? ipt[i].
fY : ppt[i].
fY;
4587 if ((
x < 0) || (
y < 0) || (
x >= (
int)
fImage->width) || (
y >= (
int)
fImage->height)) {
4603 if (!nseg || !seg) {
4604 Warning(
"DrawSegments",
"Invalid data nseg=%d seg=0x%zx", nseg, (
size_t)seg);
4610 for (
UInt_t i = 0; i < nseg; i++) {
4611 pt[0].fX = seg->
fX1;
4612 pt[1].fX = seg->
fX2;
4613 pt[0].fY = seg->
fY1;
4614 pt[1].fY = seg->
fY2;
4631 if (!npt || !ppt || !widths || (stipple && (!
w || !
h))) {
4632 Warning(
"FillSpans",
"Invalid input data npt=%d ppt=0x%zx col=%s widths=0x%zx stipple=0x%zx w=%d h=%d",
4633 npt, (
size_t)ppt, col, (
size_t)widths, (
size_t)stipple,
w,
h);
4638 parse_argb_color(col, &color);
4643 for (
UInt_t i = 0; i < npt; i++) {
4645 for (
UInt_t j = 0; j < widths[i]; j++) {
4646 if ((ppt[i].fX >= (
Int_t)
fImage->width) || (ppt[i].
fX < 0) ||
4657 if (stipple[ii >> 3] & (1 << (ii%8))) {
4674 if (!npt || !ppt || !widths || !tile) {
4675 Warning(
"FillSpans",
"Invalid input data npt=%d ppt=0x%zx widths=0x%zx tile=0x%zx",
4676 npt, (
size_t)ppt, (
size_t)widths, (
size_t)tile);
4688 for (
UInt_t i = 0; i < npt; i++) {
4691 for (
UInt_t j = 0; j < widths[i]; j++) {
4692 if ((ppt[i].fX >= (
Int_t)
fImage->width) || (ppt[i].
fX < 0) ||
4713 if (!npt || !ppt || !widths) {
4714 Warning(
"CropSpans",
"No points specified npt=%d ppt=0x%zx widths=0x%zx", npt, (
size_t)ppt, (
size_t)widths);
4719 int y1 = ppt[npt-1].
fY;
4727 for (
y = 0; (
int)
y < y0;
y++) {
4730 if (idx < sz)
fImage->alt.argb32[idx] = 0;
4735 for (i = 0; i < npt; i++) {
4736 for (
x = 0; (
int)
x < ppt[i].fX;
x++) {
4738 if (idx < sz)
fImage->alt.argb32[idx] = 0;
4740 for (
x = ppt[i].fX + widths[i] + 1;
x <
fImage->width;
x++) {
4742 if (idx < sz)
fImage->alt.argb32[idx] = 0;
4750 if (idx < sz)
fImage->alt.argb32[idx] = 0;
4784 Warning(
"CopyArea",
"Visual not initiated");
4789 Warning(
"CopyArea",
"no image");
4800 xsrc = xsrc < 0 ? 0 : xsrc;
4801 ysrc = ysrc < 0 ? 0 : ysrc;
4803 if ((xsrc >= (
int)
fImage->width) || (ysrc >= (
int)
fImage->height))
return;
4809 if (!
fImage->alt.argb32) {
4812 if (!out->alt.argb32) {
4817 if (
fImage->alt.argb32 && out->alt.argb32) {
4818 for (
y = 0;
y < (
int)
h;
y++) {
4819 for (
x = 0;
x < (
int)
w;
x++) {
4820 idx =
Idx(yy +
x + xsrc);
4821 if ((
x + xdst < 0) || (ydst +
y < 0) ||
4822 (
x + xdst >= (
int)out->width) || (
y + ydst >= (
int)out->height) )
continue;
4824 idx2 =
Idx((ydst +
y)*out->width +
x + xdst);
4828 out->alt.argb32[idx2] = 0;
4831 out->alt.argb32[idx2] &=
fImage->alt.argb32[idx];
4834 out->alt.argb32[idx2] =
fImage->alt.argb32[idx] & (~out->alt.argb32[idx2]);
4837 out->alt.argb32[idx2] &= ~fImage->alt.argb32[idx];
4842 out->alt.argb32[idx2] ^=
fImage->alt.argb32[idx];
4845 out->alt.argb32[idx2] |=
fImage->alt.argb32[idx];
4848 out->alt.argb32[idx2] = (~fImage->alt.argb32[idx]) & (~out->alt.argb32[idx2]);
4851 out->alt.argb32[idx2] ^= ~fImage->alt.argb32[idx];
4854 out->alt.argb32[idx2] = ~out->alt.argb32[idx2];
4857 out->alt.argb32[idx2] =
fImage->alt.argb32[idx] | (~out->alt.argb32[idx2]);
4860 out->alt.argb32[idx2] = ~fImage->alt.argb32[idx];
4863 out->alt.argb32[idx2] |= ~fImage->alt.argb32[idx];
4866 out->alt.argb32[idx2] = (~fImage->alt.argb32[idx]) | (~out->alt.argb32[idx2]);
4869 out->alt.argb32[idx2] = 0xFFFFFFFF;
4873 out->alt.argb32[idx2] =
fImage->alt.argb32[idx];
4897 int i, j, ix, iy,
w,
h;
4899 ARGB32 color = 0xFFFFFFFF;
4906 for (i = 0; i < nx; i++) {
4908 for (j = 0; j < ny; j++) {
4909 icol = (ARGB32)ic[i + (nx*j)];
4910 if (icol != color) {
4964 return (ptMin - ptsStart);
4980 int mr = 0, m1r = 0;
4981 int incr1l = 0, incr2l = 0;
4982 int incr1r = 0, incr2r = 0;
4987 int nextleft, nextright;
4990 TPoint *firstPoint =
nullptr;
4991 UInt_t *firstWidth =
nullptr;
5003 if ((npt < 3) || !ppt) {
5004 Warning(
"GetPolygonSpans",
"No points specified npt=%d ppt=0x%zx", npt, (
size_t)ppt);
5013 if ((npt < 3) || (dy < 0))
return kFALSE;
5015 ptsOut = firstPoint =
new TPoint[dy];
5019 nextleft = nextright = imin;
5020 y = ppt[nextleft].
fY;
5025 if (ppt[nextleft].fY ==
y) {
5031 if (nextleft >= (
int)npt) {
5038 ppt[left].fX, ppt[nextleft].fX,
5039 xl, dl, ml, m1l, incr1l, incr2l);
5043 if (ppt[nextright].fY ==
y) {
5049 if (nextright < 0) {
5056 ppt[right].fX, ppt[nextright].fX,
5057 xr, dr, mr, m1r, incr1r, incr2r);
5062 i =
TMath::Min(ppt[nextleft].fY, ppt[nextright].fY) -
y;
5066 delete [] firstWidth;
5067 delete [] firstPoint;
5076 *(
width++) = xr - xl;
5077 (ptsOut++)->fX = xl;
5079 *(
width++) = xl - xr;
5080 (ptsOut++)->fX = xr;
5088 }
while (
y !=
ymax);
5090 *nspans =
UInt_t(ptsOut - firstPoint);
5091 *outPoint = firstPoint;
5092 *outWidth = firstWidth;
5105 TPoint *firstPoint =
nullptr;
5106 UInt_t *firstWidth =
nullptr;
5109 ARGB32 color = ARGB32_White;
5110 parse_argb_color(col, &color);
5113 if (!stipple && ((color & 0xff000000)==0xff000000)) {
5116 FillSpans(nspans, firstPoint, firstWidth, col, stipple,
w,
h);
5120 delete [] firstWidth;
5121 delete [] firstPoint;
5124 if (firstWidth)
delete [] firstWidth;
5125 if (firstPoint)
delete [] firstPoint;
5136 TPoint *firstPoint =
nullptr;
5137 UInt_t *firstWidth =
nullptr;
5142 FillSpans(nspans, firstPoint, firstWidth, tile);
5145 delete [] firstWidth;
5146 delete [] firstPoint;
5149 if (firstWidth)
delete [] firstWidth;
5150 if (firstPoint)
delete [] firstPoint;
5160 TPoint *firstPoint =
nullptr;
5161 UInt_t *firstWidth =
nullptr;
5166 CropSpans(nspans, firstPoint, firstWidth);
5169 delete [] firstWidth;
5170 delete [] firstPoint;
5173 if (firstWidth)
delete [] firstWidth;
5174 if (firstPoint)
delete [] firstPoint;
5190 if ((count < 3) || !ptsIn) {
5191 Warning(
"DrawFillArea",
"No points specified npt=%d ppt=0x%zx", count, (
size_t)ptsIn);
5200 ARGB32 color = ARGB32_White;
5201 parse_argb_color(col, &color);
5219 static const UInt_t gEdgeTableEntryCacheSize = 200;
5220 static EdgeTableEntry gEdgeTableEntryCache[gEdgeTableEntryCacheSize];
5222 if (count < gEdgeTableEntryCacheSize) {
5233 ptsOut = firstPoint;
5255 if (!stipple && ((color & 0xff000000)==0xff000000)) {
5258 FillSpans(nPts, firstPoint, firstWidth, col, stipple,
w,
h);
5260 ptsOut = firstPoint;
5271 if (!stipple && ((color & 0xff000000)==0xff000000)) {
5274 FillSpans(nPts, firstPoint, firstWidth, col, stipple,
w,
h);
5278 if (
del)
delete [] pETEs;
5291 if ((count < 3) || !ptsIn) {
5292 Warning(
"DrawFillArea",
"No points specified npt=%d ppt=0x%zx", count, (
size_t)ptsIn);
5321 ptsOut = firstPoint;
5343 FillSpans(nPts, firstPoint, firstWidth, tile);
5344 ptsOut = firstPoint;
5353 FillSpans(nPts, firstPoint, firstWidth, tile);
5364 ASDrawContext *ctx =
new ASDrawContext;
5366 ctx->canvas_width = im->width;
5367 ctx->canvas_height = im->height;
5368 ctx->canvas = im->alt.argb32;
5369 ctx->scratch_canvas =
nullptr;
5371 ctx->flags = ASDrawCTX_CanvasIsARGB;
5372 asim_set_custom_brush_colored( ctx, brush);
5382 if (ctx->scratch_canvas)
free(ctx->scratch_canvas);
5399 Int_t sz = thick*thick;
5406 matrix =
new CARD32[sz];
5409 for (
int i = 0; i < sz; i++) {
5410 matrix[i] = (CARD32)color;
5414 brush.matrix = matrix;
5415 brush.width = thick;
5416 brush.height = thick;
5417 brush.center_y = brush.center_x = thick/2;
5426 if (xx1 ==
fImage->width) --xx1;
5427 if (yy1 ==
fImage->height) --yy1;
5428 if (xx2 ==
fImage->width) --xx2;
5429 if (yy2 ==
fImage->height) --yy2;
5431 asim_move_to(ctx, xx1, yy1);
5432 asim_line_to(ctx, xx2, yy2);
5445 Int_t clipx1 = 0, clipx2 = 0, clipy1 = 0, clipy2 = 0;
5458 Bool_t has_alpha = (color & 0xff000000) != 0xff000000;
5463 Int_t bx = 0, by = 0;
5472 auto ndots =
width * rows;
5479 if ((byy >= (
Int_t)
fImage->height) || (byy < 0))
continue;
5483 if ((bxx >= (
Int_t)
fImage->width) || (bxx < 0))
continue;
5485 auto idx =
Idx(bxx + yy);
5486 r += ((
fImage->alt.argb32[idx] & 0xff0000) >> 16);
5487 g += ((
fImage->alt.argb32[idx] & 0x00ff00) >> 8);
5488 b += (
fImage->alt.argb32[idx] & 0x0000ff);
5498 col[0] = (
r << 16) + (
g << 8) +
b;
5500 Int_t col4r = (col[4] & 0xff0000) >> 16;
5501 Int_t col4g = (col[4] & 0x00ff00) >> 8;
5502 Int_t col4b = (col[4] & 0x0000ff);
5507 Int_t colxr = (col4r*
x +
r*xx) >> 2;
5508 Int_t colxg = (col4g*
x +
g*xx) >> 2;
5509 Int_t colxb = (col4b*
x +
b*xx) >> 2;
5510 col[
x] = (colxr << 16) + (colxg << 8) + colxb;
5524 d = ((
d + 10) * 5) >> 8;
5528 if (noClip || ((bxx < clipx2) && (bxx >= clipx1) &&
5529 (byy >= clipy2) && (byy < clipy1))) {
5530 auto idx =
Idx(bxx + yy);
5531 auto acolor = (ARGB32) col[
d];
5535 fImage->alt.argb32[idx] = acolor;
5576 const wchar_t *wcsTitle =
reinterpret_cast<const wchar_t *
>(
text->GetWcsTitle());
5590 ARGB32 color = ARGB32_White;
5625 static ASImageExportParams params;
5633 ret = ASImage2xpmRawBuff(img, (CARD8 **)buffer,
size,
nullptr);
5636 ret = ASImage2PNGBuff(img, (CARD8 **)buffer,
size, ¶ms);
5680 static ASImageImportParams params;
5684 params.filter = SCL_DO_ALL;
5685 params.gamma = SCREEN_GAMMA;
5686 params.gamma_table =
nullptr;
5687 params.compression = 0;
5688 params.format = ASA_ASImage;
5689 params.search_path =
nullptr;
5690 params.subimage = 0;
5695 char *ptr = buffer[0];
5696 while (isspace((
int)*ptr)) ++ptr;
5698 fImage = xpm_data2ASImage((
const char**)buffer, ¶ms);
5700 fImage = xpmRawBuff2ASImage((
const char*)*buffer, ¶ms);
5705 fImage = PNGBuff2ASimage((CARD8 *)*buffer, ¶ms);
5731 Warning(
"CreateThumbnail",
"No image");
5736 Warning(
"CreateThumbnail",
"Visual not initiated");
5740 static char *buf =
nullptr;
5742 ASImage *img =
nullptr;
5762 ASImage *rendered_im;
5763 ASImageLayer layers[2];
5764 init_image_layers(&(layers[0]), 2);
5766 layers[0].dst_x = 0;
5767 layers[0].dst_y = 0;
5768 layers[0].clip_width = img->width;
5769 layers[0].clip_height = img->height;
5770 layers[0].bevel =
nullptr;
5772 layers[1].dst_x = 0;
5773 layers[1].dst_y = 0;
5774 layers[1].clip_width = img->width;
5775 layers[1].clip_height = img->height;
5776 layers[1].merge_scanlines = blend_scanlines_name2func(
"tint");
5777 rendered_im = merge_layers(
fgVisual, &(layers[0]), 2, img->width, img->height,
5779 destroy_asimage(&img);
5783 ASImage *padimg =
nullptr;
5788 padimg = pad_asimage(
fgVisual, img, 0,
d, sz, sz, 0x00ffffff,
5792 padimg = pad_asimage(
fgVisual, img,
d, 0, sz, sz, 0x00ffffff,
5797 destroy_asimage(&img);
5802 ASImage2xpmRawBuff(padimg, (CARD8 **)ptr, &
size,
nullptr);
5805 destroy_asimage(&padimg);
5818 if (
b.IsReading()) {
5819 Version_t version =
b.ReadVersion(&R__s, &R__c);
5824 if ( version == 1 ) {
5825 Int_t fileVersion =
b.GetVersionOwner();
5826 if (fileVersion > 0 && fileVersion < 50000 ) {
5834 if ( fileVersion < 40200 ) {
5853 if (image_type != 0) {
5855 char *buffer =
new char[
size];
5856 b.ReadFastArray(buffer,
size);
5865 b.ReadFastArray(vec,
size);
5881 image_type =
fImage->alt.vector ? 0 : 1;
5884 if (image_type != 0) {
5885 char *buffer =
nullptr;
5888 b.WriteFastArray(buffer,
size);
5896 b.SetByteCount(R__c,
kTRUE);
5905 if (
fImage->alt.vector) {
5946 if ((start > 0) && (stop - start > 0)) {
5960 Int_t sz = thick*thick;
5964 ARGB32 color = ARGB32_White;
5965 parse_argb_color(col, &color);
5970 matrix =
new CARD32[sz];
5973 for (
int i = 0; i < sz; i++) {
5974 matrix[i] = (CARD32)color;
5978 brush.matrix = matrix;
5979 brush.width = thick;
5980 brush.height = thick;
5981 brush.center_y = brush.center_x = thick/2;
5984 asim_cube_bezier(ctx,
x1,
y1,
x2,
y2, x3, y3);
5997 const char *col,
Int_t thick)
6002 thick = !thick ? 1 : thick;
6003 Int_t sz = thick*thick;
6007 ARGB32 color = ARGB32_White;
6008 parse_argb_color(col, &color);
6013 matrix =
new CARD32[sz];
6016 for (
int i = 0; i < sz; i++) {
6017 matrix[i] = (CARD32)color;
6021 brush.matrix = matrix;
6022 brush.width = thick > 0 ? thick : 1;
6023 brush.height = thick > 0 ? thick : 1;
6024 brush.center_y = brush.center_x = thick > 0 ? thick/2 : 0;
6027 asim_straight_ellips(ctx,
x,
y, rx, ry, thick < 0);
6045 thick = !thick ? 1 : thick;
6046 Int_t sz = thick*thick;
6050 ARGB32 color = ARGB32_White;
6051 parse_argb_color(col, &color);
6057 matrix =
new CARD32[sz];
6060 for (
int i = 0; i < sz; i++) {
6061 matrix[i] = (CARD32)color;
6065 brush.matrix = matrix;
6066 brush.height = brush.width = thick > 0 ? thick : 1;
6067 brush.center_y = brush.center_x = thick > 0 ? thick/2 : 0;
6070 asim_circle(ctx,
x,
y,
r, thick < 0);
6084 const char *col,
Int_t thick)
6089 thick = !thick ? 1 : thick;
6090 Int_t sz = thick*thick;
6094 ARGB32 color = ARGB32_White;
6095 parse_argb_color(col, &color);
6100 matrix =
new CARD32[sz];
6103 for (
int i = 0; i < sz; i++) {
6104 matrix[i] = (CARD32)color;
6108 brush.matrix = matrix;
6109 brush.width = thick > 0 ? thick : 1;
6110 brush.height = thick > 0 ? thick : 1;
6111 brush.center_y = brush.center_x = thick > 0 ? thick/2 : 0;
6114 asim_ellips(ctx,
x,
y, rx, ry,
angle, thick < 0);
6127 const char *col,
Int_t thick)
6132 thick = !thick ? 1 : thick;
6133 Int_t sz = thick*thick;
6137 ARGB32 color = ARGB32_White;
6138 parse_argb_color(col, &color);
6143 matrix =
new CARD32[sz];
6146 for (
int i = 0; i < sz; i++) {
6147 matrix[i] = (CARD32)color;
6151 brush.matrix = matrix;
6152 brush.width = thick > 0 ? thick : 1;
6153 brush.height = thick > 0 ? thick : 1;
6154 brush.center_y = brush.center_x = thick > 0 ? thick/2 : 0;
6157 asim_ellips2(ctx,
x,
y, rx, ry,
angle, thick < 0);
6169 const char * ,
const char * )
6183 Warning(
"Gray",
"Image not initiated");
6188 Warning(
"Gray",
"Visual not initiated");
6195 ASImage *sav =
nullptr;
6212 if (
fImage->alt.argb32) {
6214 0, ASA_ARGB32, 0, ASIMAGE_QUALITY_DEFAULT);
6216 for (i = 0; i <
fImage->height; i++) {
6217 for (j = 0; j <
fImage->width; j++) {
6220 r = ((
fImage->alt.argb32[idx] & 0xff0000) >> 16);
6221 g = ((
fImage->alt.argb32[idx] & 0x00ff00) >> 8);
6222 b = (
fImage->alt.argb32[idx] & 0x0000ff);
6223 l = (57*
r + 181*
g + 18*
b)/256;
6231 ASImageDecoder *imdec = start_image_decoding(
fgVisual,
fImage, SCL_DO_ALL,
6243 Warning(
"ToGray",
"Failed to start image output");
6249 CARD32 *aa = imdec->buffer.alpha;
6250 CARD32 *rr = imdec->buffer.red;
6251 CARD32 *gg = imdec->buffer.green;
6252 CARD32 *bb = imdec->buffer.blue;
6257 for (i = 0; i <
fImage->height; i++) {
6258 imdec->decode_image_scanline(imdec);
6259 result.flags = imdec->buffer.flags;
6260 result.back_color = imdec->buffer.back_color;
6262 for (j = 0; j <
fImage->width; j++) {
6263 l = (57*rr[j] + 181*gg[j]+ 18*bb[j])/256;
6269 imout->output_image_scanline(imout, &
result, 1);
6272 stop_image_decoding(&imdec);
6273 stop_image_output(&imout);
6314 Warning(
"FromWindow",
"Visual not initiated");
6321 static int x11 = -1;
6322 if (x11 < 0) x11 =
gVirtualX->InheritsFrom(
"TGX11");
6332 fImage = bitmap2asimage(bits,
w,
h, 0,
nullptr);
6344 std::vector<UChar_t> xx(4 *
w);
6345 for (
UInt_t i = 0; i <
h / 2; ++i) {
6346 memcpy(xx.data(), buf + 4*
w*i, 4*
w);
6347 memcpy(buf + 4*
w*i, buf + 4*
w*(
h-i-1), 4*
w);
6348 memcpy(buf + 4*
w*(
h-i-1), xx.data(), 4*
w);
6362 fImage = bitmap2asimage(
const_cast<unsigned char *
>(buf),
width,
height, 0,
const_cast<unsigned char *
>(
mask));
6375 Warning(
"FromGradient",
"Visual not initiated");
6402 gPad->Range(-left / (1.0 - left - right),
6403 -bottom / (1.0 - top - bottom),
6404 1 + right / (1.0 - left - right),
6405 1 + top / ( 1.0 - top - bottom));
6406 gPad->RangeAxis(0, 0, 1, 1);
6416 char *buf =
nullptr;
6422 str.ReplaceAll(
"static",
"const");
6426 str.ReplaceAll(
"asxpm", xpm.
Data());
6427 out <<
"\n" << str <<
"\n\n";
6432 out <<
"asimage = TImage::Create();\n";
6433 out <<
" asimage->SetImageBuffer( (char **)" << xpm <<
", TImage::kXpm);\n";
6435 out <<
" asimage->Draw();\n";
6448 static char buf[32];
6449 FILE *fp = fopen(
name,
"rb+");
6452 printf(
"file %s : failed to open\n",
name);
6456 if (!fread(buf, 1, 20, fp)) {
6461 char dpi1 = (set & 0xffff) >> 8;
6462 char dpi2 = set & 0xff;
6467 for (i = 0; i < 20; i++) {
6468 if ((buf[i] == 0x4a) && (buf[i+1] == 0x46) && (buf[i+2] == 0x49) &&
6469 (buf[i+3] == 0x46) && (buf[i+4] == 0x00) ) {
6475 if (i == 20 || dpi+4 >= 20) {
6477 printf(
"file %s : wrong JPEG format\n",
name);
6484 buf[dpi + 1] = dpi1;
6485 buf[dpi + 2] = dpi2;
6488 buf[dpi + 3] = dpi1;
6489 buf[dpi + 4] = dpi2;
6492 fwrite(buf, 1, 20, fp);
Handle_t Pixmap_t
Pixmap handle.
const Mask_t kGCClipXOrigin
@ kGXorReverse
src OR NOT dst
@ kGXnand
NOT src OR NOT dst.
@ kGXandReverse
src AND NOT dst
@ kGXorInverted
NOT src OR dst.
@ kGXandInverted
NOT src AND dst.
@ kGXequiv
NOT src XOR dst.
@ kGXnor
NOT src AND NOT dst.
@ kGXcopyInverted
NOT src.
Handle_t GContext_t
Graphics context handle.
Handle_t Drawable_t
Drawable handle.
const Mask_t kGCClipYOrigin
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short)
int Int_t
Signed integer 4 bytes (int)
short Version_t
Class version identifier (short)
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
int Ssiz_t
String size (currently int)
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
const char Option_t
Option string (const char)
static ARGB32 GetShadow(ARGB32 background)
Calculate shadow color.
static const UInt_t kBrushCacheSize
static CARD32 gBrushCache[kBrushCacheSize *kBrushCacheSize]
static unsigned long kAllPlanes
static ARGB32 GetAverage(ARGB32 foreground, ARGB32 background)
Get average.
static char * gIconPaths[7]
static int GetPolyYBounds(TPoint *pts, int n, int *by, int *ty)
Get poly bounds along Y.
static CARD8 MakeComponentHilite(int cmp)
Make component hilite.
static ARGB32 GetHilite(ARGB32 background)
Calculate highlite color.
static const UInt_t NUMPTSTOBUFFER
static ASFontManager * gFontManager
static void init_icon_paths()
Set icons paths.
#define _MEMSET_(dst, lng, val)
#define FillSpansInternal(npt, ppt, widths, color)
static ASDrawContext * create_draw_context_argb32(ASImage *im, ASDrawTool *brush)
Create draw context.
#define _alphaBlend(bot, top)
static void destroy_asdraw_context32(ASDrawContext *ctx)
Destroy asdraw context32.
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
static int InsertionSort(EdgeTableEntry *AET)
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2)
static void loadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs)
static void FreeStorage(ScanLineListBlock *pSLLBlock)
static void CreateETandAET(int count, TPoint *pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock)
#define BRESINCRPGON(d, minval, m, m1, incr1, incr2)
winID h TVirtualViewer3D TVirtualGLPainter p
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 mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void cmap
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 filename
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 del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
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 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 result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void foreground
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char FillPolygon
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 bitmap
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 FillRectangle
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 GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pxm
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 GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TRandom * gRandom
R__EXTERN TStyle * gStyle
R__EXTERN const char * gProgName
R__EXTERN TSystem * gSystem
R__EXTERN TVirtualPS * gVirtualPS
R__EXTERN Int_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)
void PaintBox(TVirtualPad &parent)
TASImageInteractive(TVirtualPad &parent, Int_t px, Int_t py)
void PerformMove(Int_t px, Int_t py)
void CropSpans(UInt_t npt, TPoint *ppt, UInt_t *widths) override
Crop spans.
void Gradient(UInt_t angle=0, const char *colors="#FFFFFF #000000", const char *offsets=nullptr, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0) override
Render multipoint gradient inside rectangle of size (width, height) at position (x,...
void Blur(Double_t hr=3, Double_t vr=3) override
Perform Gaussian blur of the image (useful for drop shadows).
void DrawFTGlyphs(TTFhandle &ttf, UInt_t color, Int_t x, Int_t y, TVirtualPad *clippad=nullptr, Int_t offx=0, Int_t offy=0)
Draw TTF glyphs .
Bool_t SetJpegDpi(const char *name, UInt_t dpi=72)
Set an image printing resolution in Dots Per Inch units.
void StartPaletteEditor() override
Start palette editor.
void Bevel(Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0, const char *hi="#ffdddddd", const char *lo="#ff555555", UShort_t thick=1, Bool_t pressed=kFALSE) override
Bevel is used to create 3D effect while drawing buttons, or any other image that needs to be framed.
void DrawLineInternal(UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t col, UInt_t thick)
Internal line drawing.
Int_t fPaintMode
! 1 - fast mode, 0 - low memory slow mode
static Bool_t fgBatch
global flag to signal if batch mode is active ie fgVisual->dpy was set to nullptr
UInt_t GetWidth() const override
Return width of original image not of the displayed image.
Double_t fMinValue
! min value in image
void DrawEllips(Int_t x, Int_t y, Int_t rx, Int_t ry, Int_t angle, const char *col="#000000", Int_t thick=1) override
Draw an ellipse.
void Paint(Option_t *option="") override
Paint image.
void DrawHLine(UInt_t y, UInt_t x1, UInt_t x2, UInt_t col, UInt_t thick)
Draw an horizontal line.
void SetPaletteEnabled(Bool_t on=kTRUE) override
Switch on/off the image palette.
Bool_t InitImage(const char *caller)
Static function to initialize the image.
static Bool_t fgInit
global flag to init afterimage only once
const char * GetTitle() const override
Title is used to keep 32x32 xpm image's thumbnail.
void HSV(UInt_t hue=0, UInt_t radius=360, Int_t H=0, Int_t S=0, Int_t V=0, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0) override
This function will tile original image to specified size with offsets requested, and then it will go ...
void Tile(UInt_t width, UInt_t height) override
Tile the original image.
void WriteImage(const char *file, EImageFileTypes type=TImage::kUnknown) override
Write image to specified file.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Is the mouse in the image ?
char * GetObjectInfo(Int_t px, Int_t py) const override
Get image pixel coordinates and the pixel value at the mouse pointer.
const char * TypeFromMagicNumber(const char *file)
Guess the file type from the first byte of file.
void DrawLine(UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, const char *col="#000000", UInt_t thick=1) override
Draw a line.
Double_t fMaxValue
! max value in image
static ASVisual * fgBatchVisual
pointer to "batch" visual structure
void MapQuality(EImageQuality &quality, UInt_t &asquality, Bool_t toas=kTRUE)
Map quality to/from AfterImage quality.
void Zoom(UInt_t offX, UInt_t offY, UInt_t width, UInt_t height) override
The area of an image displayed in a pad is defined by this function.
UInt_t fZoomWidth
! width of zoomed image in image pixels
Bool_t fEditable
! kTRUE image can be resized, moved by resizing/moving gPad
Int_t fZoomUpdate
! kZoom - new zooming required, kZoomOps - other ops in action, kNoZoom - no zooming or ops
Bool_t IsValid() const override
TClass * IsA() const override
void DrawCubeBezier(Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t x3, Int_t y3, const char *col="#000000", UInt_t thick=1) override
Draw a cubic bezier line.
UInt_t GetScaledHeight() const override
Return height of the displayed image not of the original image.
void DrawFillArea(UInt_t npt, TPoint *ppt, const char *col="#000000", const char *stipple=nullptr, UInt_t w=16, UInt_t h=16) override
Fill a polygon (any type convex, non-convex).
void DrawVLine(UInt_t x, UInt_t y1, UInt_t y2, UInt_t col, UInt_t thick)
Draw a vertical line.
UInt_t * GetRgbaArray() override
Return a pointer to an array[width x height] of RGBA32 values.
void FillRectangle(const char *col=nullptr, Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0) override
Fill rectangle of size (width, height) at position (x,y) within the existing image with specified col...
void DrawStraightEllips(Int_t x, Int_t y, Int_t rx, Int_t ry, const char *col="#000000", Int_t thick=1) override
Draw a straight ellipse.
Double_t * GetVecArray() override
Return a pointer to internal array[width x height] of double values [0,1].
void DrawCircle(Int_t x, Int_t y, Int_t r, const char *col="#000000", Int_t thick=1) override
Draw a circle.
ASImage * fImage
! pointer to image structure of original image
void Gray(Bool_t on=kTRUE) override
Convert RGB image to Gray image and vice versa.
void DrawText(Int_t x=0, Int_t y=0, const char *text="", Int_t size=12, const char *color=nullptr, const char *font="fixed", EText3DType type=TImage::kPlain, const char *fore_file=nullptr, Float_t angle=0) override
Draw text of size (in pixels for TrueType fonts) at position (x, y) with color specified by hex strin...
UInt_t fZoomHeight
! hight of zoomed image in image pixels
void Pad(const char *color="#00FFFFFF", UInt_t left=0, UInt_t right=0, UInt_t top=0, UInt_t bottom=0) override
Enlarge image, padding it with specified color on each side in accordance with requested geometry.
static THashTable * fgPlugList
! hash table containing loaded plugins
UInt_t * GetArgbArray() override
Return a pointer to internal array[width x height] of ARGB32 values This array is directly accessible...
Bool_t SetImageBuffer(char **buffer, EImageFileTypes type=TImage::kPng) override
Create image from compressed buffer.
Double_t * Vectorize(UInt_t max_colors=256, UInt_t dither=4, Int_t opaque_threshold=1) override
Reduce color-depth of an image and fills vector of "scientific data" [0...1].
Int_t Idx(Int_t idx)
Return a valid index in fImage tables to avoid seg-fault by accessing out of indices out of array's r...
void FillPolygon(UInt_t npt, TPoint *ppt, const char *col="#000000", const char *stipple=nullptr, UInt_t w=16, UInt_t h=16) override
Fill a convex polygon with background color or bitmap.
void SetDefaults()
Set default parameters.
void CopyArea(TImage *dst, Int_t xsrc, Int_t ysrc, UInt_t w, UInt_t h, Int_t xdst=0, Int_t ydst=0, Int_t gfunc=3, EColorChan chan=kAllChan) override
Copy source region to the destination image.
void DrawWideLine(UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t col, UInt_t thick)
Draw wide line.
Pixmap_t GetMask() override
DEPRECATED! Method left for backward compatibility and will be removed in ROOT7! Returns image mask p...
UInt_t * GetScanline(UInt_t y) override
Return a pointer to scan-line.
void FillSpans(UInt_t npt, TPoint *ppt, UInt_t *widths, const char *col="#000000", const char *stipple=nullptr, UInt_t w=16, UInt_t h=16) override
Fill spans with specified color or/and stipple.
void DrawEllips2(Int_t x, Int_t y, Int_t rx, Int_t ry, Int_t angle, const char *col="#000000", Int_t thick=1) override
Draw an ellipse.
void FromGLBuffer(UChar_t *buf, UInt_t width, UInt_t height) override
DEPRECATED.
TObject * Clone(const char *newname="") const override
Clone image.
void Draw(Option_t *option="") override
Draw image.
void CropPolygon(UInt_t npt, TPoint *ppt) override
Crop a convex polygon.
static const ASVisual * GetVisual()
Return visual.
void DrawPolyLine(UInt_t nn, TPoint *xy, const char *col="#000000", UInt_t thick=1, TImage::ECoordMode mode=kCoordModeOrigin) override
Draw a polyline.
void PolyPoint(UInt_t npt, TPoint *ppt, const char *col="#000000", TImage::ECoordMode mode=kCoordModeOrigin) override
Draw a poly point.
static void Image2Drawable(ASImage *im, Drawable_t wid, Int_t x, Int_t y, Int_t xsrc=0, Int_t ysrc=0, UInt_t wsrc=0, UInt_t hsrc=0, Option_t *opt="")
Draw asimage on drawable.
void FromBitmap(const UChar_t *buf, UInt_t width, UInt_t height, const UChar_t *mask=nullptr) override
Creates an image from a RGBA buffer.
void Merge(const TImage *im, const char *op="alphablend", Int_t x=0, Int_t y=0) override
Merge two images.
void DrawCellArray(Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t nx, Int_t ny, UInt_t *ic) override
Draw a cell array.
void FillRectangleInternal(UInt_t col, Int_t x, Int_t y, UInt_t width, UInt_t height)
Fill rectangle of size (width, height) at position (x,y) within the existing image with specified col...
~TASImage() override
Image destructor, clean up image and visual.
Bool_t GetMaskBits(UInt_t &width, UInt_t &height, std::vector< char > &bits) override
Returns image mask bits - only alpha channel of the image.
void FloodFill(Int_t x, Int_t y, const char *col, const char *min_col, const char *max_col=nullptr) override
Flood fill.
TASImage * fScaledImage
! temporary scaled and zoomed image produced from original image
Bool_t IsEditable() const override
UInt_t fZoomOffX
! X - offset for zooming in image pixels
void ReadImage(const char *file, EImageFileTypes type=TImage::kUnknown) override
Read specified image file.
void GetImageBuffer(char **buffer, int *size, EImageFileTypes type=TImage::kPng) override
Return in-memory buffer compressed according image type.
EImageFileTypes GetFileType(const char *ext)
Return file type depending on specified extension.
void FromGradient(struct ASGradient *as_gradient, UInt_t width, UInt_t height)
Creates an image from ASGradient.
void Slice(UInt_t xStart, UInt_t xEnd, UInt_t yStart, UInt_t yEnd, UInt_t toWidth, UInt_t toHeight) override
Another method of enlarging images where corners remain unchanged, but middle part gets tiled.
static UInt_t AlphaBlend(UInt_t bot, UInt_t top)
Return alpha-blended value computed from bottom and top pixel values.
void SetImage(const Double_t *imageData, UInt_t width, UInt_t height, TImagePalette *palette=nullptr) override
Deletes the old image and creates a new image depending on the values of imageData.
void DrawTextTTF(Int_t x, Int_t y, const char *text, Int_t size, UInt_t color, const char *font_name, Float_t angle)
Draw text using TrueType fonts.
void PutPixel(Int_t x, Int_t y, const char *col="#000000") override
Draw a point at the specified position.
void Browse(TBrowser *) override
Browse image.
void DrawDashZTLine(UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t nDash, const char *pDash, UInt_t col, UInt_t thick)
Draw a dashed line with thick pixel width.
void DrawTextOnPad(TText *text, Int_t x=0, Int_t y=0, TVirtualPad *pad=nullptr, Int_t offx=0, Int_t offy=0) override
Draw text at the pixel position (x,y) checking clip on pad.
void DestroyImage()
Destroy image.
UInt_t fZoomOffY
! Y - offset for zooming im image pixels
void UnZoom() override
Un-zoom the image to original size.
void Streamer(TBuffer &) override
Streamer for ROOT I/O.
TArrayL * GetPixels(Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0) override
Return 2D array of machine dependent pixel values.
void PaintImage(Drawable_t wid, Int_t x, Int_t y, Int_t xsrc=0, Int_t ysrc=0, UInt_t wsrc=0, UInt_t hsrc=0, Option_t *opt="") override
Draw image on the drawable wid (pixmap, window) at x,y position.
void DestroyScaledImage()
Destroy scaled image.
ASImage * fGrayImage
! gray image
void DrawDashVLine(UInt_t x, UInt_t y1, UInt_t y2, UInt_t nDash, const char *pDash, UInt_t col, UInt_t thick)
Draw a dashed vertical line.
void SetTitle(const char *title="") override
Set a title for an image.
void MapFileTypes(EImageFileTypes &type, UInt_t &astype, Bool_t toas=kTRUE)
Map file type to/from AfterImage types.
void DrawRectangle(UInt_t x, UInt_t y, UInt_t w, UInt_t h, const char *col="#000000", UInt_t thick=1) override
Draw a rectangle.
void Append(const TImage *im, const char *option="+", const char *color="#00000000") override
Append image.
void DrawDashHLine(UInt_t y, UInt_t x1, UInt_t x2, UInt_t nDash, const char *pDash, UInt_t col, UInt_t thick)
Draw a dashed horizontal line.
void DrawDashLine(UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t nDash, const char *pDash, const char *col="#000000", UInt_t thick=1) override
Draw a dashed line.
void SetPalette(const TImagePalette *palette) override
Set a new palette to an image.
void Scale(UInt_t width, UInt_t height) override
Scale the original image.
TASImage()
Default image constructor.
TASImage & operator=(const TASImage &img)
Image assignment operator.
void Mirror(Bool_t vert=kTRUE) override
Mirror image in place.
void DrawDashZLine(UInt_t x1, UInt_t y1, UInt_t x2, UInt_t y2, UInt_t nDash, const char *pDash, UInt_t col)
Draw a dashed line with one pixel width.
void DrawSegments(UInt_t nseg, Segment_t *seg, const char *col="#000000", UInt_t thick=1) override
Draw segments.
Pixmap_t GetPixmap() override
DEPRECATED.
void FromWindow(Drawable_t wid, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0) override
DEPRECATED.
TArrayD * GetArray(UInt_t w=0, UInt_t h=0, TImagePalette *pal=gWebImagePalette) override
In case of vectorized image return an associated array of doubles otherwise this method creates and r...
void CloneImageData(const TASImage &src)
Clone image data Used for clones and assign operator.
void Flip(Int_t flip=180) override
Flip image in place.
Bool_t GetPolygonSpans(UInt_t npt, TPoint *ppt, UInt_t *nspans, TPoint **firstPoint, UInt_t **firstWidth)
The code is based on Xserver/mi/mipolycon.c "Copyright 1987, 1998 The Open Group".
void Crop(Int_t x=0, Int_t y=0, UInt_t width=0, UInt_t height=0) override
Crop an image.
void EndPaint() override
EndPaint does internal RLE compression of image data.
void BeginPaint(Bool_t fast=kTRUE) override
BeginPaint initializes internal array[width x height] of ARGB32 pixel values.
static ASVisual * fgVisual
pointer to visual structure
UInt_t GetScaledWidth() const override
Return width of the displayed image not of the original image.
void GetZoomPosition(UInt_t &x, UInt_t &y, UInt_t &w, UInt_t &h) const
Return the zoom parameters.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute mouse events.
void FromPad(TVirtualPad *pad, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0) override
Create an image from the given pad, afterwards this image can be saved in any of the supported image ...
static ASVisual * InitVisual(Bool_t plain=kFALSE)
Static internal method to initialize the ASVisual Many operations do not require X11 display so plain...
UInt_t GetHeight() const override
Return height of original image not of the displayed image.
void DrawBox(Int_t x1, Int_t y1, Int_t x2, Int_t y2, const char *col="#000000", UInt_t thick=1, Int_t mode=0) override
Draw a box.
Bool_t fIsGray
! kTRUE if image is gray
void CreateThumbnail()
Create image thumbnail.
Array of doubles (64 bits per element).
void AddAt(Double_t c, Int_t i)
Set the double c value at position i in the array.
const Double_t * GetArray() const
Array of longs (32 or 64 bits per element).
void AddAt(Long_t c, Int_t i)
Add long c at position i. Check for out of bounds.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetPalette(const TImagePalette *palette)
Set a new palette for the image.
Bool_t fConstRatio
keep aspect ratio of image on the screen
EImageQuality GetImageQuality() const
Bool_t GetConstRatio() const
virtual const TImagePalette & GetPalette() const
TImagePalette fPalette
color palette for value -> color conversion
virtual void Streamer(TBuffer &)
UInt_t GetImageCompression() const
Bool_t fPaletteEnabled
! kTRUE - palette is drawn on the image
virtual void SaveImageAttributes(std::ostream &out, const char *name, EImageQuality qualdef=kImgPoor, UInt_t comprdef=0, Bool_t constRatiodef=kTRUE)
Save image attributes as C++ statement(s) on output stream, but not the palette.
virtual void StartPaletteEditor()
Opens a GUI to edit the color palette.
virtual void ModifyOn(TVirtualPad &pad)
Change current line attributes on specified pad.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
The color creation and management class.
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
Convert r,g,b to graphics system dependent pixel value.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
const char * AsHexString() const
Return color as hexadecimal string.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
void Draw(Option_t *option="") override
Draw this frame with its current attributes.
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
THashTable implements a hash table to store TObject's.
void Add(TObject *obj) override
Add object to the hash table.
TObject * FindObject(const char *name) const override
Find object using its name.
Save canvas as an image (GIF, JPEG, PNG, XPM, TIFF etc.).
A class to define a conversion from pixel values to pixel color.
UShort_t * fColorRed
[fNumPoints] red color at each anchor point
Double_t * fPoints
[fNumPoints] value of each anchor point [0..1]
virtual Int_t FindColor(UShort_t r, UShort_t g, UShort_t b)
Returns an index of the closest color.
UShort_t * fColorGreen
[fNumPoints] green color at each anchor point
UShort_t * fColorBlue
[fNumPoints] blue color at each anchor point
UInt_t fNumPoints
number of anchor points
UShort_t * fColorAlpha
[fNumPoints] alpha at each anchor point
virtual unsigned char * ReadFile(const char *filename, UInt_t &w, UInt_t &h)=0
An abstract interface to image processing library.
void Streamer(TBuffer &) override
Stream an object of class TObject.
virtual UInt_t * GetArgbArray()
virtual UInt_t GetWidth() const
virtual void Option_t *static TImage * Create()
Create an image.
TImage & operator=(const TImage &img)
virtual UInt_t GetHeight() const
const char * GetName() const override
Returns name of object.
void Streamer(TBuffer &) override
Stream an object of class TObject.
virtual void SetName(const char *name)
Set the name of the TNamed.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Longptr_t ExecPlugin(int nargs)
Int_t LoadPlugin()
Load the plugin library for this handler.
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
static const TString & GetIconPath()
Get the icon path in the installation. Static utility function.
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
void ToLower()
Change string to lower-case.
Int_t Atoi() const
Return integer value of string.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Float_t GetScreenFactor() const
Float_t GetImageScaling() const
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Dynamic handle to work with freetype 2 library.
Bool_t SetTextSize(Float_t textsize)
Set current text size.
void SetRotationMatrix(Float_t angle)
Set the rotation matrix used to rotate the font outlines.
void PrepareString(const char *string)
Put the characters in "string" in the "glyphs" array.
UInt_t GetNumGlyphs() const
return number of glyphs
void SetTextFont(Font_t fontnumber)
Set specified font.
void LayoutGlyphs()
Compute the glyphs positions, fgAscent and fgWidth (needed for alignment).
void SetSmoothing(Bool_t state)
Bool_t GetGlyphData(UInt_t n, Int_t &offx, Int_t &offy, UChar_t *&buffer, UInt_t &width, UInt_t &rows, UInt_t &pitch)
Returns data for glyph bitmap Instead direct access to FT_BitmapGlyph one can obtain all relevant fie...
Bool_t ApplyAlignRotate(Int_t &px, Int_t &py, Int_t align, Int_t pad_width, Int_t pad_height)
Apply align and configured rotation matrix to text position px and py will be shifted to the place wh...
Base class for several text objects.
Int_t GetNoElements() const
Element * GetMatrixArray()
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
virtual void * GetStream() const
virtual void Open(const char *filename, Int_t type=-111)=0
virtual Bool_t FillImageFromPad(TImage *image, TVirtualPad *pad) const
Fill TImage object by data from the pad Returns kFALSE if not supported or in case of failures.
small helper class to store/restore gPad context in TPad methods
Helper class to store interactive parameters for individual objects Should be used via MakeInteractiv...
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual Int_t YtoAbsPixel(Double_t y) const =0
virtual Double_t GetX2() const =0
virtual void UpdateAsync()=0
virtual Bool_t IsWeb() const
virtual Double_t AbsPixeltoX(Double_t px)=0
virtual Bool_t IsBatch() const =0
virtual Int_t XtoAbsPixel(Double_t x) const =0
virtual Double_t GetY1() const =0
virtual TVirtualPadPainter * GetPainter()=0
const char * GetName() const override=0
Returns name of object.
virtual void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="")=0
void Paint(Option_t *option="") override=0
This method must be overridden if a class wants to paint itself.
virtual Double_t GetY2() const =0
virtual Double_t AbsPixeltoY(Double_t py)=0
virtual Double_t GetX1() const =0
virtual void SetBorderMode(Short_t bordermode)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
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.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Graphics context structure.
Pixmap_t fClipMask
bitmap clipping; other calls for rects
Int_t fClipXOrigin
origin for clipping
Mask_t fMask
bit mask specifying which fields are valid
Used for drawing line segments (maps to the X11 XSegments structure)
struct _EdgeTableEntry * next
struct _ScanLineListBlock * next
EdgeTableEntry * edgelist
struct _ScanLineList * next