home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / xpaint-247 / pattern.c < prev    next >
C/C++ Source or Header  |  1997-01-03  |  16KB  |  583 lines

  1. /* +-------------------------------------------------------------------+ */
  2. /* | Copyright 1992, 1993, David Koblas (koblas@netcom.com)            | */
  3. /* | Copyright 1995, 1996 Torsten Martinsen (bullestock@dk-online.dk)  | */
  4. /* |                                                                   | */
  5. /* | Permission to use, copy, modify, and to distribute this software  | */
  6. /* | and its documentation for any purpose is hereby granted without   | */
  7. /* | fee, provided that the above copyright notice appear in all       | */
  8. /* | copies and that both that copyright notice and this permission    | */
  9. /* | notice appear in supporting documentation.  There is no           | */
  10. /* | representations about the suitability of this software for        | */
  11. /* | any purpose.  this software is provided "as is" without express   | */
  12. /* | or implied warranty.                                              | */
  13. /* |                                                                   | */
  14. /* +-------------------------------------------------------------------+ */
  15.  
  16. /* $Id: pattern.c,v 1.6 1996/04/19 08:53:22 torsten Exp $ */
  17.  
  18. #include <X11/IntrinsicP.h>
  19. #include <X11/Shell.h>
  20. #include <X11/StringDefs.h>
  21. #ifndef VMS
  22. #include <X11/Xaw/Box.h>
  23. #include <X11/Xaw/Form.h>
  24. #include <X11/Xaw/Scrollbar.h>
  25. #include <X11/Xaw/Viewport.h>
  26. #include <X11/Xaw/Command.h>
  27. #include <X11/CoreP.h>
  28. #include <X11/Xaw/ToggleP.h>
  29. #else
  30. #include <X11Xaw/Box.h>
  31. #include <X11Xaw/Form.h>
  32. #include <X11Xaw/Scrollbar.h>
  33. #include <X11Xaw/Viewport.h>
  34. #include <X11Xaw/Command.h>
  35. #include <X11/CoreP.h>
  36. #include <X11Xaw/ToggleP.h>
  37. #endif
  38. #include <X11/cursorfont.h>
  39. #include <stdio.h>
  40. #include "Colormap.h"
  41. #include "Paint.h"
  42. #include "palette.h"
  43. #include "xpaint.h"
  44. #include "menu.h"
  45. #include "image.h"
  46. #include "misc.h"
  47. #include "cutCopyPaste.h"
  48. #include "text.h"
  49. #include "graphic.h"
  50. #include "operation.h"
  51. #include "color.h"
  52. #include "protocol.h"
  53.  
  54. #ifndef NOSTDHDRS
  55. #include <stdlib.h>
  56. #include <unistd.h>
  57. #endif
  58.  
  59. static PaintMenuItem fileMenu[] =
  60. {
  61.     MI_SIMPLE("read"),
  62.     MI_SIMPLE("save"),
  63.     MI_SIMPLE("close"),
  64. };
  65. static PaintMenuItem editMenu[] =
  66. {
  67.     MI_SIMPLE("undo"),
  68.     MI_SEPERATOR(),
  69.     MI_SIMPLE("cut"),
  70.     MI_SIMPLE("copy"),
  71.     MI_SIMPLE("paste"),
  72.     MI_SIMPLE("clear"),
  73.     MI_SEPERATOR(),
  74.     MI_SIMPLE("dup"),
  75.     MI_SIMPLE("all"),
  76. };
  77. static PaintMenuItem sizeMenu[] =
  78. {
  79. #define SZ_N1    0
  80.     MI_FLAG("16x16", MF_CHECK | MF_GROUP1),
  81. #define SZ_N2    1
  82.     MI_FLAG("24x24", MF_CHECK | MF_GROUP1),
  83. #define SZ_N3    2
  84.     MI_FLAG("32x32", MF_CHECK | MF_GROUP1),
  85. #define SZ_N4    3
  86.     MI_FLAG("48x48", MF_CHECK | MF_GROUP1),
  87. #define SZ_N5    4
  88.     MI_FLAG("64x64", MF_CHECK | MF_GROUP1),
  89.     MI_SEPERATOR(),
  90. #define SZ_N6    6
  91.     MI_FLAG("other", MF_CHECK | MF_GROUP1),
  92. };
  93. static PaintMenuItem imageMenu[] =
  94. {
  95.     MI_FLAG("grid", MF_CHECK),
  96. };
  97. static PaintMenuItem helpMenu[] =
  98. {
  99.     MI_SIMPLECB("help", HelpDialog, "canvas.patBox.pattern"),
  100. };
  101. static PaintMenuBar menuBar[] =
  102. {
  103.     {None, "file", XtNumber(fileMenu), fileMenu},
  104.     {None, "edit", XtNumber(editMenu), editMenu},
  105.     {None, "size", XtNumber(sizeMenu), sizeMenu},
  106.     {None, "image", XtNumber(imageMenu), imageMenu},
  107.     {None, "help", XtNumber(helpMenu), helpMenu},
  108. };
  109.  
  110. #define    RED    1
  111. #define    GREEN    2
  112. #define    BLUE    3
  113.  
  114. Widget ColorPickerPalette(Widget, Palette *, Pixel *);
  115.  
  116. typedef struct {
  117.     int add;
  118.     Pixmap pix;
  119.     void *iconList;
  120.     Widget fat, norm, paint;
  121.     Widget cpick, color;
  122.     Widget curCheck;
  123.     Widget sizeChecks[XtNumber(sizeMenu) - 1];
  124.     Palette *map;
  125. } LocalInfo;
  126.  
  127. static void 
  128. activePixel(LocalInfo * l, Pixel p)
  129. {
  130.     if (l->color != None)
  131.     XtVaSetValues(l->color, XtNcolor, p, NULL);
  132.     XtVaSetValues(l->fat, XtNforeground, p,
  133.           XtNlineForeground, p,
  134.           NULL);
  135.     if (l->cpick != None)
  136.     ColorPickerSetPixel(l->cpick, p);
  137.     PaletteSetInvalid(l->map, p);
  138. }
  139.  
  140. static void 
  141. cpickCallback(Widget w, LocalInfo * l, Pixel p)
  142. {
  143.     activePixel(l, p);
  144. }
  145.  
  146. static void 
  147. colorCallback(Widget w, LocalInfo * l, XColor * color)
  148. {
  149.     activePixel(l, color->pixel);
  150. }
  151.  
  152. static void 
  153. matchCallback(Widget w, LocalInfo * l, XtPointer junk)
  154. {
  155.     Colormap cmap;
  156.     Pixel p;
  157.  
  158.     DoGrabPixel(w, &p, &cmap);
  159.  
  160.     if (l->map->cmap == cmap) {
  161.     activePixel(l, p);
  162.     } else {
  163.     XColor col;
  164.  
  165.     col.flags = DoRed | DoGreen | DoBlue;
  166.     col.pixel = p;
  167.     XQueryColor(XtDisplay(w), cmap, &col);
  168.     if (PaletteLookupColor(l->map, &col, &p)) {
  169.         activePixel(l, p);
  170.     } else {
  171.         Notice(w, "Selected color is from a different colormap,\n"
  172.            "with no matching color on this colormap");
  173.     }
  174.     }
  175. }
  176.  
  177.  
  178. static void 
  179. grabCallback(Widget w, XtPointer infoArg, XtPointer junk2)
  180. {
  181.     LocalInfo *info = (LocalInfo *) infoArg;
  182.     Image *image;
  183.     Colormap cmap;
  184.     Pixmap pix;
  185.     int grabW, grabH;
  186.  
  187.     XtVaGetValues(info->fat, XtNdrawWidth, &grabW,
  188.           XtNdrawHeight, &grabH,
  189.           NULL);
  190.  
  191.     image = DoGrabImage(w, grabW, grabH);
  192.  
  193.     XtVaGetValues(info->paint, XtNcolormap, &cmap, NULL);
  194.     pix = None;
  195.     if (ImageToPixmapCmap(image, info->fat, &pix, cmap))
  196.     PwPutPixmap(info->fat, pix);
  197. }
  198.  
  199. static void 
  200. closeCallback(Widget w, XtPointer infoArg, XtPointer junk2)
  201. {
  202.     LocalInfo *info = (LocalInfo *) infoArg;
  203.  
  204.     XtDestroyWidget(GetShell(info->fat));
  205.     StateShellBusy(info->paint, False);
  206.     XtFree((XtPointer) info);
  207. }
  208. static void 
  209. buttonCallback(Widget w, XtPointer infoArg, XtPointer junk2)
  210. {
  211.     LocalInfo *info = (LocalInfo *) infoArg;
  212.     Pixmap pix;
  213.     Widget icon;
  214. #if 0
  215.     XtPointer data;
  216. #endif
  217.  
  218.     if (info != NULL) {
  219.     void *pi = XawToggleGetCurrent(info->iconList);
  220.     PwRegionFinish(info->fat, True);
  221.     PwGetPixmap(info->fat, &pix, NULL, NULL);
  222.  
  223.     if (info->add) {
  224.         icon = AddPatternInfo(pi, pix, 0);
  225.  
  226. #if 0
  227.         XtVaGetValues(icon, XtNradioData, &data, NULL);
  228.  
  229.         XawToggleSetCurrent(icon, data);
  230. #endif
  231.     } else {
  232.         ChangePattern(pi, pix);
  233.     }
  234.  
  235. #if 0
  236.     XtVaSetValues(info->paint, XtNpattern, pix, NULL);
  237. #endif
  238.     StateShellBusy(info->paint, False);
  239.     XtFree((XtPointer) info);
  240.     }
  241.     XtDestroyWidget(GetShell(w));
  242. }
  243. static void 
  244. readFileCallback(Widget paint, XtPointer fileArg, XtPointer imageArg)
  245. {
  246.     Image *image = (Image *) imageArg;
  247.     Pixmap pix;
  248.     Colormap cmap;
  249.  
  250.     /*  XXX - allocating a new colormap! */
  251.     if (ImageToPixmap(image, paint, &pix, &cmap)) {
  252.     XtVaSetValues(paint, XtNcolormap, cmap, NULL);
  253.     PwPutPixmap(paint, pix);
  254.     return;
  255.     }
  256. }
  257. static void 
  258. readCallback(Widget w, XtPointer paint, XtPointer junk)
  259. {
  260.     GetFileName((Widget) paint, False, NULL, readFileCallback, NULL);
  261. }
  262.  
  263. static void 
  264. cac(LocalInfo * info, int inW, int inH)
  265. {
  266.     int width, height, i;
  267.     String lbl;
  268.  
  269.     for (i = 0; i < XtNumber(info->sizeChecks); i++) {
  270.     Widget w = info->sizeChecks[i];
  271.     XtVaGetValues(w, XtNlabel, &lbl, NULL);
  272.     width = -1;
  273.     height = -1;
  274.     sscanf(lbl, "%dx%d", &width, &height);
  275.     if (width <= 0 || height <= 0 || (width == inW && height == inH)) {
  276.         MenuCheckItem(info->curCheck = w, True);
  277.         break;
  278.     }
  279.     }
  280. }
  281. static void 
  282. sizeOkChoiceCallback(Widget w, LocalInfo * l, TextPromptInfo * info)
  283. {
  284.     int width = atoi(info->prompts[0].rstr);
  285.     int height = atoi(info->prompts[1].rstr);
  286.  
  287.     if (width <= 0 || height <= 0) {
  288.     Notice(w, "Invalid width or height,\nmust be greater than 0");
  289.     } else if (width > 128 || height > 128) {
  290.     Notice(w, "Invalid width or height,\nmust be less than 129");
  291.     } else {
  292.     XtVaSetValues(l->fat, XtNdrawWidth, width,
  293.               XtNdrawHeight, height,
  294.               NULL);
  295.     MenuCheckItem(l->curCheck, False);
  296.     l->curCheck = None;
  297.     cac(l, width, height);
  298.     }
  299. }
  300. static void 
  301. sizeChoiceCallback(Widget w, XtPointer larg, XtPointer junk)
  302. {
  303.     static TextPromptInfo info;
  304.     static struct textPromptInfo values[3];
  305.     char bufA[16], bufB[16];
  306.     int width, height;
  307.     LocalInfo *l = (LocalInfo *) larg;
  308.  
  309.     XtVaGetValues(l->fat, XtNdrawWidth, &width,
  310.           XtNdrawHeight, &height,
  311.           NULL);
  312.  
  313.     info.prompts = values;
  314.     info.nprompt = 2;
  315.     info.title = "Enter the desired pattern size:";
  316.  
  317.     values[0].prompt = "Width:";
  318.     values[0].str = bufA;
  319.     values[0].len = 4;
  320.     values[1].prompt = "Height:";
  321.     values[1].str = bufB;
  322.     values[1].len = 4;
  323.  
  324.     sprintf(bufA, "%d", width);
  325.     sprintf(bufB, "%d", height);
  326.  
  327.     TextPrompt(w, "sizeselect", &info, (XtCallbackProc) sizeOkChoiceCallback,
  328.            NULL, larg);
  329. }
  330. static void 
  331. sizeCallback(Widget w, XtPointer larg, XtPointer junk)
  332. {
  333.     LocalInfo *l = (LocalInfo *) larg;
  334.     int width, height;
  335.     String lbl;
  336.  
  337.     if (l->curCheck == w)
  338.     return;
  339.  
  340.     XtVaGetValues(w, XtNlabel, &lbl, NULL);
  341.     width = -1;
  342.     height = -1;
  343.     sscanf(lbl, "%dx%d", &width, &height);
  344.     if (width <= 0 || height <= 0 || width >= 256 || height >= 256) {
  345.     Notice(w, "Invalid width/height specification must be between 0..256");
  346.     return;
  347.     }
  348.     MenuCheckItem(l->curCheck = w, True);
  349.  
  350.     /*
  351.     **  Just change the size, no OK
  352.      */
  353.     XtVaSetValues(l->fat, XtNdrawWidth, width,
  354.           XtNdrawHeight, height,
  355.           NULL);
  356.     XtVaSetValues(l->norm, XtNdrawWidth, width,
  357.           XtNdrawHeight, height,
  358.           NULL);
  359. }
  360. static void 
  361. gridCallback(Widget w, XtPointer larg, XtPointer junk)
  362. {
  363.     LocalInfo *l = (LocalInfo *) larg;
  364.     Boolean v;
  365.  
  366.     XtVaGetValues(l->fat, XtNgrid, &v, NULL);
  367.     v = !v;
  368.     XtVaSetValues(l->fat, XtNgrid, v, NULL);
  369.  
  370.     MenuCheckItem(w, v);
  371. }
  372.  
  373. void 
  374. PatternEdit(Widget w, Pixmap pix, Widget button)
  375. {
  376.     Widget shell, form, topf, norm, box, vp;
  377.     Widget color, fat, bar, cpick;
  378.     Widget okButton, cancelButton, grabButton, matchButton;
  379.     Colormap cmap;
  380.     Pixel pval = WhitePixelOfScreen(XtScreen(w));
  381.     LocalInfo *info = (LocalInfo *) XtMalloc(sizeof(LocalInfo));
  382.     Palette *map;
  383.     int width, height;
  384.     Position x, y;
  385.  
  386.     info->paint = w;
  387.     info->add = (pix == None);
  388.     info->iconList = button;
  389.  
  390.     StateShellBusy(w, True);
  391.     XtVaGetValues(GetShell(w), XtNcolormap, &cmap, XtNx, &x, XtNy, &y, NULL);
  392.     info->map = map = PaletteFind(w, cmap);
  393.  
  394.     shell = XtVaCreatePopupShell("pattern", transientShellWidgetClass,
  395.                  GetShell(w),
  396.                  XtNcolormap, cmap,
  397.                  XtNx, x + 24,
  398.                  XtNy, y + 24,
  399.                  NULL);
  400.     PaletteAddUser(map, shell);
  401.  
  402.     topf = XtVaCreateManagedWidget("form", formWidgetClass, shell,
  403.                    NULL);
  404.  
  405.     bar = MenuBarCreate(topf, XtNumber(menuBar), menuBar);
  406.  
  407.     form = XtVaCreateManagedWidget("box", formWidgetClass, topf,
  408.                    XtNfromVert, bar,
  409.                    XtNtop, XtChainTop,
  410.                    XtNbottom, XtChainBottom,
  411.                    NULL);
  412.     vp = XtVaCreateManagedWidget("viewport", viewportWidgetClass, form,
  413.                  XtNfromVert, bar,
  414.                  XtNallowVert, True,
  415.                  XtNallowHoriz, True,
  416.                  XtNuseBottom, True,
  417.                  XtNuseRight, True,
  418.                  XtNleft, XtChainLeft,
  419.                  XtNright, XtChainRight,
  420.                  NULL);
  421.     box = XtVaCreateManagedWidget("patternBox", boxWidgetClass, vp,
  422.                 XtNbackgroundPixmap, GetBackgroundPixmap(vp),
  423.                   XtNorientation, XtorientHorizontal,
  424.                   NULL);
  425.  
  426.     if (pix == None)
  427.     fat = XtVaCreateManagedWidget("paint", paintWidgetClass, box,
  428.                       XtNpixmap, pix,
  429.                       XtNdrawWidth, 24,
  430.                       XtNdrawHeight, 24,
  431.                       XtNfillRule, FillSolid,
  432.                       NULL);
  433.     else
  434.     fat = XtVaCreateManagedWidget("paint", paintWidgetClass, box,
  435.                       XtNpixmap, pix,
  436.                       XtNfillRule, FillSolid,
  437.                       NULL);
  438.     norm = XtVaCreateManagedWidget("norm", paintWidgetClass, box,
  439.                    XtNpaint, fat,
  440.                    XtNfillRule, FillSolid,
  441.                    XtNzoom, 1,
  442.                    NULL);
  443.     OperationSetPaint(fat);
  444.     ccpAddStdPopup(fat);
  445.  
  446.  
  447.     cpick = None;
  448. #ifndef VMS
  449.     if (!map->isMapped || !map->readonly || map->ncolors > 256)
  450. #else
  451.     if (!map->isMapped || !map->Readonly || map->ncolors > 256)
  452. #endif
  453.     cpick = ColorPickerPalette(form, map, &pval);
  454.  
  455.     if (map->isMapped) {
  456.     color = XtVaCreateManagedWidget("cedit", colormapWidgetClass, form,
  457.                     XtNwidth, 256,
  458.                     XtNheight, 256,
  459.                     XtNcolormap, cmap,
  460.                     XtNfromHoriz, vp,
  461.                     XtNleft, XtChainRight,
  462.                     XtNright, XtChainRight,
  463.                     NULL);
  464.     if (cpick != None)
  465.         XtVaSetValues(cpick, XtNfromHoriz, color,
  466.               XtNleft, XtChainRight,
  467.               NULL);
  468.     XtAddCallback(color, XtNcallback,
  469.               (XtCallbackProc) colorCallback, (XtPointer) info);
  470.     } else {
  471.     color = None;
  472.     if (cpick != None) {
  473.         XtVaSetValues(cpick, XtNfromHoriz, vp,
  474.               XtNleft, XtChainRight,
  475.               XtNright, XtChainRight,
  476.               NULL);
  477.         ColorPickerSetFunction(cpick,
  478.                (XtCallbackProc) cpickCallback, (XtPointer) info);
  479.     }
  480.     }
  481.  
  482.     info->cpick = cpick;
  483.     info->color = color;
  484.     info->fat = fat;
  485.     info->norm = norm;
  486.  
  487.     okButton = XtVaCreateManagedWidget("ok",
  488.                        commandWidgetClass, topf,
  489.                        XtNfromVert, form,
  490.                        XtNtop, XtChainBottom,
  491.                        XtNbottom, XtChainBottom,
  492.                        XtNleft, XtChainLeft,
  493.                        XtNright, XtChainLeft,
  494.                        NULL);
  495.  
  496.     cancelButton = XtVaCreateManagedWidget("cancel",
  497.                        commandWidgetClass, topf,
  498.                        XtNfromVert, form,
  499.                        XtNfromHoriz, okButton,
  500.                        XtNtop, XtChainBottom,
  501.                        XtNbottom, XtChainBottom,
  502.                        XtNleft, XtChainLeft,
  503.                        XtNright, XtChainLeft,
  504.                        NULL);
  505.     grabButton = XtVaCreateManagedWidget("grab",
  506.                      commandWidgetClass, topf,
  507.                      XtNfromVert, form,
  508.                      XtNfromHoriz, cancelButton,
  509.                      XtNtop, XtChainBottom,
  510.                      XtNbottom, XtChainBottom,
  511.                      XtNleft, XtChainLeft,
  512.                      XtNright, XtChainLeft,
  513.                      NULL);
  514.     matchButton = XtVaCreateManagedWidget("lookup",
  515.                       commandWidgetClass, topf,
  516.                       XtNfromVert, form,
  517.                       XtNfromHoriz, grabButton,
  518.                       XtNtop, XtChainBottom,
  519.                       XtNbottom, XtChainBottom,
  520.                       XtNleft, XtChainLeft,
  521.                       XtNright, XtChainLeft,
  522.                       NULL);
  523.  
  524.     ccpAddUndo(XtNameToWidget(bar, "edit.editMenu.undo"), fat);
  525.     ccpAddCut(XtNameToWidget(bar, "edit.editMenu.cut"), fat);
  526.     ccpAddCopy(XtNameToWidget(bar, "edit.editMenu.copy"), fat);
  527.     ccpAddPaste(XtNameToWidget(bar, "edit.editMenu.paste"), fat);
  528.     ccpAddClear(XtNameToWidget(bar, "edit.editMenu.clear"), fat);
  529.     ccpAddDuplicate(XtNameToWidget(bar, "edit.editMenu.dup"), fat);
  530.  
  531.     XtAddCallback(XtNameToWidget(bar, "edit.editMenu.all"),
  532.           XtNcallback, StdSelectAllCallback, (XtPointer) fat);
  533.  
  534.     XtAddCallback(XtNameToWidget(bar, "file.fileMenu.close"),
  535.           XtNcallback, closeCallback, (XtPointer) info);
  536.     XtAddCallback(XtNameToWidget(bar, "file.fileMenu.save"),
  537.           XtNcallback, StdSaveFile, (XtPointer) fat);
  538.     XtAddCallback(XtNameToWidget(bar, "file.fileMenu.read"),
  539.           XtNcallback, readCallback, (XtPointer) fat);
  540.  
  541.     XtAddCallback(sizeMenu[SZ_N1].widget,
  542.           XtNcallback, sizeCallback, (XtPointer) info);
  543.     XtAddCallback(sizeMenu[SZ_N2].widget,
  544.           XtNcallback, sizeCallback, (XtPointer) info);
  545.     XtAddCallback(sizeMenu[SZ_N3].widget,
  546.           XtNcallback, sizeCallback, (XtPointer) info);
  547.     XtAddCallback(sizeMenu[SZ_N4].widget,
  548.           XtNcallback, sizeCallback, (XtPointer) info);
  549.     XtAddCallback(sizeMenu[SZ_N5].widget,
  550.           XtNcallback, sizeCallback, (XtPointer) info);
  551.     XtAddCallback(sizeMenu[SZ_N6].widget,
  552.           XtNcallback, sizeChoiceCallback, (XtPointer) info);
  553.     XtAddCallback(imageMenu[0].widget,
  554.           XtNcallback, gridCallback, (XtPointer) info);
  555.  
  556.     info->sizeChecks[0] = sizeMenu[SZ_N1].widget;
  557.     info->sizeChecks[1] = sizeMenu[SZ_N2].widget;
  558.     info->sizeChecks[2] = sizeMenu[SZ_N3].widget;
  559.     info->sizeChecks[3] = sizeMenu[SZ_N4].widget;
  560.     info->sizeChecks[4] = sizeMenu[SZ_N5].widget;
  561.     info->sizeChecks[5] = sizeMenu[SZ_N6].widget;
  562.  
  563.     XtVaGetValues(info->fat, XtNdrawWidth, &width, XtNdrawHeight, &height, NULL);
  564.     cac(info, width, height);
  565.  
  566.     XtAddCallback(okButton, XtNcallback,
  567.           (XtCallbackProc) buttonCallback, (XtPointer) info);
  568.     XtAddCallback(cancelButton, XtNcallback,
  569.           (XtCallbackProc) closeCallback, (XtPointer) info);
  570.     AddDestroyCallback(shell, (DestroyCallbackFunc) closeCallback, info);
  571.     XtAddCallback(grabButton, XtNcallback,
  572.           (XtCallbackProc) grabCallback, (XtPointer) info);
  573.     XtAddCallback(matchButton, XtNcallback,
  574.           (XtCallbackProc) matchCallback, (XtPointer) info);
  575.  
  576.     XtPopup(shell, XtGrabNone);
  577.  
  578.     activePixel(info, 0);
  579.  
  580.     GraphicAdd(fat);
  581.     GraphicAdd(norm);
  582. }