*** drawing.c.orig Thu Nov 6 09:57:22 1997 --- drawing.c Thu Nov 6 09:57:22 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/drawing.c,v 3.19 1997/09/14 20:37:50 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/drawing.c,v 3.21 1997/11/06 05:52:38 william Exp $ */ *************** *** 95,98 **** --- 95,99 ---- #include "stretch.e" #include "text.e" + #include "util.e" #ifdef _TGIF_WB #include "wb1.e" *************** *** 1765,1768 **** --- 1766,1771 ---- strcmp(name, "LatestReleaseInfo()") == 0) { LatestReleaseInfo(); + } else if (strcmp(name, "VectorWarp()") == 0) { + VectorWarp(); } } *** exec.c.orig Thu Nov 6 09:57:25 1997 --- exec.c Thu Nov 6 09:57:25 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/exec.c,v 3.19 1997/10/08 13:56:01 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/exec.c,v 3.22 1997/11/06 14:38:00 william Exp $ */ *************** *** 242,245 **** --- 242,248 ---- int ExecFindObjNames ARGS_DECL((char**, struct ObjRec *, char*)); int ExecTokenize ARGS_DECL((char**, struct ObjRec *, char*)); + int ExecMoveAttrRel ARGS_DECL((char**, struct ObjRec *, char*)); + int ExecGetNumberOfVs ARGS_DECL((char**, struct ObjRec *, char*)); + int ExecIsObjTransformed ARGS_DECL((char**, struct ObjRec *, char*)); static *************** *** 335,338 **** --- 338,344 ---- { (void*)ExecFindObjNames, "find_obj_names", 3, 0}, { (void*)ExecTokenize, "tokenize", 3, 0}, + { (void*)ExecMoveAttrRel, "move_attr_relative", 3, 0}, + { (void*)ExecGetNumberOfVs, "get_number_of_vertices", 2, 0}, + { (void*)ExecIsObjTransformed, "is_obj_transformed", 2, 0}, { NULL, NULL, 0, 0 } }; *************** *** 415,424 **** if ((bang_ptr=strchr(obj_name, '!')) != NULL) { - if (OrigObj != NULL) { - if (!(OrigObj->type == OBJ_GROUP || OrigObj->type == OBJ_ICON || - OrigObj->type == OBJ_SYM)) { - return NULL; - } - } *bang_ptr = '\0'; if (OrigObj != NULL && strcmp(obj_name, "THIS") == 0) { --- 421,424 ---- *************** *** 455,459 **** if (pp_owner_obj != NULL) *pp_owner_obj = obj_ptr; if (pp_top_owner != NULL && bot_obj == botObj) { ! *pp_top_owner = OrigObj; } return FindObjWithName(obj_ptr->detail.r->last, obj_ptr, --- 455,459 ---- if (pp_owner_obj != NULL) *pp_owner_obj = obj_ptr; if (pp_top_owner != NULL && bot_obj == botObj) { ! *pp_top_owner = obj_ptr; } return FindObjWithName(obj_ptr->detail.r->last, obj_ptr, *************** *** 3072,3076 **** break; case DBL_VAL: ! sprintf(buf, "%.12lf", v.val.d); ReplaceAttrFirstValue(attr_owner_obj, attr_ptr, buf); break; --- 3072,3076 ---- break; case DBL_VAL: ! sprintf(buf, "%.12f", (float)(v.val.d)); ReplaceAttrFirstValue(attr_owner_obj, attr_ptr, buf); break; *************** *** 4323,4327 **** } d_val = (double)sqrt((double)d_val); ! sprintf(buf, "%.12lf", d_val); ReplaceAttrFirstValue(attr_owner_obj, attr_ptr, buf); return TRUE; --- 4323,4327 ---- } d_val = (double)sqrt((double)d_val); ! sprintf(buf, "%.12f", (float)(d_val)); ReplaceAttrFirstValue(attr_owner_obj, attr_ptr, buf); return TRUE; *************** *** 5334,5337 **** --- 5334,5451 ---- } CleanTmpStr(); + return TRUE; + } + + int ExecMoveAttrRel(argv, obj_ptr, orig_cmd) + char **argv, *orig_cmd; + struct ObjRec *obj_ptr; + /* move_attr_relative(attr_name,dx,dy); */ + { + char *attr_name=argv[0]; + char *dx_str=argv[1], *dy_str=argv[2]; + int dx, dy; + struct AttrRec *attr_ptr; + struct ObjRec *attr_owner_obj=NULL; + + UtilRemoveQuotes(attr_name); + + sprintf(execDummyStr, "%s=", attr_name); + attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, &attr_owner_obj); + if (attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + UtilRemoveQuotes(dx_str); + UtilRemoveQuotes(dy_str); + if (!IntExpression(dx_str, &dx, orig_cmd) || + !IntExpression(dy_str, &dy, orig_cmd)) { + return FALSE; + } + if (dx != 0 || dy != 0) { + struct ObjRec *text_obj_ptr=attr_ptr->obj; + int ltx, lty, rbx, rby; + + ltx = attr_owner_obj->bbox.ltx; + lty = attr_owner_obj->bbox.lty; + rbx = attr_owner_obj->bbox.rbx; + rby = attr_owner_obj->bbox.rby; + PrepareToReplaceAnObj(attr_owner_obj); + MoveObj(text_obj_ptr, dx, dy); + RecursivelyAdjObjBBox(attr_ptr->owner, attr_ptr->owner, attr_owner_obj); + RecordReplaceAnObj(attr_owner_obj); + RedrawAreas(botObj, ltx-GRID_ABS_SIZE(1), lty-GRID_ABS_SIZE(1), + rbx+GRID_ABS_SIZE(1), rby+GRID_ABS_SIZE(1), + attr_owner_obj->bbox.ltx-GRID_ABS_SIZE(1), + attr_owner_obj->bbox.lty-GRID_ABS_SIZE(1), + attr_owner_obj->bbox.rbx+GRID_ABS_SIZE(1), + attr_owner_obj->bbox.rby+GRID_ABS_SIZE(1)); + SetFileModified(TRUE); + } + return TRUE; + } + + int ExecGetNumberOfVs(argv, obj_ptr, orig_cmd) + char **argv, *orig_cmd; + struct ObjRec *obj_ptr; + /* get_number_of_vertices(result_attr,obj_name); */ + { + char *result_attr_name=argv[0], *obj_name=argv[1], buf[40]; + int count=0; + struct AttrRec *result_attr_ptr=NULL; + struct ObjRec *result_attr_owner_obj=NULL, *owner_obj=NULL, *named_obj=NULL; + + UtilRemoveQuotes(result_attr_name); + UtilRemoveQuotes(obj_name); + + named_obj = FindObjWithName(botObj, obj_ptr, obj_name, FALSE, + FALSE, &owner_obj, NULL); + if (named_obj == NULL) return BadObjName(obj_name, orig_cmd); + + sprintf(execDummyStr, "%s=", result_attr_name); + result_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, + &result_attr_owner_obj); + if (result_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + switch (named_obj->type) { + case OBJ_POLY: count = named_obj->detail.p->n; break; + case OBJ_POLYGON: count = named_obj->detail.g->n-1; break; + default: + sprintf(execDummyStr, "'%s' %s '%s' %s.", + obj_name, + "is neither a poly nor a polygon object when executing the", + orig_cmd, "command"); + MsgBox(execDummyStr, TOOL_NAME, INFO_MB); + return FALSE; + } + sprintf(buf, "%1d", count); + ReplaceAttrFirstValue(result_attr_owner_obj, result_attr_ptr, buf); + + SetFileModified(TRUE); + return TRUE; + } + + int ExecIsObjTransformed(argv, obj_ptr, orig_cmd) + char **argv, *orig_cmd; + struct ObjRec *obj_ptr; + /* is_obj_transformed(result_attr,obj_name); */ + { + char *result_attr_name=argv[0], *obj_name=argv[1], buf[40]; + struct AttrRec *result_attr_ptr=NULL; + struct ObjRec *result_attr_owner_obj=NULL, *owner_obj=NULL, *named_obj=NULL; + + UtilRemoveQuotes(result_attr_name); + UtilRemoveQuotes(obj_name); + + named_obj = FindObjWithName(botObj, obj_ptr, obj_name, FALSE, + FALSE, &owner_obj, NULL); + if (named_obj == NULL) return BadObjName(obj_name, orig_cmd); + strcpy(buf, (named_obj->ctm==NULL ? "0" : "1")); + + sprintf(execDummyStr, "%s=", result_attr_name); + result_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, + &result_attr_owner_obj); + if (result_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + ReplaceAttrFirstValue(result_attr_owner_obj, result_attr_ptr, buf); + + SetFileModified(TRUE); return TRUE; } *** expr.c.orig Thu Nov 6 09:57:27 1997 --- expr.c Thu Nov 6 09:57:27 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/expr.c,v 3.1 1997/09/14 20:37:51 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/expr.c,v 3.2 1997/11/06 14:38:00 william Exp $ */ *************** *** 922,927 **** break; case DBL_VAL: ! fprintf(stderr, " | DBL, %.3lf\n", ! v_ptr->v.val.d); break; case STR_VAL: --- 922,927 ---- break; case DBL_VAL: ! fprintf(stderr, " | DBL, %.3f\n", ! (float)(v_ptr->v.val.d)); break; case STR_VAL: *** file.c.orig Thu Nov 6 09:57:29 1997 --- file.c Thu Nov 6 09:57:29 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/file.c,v 3.32 1997/09/18 00:29:18 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/file.c,v 3.33 1997/10/24 03:14:35 william Exp $ */ *************** *** 405,417 **** ResetXPmErrorMessage(); GetPSFontStr(curFont, curStyle, font_str); ! if (TGIF_PATCHLEVEL == 0) { ! if (fprintf(FP, "%%TGIF %s\n", versionString) == EOF) { ! writeFileFailed = TRUE; ! } ! } else { ! if (fprintf(FP, "%%TGIF %s-p%1d\n", versionString, ! TGIF_PATCHLEVEL) == EOF) { ! writeFileFailed = TRUE; ! } } --- 405,411 ---- ResetXPmErrorMessage(); GetPSFontStr(curFont, curStyle, font_str); ! SetFullVersionString(); ! if (fprintf(FP, "%%TGIF %s\n", fullVersionString) == EOF) { ! writeFileFailed = TRUE; } *************** *** 4133,4148 **** writeFileFailed = TRUE; } ! if (TGIF_PATCHLEVEL == 0) { ! if (fprintf(dumpFP, "%%%%Creator: %s-%s by %s\n", ! TOOL_NAME, versionString, ! "William Chia-Wei Cheng (william@cs.UCLA.edu)") == EOF) { ! writeFileFailed = TRUE; ! } ! } else { ! if (fprintf(dumpFP, "%%%%Creator: %s-%s-p%1d by %s\n", ! TOOL_NAME, versionString, TGIF_PATCHLEVEL, ! "William Chia-Wei Cheng (william@cs.UCLA.edu)") == EOF) { ! writeFileFailed = TRUE; ! } } if (whereToPrint != LATEX_FIG && whereToPrint != EPSI_FILE) { --- 4127,4135 ---- writeFileFailed = TRUE; } ! SetFullVersionString(); ! if (fprintf(dumpFP, "%%%%Creator: %s by %s\n", ! fullToolName, ! "William Chia-Wei Cheng (william@cs.UCLA.edu)") == EOF) { ! writeFileFailed = TRUE; } if (whereToPrint != LATEX_FIG && whereToPrint != EPSI_FILE) { *** help.c.orig Thu Nov 6 09:57:31 1997 --- help.c Thu Nov 6 09:57:31 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/help.c,v 3.9 1997/09/14 20:37:52 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/help.c,v 3.10 1997/10/24 03:14:35 william Exp $ */ *************** *** 82,89 **** if (TGIF_PATCHLEVEL == 0) { ! sprintf(c_ptr, "%s Version %s", TOOL_NAME, versionString); } else { ! sprintf(c_ptr, "%s Version %s (patchlevel %1d)", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); } c_ptr = (&c_ptr[strlen(c_ptr)]); --- 82,99 ---- if (TGIF_PATCHLEVEL == 0) { ! if (*specialBuild == '\0') { ! sprintf(c_ptr, "%s Version %s", TOOL_NAME, versionString); ! } else { ! sprintf(c_ptr, "%s Version %s (%s)", TOOL_NAME, versionString, ! specialBuild); ! } } else { ! if (*specialBuild == '\0') { ! sprintf(c_ptr, "%s Version %s (patchlevel %1d)", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); ! } else { ! sprintf(c_ptr, "%s Version %s (patchlevel %1d - %s)", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL, specialBuild); ! } } c_ptr = (&c_ptr[strlen(c_ptr)]); *************** *** 200,217 **** "Please view", currentReleaseURL, "with a web browser"); } else if (TGIF_PATCHLEVEL == 0) { ! sprintf(gszMsgBox, "%s %s %s %s %s %s %s.\n\n%s %s %s.", ! TOOL_NAME, "is currently at", version_str, ! "and this", TOOL_NAME, "is Version", versionString, ! "For download information, please visit", ! (*final_url=='\0' ? currentReleaseURL : final_url), ! "with a web browser"); } else { ! sprintf(gszMsgBox, "%s %s %s %s %s %s %s %s %1d.\n\n%s %s %s.", ! TOOL_NAME, "is currently at", version_str, ! "and this", TOOL_NAME, "is Version", versionString, ! "Patchlevel", TGIF_PATCHLEVEL, ! "For download information, please visit", ! (*final_url=='\0' ? currentReleaseURL : final_url), ! "with a web browser"); } MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); --- 210,248 ---- "Please view", currentReleaseURL, "with a web browser"); } else if (TGIF_PATCHLEVEL == 0) { ! if (*specialBuild == '\0') { ! sprintf(gszMsgBox, "%s %s %s %s %s %s %s.\n\n%s %s %s.", ! TOOL_NAME, "is currently at", version_str, ! "and this", TOOL_NAME, "is Version", versionString, ! "For download information, please visit", ! (*final_url=='\0' ? currentReleaseURL : final_url), ! "with a web browser"); ! } else { ! sprintf(gszMsgBox, "%s %s %s %s %s %s %s (%s).\n\n%s %s %s.", ! TOOL_NAME, "is currently at", version_str, ! "and this", TOOL_NAME, "is Version", versionString, ! specialBuild, "For download information, please visit", ! (*final_url=='\0' ? currentReleaseURL : final_url), ! "with a web browser"); ! } } else { ! if (*specialBuild == '\0') { ! sprintf(gszMsgBox, ! "%s %s %s %s %s %s %s %s %1d.\n\n%s %s %s.", ! TOOL_NAME, "is currently at", version_str, ! "and this", TOOL_NAME, "is Version", versionString, ! "Patchlevel", TGIF_PATCHLEVEL, ! "For download information, please visit", ! (*final_url=='\0' ? currentReleaseURL : final_url), ! "with a web browser"); ! } else { ! sprintf(gszMsgBox, ! "%s %s %s %s %s %s %s %s %1d (%s).\n\n%s %s %s.", ! TOOL_NAME, "is currently at", version_str, ! "and this", TOOL_NAME, "is Version", versionString, ! "Patchlevel", TGIF_PATCHLEVEL, specialBuild, ! "For download information, please visit", ! (*final_url=='\0' ? currentReleaseURL : final_url), ! "with a web browser"); ! } } MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); *** imgproc.c.orig Thu Nov 6 09:57:33 1997 --- imgproc.c Thu Nov 6 09:57:33 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/imgproc.c,v 3.10 1997/09/14 20:37:53 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/imgproc.c,v 3.19 1997/11/06 05:59:59 william Exp $ */ *************** *** 61,66 **** --- 61,68 ---- #include "msg.e" #include "names.e" + #include "navigate.e" #include "obj.e" #include "page.e" + #include "poly.e" #include "polygon.e" #include "raster.e" *************** *** 117,122 **** #define IMAGEPROC_SUBTRACT 29 #define IMAGEPROC_ALPHACOMBINE 30 ! #define MAXIMAGEPROCS 31 int numImageProc=MAXIMAGEPROCS; --- 119,125 ---- #define IMAGEPROC_SUBTRACT 29 #define IMAGEPROC_ALPHACOMBINE 30 + #define IMAGEPROC_VECTORWARP 31 ! #define MAXIMAGEPROCS 32 int numImageProc=MAXIMAGEPROCS; *************** *** 127,130 **** --- 130,135 ---- char gszImageProcXPmFile[MAXPATHLENGTH+1]; + float gfVectorWarpSoftness=1.5; + static void *gpImageMapColorFunc=NULL; static void *gpConvolveFunc=NULL; *************** *** 169,172 **** --- 174,178 ---- "Subtract ", "AlphaCombine ", + "VectorWarp ", NULL }; *************** *** 203,206 **** --- 209,213 ---- "Subtract one image from another", "Combine 2 images using another image as the alpha channel", + "Warp selected image in a specified direction for a specified amount", NULL }; *************** *** 3886,3890 **** } ! /* ----------------------- Non-Image Processing ----------------------- */ /* ----------------------- RunBggen ----------------------- */ --- 3893,4891 ---- } ! /* ======================= Image Warping ======================= */ ! ! /* ----------------------- VectorWarp ----------------------- */ ! ! #define TRAP_NODE_LEAF 0 ! #define TRAP_NODE_PT 1 ! #define TRAP_NODE_SEG 2 ! ! #define TRAP_PT_L 0 ! #define TRAP_PT_T 1 ! #define TRAP_PT_R 2 ! #define TRAP_PT_B 3 ! #define TRAP_PT_C 4 ! ! #define TRAP_SEG_L 0 ! #define TRAP_SEG_T 1 ! #define TRAP_SEG_R 2 ! #define TRAP_SEG_B 3 ! ! #define TRAP_LEAF_LT 0 ! #define TRAP_LEAF_RT 1 ! #define TRAP_LEAF_LB 2 ! #define TRAP_LEAF_RB 3 ! ! typedef struct TrapMapSegRec { ! double m, b; /* y = mx + b */ ! } TrapMapSeg; ! ! typedef struct RevWarpXformRec { ! /* ! * x = X + x_coef ( X + w - f(x)W ) ( Y + h - g(y)H ) ! * y = Y + y_coef ( X + w - f(x)W ) ( Y + h - g(y)H ) ! * ! * [ 00 | 10 ] ! * where f(x)g(y) = [ ---+--- ] ! * [ 01 | 11 ] ! * ! * X and Y are in the warped domain and x and y are in the original domain ! * ! * x_coef = -dw / ( ( w + dw - f(x)W ) ( h + dh - g(y)H ) ) ! * y_coef = -dh / ( ( w + dw - f(x)W ) ( h + dh - g(y)H ) ) ! */ ! double x_coef, y_coef; ! } RevWarpXform; ! ! static IntPoint gaTrapMapPt[5]; ! static TrapMapSeg gaTrapMapSeg[4]; ! static int gaTrapMapLeaf[4]; ! ! typedef struct TrapMapRec { ! int type; /* TRAP_NODE_* */ ! union { ! struct { ! int which; /* TRAP_LEAF_* */ ! int *data; /* points to one of gaTrapMapLeaf */ ! } leaf; ! struct { ! int which; /* TRAP_PT_* */ ! IntPoint *data; /* points to one of gaTrapMapPt */ ! struct TrapMapRec *left, *right; ! } pt; ! struct { ! int which; /* TRAP_SEG_* */ ! TrapMapSeg *data; /* points to one of gaTrapMapSeg */ ! struct TrapMapRec *above, *below; ! } seg; ! } detail; ! } TrapMap; ! ! typedef struct TrapMapSpecRec { ! int type; ! int which; ! } TrapMapSpec; ! ! static TrapMapSpec gLeftTrapMapSpec[] = { ! /* ! * In-order specification of the trapezoidal map for Cx < Tx. ! */ ! { TRAP_NODE_PT, TRAP_PT_C }, ! { TRAP_NODE_SEG, TRAP_SEG_L }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LT }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LB }, ! { TRAP_NODE_PT, TRAP_PT_T }, ! { TRAP_NODE_SEG, TRAP_SEG_T }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LT }, ! { TRAP_NODE_SEG, TRAP_SEG_R }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RT }, ! { TRAP_NODE_SEG, TRAP_SEG_B }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RB }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LB }, ! { TRAP_NODE_SEG, TRAP_SEG_R }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RT }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RB }, ! { -1, -1 } ! }; ! ! static TrapMapSpec gRightTrapMapSpec[] = { ! /* ! * In-order specification of the trapezoidal map for Cx > Tx. ! */ ! { TRAP_NODE_PT, TRAP_PT_T }, ! { TRAP_NODE_SEG, TRAP_SEG_L }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LT }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LB }, ! { TRAP_NODE_PT, TRAP_PT_C }, ! { TRAP_NODE_SEG, TRAP_SEG_T }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RT }, ! { TRAP_NODE_SEG, TRAP_SEG_L }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LT }, ! { TRAP_NODE_SEG, TRAP_SEG_B }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LB }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RB }, ! { TRAP_NODE_SEG, TRAP_SEG_R }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RT }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RB }, ! { -1, -1 } ! }; ! ! static TrapMapSpec gCenterTrapMapSpec[] = { ! /* ! * In-order specification of the trapezoidal map for Cx == Tx. ! */ ! { TRAP_NODE_PT, TRAP_PT_T }, ! { TRAP_NODE_SEG, TRAP_SEG_L }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LT }, ! { TRAP_NODE_LEAF, TRAP_LEAF_LB }, ! { TRAP_NODE_SEG, TRAP_SEG_R }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RT }, ! { TRAP_NODE_LEAF, TRAP_LEAF_RB }, ! { -1, -1 } ! }; ! ! static TrapMap *gpTrapMap=NULL; ! static TrapMapSpec *gpTrapMapSpec=NULL; ! static int **gpSegYIntersects=NULL; ! static int **gpExtraYIntersects=NULL; ! ! static ! void CleanTrapMapNode(pTrapMapNode) ! TrapMap *pTrapMapNode; ! { ! switch (pTrapMapNode->type) { ! case TRAP_NODE_LEAF: break; ! case TRAP_NODE_PT: ! if (pTrapMapNode->detail.pt.left != NULL) { ! CleanTrapMapNode(pTrapMapNode->detail.pt.left); ! } ! if (pTrapMapNode->detail.pt.right != NULL) { ! CleanTrapMapNode(pTrapMapNode->detail.pt.right); ! } ! break; ! case TRAP_NODE_SEG: ! if (pTrapMapNode->detail.seg.above != NULL) { ! CleanTrapMapNode(pTrapMapNode->detail.seg.above); ! } ! if (pTrapMapNode->detail.seg.below != NULL) { ! CleanTrapMapNode(pTrapMapNode->detail.seg.below); ! } ! break; ! } ! free(pTrapMapNode); ! } ! ! static ! void CleanTrapMap() ! { ! if (gpTrapMap != NULL) { ! CleanTrapMapNode(gpTrapMap); ! } ! gpTrapMap = NULL; ! if (gpSegYIntersects != NULL) { ! int i; ! ! for (i=0; i < 4; i++) { ! if (gpSegYIntersects[i] != NULL) { ! free(gpSegYIntersects[i]); ! } ! } ! free(gpSegYIntersects); ! gpSegYIntersects = NULL; ! } ! if (gpExtraYIntersects != NULL) { ! int i; ! ! for (i=0; i < 4; i++) { ! if (gpExtraYIntersects[i] != NULL) { ! free(gpExtraYIntersects[i]); ! } ! } ! free(gpExtraYIntersects); ! gpExtraYIntersects = NULL; ! } ! } ! ! static int BuildTrapMapNode ARGS_DECL((TrapMapSpec*, int*, TrapMap*)); ! ! static ! int SetTrapMapLeaf(pTrapMapSpecRoot, pnIndex, pTrapMapNode, nWhich) ! TrapMapSpec *pTrapMapSpecRoot; ! int *pnIndex; ! TrapMap *pTrapMapNode; ! int nWhich; ! { ! pTrapMapNode->type = TRAP_NODE_LEAF; ! pTrapMapNode->detail.leaf.which = nWhich; ! pTrapMapNode->detail.leaf.data = (&gaTrapMapLeaf[nWhich]); ! return TRUE; ! } ! ! static ! int SetTrapMapPt(pTrapMapSpecRoot, pnIndex, pTrapMapNode, nWhich) ! TrapMapSpec *pTrapMapSpecRoot; ! int *pnIndex; ! TrapMap *pTrapMapNode; ! int nWhich; ! { ! pTrapMapNode->type = TRAP_NODE_PT; ! pTrapMapNode->detail.pt.which = nWhich; ! pTrapMapNode->detail.pt.data = (&gaTrapMapPt[nWhich]); ! pTrapMapNode->detail.pt.left = (TrapMap*)malloc(sizeof(TrapMap)); ! pTrapMapNode->detail.pt.right = (TrapMap*)malloc(sizeof(TrapMap)); ! if (pTrapMapNode->detail.pt.left == NULL || ! pTrapMapNode->detail.pt.right == NULL) { ! FailAllocMessage(); ! } ! memset(pTrapMapNode->detail.pt.left, 0, sizeof(TrapMap)); ! memset(pTrapMapNode->detail.pt.right, 0, sizeof(TrapMap)); ! (*pnIndex)++; ! if (!BuildTrapMapNode(pTrapMapSpecRoot, pnIndex, ! pTrapMapNode->detail.pt.left)) { ! return FALSE; ! } ! (*pnIndex)++; ! if (!BuildTrapMapNode(pTrapMapSpecRoot, pnIndex, ! pTrapMapNode->detail.pt.right)) { ! return FALSE; ! } ! return TRUE; ! } ! ! static ! int SetTrapMapSeg(pTrapMapSpecRoot, pnIndex, pTrapMapNode, nWhich) ! TrapMapSpec *pTrapMapSpecRoot; ! int *pnIndex; ! TrapMap *pTrapMapNode; ! int nWhich; ! { ! pTrapMapNode->type = TRAP_NODE_SEG; ! pTrapMapNode->detail.seg.which = nWhich; ! pTrapMapNode->detail.seg.data = (&gaTrapMapSeg[nWhich]); ! pTrapMapNode->detail.seg.above = (TrapMap*)malloc(sizeof(TrapMap)); ! pTrapMapNode->detail.seg.below = (TrapMap*)malloc(sizeof(TrapMap)); ! if (pTrapMapNode->detail.seg.above == NULL || ! pTrapMapNode->detail.seg.below == NULL) { ! FailAllocMessage(); ! } ! memset(pTrapMapNode->detail.seg.above, 0, sizeof(TrapMap)); ! memset(pTrapMapNode->detail.seg.below, 0, sizeof(TrapMap)); ! (*pnIndex)++; ! if (!BuildTrapMapNode(pTrapMapSpecRoot, pnIndex, ! pTrapMapNode->detail.seg.above)) { ! return FALSE; ! } ! (*pnIndex)++; ! if (!BuildTrapMapNode(pTrapMapSpecRoot, pnIndex, ! pTrapMapNode->detail.seg.below)) { ! return FALSE; ! } ! return TRUE; ! } ! ! static ! int BuildTrapMapNode(pTrapMapSpecRoot, pnIndex, pTrapMapNode) ! TrapMapSpec *pTrapMapSpecRoot; ! int *pnIndex; ! TrapMap *pTrapMapNode; ! { ! TrapMapSpec *pTrapMapSpec=(&pTrapMapSpecRoot[*pnIndex]); ! ! switch (pTrapMapSpec->type) { ! case TRAP_NODE_LEAF: ! return SetTrapMapLeaf(pTrapMapSpecRoot, pnIndex, pTrapMapNode, ! pTrapMapSpec->which); ! case TRAP_NODE_PT: ! return SetTrapMapPt(pTrapMapSpecRoot, pnIndex, pTrapMapNode, ! pTrapMapSpec->which); ! break; ! case TRAP_NODE_SEG: ! return SetTrapMapSeg(pTrapMapSpecRoot, pnIndex, pTrapMapNode, ! pTrapMapSpec->which); ! break; ! default: break; ! } ! return TRUE; ! } ! ! static ! int BuildTrapMap(pTrapMapSpec) ! TrapMapSpec *pTrapMapSpec; ! { ! int nIndex=0; ! ! gpTrapMap = (TrapMap*)malloc(sizeof(TrapMap)); ! if (gpTrapMap == NULL) FailAllocMessage(); ! memset(gpTrapMap, 0, sizeof(TrapMap)); ! if (BuildTrapMapNode(pTrapMapSpec, &nIndex, gpTrapMap)) { ! return TRUE; ! } ! CleanTrapMap(); ! return FALSE; ! } ! ! /* ! * L, T, R, B, C are points. Left subtree are to the left of the point. ! * sL, sT, sR, sB are line segments. Left subtree are above the line segment. ! * lt, rt, lb, rb are the quardrants (leaves of the tree). ! * ! * If Cx == Tx && Cy == Ly: Do not warp. ! * ! * If Cx < Tx: ! * ! * +-------T-------+ C ! * | | / \ ! * | sT | / \ ! * | | / \ ! * | C sR | sL T ! * L sL R / \ / \ ! * | | lt lb / \ ! * | sB | / \ ! * | | sT sR ! * | | / \ / \ ! * +-------B-------+ lt sR rt rb ! * / \ ! * rt sB ! * / \ ! * rb lb ! * If Cx > Tx: ! * ! * +-------T-------+ T ! * | | / \ ! * | sT | / \ ! * | | / \ ! * | sL C | sL C ! * L sR R / \ / \ ! * | | lt lb / \ ! * | sB | / \ ! * | | sT sR ! * | | / \ / \ ! * +-------B-------+ rt sL rt rb ! * / \ ! * lt sB ! * / \ ! * lb rb ! * If Cx == Tx: ! * ! * +-------T-------+ T ! * | | / \ ! * | sT | / \ ! * | | / \ ! * | sL C sR | sL sR ! * L R / \ / \ ! * | | lt lb rt rb ! * | sB | ! * | | ! * | | ! * +-------B-------+ ! */ ! ! static int **gnVectorWarpImageSrcIndex=NULL; ! static int **gnVectorWarpImageDestIndex=NULL; ! ! static ! int ConvolveToVectorWarp(x, y) ! int x, y; ! { ! return GetOrAllocHistogramIndex( ! &tgifColors[gnVectorWarpImageDestIndex[y][x]]); ! } ! ! static ! void CleanUpVectorWarpData() ! { ! int i, image_h=topSel->obj->detail.xpm->image_h; ! ! if (gnVectorWarpImageSrcIndex != NULL) { ! for (i=0; i < image_h; i++) { ! if (gnVectorWarpImageSrcIndex[i] != NULL) { ! free(gnVectorWarpImageSrcIndex[i]); ! } ! } ! free(gnVectorWarpImageSrcIndex); ! gnVectorWarpImageSrcIndex = NULL; ! } ! if (gnVectorWarpImageDestIndex != NULL) { ! for (i=0; i < image_h; i++) { ! if (gnVectorWarpImageDestIndex[i] != NULL) { ! free(gnVectorWarpImageDestIndex[i]); ! } ! } ! free(gnVectorWarpImageDestIndex); ! gnVectorWarpImageDestIndex = NULL; ! } ! } ! ! static ! void SetTrapMapSegValue(nSegIndex, nPtIndex, w) ! int nSegIndex, nPtIndex, w; ! { ! int i; ! double dx=(double)0.0, dy, m, b; ! ! dy = (double)(gaTrapMapPt[TRAP_PT_C].y - gaTrapMapPt[nPtIndex].y); ! if (gaTrapMapPt[TRAP_PT_C].x == gaTrapMapPt[nPtIndex].x) { ! dx = (double)0.0; ! m = (double)0.0; ! } else { ! dx = (double)(gaTrapMapPt[TRAP_PT_C].x - gaTrapMapPt[nPtIndex].x); ! m = ((double)dy) / ((double)dx); ! } ! b = ((double)(gaTrapMapPt[TRAP_PT_C].y)) - ! m * ((double)(gaTrapMapPt[TRAP_PT_C].x)); ! gaTrapMapSeg[nSegIndex].m = m; ! gaTrapMapSeg[nSegIndex].b = b; ! for (i=0; i < w; i++) { ! double y=m*((double)(i))+b; ! ! gpSegYIntersects[nSegIndex][i] = round(y); ! } ! } ! ! static ! void SetTrapMapExtraValue(nLeafIndex, end_x, end_y, w) ! int nLeafIndex, end_x, end_y, w; ! { ! int i; ! double dx=(double)0.0, dy, m, b; ! ! dy = (double)(gaTrapMapPt[TRAP_PT_C].y - end_y); ! if (gaTrapMapPt[TRAP_PT_C].x == end_x) { ! dx = (double)0.0; ! m = (double)0.0; ! } else { ! dx = (double)(gaTrapMapPt[TRAP_PT_C].x - end_x); ! m = ((double)dy) / ((double)dx); ! } ! b = ((double)(gaTrapMapPt[TRAP_PT_C].y)) - ! m * ((double)(gaTrapMapPt[TRAP_PT_C].x)); ! for (i=0; i < w; i++) { ! double y=m*((double)(i))+b; ! ! gpExtraYIntersects[nLeafIndex][i] = round(y); ! } ! } ! ! static ! int CheckVectorWarpCoords(pFromPt, pToPt, dx, dy, image_w, image_h, pBBox) ! IntPoint *pFromPt, *pToPt; ! int dx, dy, image_w, image_h; ! struct BBRec *pBBox; ! { ! IntPoint to_pt; ! double ddx, ddy, d; ! int i, diam, ltx, lty, rbx, rby, w, h; ! ! if (pFromPt->x < topSel->obj->obbox.ltx || ! pFromPt->y < topSel->obj->obbox.lty || ! pFromPt->x >= topSel->obj->obbox.rbx || ! pFromPt->y >= topSel->obj->obbox.rby) { ! sprintf(gszMsgBox, "%s.", ! "Please pick a starting point within the image boundary"); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! return FALSE; ! } else if (image_w <= 4 || image_h <= 4) { ! sprintf(gszMsgBox, "Image is too small for VectorWarp."); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! return FALSE; ! } ! to_pt.x = pFromPt->x+dx; ! to_pt.y = pFromPt->y+dy; ! if (to_pt.x < topSel->obj->obbox.ltx || ! to_pt.y < topSel->obj->obbox.lty || ! to_pt.x >= topSel->obj->obbox.rbx || ! to_pt.y >= topSel->obj->obbox.rby) { ! if (dx == 0) { ! if (dy > 0) { ! to_pt.y = topSel->obj->obbox.rby-1; ! } else { ! to_pt.y = topSel->obj->obbox.lty; ! } ! } else { ! double m, b, x_intersect, y_intersect; ! int intersect=CORNER_TOP; ! ! m = ((double)dy) / ((double)dx); ! b = ((double)(pFromPt->y)) - m * ((double)(pFromPt->x)); ! if (dx < 0) { ! y_intersect = m * ((double)(topSel->obj->obbox.ltx)) + b; ! if (y_intersect < topSel->obj->obbox.lty) { ! intersect = CORNER_TOP; ! } else if (y_intersect > topSel->obj->obbox.rby-1) { ! intersect = CORNER_BOTTOM; ! } else { ! intersect = CORNER_LEFT; ! } ! } else { ! y_intersect = m * ((double)(topSel->obj->obbox.rbx-1)) + b; ! if (y_intersect < topSel->obj->obbox.lty) { ! intersect = CORNER_TOP; ! } else if (y_intersect > topSel->obj->obbox.rby-1) { ! intersect = CORNER_BOTTOM; ! } else { ! intersect = CORNER_RIGHT; ! } ! } ! switch (intersect) { ! case CORNER_TOP: ! /* intersects the obbox at the top */ ! to_pt.y = topSel->obj->obbox.lty; ! x_intersect = (((double)(to_pt.y)) - b) / m; ! to_pt.x = round(x_intersect); ! if (to_pt.x < topSel->obj->obbox.ltx) { ! to_pt.x = topSel->obj->obbox.ltx; ! } else if (to_pt.x >= topSel->obj->obbox.rbx) { ! to_pt.x = topSel->obj->obbox.rbx-1; ! } ! break; ! case CORNER_BOTTOM: ! /* intersects the obbox at the bottom */ ! to_pt.y = topSel->obj->obbox.rby; ! x_intersect = (((double)(to_pt.y)) - b) / m; ! to_pt.x = round(x_intersect); ! if (to_pt.x < topSel->obj->obbox.ltx) { ! to_pt.x = topSel->obj->obbox.ltx; ! } else if (to_pt.x >= topSel->obj->obbox.rbx) { ! to_pt.x = topSel->obj->obbox.rbx-1; ! } ! break; ! case CORNER_LEFT: ! /* intersects the obbox at the left */ ! to_pt.x = topSel->obj->obbox.lty; ! y_intersect = (m * ((double)(to_pt.x))) + b; ! to_pt.y = round(y_intersect); ! if (to_pt.y < topSel->obj->obbox.lty) { ! to_pt.y = topSel->obj->obbox.lty; ! } else if (to_pt.y >= topSel->obj->obbox.rby) { ! to_pt.y = topSel->obj->obbox.rby-1; ! } ! break; ! case CORNER_RIGHT: ! /* intersects the obbox at the right */ ! to_pt.x = topSel->obj->obbox.rby; ! y_intersect = (m * ((double)(to_pt.x))) + b; ! to_pt.y = round(y_intersect); ! if (to_pt.y < topSel->obj->obbox.lty) { ! to_pt.y = topSel->obj->obbox.lty; ! } else if (to_pt.y >= topSel->obj->obbox.rby) { ! to_pt.y = topSel->obj->obbox.rby-1; ! } ! break; ! } ! } ! } ! ddx = (double)(to_pt.x - pFromPt->x); ! ddy = (double)(to_pt.y - pFromPt->y); ! d = ((double)gfVectorWarpSoftness)*(double)sqrt((double)(ddx*ddx+ddy*ddy)); ! diam = round(d); ! ltx = pFromPt->x-diam - topSel->obj->obbox.ltx; ! lty = pFromPt->y-diam - topSel->obj->obbox.lty; ! rbx = pFromPt->x+diam - topSel->obj->obbox.ltx; ! rby = pFromPt->y+diam - topSel->obj->obbox.lty; ! if (ltx < 0) ltx = 0; ! if (lty < 0) lty = 0; ! if (rbx >= image_w) rbx = image_w; ! if (rby >= image_h) rby = image_h; ! pBBox->ltx = ltx; pBBox->lty = lty; ! pBBox->rbx = rbx; pBBox->rby = rby; ! pFromPt->x -= topSel->obj->obbox.ltx; ! pFromPt->y -= topSel->obj->obbox.lty; ! pToPt->x = to_pt.x - topSel->obj->obbox.ltx; ! pToPt->y = to_pt.y - topSel->obj->obbox.lty; ! if (pToPt->x == pFromPt->x) { ! if (pToPt->y == pFromPt->y) { ! Msg("No warping!"); ! return FALSE; ! } ! gpTrapMapSpec = gCenterTrapMapSpec; ! } else if (pToPt->x < pFromPt->x) { ! gpTrapMapSpec = gLeftTrapMapSpec; ! } else { ! gpTrapMapSpec = gRightTrapMapSpec; ! } ! w = pBBox->rbx-pBBox->ltx; ! h = pBBox->rby-pBBox->lty; ! ! gpSegYIntersects = (int**)malloc(4*sizeof(int*)); ! gpExtraYIntersects = (int**)malloc(4*sizeof(int*)); ! if (gpSegYIntersects == NULL || gpExtraYIntersects == NULL) { ! FailAllocMessage(); ! if (gpSegYIntersects != NULL) free(gpSegYIntersects); ! if (gpExtraYIntersects != NULL) free(gpExtraYIntersects); ! return FALSE; ! } ! for (i=0; i < 4; i++) { ! gpSegYIntersects[i] = (int*)malloc(w*sizeof(int)); ! gpExtraYIntersects[i] = (int*)malloc(w*sizeof(int)); ! if (gpSegYIntersects[i] == NULL || gpExtraYIntersects[i] == NULL) { ! FailAllocMessage(); ! return FALSE; ! } ! memset(gpSegYIntersects[i], 0, w*sizeof(int)); ! memset(gpExtraYIntersects[i], 0, w*sizeof(int)); ! } ! ! /* sets L, T, R, B, and C points */ ! gaTrapMapPt[TRAP_PT_L].x = pBBox->ltx - pBBox->ltx; ! gaTrapMapPt[TRAP_PT_L].y = pFromPt->y - pBBox->lty; ! gaTrapMapPt[TRAP_PT_T].x = pFromPt->x - pBBox->ltx; ! gaTrapMapPt[TRAP_PT_T].y = pBBox->lty - pBBox->lty; ! gaTrapMapPt[TRAP_PT_R].x = pBBox->rbx - pBBox->ltx; ! gaTrapMapPt[TRAP_PT_R].y = pFromPt->y - pBBox->lty; ! gaTrapMapPt[TRAP_PT_B].x = pFromPt->x - pBBox->ltx; ! gaTrapMapPt[TRAP_PT_B].y = pBBox->rby - pBBox->lty; ! gaTrapMapPt[TRAP_PT_C].x = pToPt->x - pBBox->ltx; ! gaTrapMapPt[TRAP_PT_C].y = pToPt->y - pBBox->lty; ! ! /* sets sL, sT, sR, and sB line segments */ ! SetTrapMapSegValue(TRAP_SEG_L, TRAP_PT_L, w); ! SetTrapMapSegValue(TRAP_SEG_T, TRAP_PT_T, w); ! SetTrapMapSegValue(TRAP_SEG_R, TRAP_PT_R, w); ! SetTrapMapSegValue(TRAP_SEG_B, TRAP_PT_B, w); ! ! /* sets sL, sT, sR, and sB line segments */ ! SetTrapMapExtraValue(TRAP_LEAF_LT, 0, 0, w); ! SetTrapMapExtraValue(TRAP_LEAF_RT, w, 0, w); ! SetTrapMapExtraValue(TRAP_LEAF_LB, 0, h, w); ! SetTrapMapExtraValue(TRAP_LEAF_RB, w, h, w); ! ! /* sets lt, rt, lb, rb quardrants */ ! gaTrapMapLeaf[TRAP_LEAF_LT] = TRAP_LEAF_LT; ! gaTrapMapLeaf[TRAP_LEAF_RT] = TRAP_LEAF_RT; ! gaTrapMapLeaf[TRAP_LEAF_LB] = TRAP_LEAF_LB; ! gaTrapMapLeaf[TRAP_LEAF_RB] = TRAP_LEAF_RB; ! ! return TRUE; ! } ! ! static ! int GetQuadrant(pTrapMap, x, y) ! TrapMap *pTrapMap; ! int x, y; ! /* returns one of the TRAP_LEAF_*'s */ ! { ! switch (pTrapMap->type) { ! case TRAP_NODE_LEAF: ! return pTrapMap->detail.leaf.which; ! break; ! case TRAP_NODE_PT: ! if (x < pTrapMap->detail.pt.data->x) { ! return GetQuadrant(pTrapMap->detail.pt.left, x, y); ! } else { ! return GetQuadrant(pTrapMap->detail.pt.right, x, y); ! } ! break; ! case TRAP_NODE_SEG: ! if (y < gpSegYIntersects[pTrapMap->detail.seg.which][x]) { ! return GetQuadrant(pTrapMap->detail.seg.above, x, y); ! } else { ! return GetQuadrant(pTrapMap->detail.seg.below, x, y); ! } ! break; ! } ! return (-1); ! } ! ! /* ! * w w dw ! * +-----+ +-----+------+ ! * | o | warp | \ ! * h|(x,y)| ======> h| o \ ! * | | | (X,Y) \ X is also known as x_hat ! * +-----+ +__ \ Y is also known as y_hat ! * | \__ \ ! * dh| \__ \ ! * + \___\ ! * ! * w -> x_off, w+dw -> d_new_w, W -> d_bbox_w, x_hat -> new_x ! * h -> y_off, h+dh -> d_new_h, H -> d_bbox_h, y_hat -> new_y ! */ ! ! static ! int ComputeVectorWarpData(pFromPt, dx, dy) ! IntPoint *pFromPt; ! int dx, dy; ! { ! struct XPmRec *xpm_ptr=topSel->obj->detail.xpm; ! int i, image_w=xpm_ptr->image_w, image_h=xpm_ptr->image_h, target_percent; ! int bbox_w, bbox_h, x_off, y_off; ! double d_bbox_w, d_bbox_h, d_x_off, d_y_off, d_new_w, d_new_h, ddw, ddh; ! Pixmap pixmap=xpm_ptr->pixmap; ! XImage *image=NULL; ! struct BBRec bbox; /* only points within bbox need to be warped */ ! IntPoint to_pt; ! ! if (!CheckVectorWarpCoords(pFromPt, &to_pt, dx, dy, image_w, image_h, ! &bbox)) { ! return FALSE; ! } ! /* ! * w -> x_off, w+dw -> new_w, W -> bbox_w, x_hat -> new_x ! * h -> y_off, h+dh -> new_h, H -> bbox_h, y_hat -> new_y ! */ ! bbox_w = bbox.rbx - bbox.ltx; d_bbox_w = (double)bbox_w; ! bbox_h = bbox.rby - bbox.lty; d_bbox_h = (double)bbox_h; ! x_off = pFromPt->x - bbox.ltx; d_x_off = (double)x_off; ! y_off = pFromPt->y - bbox.lty; d_y_off = (double)y_off; ! d_new_w = (double)(to_pt.x - bbox.ltx); ! d_new_h = (double)(to_pt.y - bbox.lty); ! ddw = d_new_w - ((double)x_off); ! ddh = d_new_h - ((double)y_off); ! ! if (!BuildTrapMap(gpTrapMapSpec)) { ! return FALSE; ! } ! image = XGetImage(mainDisplay, pixmap, 0, 0, image_w, image_h, AllPlanes, ! ZPixmap); ! if (image == NULL) { ! FailAllocMessage(); ! return FALSE; ! } ! if (!CreatePixelToIndexMapping()) { ! XDestroyImage(image); ! return FALSE; ! } ! gnVectorWarpImageSrcIndex = (int**)malloc(image_h*sizeof(int*)); ! gnVectorWarpImageDestIndex = (int**)malloc(image_h*sizeof(int*)); ! if (gnVectorWarpImageSrcIndex == NULL || ! gnVectorWarpImageDestIndex == NULL) { ! if (gnVectorWarpImageSrcIndex != NULL) free(gnVectorWarpImageSrcIndex); ! if (gnVectorWarpImageDestIndex != NULL) free(gnVectorWarpImageDestIndex); ! FailAllocMessage(); ! XDestroyImage(image); ! free(gpnPixelToIndexMap); ! gpnPixelToIndexMap = NULL; ! return FALSE; ! } ! memset(gnVectorWarpImageSrcIndex, 0, image_h*sizeof(int*)); ! memset(gnVectorWarpImageDestIndex, 0, image_h*sizeof(int*)); ! target_percent = 5; ! for (i=0; i < image_h; i++) { ! int j; ! int percent=(i*10000/image_h)/100; ! ! if (percent >= target_percent) { ! sprintf(gszMsgBox, ! "Calculating new pixel values (pass 1): %1d%%", percent); ! SetStringStatus(gszMsgBox); ! XSync(mainDisplay, False); ! while (target_percent <= percent) { ! target_percent += 5; ! } ! } ! gnVectorWarpImageSrcIndex[i] = (int*)malloc(image_w*sizeof(int)); ! gnVectorWarpImageDestIndex[i] = (int*)malloc(image_w*sizeof(int)); ! if (gnVectorWarpImageSrcIndex[i] == NULL || ! gnVectorWarpImageDestIndex[i] == NULL) { ! FailAllocMessage(); ! for (j=0; j < i; j++) { ! if (gnVectorWarpImageSrcIndex[j] != NULL) { ! free(gnVectorWarpImageSrcIndex[j]); ! } ! } ! free(gnVectorWarpImageSrcIndex); ! gnVectorWarpImageSrcIndex = NULL; ! for (j=0; j < i; j++) { ! if (gnVectorWarpImageDestIndex[j] != NULL) { ! free(gnVectorWarpImageDestIndex[j]); ! } ! } ! free(gnVectorWarpImageDestIndex); ! gnVectorWarpImageDestIndex = NULL; ! XDestroyImage(image); ! free(gpnPixelToIndexMap); ! gpnPixelToIndexMap = NULL; ! return FALSE; ! } ! for (j=0; j < image_w; j++) { ! gnVectorWarpImageSrcIndex[i][j] = gnVectorWarpImageDestIndex[i][j] = ! gpnPixelToIndexMap[XGetPixel(image,j,i)]; ! } ! } ! target_percent = 5; ! srand(0); ! for (i=0; i < image_h; i++) { ! int j; ! int percent=(i*10000/image_h)/100; ! ! if (percent >= target_percent) { ! sprintf(gszMsgBox, ! "Calculating new pixel values (pass 2): %1d%%", percent); ! SetStringStatus(gszMsgBox); ! XSync(mainDisplay, False); ! while (target_percent <= percent) { ! target_percent += 5; ! } ! } ! if (i < bbox.lty || i >= bbox.rby) continue; ! for (j=0; j < image_w; j++) { ! int quadrant, new_x, new_y; ! ! if (j < bbox.ltx || j >= bbox.rbx) continue; ! ! new_x = j - bbox.ltx; ! new_y = i - bbox.lty; ! quadrant = GetQuadrant(gpTrapMap, new_x, new_y); ! if (quadrant != -1) { ! double d_new_x=(double)new_x, d_new_y=(double)new_y; ! double ddx=(double)0.0, ddy=(double)0.0, frac; ! int x, y, above; ! ! above = (new_y < gpExtraYIntersects[quadrant][new_x]); ! ! switch (quadrant) { ! case TRAP_LEAF_LT: ! if (above) { ! ddx = d_new_x - ddw*d_new_y/d_new_h; ! ddy = d_y_off*d_new_y/d_new_h; ! } else { ! ddx = d_x_off*d_new_x/d_new_w; ! ddy = d_new_y - ddh*d_new_x/d_new_w; ! } ! break; ! case TRAP_LEAF_RT: ! if (above) { ! ddx = d_new_x - ddw*d_new_y/d_new_h; ! ddy = d_y_off*d_new_y/d_new_h; ! } else { ! frac = (d_new_x-d_bbox_w)/(d_new_w-d_bbox_w); ! ddx = d_bbox_w - (d_bbox_w-d_x_off)*frac; ! ddy = d_new_y - ddh*frac; ! } ! break; ! case TRAP_LEAF_LB: ! if (above) { ! ddx = d_x_off*d_new_x/d_new_w; ! ddy = d_new_y - ddh*d_new_x/d_new_w; ! } else { ! frac = (d_new_y-d_bbox_h)/(d_new_h-d_bbox_h); ! ddx = d_new_x - ddw*frac; ! ddy = d_bbox_h - (d_bbox_h-d_y_off)*frac; ! } ! break; ! case TRAP_LEAF_RB: ! if (above) { ! frac = (d_new_x-d_bbox_w)/(d_new_w-d_bbox_w); ! ddx = d_bbox_w - (d_bbox_w-d_x_off)*frac; ! ddy = d_new_y - ddh*frac; ! } else { ! frac = (d_new_y-d_bbox_h)/(d_new_h-d_bbox_h); ! ddx = d_new_x - ddw*frac; ! ddy = d_bbox_h - (d_bbox_h-d_y_off)*frac; ! } ! break; ! } ! x = round(ddx); ! y = round(ddy); ! x += bbox.ltx; ! y += bbox.lty; ! if (x < bbox.ltx) x = bbox.ltx; ! if (x >= bbox.rbx) x = bbox.rbx-1; ! if (y < bbox.lty) y = bbox.lty; ! if (y >= bbox.rby) y = bbox.rby-1; ! gnVectorWarpImageDestIndex[i][j] = gnVectorWarpImageSrcIndex[y][x]; ! } ! } ! } ! XDestroyImage(image); ! free(gpnPixelToIndexMap); ! gpnPixelToIndexMap = NULL; ! return TRUE; ! } ! ! static ! int SpecifyLineSeg(pnFromAbsX, pnFromAbsY, pnToAbsX, pnToAbsY) ! int *pnFromAbsX, *pnFromAbsY, *pnToAbsX, *pnToAbsY; ! { ! int started=FALSE, done=FALSE, orig_x=0, orig_y=0, grid_x=0, grid_y=0; ! int root_x, root_y, saved_grid_on=gridOn; ! char buf[80]; ! unsigned int status; ! Window root_win, child_win; ! ! gridOn = FALSE; ! *buf = '\0'; ! SetMouseStatus("Start line segment...", "Cancel", "Cancel"); ! XGrabPointer(mainDisplay, drawWindow, FALSE, ! PointerMotionMask | ButtonPressMask | ButtonReleaseMask, ! GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime); ! XQueryPointer(mainDisplay, drawWindow, &root_win, &child_win, ! &root_x, &root_y, &orig_x, &orig_y, &status); ! GridXY(orig_x, orig_y, &grid_x, &grid_y); ! MarkRulers(grid_x, grid_y); ! orig_x = grid_x; ! orig_y = grid_y; ! while (!done) { ! XEvent input; ! ! XNextEvent(mainDisplay, &input); ! switch (input.type) { ! case Expose: ExposeEventHandler(&input, TRUE); break; ! case VisibilityNotify: ExposeEventHandler(&input, TRUE); break; ! case ButtonPress: ! if (input.xbutton.button == Button1) { ! MarkRulers(grid_x, grid_y); ! SetMouseStatus("End line segment", "", ""); ! GridXY(input.xbutton.x, input.xbutton.y, &grid_x, &grid_y); ! orig_x = grid_x; ! orig_y = grid_y; ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, orig_x, orig_y, ! grid_x, grid_y); ! MarkRulers(grid_x, grid_y); ! started = TRUE; ! } else { ! XUngrabPointer(mainDisplay, CurrentTime); ! XSync(mainDisplay, False); ! done = TRUE; ! started = FALSE; ! } ! break; ! case MotionNotify: ! MarkRulers(grid_x, grid_y); ! if (started) { ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, orig_x, orig_y, ! grid_x, grid_y); ! } ! GridXY(input.xmotion.x, input.xmotion.y, &grid_x, &grid_y); ! if (started) { ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, orig_x, orig_y, ! grid_x, grid_y); ! } ! MarkRulers(grid_x, grid_y); ! break; ! case ButtonRelease: ! XUngrabPointer(mainDisplay, CurrentTime); ! XSync(mainDisplay, False); ! done = TRUE; ! MarkRulers(grid_x, grid_y); ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, orig_x, orig_y, ! grid_x, grid_y); ! } ! } ! gridOn = saved_grid_on; ! if (started && !(orig_x == grid_x && orig_y == grid_y)) { ! *pnFromAbsX = ABS_X(orig_x); ! *pnFromAbsY = ABS_Y(orig_y); ! *pnToAbsX = ABS_X(grid_x); ! *pnToAbsY = ABS_Y(grid_y); ! return TRUE; ! } ! return FALSE; ! } ! ! void VectorWarp() ! { ! int ok=FALSE; ! IntPoint from_pt, to_pt; ! ! if (!CheckSelectionForImageProc( ! imageProcMenuStr[IMAGEPROC_VECTORWARP])) { ! return; ! } ! HighLightReverse(); ! SaveStatusStrings(); ! ok = SpecifyLineSeg(&from_pt.x, &from_pt.y, &to_pt.x, &to_pt.y); ! RestoreStatusStrings(); ! HighLightForward(); ! ! if (!ok) { ! return; ! } ! if (!ComputeVectorWarpData(&from_pt, to_pt.x-from_pt.x, to_pt.y-from_pt.y)) { ! CleanTrapMap(); ! return; ! } ! CleanTrapMap(); ! ! gpConvolveFunc = (void*)ConvolveToVectorWarp; ! gnConvolving = TRUE; ! DoImageProc(NULL); ! gnConvolving = FALSE; ! gpConvolveFunc = NULL; ! ! CleanUpVectorWarpData(); ! } ! ! /* ======================= Non-Image Processing ======================= */ /* ----------------------- RunBggen ----------------------- */ *************** *** 5786,5789 **** --- 6787,6791 ---- case IMAGEPROC_SUBTRACT: Subtract(); break; case IMAGEPROC_ALPHACOMBINE: AlphaCombine(); break; + case IMAGEPROC_VECTORWARP: VectorWarp(); break; } } *** mainloop.c.orig Thu Nov 6 09:57:35 1997 --- mainloop.c Thu Nov 6 09:57:35 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/mainloop.c,v 3.18 1997/09/17 15:57:51 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/mainloop.c,v 3.19 1997/10/24 03:14:35 william Exp $ */ *************** *** 837,844 **** if (TGIF_PATCHLEVEL == 0) { ! sprintf(szMsg1, "%s Version %s", TOOL_NAME, versionString); } else { ! sprintf(szMsg1, "%s Version %s (patchlevel %1d)", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); } sprintf(szMsg2, "%s %s", copyrightString, "(william@cs.UCLA.edu)"); --- 837,854 ---- if (TGIF_PATCHLEVEL == 0) { ! if (*specialBuild == '\0') { ! sprintf(szMsg1, "%s Version %s", TOOL_NAME, versionString); ! } else { ! sprintf(szMsg1, "%s Version %s (%s)", TOOL_NAME, versionString, ! specialBuild); ! } } else { ! if (*specialBuild == '\0') { ! sprintf(szMsg1, "%s Version %s (patchlevel %1d)", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); ! } else { ! sprintf(szMsg1, "%s Version %s (patchlevel %1d - %s)", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL, specialBuild); ! } } sprintf(szMsg2, "%s %s", copyrightString, "(william@cs.UCLA.edu)"); *** menu.c.orig Thu Nov 6 09:57:37 1997 --- menu.c Thu Nov 6 09:57:37 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/menu.c,v 3.9 1997/09/14 20:37:54 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/menu.c,v 3.10 1997/10/24 03:14:35 william Exp $ */ *************** *** 1065,1073 **** } if (showVersion) { ! if (TGIF_PATCHLEVEL == 0) { ! sprintf(s, "%s-%s", TOOL_NAME, versionString); ! } else { ! sprintf(s, "%s-%s-p%1d", TOOL_NAME, versionString, TGIF_PATCHLEVEL); ! } len = strlen(s); --- 1065,1070 ---- } if (showVersion) { ! SetFullVersionString(); ! strcpy(s, fullToolName); len = strlen(s); *** msg.c.orig Thu Nov 6 09:57:39 1997 --- msg.c Thu Nov 6 09:57:39 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/msg.c,v 3.14 1997/09/18 00:29:58 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/msg.c,v 3.15 1997/10/24 03:14:35 william Exp $ */ *************** *** 887,894 **** { if (TGIF_PATCHLEVEL == 0) { ! fprintf(stderr, "%s Version %s\n", TOOL_NAME, versionString); } else { ! fprintf(stderr, "%s Version %s (patchlevel %1d)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); } fprintf(stderr, "%s\n\n", copyrightString); --- 887,904 ---- { if (TGIF_PATCHLEVEL == 0) { ! if (*specialBuild == '\0') { ! fprintf(stderr, "%s Version %s\n", TOOL_NAME, versionString); ! } else { ! fprintf(stderr, "%s Version %s (%s)\n", TOOL_NAME, versionString, ! specialBuild); ! } } else { ! if (*specialBuild == '\0') { ! fprintf(stderr, "%s Version %s (patchlevel %1d)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); ! } else { ! fprintf(stderr, "%s Version %s (patchlevel %1d - %s)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL, specialBuild); ! } } fprintf(stderr, "%s\n\n", copyrightString); *************** *** 958,965 **** if (show_copyright) { if (TGIF_PATCHLEVEL == 0) { ! fprintf(stderr, "%s Version %s\n", TOOL_NAME, versionString); } else { ! fprintf(stderr, "%s Version %s (patchlevel %1d)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); } fprintf(stderr, "%s\n\n", copyrightString); --- 968,985 ---- if (show_copyright) { if (TGIF_PATCHLEVEL == 0) { ! if (*specialBuild == '\0') { ! fprintf(stderr, "%s Version %s\n", TOOL_NAME, versionString); ! } else { ! fprintf(stderr, "%s Version %s (%s)\n", TOOL_NAME, versionString, ! specialBuild); ! } } else { ! if (*specialBuild == '\0') { ! fprintf(stderr, "%s Version %s (patchlevel %1d)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); ! } else { ! fprintf(stderr, "%s Version %s (patchlevel %1d - %s)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL, specialBuild); ! } } fprintf(stderr, "%s\n\n", copyrightString); *** rect.c.orig Thu Nov 6 09:57:40 1997 --- rect.c Thu Nov 6 09:57:40 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/rect.c,v 3.4 1997/09/17 00:23:34 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/rect.c,v 3.5 1997/10/26 21:22:00 william Exp $ */ *************** *** 48,51 **** --- 48,89 ---- #include "setup.e" #include "spline.e" + + void SetPoint(pt, x, y) + IntPoint *pt; + int x, y; + { + pt->x = x; + pt->y = y; + } + + void ClipRect(bbox, w, h) + struct BBRec *bbox; + int w, h; + { + if (bbox->ltx < 0) { + bbox->rbx += bbox->ltx; + bbox->ltx = 0; + } + if (bbox->lty < 0) { + bbox->rby += bbox->lty; + bbox->lty = 0; + } + if (bbox->rbx >= w) { + bbox->rbx = w - 1; + } + if (bbox->rby >= h) { + bbox->rby = h - 1; + } + } + + void SetRect(bbox, ltx, lty, rbx, rby) + struct BBRec *bbox; + int ltx, lty, rbx, rby; + { + bbox->ltx = ltx; + bbox->lty = lty; + bbox->rbx = rbx; + bbox->rby = rby; + } void SetRotateVs(vs, ltx, lty, rbx, rby) *** remote.c.orig Thu Nov 6 09:57:42 1997 --- remote.c Thu Nov 6 09:57:42 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/remote.c,v 3.7 1997/09/15 16:43:15 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/remote.c,v 3.8 1997/10/24 03:14:35 william Exp $ */ *************** *** 87,92 **** char agent_name[128]; ! sprintf(agent_name, "%s/%s patchlevel/%1d", TOOL_NAME, versionString, ! TGIF_PATCHLEVEL); return UtilStrCpy(psz_buf, buf_sz, agent_name); } --- 87,97 ---- char agent_name[128]; ! if (*specialBuild == '\0') { ! sprintf(agent_name, "%s/%s patchlevel/%1d", TOOL_NAME, versionString, ! TGIF_PATCHLEVEL); ! } else { ! sprintf(agent_name, "%s/%s patchlevel/%1d-%s", TOOL_NAME, versionString, ! TGIF_PATCHLEVEL, specialBuild); ! } return UtilStrCpy(psz_buf, buf_sz, agent_name); } *** setup.c.orig Thu Nov 6 09:57:44 1997 --- setup.c Thu Nov 6 09:57:44 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/setup.c,v 3.22 1997/09/17 01:40:59 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/setup.c,v 3.24 1997/11/06 05:36:04 william Exp $ */ *************** *** 1028,1031 **** --- 1028,1050 ---- NULL && UtilStrICmp(c_ptr, "true") == 0) { titledPinnedMenu = TRUE; + } + gfVectorWarpSoftness = (float)1.5; + if ((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"VectorWarpSoftness")) != + NULL) { + if (sscanf(c_ptr, "%f", &gfVectorWarpSoftness) != 1) { + fprintf(stderr, "Invalid %s*VectorWarpSoftness: '%s', %s.\n", + TOOL_NAME, c_ptr, "1.5 is used"); + gfVectorWarpSoftness = (float)1.5; + } else if (gfVectorWarpSoftness > 4.0) { + fprintf(stderr, + "Invalid %s*VectorWarpSoftness (too large): '%s', %s.\n", + TOOL_NAME, c_ptr, "4.0 is used"); + gfVectorWarpSoftness = (float)4.0; + } else if (gfVectorWarpSoftness < 1.0) { + fprintf(stderr, + "Invalid %s*VectorWarpSoftness (too small): '%s', %s.\n", + TOOL_NAME, c_ptr, "1.0 is used"); + gfVectorWarpSoftness = (float)1.0; + } } *** shortcut.c.orig Thu Nov 6 09:57:45 1997 --- shortcut.c Thu Nov 6 09:57:45 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/shortcut.c,v 3.12 1997/09/14 20:37:59 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/shortcut.c,v 3.13 1997/10/28 02:26:15 william Exp $ */ *************** *** 294,297 **** --- 294,298 ---- { '\0', 0, "CurrentVersionInfo()", 0, }, { '\0', 0, "LatestReleaseInfo()", 0, }, + { '\0', 0, "VectorWarp()", 0, }, { '\0', 0, "", 0 } }; *** stretch.c.orig Thu Nov 6 09:57:47 1997 --- stretch.c Thu Nov 6 09:57:47 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/stretch.c,v 3.14 1997/09/17 02:28:20 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/stretch.c,v 3.16 1997/10/23 18:58:08 william Exp $ */ *************** *** 324,329 **** case OBJ_BOX: case OBJ_GROUP: - case OBJ_SYM: case OBJ_ICON: case OBJ_OVAL: case OBJ_ARC: --- 324,329 ---- case OBJ_BOX: case OBJ_GROUP: case OBJ_ICON: + case OBJ_SYM: case OBJ_OVAL: case OBJ_ARC: *************** *** 917,922 **** switch (ObjPtr->type) { case OBJ_GROUP: - case OBJ_SYM: case OBJ_ICON: for (obj_ptr=ObjPtr->detail.r->first; obj_ptr != NULL; obj_ptr=obj_ptr->next) { --- 917,922 ---- switch (ObjPtr->type) { case OBJ_GROUP: case OBJ_ICON: + case OBJ_SYM: for (obj_ptr=ObjPtr->detail.r->first; obj_ptr != NULL; obj_ptr=obj_ptr->next) { *************** *** 1281,1286 **** break; case OBJ_GROUP: - case OBJ_SYM: case OBJ_ICON: for (obj_ptr=ObjPtr->detail.r->first; obj_ptr != NULL; obj_ptr=obj_ptr->next) { --- 1281,1286 ---- break; case OBJ_GROUP: case OBJ_ICON: + case OBJ_SYM: for (obj_ptr=ObjPtr->detail.r->first; obj_ptr != NULL; obj_ptr=obj_ptr->next) { *************** *** 1838,1844 **** case OBJ_GROUP: case OBJ_ICON: case OBJ_ARC: case OBJ_RCBOX: - case OBJ_SYM: case OBJ_XBM: case OBJ_XPM: --- 1838,1844 ---- case OBJ_GROUP: case OBJ_ICON: + case OBJ_SYM: case OBJ_ARC: case OBJ_RCBOX: case OBJ_XBM: case OBJ_XPM: *************** *** 1882,1935 **** int Corner, XScale, YScale; { ! register struct SelRec *sel_ptr; ! register struct BBRec *obbox; for (sel_ptr=topSel; sel_ptr != NULL; sel_ptr=sel_ptr->next) { if (!sel_ptr->obj->locked) { ! obbox = &(sel_ptr->obj->obbox); ! switch (Corner) ! { ! case CORNER_NONE: ! moveX = absPivotX = (obbox->ltx+obbox->rbx)>>1; ! moveY = absPivotY = (obbox->lty+obbox->rby)>>1; ! break; ! case CORNER_LT: ! absPivotX = obbox->rbx; absPivotY = obbox->rby; ! moveX = obbox->ltx; moveY = obbox->lty; ! break; ! case CORNER_TOP: ! moveX = absPivotX = (obbox->ltx+obbox->rbx)>>1; ! absPivotY = obbox->rby; ! moveY = obbox->lty; ! break; ! case CORNER_RT: ! absPivotX = obbox->ltx; absPivotY = obbox->rby; ! moveX = obbox->rbx; moveY = obbox->lty; ! break; ! case CORNER_RIGHT: ! absPivotX = obbox->ltx; ! moveX = obbox->rbx; ! moveY = absPivotY = (obbox->lty+obbox->rby)>>1; ! break; ! case CORNER_RB: ! absPivotX = obbox->ltx; absPivotY = obbox->lty; ! moveX = obbox->rbx; moveY = obbox->rby; ! break; ! case CORNER_BOTTOM: ! moveX = absPivotX = (obbox->ltx+obbox->rbx)>>1; ! absPivotY = obbox->lty; ! moveY = obbox->rby; ! break; ! case CORNER_LB: ! absPivotX = obbox->rbx; absPivotY = obbox->lty; ! moveX = obbox->ltx; moveY = obbox->rby; ! break; ! case CORNER_LEFT: ! absPivotX = obbox->rbx; ! moveX = obbox->ltx; ! moveY = absPivotY = (obbox->lty+obbox->rby)>>1; ! break; ! } ! StretchObj (sel_ptr->obj, Corner, XScale, YScale); } } --- 1882,1890 ---- int Corner, XScale, YScale; { ! struct SelRec *sel_ptr; for (sel_ptr=topSel; sel_ptr != NULL; sel_ptr=sel_ptr->next) { if (!sel_ptr->obj->locked) { ! StretchObj(sel_ptr->obj, Corner, XScale, YScale); } } *************** *** 2115,2119 **** changeX = (fabs(multX-1.0) > 1.0e-6); changeY = (fabs(multY-1.0) > 1.0e-6); ! ScaleAllSel(CORNER_RB); horiAlign = saved_h_align; vertAlign = saved_v_align; --- 2070,2074 ---- changeX = (fabs(multX-1.0) > 1.0e-6); changeY = (fabs(multY-1.0) > 1.0e-6); ! ScaleAllSel(CORNER_RB, (int)(multX * 1000.0), (int)(multY * 1000.0)); horiAlign = saved_h_align; vertAlign = saved_v_align; *************** *** 2290,2295 **** break; case OBJ_GROUP: - case OBJ_SYM: case OBJ_ICON: obj_ptr = ObjPtr->detail.r->first; for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) { --- 2245,2250 ---- break; case OBJ_GROUP: case OBJ_ICON: + case OBJ_SYM: obj_ptr = ObjPtr->detail.r->first; for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) { *************** *** 2502,2507 **** break; case OBJ_GROUP: - case OBJ_SYM: case OBJ_ICON: obj_ptr = ObjPtr->detail.r->first; for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) { --- 2457,2462 ---- break; case OBJ_GROUP: case OBJ_ICON: + case OBJ_SYM: obj_ptr = ObjPtr->detail.r->first; for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) { *************** *** 2637,2642 **** switch (ObjPtr->type) { case OBJ_GROUP: - case OBJ_SYM: case OBJ_ICON: for (obj_ptr=ObjPtr->detail.r->first; obj_ptr != NULL; obj_ptr=obj_ptr->next) { --- 2592,2597 ---- switch (ObjPtr->type) { case OBJ_GROUP: case OBJ_ICON: + case OBJ_SYM: for (obj_ptr=ObjPtr->detail.r->first; obj_ptr != NULL; obj_ptr=obj_ptr->next) { *** text.c.orig Thu Nov 6 09:57:49 1997 --- text.c Thu Nov 6 09:57:49 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/text.c,v 3.20 1997/10/03 20:28:26 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/text.c,v 3.21 1997/11/06 05:54:01 william Exp $ */ *************** *** 55,58 **** --- 55,59 ---- #include "mainloop.e" #include "mark.e" + #include "move.e" #include "msg.e" #include "names.e" *** util.c.orig Thu Nov 6 09:57:51 1997 --- util.c Thu Nov 6 09:57:51 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/util.c,v 3.5 1997/10/06 13:44:44 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/util.c,v 3.6 1997/10/24 02:38:43 william Exp $ */ *************** *** 105,109 **** { register int len; - register char *c_ptr; for (len=strlen(pszStr)-1; len >= 0; len--) { --- 105,108 ---- *** version.c.orig Thu Nov 6 09:57:52 1997 --- version.c Thu Nov 6 09:57:52 1997 *************** *** 28,34 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/version.c,v 3.4 1997/09/14 20:38:03 william Exp $ */ #ifndef _NO_EXTERN #include "version.e" --- 28,37 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/version.c,v 3.6 1997/10/24 02:54:40 william Exp $ */ + #include "const.h" + #include "patchlvl.h" + #ifndef _NO_EXTERN #include "version.e" *************** *** 36,42 **** char *versionString="3.0"; - char *betaString=""; char *copyrightString="Copyright (C) 1990-1997, William Chia-Wei Cheng"; char *homePageURL="http://bourbon.cs.umd.edu:8001/tgif/"; char *currentReleaseURL="http://bourbon.cs.umd.edu:8001/tgif/current.html"; char *hyperGraphicsURL="http://bourbon.cs.umd.edu:8001/tgif/index.obj"; --- 39,68 ---- char *versionString="3.0"; char *copyrightString="Copyright (C) 1990-1997, William Chia-Wei Cheng"; char *homePageURL="http://bourbon.cs.umd.edu:8001/tgif/"; char *currentReleaseURL="http://bourbon.cs.umd.edu:8001/tgif/current.html"; char *hyperGraphicsURL="http://bourbon.cs.umd.edu:8001/tgif/index.obj"; + + char fullVersionString[MAXSTRING]; + char fullToolName[MAXSTRING]; + char *specialBuild=""; + + void SetFullVersionString() + { + if (TGIF_PATCHLEVEL == 0) { + if (*specialBuild == '\0') { + sprintf(fullVersionString, "%s", versionString); + } else { + sprintf(fullVersionString, "%s-%s", versionString, specialBuild); + } + } else { + if (*specialBuild == '\0') { + sprintf(fullVersionString, "%s-p%1d", versionString, TGIF_PATCHLEVEL); + } else { + sprintf(fullVersionString, "%s-p%1d-%s", versionString, + TGIF_PATCHLEVEL, specialBuild); + } + } + sprintf(fullToolName, "%s-%s", TOOL_NAME, fullVersionString); + } + *** wb3.c.orig Thu Nov 6 09:57:53 1997 --- wb3.c Thu Nov 6 09:57:53 1997 *************** *** 2,6 **** * Author: Renato Santana, in January, 1996. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/wb3.c,v 3.2 1996/10/31 03:31:53 william Exp $ */ --- 2,6 ---- * Author: Renato Santana, in January, 1996. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/wb3.c,v 3.3 1997/10/24 03:14:35 william Exp $ */ *************** *** 1222,1231 **** GetPSFontStr (curFont, curStyle, font_str); ! if (TGIF_PATCHLEVEL == 0) { ! sprintf (buff, "%s%%TGIF %s\n", buff, versionString); ! } else { ! sprintf (buff, "%s%%TGIF %s-p%1d\n", buff, versionString, ! TGIF_PATCHLEVEL); ! } sprintf (buff, "%sstate(%1d,%1d,%.3f,", buff, pageStyle, CUR_VERSION, --- 1222,1227 ---- GetPSFontStr (curFont, curStyle, font_str); ! SetFullVersionString(); ! sprintf (buff, "%s%%TGIF %s\n", buff, fullVersionString); sprintf (buff, "%sstate(%1d,%1d,%.3f,", buff, pageStyle, CUR_VERSION, *** xbitmap.c.orig Thu Nov 6 09:57:55 1997 --- xbitmap.c Thu Nov 6 09:57:55 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/xbitmap.c,v 3.20 1997/09/17 05:52:24 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/xbitmap.c,v 3.24 1997/11/06 06:00:44 william Exp $ */ *************** *** 67,70 **** --- 67,71 ---- #include "raster.e" #include "rect.e" + #include "remote.e" #include "select.e" #include "setup.e" *************** *** 625,631 **** int abs_offset_x=ObjPtr->obbox.ltx-ObjPtr->x; int abs_offset_y=ObjPtr->obbox.lty-ObjPtr->y; ! double sx=(((double)xbm_ptr->eps_w)/((double)image_w)); ! double sy=(((double)xbm_ptr->eps_h)/((double)image_h)); target_percent = 5; for (r = 0; r < num_rows; r++) --- 626,635 ---- int abs_offset_x=ObjPtr->obbox.ltx-ObjPtr->x; int abs_offset_y=ObjPtr->obbox.lty-ObjPtr->y; ! double sx=(double)0.0, sy=(double)0.0; + if (xbm_ptr->real_type != XBM_XBM) { + sx = (((double)xbm_ptr->eps_w)/((double)image_w)); + sy = (((double)xbm_ptr->eps_h)/((double)image_h)); + } target_percent = 5; for (r = 0; r < num_rows; r++) *************** *** 650,657 **** ReverseTransformPointThroughCTM(x, y, ObjPtr->ctm, &new_x, &new_y); ! dx = ((double)new_x)/sx; ! dy = ((double)new_y)/sy; ! new_x = round(dx)+ObjPtr->x-ObjPtr->orig_obbox.ltx; ! new_y = round(dy)+ObjPtr->y-ObjPtr->orig_obbox.lty; if (new_x>=0 && new_x=0 && new_yctm, &new_x, &new_y); ! if (xbm_ptr->real_type != XBM_XBM) { ! dx = ((double)new_x)/sx; ! dy = ((double)new_y)/sy; ! new_x = round(dx)+ObjPtr->x-ObjPtr->orig_obbox.ltx; ! new_y = round(dy)+ObjPtr->y-ObjPtr->orig_obbox.lty; ! } else { ! new_x += ObjPtr->x-ObjPtr->orig_obbox.ltx; ! new_y += ObjPtr->y-ObjPtr->orig_obbox.lty; ! } if (new_x>=0 && new_x=0 && new_yx, orig_y=ObjPtr->y; Pixmap bitmap=None; XImage * image=NULL; *** imgproc.e.orig Thu Nov 6 09:57:57 1997 --- imgproc.e Thu Nov 6 09:57:57 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/imgproc.e,v 3.1 1997/09/14 20:38:06 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/imgproc.e,v 3.4 1997/11/06 05:35:52 william Exp $ */ *************** *** 42,45 **** --- 42,47 ---- extern char *imageProcMenuStr[]; + extern float gfVectorWarpSoftness; + extern void CleanUpConvolution ARGS_DECL((void)); extern int DoConvolution ARGS_DECL((FILE*, XImage *image, *************** *** 77,80 **** --- 79,83 ---- extern void Subtract ARGS_DECL((void)); extern void AlphaCombine ARGS_DECL((void)); + extern void VectorWarp ARGS_DECL((void)); extern void CleanUpImageProc ARGS_DECL((void)); *** rect.e.orig Thu Nov 6 09:57:58 1997 --- rect.e Thu Nov 6 09:57:58 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/rect.e,v 3.4 1997/09/14 20:38:07 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/rect.e,v 3.6 1997/10/26 21:22:54 william Exp $ */ *************** *** 34,37 **** --- 34,41 ---- #define _RECT_E_ + extern void SetPoint ARGS_DECL((IntPoint*, int X, int Y)); + extern void ClipRect ARGS_DECL((struct BBRec *, int W, int H)); + extern void SetRect ARGS_DECL((struct BBRec *, int LtX, int LtY, int RbX, + int RbY)); extern void SetRotateVs ARGS_DECL((XPoint *, int LtX, int LtY, int RbX, int RbY)); *** version.e.orig Thu Nov 6 09:57:59 1997 --- version.e Thu Nov 6 09:57:59 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/version.e,v 3.1 1997/09/14 20:38:09 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/version.e,v 3.3 1997/10/24 02:54:40 william Exp $ */ *************** *** 35,43 **** extern char *versionString; - extern char *betaString; extern char *copyrightString; extern char *homePageURL; extern char *currentReleaseURL; extern char *hyperGraphicsURL; #endif /*_VERSION_E_*/ --- 35,48 ---- extern char *versionString; extern char *copyrightString; extern char *homePageURL; extern char *currentReleaseURL; extern char *hyperGraphicsURL; + + extern char fullVersionString[]; + extern char fullToolName[]; + extern char *specialBuild; + + extern void SetFullVersionString ARGS_DECL((void)); #endif /*_VERSION_E_*/ *** patchlvl.h.orig Thu Nov 6 09:58:00 1997 --- patchlvl.h Thu Nov 6 09:58:00 1997 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/patchlvl.h,v 3.16 1997/10/01 10:54:05 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/patchlvl.h,v 3.17 1997/10/08 16:41:03 william Exp $ */ *************** *** 34,38 **** #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 15 #endif /*_TGIF_PATCHLEVEL_H_*/ --- 34,38 ---- #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 16 #endif /*_TGIF_PATCHLEVEL_H_*/ *** Makefile.noimake.orig Thu Nov 6 09:58:01 1997 --- Makefile.noimake Thu Nov 6 09:58:01 1997 *************** *** 24,28 **** # PERFORMANCE OF THIS SOFTWARE. # ! # @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/Makefile.noimake,v 3.14 1997/09/15 19:01:50 william Exp $ # --- 24,28 ---- # PERFORMANCE OF THIS SOFTWARE. # ! # @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/Makefile.noimake,v 3.15 1997/11/06 14:55:20 william Exp $ # *************** *** 328,333 **** poly.e polygon.e raster.e rcbox.e rect.e remote.e ruler.e \ scroll.e select.e setup.e shape.e shortcut.e special.e stk.e \ ! stretch.e text.e wb1.e xbitmap.e xpixmap.e xbm/intr.xbm \ ! xbm/trek.xbm dup.o: const.h tgif_dbg.h types.h attr.e auxtext.e choice.e cmd.e \ drawing.e dup.e grid.e mark.e move.e msg.e obj.e page.e \ --- 328,333 ---- poly.e polygon.e raster.e rcbox.e rect.e remote.e ruler.e \ scroll.e select.e setup.e shape.e shortcut.e special.e stk.e \ ! stretch.e text.e util.e wb1.e xbitmap.e xpixmap.e \ ! xbm/intr.xbm xbm/trek.xbm dup.o: const.h tgif_dbg.h types.h attr.e auxtext.e choice.e cmd.e \ drawing.e dup.e grid.e mark.e move.e msg.e obj.e page.e \ *************** *** 379,384 **** cursor.e dialog.e drawing.e dup.e file.e grid.e imgproc.e \ mainloop.e mainmenu.e mark.e menu.e move.e msg.e names.e \ ! obj.e page.e polygon.e raster.e rect.e remote.e ruler.e \ ! select.e setup.e special.e util.e xbitmap.e xpixmap.e import.o: const.h tgif_dbg.h types.h attr.e choose.e cmd.e color.e \ cursor.e dialog.e drawing.e dup.e eps.e file.e import.e \ --- 379,385 ---- cursor.e dialog.e drawing.e dup.e file.e grid.e imgproc.e \ mainloop.e mainmenu.e mark.e menu.e move.e msg.e names.e \ ! navigate.e obj.e page.e poly.e polygon.e raster.e rect.e \ ! remote.e ruler.e select.e setup.e special.e util.e xbitmap.e \ ! xpixmap.e import.o: const.h tgif_dbg.h types.h attr.e choose.e cmd.e color.e \ cursor.e dialog.e drawing.e dup.e eps.e file.e import.e \ *************** *** 388,396 **** mainloop.o: const.h tgif_dbg.h patchlvl.h types.h animate.e auxtext.e \ choice.e cmd.e color.e cutpaste.e cursor.e dialog.e drawing.e \ ! edit.e exec.e expr.e file.e font.e ftp.e grid.e help.e http.e \ ! imgproc.e import.e mainloop.e mainmenu.e menu.e msg.e names.e \ ! navigate.e obj.e page.e ps.e raster.e remote.e ruler.e \ ! scroll.e select.e setup.e shape.e shortcut.e stk.e text.e \ ! util.e version.e wb1.e xbitmap.e xpixmap.e mainmenu.o: const.h tgif_dbg.h types.h align.e choice.e color.e cursor.e \ edit.e file.e font.e grid.e help.e imgproc.e mainloop.e \ --- 389,397 ---- mainloop.o: const.h tgif_dbg.h patchlvl.h types.h animate.e auxtext.e \ choice.e cmd.e color.e cutpaste.e cursor.e dialog.e drawing.e \ ! edit.e eps.e exec.e expr.e file.e font.e ftp.e grid.e help.e \ ! http.e imgproc.e import.e mainloop.e mainmenu.e menu.e msg.e \ ! names.e navigate.e obj.e page.e ps.e raster.e remote.e \ ! ruler.e scroll.e select.e setup.e shape.e shortcut.e stk.e \ ! text.e util.e version.e wb1.e xbitmap.e xpixmap.e mainmenu.o: const.h tgif_dbg.h types.h align.e choice.e color.e cursor.e \ edit.e file.e font.e grid.e help.e imgproc.e mainloop.e \ *************** *** 549,555 **** text.o: const.h tgif_dbg.h types.h attr.e auxtext.e choice.e cmd.e \ color.e cutpaste.e cursor.e dialog.e drawing.e dup.e file.e \ ! font.e grid.e mainloop.e mark.e msg.e names.e obj.e pattern.e \ ! poly.e prtgif.e raster.e rect.e ruler.e scroll.e select.e \ ! setup.e stretch.e text.e util.e xpixmap.e tgif.o: const.h tgif_dbg.h types.h color.e file.e grid.e mainloop.e \ msg.e names.e obj.e page.e setup.e util.e --- 550,556 ---- text.o: const.h tgif_dbg.h types.h attr.e auxtext.e choice.e cmd.e \ color.e cutpaste.e cursor.e dialog.e drawing.e dup.e file.e \ ! font.e grid.e mainloop.e mark.e move.e msg.e names.e obj.e \ ! pattern.e poly.e prtgif.e raster.e rect.e ruler.e scroll.e \ ! select.e setup.e stretch.e text.e util.e xpixmap.e tgif.o: const.h tgif_dbg.h types.h color.e file.e grid.e mainloop.e \ msg.e names.e obj.e page.e setup.e util.e *************** *** 558,562 **** version.o: vms_comp.o: vms_comp.h ! version.o: version.e vms_comp.o: wb1.o: const.h tgif_dbg.h types.h arc.e box.e choice.e cmd.e color.e \ --- 559,563 ---- version.o: vms_comp.o: vms_comp.h ! version.o: const.h tgif_dbg.h patchlvl.h version.e vms_comp.o: wb1.o: const.h tgif_dbg.h types.h arc.e box.e choice.e cmd.e color.e \ *************** *** 572,577 **** color.e cursor.e dialog.e drawing.e dup.e eps.e file.e font.e \ grid.e imgproc.e mark.e menu.e move.e msg.e names.e obj.e \ ! page.e pattern.e ps.e raster.e rect.e select.e setup.e \ ! stretch.e util.e xbitmap.e xpixmap.e xpixmap.o: const.h tgif_dbg.h types.h attr.e choice.e cmd.e color.e \ cursor.e dialog.e drawing.e dup.e file.e font.e grid.e \ --- 573,578 ---- color.e cursor.e dialog.e drawing.e dup.e eps.e file.e font.e \ grid.e imgproc.e mark.e menu.e move.e msg.e names.e obj.e \ ! page.e pattern.e ps.e raster.e rect.e remote.e select.e \ ! setup.e stretch.e util.e xbitmap.e xpixmap.e xpixmap.o: const.h tgif_dbg.h types.h attr.e choice.e cmd.e color.e \ cursor.e dialog.e drawing.e dup.e file.e font.e grid.e \ *** Imakefile.orig Thu Nov 6 09:58:03 1997 --- Imakefile Thu Nov 6 09:58:03 1997 *************** *** 36,40 **** XCOMM PERFORMANCE OF THIS SOFTWARE. XCOMM ! XCOMM @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/Imakefile,v 3.20 1997/10/08 13:45:42 william Exp $ XCOMM --- 36,40 ---- XCOMM PERFORMANCE OF THIS SOFTWARE. XCOMM ! XCOMM @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/Imakefile,v 3.21 1997/11/06 14:43:25 william Exp $ XCOMM *************** *** 45,49 **** XCOMM EXTRA_LDOPTIONS = ! TGIFVERSION = 3.0-p15 PROGRAMS = tgif prtgif XCOMM frontend11.o testdrive XCOMM CDEBUGFLAGS= -g --- 45,49 ---- XCOMM EXTRA_LDOPTIONS = ! TGIFVERSION = 3.0-p16 PROGRAMS = tgif prtgif XCOMM frontend11.o testdrive XCOMM CDEBUGFLAGS= -g *** tgif.man.orig Thu Nov 6 09:58:05 1997 --- tgif.man Thu Nov 6 09:58:05 1997 *************** *** 1,9 **** .\" Tgif's man pages. .\" ! .\" @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.man,v 3.16 1997/10/06 18:11:19 william Exp $ .\" .\" .\" ! .TH TGIF n "Version 3.0 Patchlevel 15 and Above" "Tgif" .\" .SH NAME --- 1,9 ---- .\" Tgif's man pages. .\" ! .\" @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.man,v 3.17 1997/11/06 14:38:05 william Exp $ .\" .\" .\" ! .TH TGIF n "Version 3.0 Patchlevel 16 and Above" "Tgif" .\" .SH NAME *************** *** 1851,1854 **** --- 1851,1868 ---- tokens. .RE + .TP + .I move_attr_relative(,,) + This command moves the attribute whose name is by absolute + units in the x direction and absolute units in the y direction. + .TP + .I get_number_of_vertices(,) + This command copies the number of vertices of the object specified by + into . The specified object must be a polyline + (open-spline) or a polygon (closed-spline). + .TP + .I is_obj_transformed(,) + This command writes a "1" into if the object + specified by is transformed (rotated or sheared). + It writes a "0" into otherwise. .\" .SH ARITHMETIC EXPRESSIONS *************** *** 3529,3532 **** --- 3543,3554 ---- colors. If this X default is specified, the Tgif.Color# X defaults are ignored. + .TP + .I Tgif.VectorWarpSoftness: NUMBER + This specifies the softness value used when VectorWarp() is selected + from the ImageProc Menu. VectorWarp() lets the user warp pixels in + an X11 pixmap object by specifying a vector. The size of the + affected area is controled by this value, which must lie between 1.0 + and 4.0. The larger the value, the larger the affected area. + The default value is 1.5. .\" .SH ENVIRONMENT VARIABLE *** HISTORY.orig Thu Nov 6 09:58:06 1997 --- HISTORY Thu Nov 6 09:58:06 1997 *************** *** 1,2 **** --- 1,18 ---- + -----------------------> tgif-3.0-p15 => tgif-3.0-p16 <----------------------- + Here's a short list of added features/bug fixes. + + 1) Fix a bug in scaling objects. Thanks to Helmut Jarausch + for pointing out the problem. + 2) Fix a bug in rotating XBM objects. Thanks to Fozzy C. Dressel + for pointing out the problem. + 3) Add VectorWarp() to the ImageProc Menu to warp selected image in + a specified direction for a specified amount. Add a new X default, + Tgif.VectorWarpSoftness to control the softness of the warp. + 4) Add new internal commands: + + move_attr_relative(,,) + get_number_of_vertices(,) + is_obj_transformed(,) + -----------------------> tgif-3.0-p14 => tgif-3.0-p15 <----------------------- Here's a short list of added features/bug fixes. *************** *** 312,315 **** /* ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/HISTORY,v 3.18 1997/10/08 13:45:11 william Exp $ */ --- 328,331 ---- /* ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/HISTORY,v 3.19 1997/11/06 14:40:01 william Exp $ */ *** descrip.mms.orig Thu Nov 6 09:58:08 1997 --- descrip.mms Thu Nov 6 09:58:08 1997 *************** *** 6,10 **** ! $ DEFINE SYS SYS$LIBRARY ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/descrip.mms,v 3.12 1997/09/14 20:59:34 william Exp $ ! --- 6,10 ---- ! $ DEFINE SYS SYS$LIBRARY ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/descrip.mms,v 3.13 1997/11/06 14:55:20 william Exp $ ! *************** *** 217,222 **** pattern.e,poly.e,polygon.e,raster.e,rcbox.e,rect.e,remote.e,- ruler.e,scroll.e,select.e,setup.e,shape.e,shortcut.e,special.e,- ! stk.e,stretch.e,text.e,wb1.e,xbitmap.e,xpixmap.e,xbm/intr.xbm,- ! xbm/trek.xbm dup.obj depends_on dup.c,const.h,tgif_dbg.h,types.h,attr.e,auxtext.e,choice.e,- cmd.e,drawing.e,dup.e,grid.e,mark.e,move.e,msg.e,obj.e,page.e,- --- 217,222 ---- pattern.e,poly.e,polygon.e,raster.e,rcbox.e,rect.e,remote.e,- ruler.e,scroll.e,select.e,setup.e,shape.e,shortcut.e,special.e,- ! stk.e,stretch.e,text.e,util.e,wb1.e,xbitmap.e,xpixmap.e,- ! xbm/intr.xbm,xbm/trek.xbm dup.obj depends_on dup.c,const.h,tgif_dbg.h,types.h,attr.e,auxtext.e,choice.e,- cmd.e,drawing.e,dup.e,grid.e,mark.e,move.e,msg.e,obj.e,page.e,- *************** *** 271,276 **** cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,file.e,grid.e,- imgproc.e,mainloop.e,mainmenu.e,mark.e,menu.e,move.e,msg.e,- ! names.e,obj.e,page.e,polygon.e,raster.e,rect.e,remote.e,- ! ruler.e,select.e,setup.e,special.e,util.e,xbitmap.e,xpixmap.e import.obj depends_on import.c,const.h,tgif_dbg.h,types.h,attr.e,choose.e,- cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,eps.e,file.e,- --- 271,277 ---- cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,file.e,grid.e,- imgproc.e,mainloop.e,mainmenu.e,mark.e,menu.e,move.e,msg.e,- ! names.e,navigate.e,obj.e,page.e,poly.e,polygon.e,raster.e,- ! rect.e,remote.e,ruler.e,select.e,setup.e,special.e,util.e,- ! xbitmap.e,xpixmap.e import.obj depends_on import.c,const.h,tgif_dbg.h,types.h,attr.e,choose.e,- cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,eps.e,file.e,- *************** *** 280,288 **** mainloop.obj depends_on mainloop.c,const.h,tgif_dbg.h,patchlvl.h,types.h,- animate.e,auxtext.e,choice.e,cmd.e,color.e,cutpaste.e,cursor.e,- ! dialog.e,drawing.e,edit.e,exec.e,expr.e,file.e,font.e,ftp.e,- ! grid.e,help.e,http.e,imgproc.e,import.e,mainloop.e,mainmenu.e,- ! menu.e,msg.e,names.e,navigate.e,obj.e,page.e,ps.e,raster.e,- ! remote.e,ruler.e,scroll.e,select.e,setup.e,shape.e,shortcut.e,- ! stk.e,text.e,util.e,version.e,wb1.e,xbitmap.e,xpixmap.e mainmenu.obj depends_on mainmenu.c,const.h,tgif_dbg.h,types.h,align.e,choice.e,- color.e,cursor.e,edit.e,file.e,font.e,grid.e,help.e,imgproc.e,- --- 281,290 ---- mainloop.obj depends_on mainloop.c,const.h,tgif_dbg.h,patchlvl.h,types.h,- animate.e,auxtext.e,choice.e,cmd.e,color.e,cutpaste.e,cursor.e,- ! dialog.e,drawing.e,edit.e,eps.e,exec.e,expr.e,file.e,font.e,- ! ftp.e,grid.e,help.e,http.e,imgproc.e,import.e,mainloop.e,- ! mainmenu.e,menu.e,msg.e,names.e,navigate.e,obj.e,page.e,ps.e,- ! raster.e,remote.e,ruler.e,scroll.e,select.e,setup.e,shape.e,- ! shortcut.e,stk.e,text.e,util.e,version.e,wb1.e,xbitmap.e,- ! xpixmap.e mainmenu.obj depends_on mainmenu.c,const.h,tgif_dbg.h,types.h,align.e,choice.e,- color.e,cursor.e,edit.e,file.e,font.e,grid.e,help.e,imgproc.e,- *************** *** 447,453 **** text.obj depends_on text.c,const.h,tgif_dbg.h,types.h,attr.e,auxtext.e,- choice.e,cmd.e,color.e,cutpaste.e,cursor.e,dialog.e,drawing.e,- ! dup.e,file.e,font.e,grid.e,mainloop.e,mark.e,msg.e,names.e,- ! obj.e,pattern.e,poly.e,prtgif.e,raster.e,rect.e,ruler.e,- ! scroll.e,select.e,setup.e,stretch.e,text.e,util.e,xpixmap.e tgif.obj depends_on tgif.c,const.h,tgif_dbg.h,types.h,color.e,file.e,grid.e,- mainloop.e,msg.e,names.e,obj.e,page.e,setup.e,util.e --- 449,456 ---- text.obj depends_on text.c,const.h,tgif_dbg.h,types.h,attr.e,auxtext.e,- choice.e,cmd.e,color.e,cutpaste.e,cursor.e,dialog.e,drawing.e,- ! dup.e,file.e,font.e,grid.e,mainloop.e,mark.e,move.e,msg.e,- ! names.e,obj.e,pattern.e,poly.e,prtgif.e,raster.e,rect.e,- ! ruler.e,scroll.e,select.e,setup.e,stretch.e,text.e,util.e,- ! xpixmap.e tgif.obj depends_on tgif.c,const.h,tgif_dbg.h,types.h,color.e,file.e,grid.e,- mainloop.e,msg.e,names.e,obj.e,page.e,setup.e,util.e *************** *** 457,461 **** version.obj depends_on version.c vms_comp.obj depends_on vms_comp.c, vms_comp.h ! version.obj depends_on version.c,version.e vms_comp.obj depends_on vms_comp.c wb1.obj depends_on wb1.c,const.h,tgif_dbg.h,types.h,arc.e,box.e,choice.e,cmd.e,- --- 460,464 ---- version.obj depends_on version.c vms_comp.obj depends_on vms_comp.c, vms_comp.h ! version.obj depends_on version.c,const.h,tgif_dbg.h,patchlvl.h,version.e vms_comp.obj depends_on vms_comp.c wb1.obj depends_on wb1.c,const.h,tgif_dbg.h,types.h,arc.e,box.e,choice.e,cmd.e,- *************** *** 471,476 **** choice.e,cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,eps.e,- file.e,font.e,grid.e,imgproc.e,mark.e,menu.e,move.e,msg.e,- ! names.e,obj.e,page.e,pattern.e,ps.e,raster.e,rect.e,select.e,- ! setup.e,stretch.e,util.e,xbitmap.e,xpixmap.e xpixmap.obj depends_on xpixmap.c,const.h,tgif_dbg.h,types.h,attr.e,choice.e,- cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,file.e,font.e,- --- 474,479 ---- choice.e,cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,eps.e,- file.e,font.e,grid.e,imgproc.e,mark.e,menu.e,move.e,msg.e,- ! names.e,obj.e,page.e,pattern.e,ps.e,raster.e,rect.e,remote.e,- ! select.e,setup.e,stretch.e,util.e,xbitmap.e,xpixmap.e xpixmap.obj depends_on xpixmap.c,const.h,tgif_dbg.h,types.h,attr.e,choice.e,- cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,file.e,font.e,- *** tgif.Xdefaults.orig Thu Nov 6 09:58:09 1997 --- tgif.Xdefaults Thu Nov 6 09:58:09 1997 *************** *** 7,11 **** ! identical to the default values used in tgif. ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.Xdefaults,v 3.8 1997/09/15 22:48:49 william Exp $ ! Tgif.Geometry: 640x512-40+20 --- 7,11 ---- ! identical to the default values used in tgif. ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.Xdefaults,v 3.10 1997/11/06 05:39:51 william Exp $ ! Tgif.Geometry: 640x512-40+20 *************** *** 311,312 **** --- 311,313 ---- Tgif.TitledPinnedMenu: true !Tgif.ColorFromXPixmap: /usr/local/lib/X11/tgif/tgificon.xpm + Tgif.VectorWarpSoftness: 1.5