/* Generated with C2C (Cedar To C)*/ /* Copyright (C) 1993 by Xerox Corporation. All rights reserved. */ /* time: July 28, 1993 10:14:26 am PDT */ /* C2C version: April 20, 1993 (sun4) */ /* ref-counting: off */ /* file: ImagerBrickImpl, module: ImagerBrickImpl */ /* switches: bcfhklnouw */ #include <cedar/InstallationSupport.h> #include <cedar/CedarExtra.h> static char versionStamp[] = "@(#)mob←version [375539787,3981983788] ImagerBrickImpl"; typedef unsigned word, *ptr; typedef unsigned char byte, *bPt; typedef unsigned short half, *hPt; typedef word (*fPt)(); typedef struct {word f0, f1, f2;} W3; typedef W3 *W3Pt; typedef struct {word f0, f1, f2, f3;} W4; typedef struct {word f0, f1;} W2; typedef W2 *W2Pt; typedef W4 *W4Pt; typedef struct {word f0, f1, f2, f3, f4, f5, f6;} W7; typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8; typedef struct {W8 f; W7 r;} W15; static float fc1 = 0.314156; static float fc2 = 0.271828; #define SOURCE(p, l) /* source p, l */ #define IOP2(op, x, y) ( (word) ((x) op (y)) ) #define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i ) #define INEG(x) ( (word) ( - ((int) (word) (x)) ) ) #define IABS(i) ( ((int)(word)(i) > 0) ? (i) : (word)(-(int)(word)(i)) ) static float fc17 = 0.0; #define FABS(f, t) ( ((t=(f)) >= (float) 0.0) ? (t) : (- (t)) ) static float fc25 = 0.015625; static float fc28 = 1.0; static float fc29 = -1.0; static float fc80 = 0.5; static float fc85 = 2.0; static float fc88 = 180.0; #define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) ) #define FMIN(x, y, tx, ty) ( (tx=((float) x)) <= (ty=((float) y)) ? tx : ty ) #define FMAX(x, y, tx, ty) ( (tx=((float) x)) >= (ty=((float) y)) ? tx : ty ) static void NoName←Q1500(); static void ImagerBrickImpl←P0(); static void ExtendedEuclid←P60(); static word Sig←P120(); static void BrickShapeFromDeltas←P180(); static void BrickSpecFromTransformedRectangle←P360(); static void BrickFromDotScreen←P420(); static word Filter←P684(); static void BrickFromFilter←P480(); static word Encode←P744(); static word Equidistribute←P804(); static word Compare←P864(); static struct {unsigned f; char r[20];} string3 = {1179668, "\260\006\005\146\151\162\163\164\217\005\004\162\145\163\164\214\217\261\000"}; static struct {unsigned f; char r[4];} string4 = {131074, "\004\003\000"}; static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\026bHK\300\355X@,Ap\000\000"}; static struct {unsigned f; char r[16];} string6 = {851984, "\257\300\026\142\110\113\300\355\130\100\054\100\164\000\000"}; static struct {unsigned f; char r[16];} string7 = {851984, "\257\300\144\364\322\150\300\206\136\277\046\100\150\000\000"}; static struct {unsigned f; char r[16];} string8 = {851984, "\257\300\121\117\377\026\300\315\013\026\004\100\150\000\000"}; static struct {unsigned f; char r[16];} string9 = {851984, "\257\300\246\205\220\035\300\344\000\142\023\100\150\000\000"}; static struct {unsigned f; char r[16];} string10 = {851984, "\257\300\245\247\302\156\300\052\156\325\023\100\150\000\000"}; static struct {unsigned f; char r[16];} string11 = {851984, "\257\300\247\031\224\326\300\123\162\224\023\100\150\000\000"}; static struct {unsigned f; char r[16];} string12 = {851984, "\257\300\213\226\301\143\300\072\355\320\373\100\150\000\000"}; static struct {unsigned f; char r[16];} string13 = {851984, "\257\300\041\257\203\366\300\322\161\356\007\100\150\000\000"}; static struct {unsigned f; char r[16];} string14 = {851984, "\257\300\361\072\110\004\300\054\212\055\367\100\150\000\000"}; static struct { word f0[30]; } globalframe = { {0} }; static void NoName←Q1500() { register ptr gf←c0169 = (ptr) &globalframe; word var←c15168; (* (( (ptr) gf←c0169)+4) ) = (* (ptr) &fc1 ); (* (( (ptr) gf←c0169)+5) ) = (* (ptr) &fc2 ); (* (( (ptr) gf←c0169)+20) ) = ( ((word) (fPt) ImagerBrickImpl←P0) ); (* (( (ptr) gf←c0169)+18) ) = ( ((word) (fPt) ExtendedEuclid←P60) ); (* (( (ptr) gf←c0169)+16) ) = ( ((word) (fPt) Sig←P120) ); (* (( (ptr) gf←c0169)+14) ) = ( ((word) (fPt) BrickShapeFromDeltas←P180) ); (* (( (ptr) gf←c0169)+12) ) = ( ((word) (fPt) BrickSpecFromTransformedRectangle←P360) ); (* (( (ptr) gf←c0169)+10) ) = ( ((word) (fPt) BrickFromDotScreen←P420) ); (* (( (ptr) gf←c0169)+8) ) = ( ((word) (fPt) BrickFromFilter←P480) ); (* (( (ptr) gf←c0169)+6) ) = (word) XR←GetTypeIndex((word) &string3, 0, (word) &string4); (* (( (ptr) gf←c0169)+7) ) = (word) XR←GetTypeIndexS((word) (&string5)); (void) XR←DeclareGlobalFrame((word) "ImagerBrickImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string6)), (word) ( ( (bPt) gf←c0169)+80)/* var←c13504 */ ); var←c15168 = (word) XR←ImportInterface((word) "List", (word) XR←GetTypeIndexS((word) (&string7)), 28); (* (( (ptr) gf←c0169)+27)/* var←c14976 */ ) = var←c15168; (void) XR←ImportProcS(var←c15168, 67639810); (void) XR←ImportProcS(var←c15168, 67639042); var←c15168 = (word) XR←ImportInterface((word) "ImagerTransformation", (word) XR←GetTypeIndexS((word) (&string8)), 55); (* (( (ptr) gf←c0169)+22)/* var←c13696 */ ) = var←c15168; (void) XR←ImportProcS(var←c15168, 135013890); (void) XR←ImportProcS(var←c15168, 67372289); (void) XR←ImportProcS(var←c15168, 67371777); (void) XR←ImportProcS(var←c15168, 68160004); (void) XR←ImportProcS(var←c15168, 68681734); (void) XR←ImportProcS(var←c15168, 135013378); var←c15168 = (word) XR←ImportInterface((word) "Real", (word) XR←GetTypeIndexS((word) (&string9)), 11); (* (( (ptr) gf←c0169)+24)/* var←c13888 */ ) = var←c15168; (void) XR←ImportProcS(var←c15168, 67371521); var←c15168 = (word) XR←ImportInterface((word) "RealFns", (word) XR←GetTypeIndexS((word) (&string10)), 36); (* (( (ptr) gf←c0169)+25)/* var←c14432 */ ) = var←c15168; (void) XR←ImportProcS(var←c15168, 67373313); var←c15168 = (word) XR←ImportInterface((word) "Vector2", (word) XR←GetTypeIndexS((word) (&string11)), 22); (* (( (ptr) gf←c0169)+23)/* var←c13792 */ ) = var←c15168; (void) XR←ImportProcS(var←c15168, 135266306); (void) XR←ImportProcS(var←c15168, 68161538); (void) XR←ImportProcS(var←c15168, 135266818); var←c15168 = (word) XR←ImportInterface((word) "ImagerSample", (word) XR←GetTypeIndexS((word) (&string12)), 60); (* (( (ptr) gf←c0169)+26)/* var←c14624 */ ) = var←c15168; (void) XR←ImportProcS(var←c15168, 1320708); (void) XR←ImportProcS(var←c15168, 273409); (void) XR←ImportProcS(var←c15168, 68685571); var←c15168 = (word) XR←ImportInterface((word) "ImagerSys", (word) XR←GetTypeIndexS((word) (&string13)), 15); (* (( (ptr) gf←c0169)+28)/* var←c15072 */ ) = var←c15168; (void) XR←ImportProcS(var←c15168, 67634434); var←c15168 = (word) XR←ExportInterface((word) "ImagerBrick", (word) XR←GetTypeIndexS((word) (&string14)), 4); (* (( (ptr) gf←c0169)+29)/* var←c15200 */ ) = var←c15168; (void) XR←ExportProcS(var←c15168, (word) (( (bPt) gf←c0169)+56)/* var←c13408 */ , 202375172, (word) "BrickShapeFromDeltas") ; (void) XR←ExportProcS(var←c15168, (word) (( (bPt) gf←c0169)+48)/* var←c13376 */ , 269746437, (word) "BrickSpecFromTransformedRectangle") ; (void) XR←ExportProcS(var←c15168, (word) (( (bPt) gf←c0169)+40)/* var←c13344 */ , 203424264, (word) "BrickFromDotScreen") ; (void) XR←ExportProcS(var←c15168, (word) (( (bPt) gf←c0169)+32)/* var←c13312 */ , 203162372, (word) "BrickFromFilter"); } static void ImagerBrickImpl←P0(formal←c020, formal←c019) word formal←c020; word formal←c019; { /* ImagerBrickImpl: */ SOURCE(432, 6177) SOURCE(3671, 31) /* moved to installation proc */ /* moved to installation proc */ } static void ExtendedEuclid←P60(formal←c034, u←v3544, v←v3572) word formal←c034; word u←v3544; word v←v3572; { W3 var←c3616; word u1←v5416 = 1; word u2←v5444 = 0; word u3←v5472; word v1←v5500 = 0; word v2←v5528 = 1; word v3←v5556; /* ExtendedEuclid: */ SOURCE(772, 382) SOURCE(865, 11) u3←v5472 = u←v3544; SOURCE(912, 11) v3←v5556 = v←v3572; SOURCE(925, 187) lab←L100003: ; if ((v3←v5556 != 0)) { } else { goto lab←L100001; }; { word quotient←v5600; word t1←v5628; word t2←v5656; word t3←v5684; SOURCE(941, 21) quotient←v5600 = (u3←v5472 / v3←v5556); SOURCE(964, 30) t1←v5628 = (u1←v5416 - IOP2( * , (int)v1←v5500, (int)quotient←v5600)); SOURCE(996, 30) t2←v5656 = (u2←v5444 - IOP2( * , (int)v2←v5528, (int)quotient←v5600)); SOURCE(1028, 30) t3←v5684 = (u3←v5472 - (v3←v5556 * quotient←v5600)); SOURCE(1060, 7) u1←v5416 = v1←v5500; SOURCE(1069, 7) u2←v5444 = v2←v5528; SOURCE(1078, 7) u3←v5472 = v3←v5556; SOURCE(1087, 7) v1←v5500 = t1←v5628; SOURCE(1096, 7) v2←v5528 = t2←v5656; SOURCE(1105, 7) v3←v5556 = SGNCK(t3←v5684); }; goto lab←L100003; lab←L100001: ; SOURCE(1123, 31) var←c3616.f0 = u1←v5416; var←c3616.f1 = u2←v5444; var←c3616.f2 = u3←v5472; /* removed tail goto */ (* (W3Pt) formal←c034 ) = var←c3616; return; } static word Sig←P120(a←v3676, b←v3704) word a←v3676; word b←v3704; { word var←c3748; /* Sig: */ SOURCE(1158, 71) SOURCE(1197, 32) if (( (int)a←v3676 < (int)0)) { return(INEG(b←v3704)); } else { return(b←v3704); }; } static void BrickShapeFromDeltas←P180(formal←c049, s0←v3808, f0←v3836, s1←v3864, f1←v3892) word formal←c049; word s0←v3808; word f0←v3836; word s1←v3864; word f1←v3892; { W3 var←c3936; word area←v5728; W3 gcd←v5756; word sSize←v5784; word fSize←v5812; word phase←v5840; /* BrickShapeFromDeltas: */ SOURCE(1233, 459) SOURCE(1314, 51) { word x15; area←v5728 = ( x15 = (IOP2( * , (int)s0←v3808, (int)f1←v3892) - IOP2( * , (int)s1←v3864, (int)f0←v3836)), IABS(x15) ); }; SOURCE(1396, 51) (void) ExtendedEuclid←P60((word) &gcd←v5756, IABS(s0←v3808), IABS(s1←v3864)); SOURCE(1449, 19) sSize←v5784 = gcd←v5756.f2; SOURCE(1470, 23) { word idx16; fSize←v5812 = ( idx16 = (word) (area←v5728 / sSize←v5784), SGNCK(idx16) ); }; SOURCE(1495, 60) phase←v5840 = (IOP2( * , (int)(word) Sig←P120(s0←v3808, f0←v3836), (int)gcd←v5756.f0) + IOP2( * , (int)(word) Sig←P120( s1←v3864, f1←v3892), (int)gcd←v5756.f1)); SOURCE(1557, 48) lab←L100007: ; if (( (int)phase←v5840 < (int)0)) { } else { goto lab←L100005; }; SOURCE(1576, 29) phase←v5840 = (phase←v5840 + fSize←v5812); goto lab←L100007; lab←L100005: ; SOURCE(1607, 53) lab←L100010: ; if (( (int)phase←v5840 >= (int)fSize←v5812)) { } else { goto lab←L100008; }; SOURCE(1631, 29) phase←v5840 = (phase←v5840 - fSize←v5812); goto lab←L100010; lab←L100008: ; SOURCE(1662, 30) var←c3936.f0 = sSize←v5784; var←c3936.f1 = SGNCK(fSize←v5812); var←c3936.f2 = SGNCK(phase←v5840); /* removed tail goto */ (* (W3Pt) formal←c049 ) = var←c3936; return; } static void BrickSpecFromTransformedRectangle←P360(formal←c097, w←v4232, h←v4260, clientToDevice←v4288, allowedRelativeError←v4316, minLevels←v4344) word formal←c097; word w←v4232; word h←v4260; word clientToDevice←v4288; word allowedRelativeError←v4316; word minLevels←v4344; { register ptr gf←c15232 = (ptr) &globalframe; W4 var←c4388; W4 v←v5884; W4 vMul←v5912; word allowSqr←v5940; word n0←v5968 = 1; word n1←v5996 = 1; /* BrickSpecFromTransformedRectangle: */ SOURCE(1902, 1666) SOURCE(2063, 145) { W2 var←c058; { W2 var←c13664; var←c13664.f0 = w←v4232; var←c13664.f1 = (* (ptr) &fc17 ); { word pd18; pd18 = (* (( (ptr) (* (( (ptr) gf←c15232)+22)/* var←c13696 */ ))+40) ); (void) ( *( (fPt) ((* (ptr) pd18 ))))((word) &var←c058, clientToDevice←v4288, var←c13664, pd18); }; }; (* (W2Pt) &v←v5884 ) = var←c058; }; { W2 var←c060; { W2 var←c13760; var←c13760.f0 = (* (ptr) &fc17 ); var←c13760.f1 = h←v4260; { word pd19; pd19 = (* (( (ptr) (* (( (ptr) gf←c15232)+22)/* var←c13696 */ ))+40) ); (void) ( *( (fPt) ((* (ptr) pd19 ))))((word) &var←c060, clientToDevice←v4288, var←c13760, pd19); }; }; (* (W2Pt) (( (ptr) &v←v5884)+2) ) = var←c060; }; SOURCE(2210, 29) vMul←v5912 = v←v5884; SOURCE(2241, 58) { word x20; word x21; *(float*)&allowSqr←v5940 = ( x20 = allowedRelativeError←v4316, *(float*)&x20 ) * ( x21 = allowedRelativeError←v4316, *(float*)&x21 ); }; SOURCE(2327, 190) { float tf22; word pd23; word x24; word x26; pd23 = (* (( (ptr) (* (( (ptr) gf←c15232)+23)/* var←c13792 */ ))+20) ); if ((FABS(( x24 = (word) ( *( (fPt) ((* (ptr) pd23 ))))((* (W2Pt) &v←v5884 ), (* (W2Pt) (( (ptr) &v←v5884)+2) ), pd23), *(float*)&x24 ), tf22) < ( x26 = (* (ptr) &fc25 ), *(float*)&x26 ))) { SOURCE(2379, 138) { W4 var←c13856; { W4 var←c13824; var←c13824.f0 = 1; var←c13824.f1 = 2; var←c13824.f2 = 1; { word pd27; pd27 = (* (( (ptr) (* (( (ptr) gf←c15232)+22)/* var←c13696 */ ))+4) ); var←c13824.f3 = (word) ( *( (fPt) ((* (ptr) pd27 ))))((* (ptr) &fc28 ), (* (ptr) &fc29 ), (* (( (ptr) clientToDevice←v4288)+2) ), (* (ptr) &fc28 ), (* (ptr) &fc28 ), (* (( (ptr) clientToDevice←v4288)+5) ), pd27); }; var←c13856 = var←c13824; }; var←c4388 = var←c13856; goto lab←L100011; }; }; }; SOURCE(2520, 1048) lab←L100014: ; SOURCE(2520, 1048) { word v0x←v6112; word v0y←v6140; word v1x←v6168; word v1y←v6196; word var←c13920; W2 u←v13220; W2 v←v13248; word var←c14048; W2 v←v13004; word var←c0180; word var←c14112; W2 u←v13100; W2 v←v13128; word var←c14240; W2 v←v12956; word var←c0181; SOURCE(2523, 32) { word pd30; pd30 = (* (( (ptr) (* (( (ptr) gf←c15232)+24)/* var←c13888 */ ))+6) ); v0x←v6112 = (word) ( *( (fPt) ((* (ptr) pd30 ))))(vMul←v5912.f0, pd30); }; SOURCE(2557, 32) { word pd31; pd31 = (* (( (ptr) (* (( (ptr) gf←c15232)+24)/* var←c13888 */ ))+6) ); v0y←v6140 = (word) ( *( (fPt) ((* (ptr) pd31 ))))(vMul←v5912.f1, pd31); }; SOURCE(2591, 32) { word pd32; pd32 = (* (( (ptr) (* (( (ptr) gf←c15232)+24)/* var←c13888 */ ))+6) ); v1x←v6168 = (word) ( *( (fPt) ((* (ptr) pd32 ))))(vMul←v5912.f2, pd32); }; SOURCE(2625, 32) { word pd33; pd33 = (* (( (ptr) (* (( (ptr) gf←c15232)+24)/* var←c13888 */ ))+6) ); v1y←v6196 = (word) ( *( (fPt) ((* (ptr) pd33 ))))(vMul←v5912.f3, pd33); }; { word x47; word x48; u←v13220 = (* (W2Pt) &vMul←v5912 ); { float tf34; v←v13248.f0 = ( tf34 = (float)(int)v0x←v6112, *(word*)&tf34 ); }; { float tf35; v←v13248.f1 = ( tf35 = (float)(int)v0y←v6140, *(word*)&tf35 ); }; SOURCE(1822, 34) { word var←c14016; W2 v←v13052; { word pd36; pd36 = (* (( (ptr) (* (( (ptr) gf←c15232)+23)/* var←c13792 */ ))+6) ); (void) ( *( (fPt) ((* (ptr) pd36 ))))((word) &v←v13052, u←v13220, v←v13248, pd36); }; SOURCE(1745, 24) { word x37; word x38; word x39; word x40; *(float*)&var←c14016 = (( x37 = v←v13052.f0, *(float*)&x37 ) * ( x38 = v←v13052.f0, *(float*)&x38 )) + (( x39 = v←v13052.f1, *(float*)&x39 ) * ( x40 = v←v13052.f1, *(float*)&x40 )); }; var←c13920 = var←c14016; }; v←v13004 = (* (W2Pt) &vMul←v5912 ); SOURCE(1745, 24) { word x41; word x42; word x43; word x44; *(float*)&var←c14048 = (( x41 = v←v13004.f0, *(float*)&x41 ) * ( x42 = v←v13004.f0, *(float*)&x42 )) + (( x43 = v←v13004.f1, *(float*)&x43 ) * ( x44 = v←v13004.f1, *(float*)&x44 )); }; { word x45; word x46; *(float*)&var←c0180 = ( x45 = var←c14048, *(float*)&x45 ) * ( x46 = allowSqr←v5940, *(float*)&x46 ); }; if ((( x47 = var←c13920, *(float*)&x47 ) > ( x48 = var←c0180, *(float*)&x48 ))) { SOURCE(2736, 36) { W2 var←c14080; { word pd49; pd49 = (* (( (ptr) (* (( (ptr) gf←c15232)+23)/* var←c13792 */ ))+4) ); (void) ( *( (fPt) ((* (ptr) pd49 ))))((word) &var←c14080, (* (W2Pt) &v←v5884 ), (* (W2Pt) &vMul←v5912 ), pd49); }; (* (W2Pt) &vMul←v5912 ) = var←c14080; }; SOURCE(2774, 11) n0←v5968 = (n0←v5968 + 1); } else { { word x63; word x64; u←v13100 = (* (W2Pt) (( (ptr) &vMul←v5912)+2) ); { float tf50; v←v13128.f0 = ( tf50 = (float)(int)v1x←v6168, *(word*)&tf50 ); }; { float tf51; v←v13128.f1 = ( tf51 = (float)(int)v1y←v6196, *(word*)&tf51 ); }; SOURCE(1822, 34) { word var←c14208; W2 v←v13176; { word pd52; pd52 = (* (( (ptr) (* (( (ptr) gf←c15232)+23)/* var←c13792 */ ))+6) ); (void) ( *( (fPt) ((* (ptr) pd52 ))))((word) &v←v13176, u←v13100, v←v13128, pd52); }; SOURCE(1745, 24) { word x53; word x54; word x55; word x56; *(float*)&var←c14208 = (( x53 = v←v13176.f0, *(float*)&x53 ) * ( x54 = v←v13176.f0, *(float*)&x54 )) + (( x55 = v←v13176.f1, *(float*)&x55 ) * ( x56 = v←v13176.f1, *(float*)&x56 )); }; var←c14112 = var←c14208; }; v←v12956 = (* (W2Pt) (( (ptr) &vMul←v5912)+2) ); SOURCE(1745, 24) { word x57; word x58; word x59; word x60; *(float*)&var←c14240 = (( x57 = v←v12956.f0, *(float*)&x57 ) * ( x58 = v←v12956.f0, *(float*)&x58 )) + (( x59 = v←v12956.f1, *(float*)&x59 ) * ( x60 = v←v12956.f1, *(float*)&x60 )); }; { word x61; word x62; *(float*)&var←c0181 = ( x61 = var←c14240, *(float*)&x61 ) * ( x62 = allowSqr←v5940, *(float*)&x62 ); }; if ((( x63 = var←c14112, *(float*)&x63 ) > ( x64 = var←c0181, *(float*)&x64 ))) { SOURCE(2850, 36) { W2 var←c14272; { word pd65; pd65 = (* (( (ptr) (* (( (ptr) gf←c15232)+23)/* var←c13792 */ ))+4) ); (void) ( *( (fPt) ((* (ptr) pd65 ))))((word) &var←c14272, (* (W2Pt) (( (ptr) &v←v5884)+2) ), (* (W2Pt) (( (ptr) &vMul←v5912)+2) ), pd65); }; (* (W2Pt) (( (ptr) &vMul←v5912)+2) ) = var←c14272; }; SOURCE(2888, 11) n1←v5996 = (n1←v5996 + 1); } else { SOURCE(2915, 653) { word n0w←v6240; word n1h←v6268; W3 bs←v6296; W3 brickShape←v6324; word m←v6352; SOURCE(2917, 22) { word x66; *(float*)&n0w←v6240 = (float)(int)n0←v5968 * ( x66 = w←v4232, *(float*)&x66 ); }; SOURCE(2941, 22) { word x67; *(float*)&n1h←v6268 = (float)(int)n1←v5996 * ( x67 = h←v4260, *(float*)&x67 ); }; SOURCE(2965, 57) (void) BrickShapeFromDeltas←P180((word) &bs←v6296, v0x←v6112, v0y←v6140, v1x←v6168, v1y←v6196); SOURCE(3024, 27) brickShape←v6324 = bs←v6296; SOURCE(3053, 137) { word pd68; word x69; float tf70; word x71; float tf72; word x73; float tf74; word x75; float tf76; pd68 = (* (( (ptr) (* (( (ptr) gf←c15232)+22)/* var←c13696 */ ))+4) ); m←v6352 = (word) ( *( (fPt) ((* (ptr) pd68 ))))(( /*1*/ tf70 = (float)(int)v0x←v6112 / ( /*1*/ x69 = n0w←v6240, *(float*)&x69 /*1*/ ), *(word*)&tf70 /*1*/ ), ( /*1*/ tf72 = (float)(int)v1x←v6168 / ( /*1*/ x71 = n1h←v6268, *(float*)&x71 /*1*/ ), *(word*)&tf72 /*1*/ ), (* (( (ptr) clientToDevice←v4288)+2) ), ( /*1*/ tf74 = (float)(int)v0y←v6140 / ( /*1*/ x73 = n0w←v6240, *(float*)&x73 /*1*/ ), *(word*)&tf74 /*1*/ ), ( /*1*/ tf76 = (float)(int)v1y←v6196 / ( /*1*/ x75 = n1h←v6268, *(float*)&x75 /*1*/ ), *(word*)&tf76 /*1*/ ), (* (( (ptr) clientToDevice←v4288)+5) ), pd68); }; SOURCE(3192, 337) lab←L100023: ; if (((brickShape←v6324.f0 * brickShape←v6324.f1) < minLevels←v4344)) { } else { goto lab←L100021; }; SOURCE(3247, 282) if ((brickShape←v6324.f0 < brickShape←v6324.f1)) { SOURCE(3293, 46) brickShape←v6324.f0 = (brickShape←v6324.f0 + bs←v6296.f0); SOURCE(3341, 46) brickShape←v6324.f2 = (brickShape←v6324.f2 + bs←v6296.f2); SOURCE(3389, 83) if ((brickShape←v6324.f2 >= bs←v6296.f1)) { SOURCE(3426, 46) brickShape←v6324.f2 = (brickShape←v6324.f2 - bs←v6296.f1); }; } else { SOURCE(3483, 46) brickShape←v6324.f1 = (brickShape←v6324.f1 + bs←v6296.f1); }; goto lab←L100023; lab←L100021: ; SOURCE(3543, 25) (* (W3Pt) &var←c4388 ) = brickShape←v6324; var←c4388.f3 = m←v6352; goto lab←L100011; }; }; }; }; }; }; goto lab←L100014; lab←L100011: ; (* (W4Pt) formal←c097 ) = var←c4388; return; } static void BrickFromDotScreen←P420(formal←c0115, pixelsPerDot←v4580, degrees←v4608, formal←c0187, allowedRelativeError←v4664, minLevels←v4692, maxSample←v4720, pixelToDevice←v4748, trc←v4776) word formal←c0115; word pixelsPerDot←v4580; word degrees←v4608; word formal←c0187; word allowedRelativeError←v4664; word minLevels←v4692; word maxSample←v4720; word pixelToDevice←v4748; word trc←v4776; { W7 var←c15264; /* declaration of shape←v4636 skipped */ register ptr gf←c15296 = (ptr) &globalframe; W3 var←c4924; /* declaration of var←c14336 skipped */ word m←v6424; W4 brickSpec←v6452; W3 brick←v6480; var←c15264.f4/* shape←v4636 */ = formal←c0187; /* BrickFromDotScreen: */ SOURCE(3705, 696) { word tmpAddr77; tmpAddr77 = (word) (( (ptr) &var←c15264)+5)/* var←c14336 */ ; (* (ptr) tmpAddr77 ) = ( ((word) (fPt) Filter←P684) ); (* (( (ptr) tmpAddr77) + 1) ) = 1; }; SOURCE(4075, 143) { word var←c14368; word var←c14400; { word pd78; word x79; word x81; float tf82; pd78 = (* (( (ptr) (* (( (ptr) gf←c15296)+22)/* var←c13696 */ ))+7) ); var←c14368 = (word) ( *( (fPt) ((* (ptr) pd78 ))))(( tf82 = ( x79 = pixelsPerDot←v4580, *(float*)&x79 ) * ( x81 = (* (ptr) &fc80 ), *(float*)&x81 ), *(word*)&tf82 ), pd78); }; { word pd83; pd83 = (* (( (ptr) (* (( (ptr) gf←c15296)+22)/* var←c13696 */ ))+9) ); var←c14400 = (word) ( *( (fPt) ((* (ptr) pd83 ))))(degrees←v4608, pd83); }; { word pd84; pd84 = (* (( (ptr) (* (( (ptr) gf←c15296)+22)/* var←c13696 */ ))+14) ); m←v6424 = (word) ( *( (fPt) ((* (ptr) pd84 ))))(var←c14368, var←c14400, pixelToDevice←v4748, 0, pd84); }; }; SOURCE(4220, 98) (void) BrickSpecFromTransformedRectangle←P360((word) &brickSpec←v6452, (* (ptr) &fc85 ), (* (ptr) &fc85 ), m←v6424, allowedRelativeError←v4664, minLevels←v4692) ; SOURCE(4320, 65) (void) BrickFromFilter←P480((word) &brick←v6480, brickSpec←v6452, (word) (( (bPt) &var←c15264)+20)/* var←c14336 */ , maxSample←v4720, trc←v4776) ; SOURCE(4387, 14) var←c4924 = brick←v6480; /* removed tail goto */ (* (W3Pt) formal←c0115 ) = var←c4924; return; } static word Filter←P684(x←v12284, y←v12312, formal←c15360) word x←v12284; word y←v12312; word formal←c15360; { register ptr gf←c15328 = (ptr) &globalframe; word var←c12356; word tx←v6524; word ty←v6552; formal←c15360 = (formal←c15360 - 20); /* Filter: */ SOURCE(3936, 136) SOURCE(3959, 38) { word pd86; word x87; word x89; word x90; float tf91; pd86 = (* (( (ptr) (* (( (ptr) gf←c15328)+25)/* var←c14432 */ ))+13) ); tx←v6524 = (word) ( *( (fPt) ((* (ptr) pd86 ))))(( tf91 = (( x87 = x←v12284, *(float*)&x87 ) * ( x89 = (* (ptr) &fc88 ), *(float*)&x89 )) + ( x90 = (* (( (ptr) gf←c15328)+4) ), *(float*)&x90 ), *(word*)&tf91 ), pd86); }; SOURCE(3999, 38) { word pd92; word x93; word x94; word x95; float tf96; pd92 = (* (( (ptr) (* (( (ptr) gf←c15328)+25)/* var←c14432 */ ))+13) ); ty←v6552 = (word) ( *( (fPt) ((* (ptr) pd92 ))))(( tf96 = (( x93 = y←v12312, *(float*)&x93 ) * ( x94 = (* (ptr) &fc88 ), *(float*)&x94 )) + ( x95 = (* (( (ptr) gf←c15328)+5) ), *(float*)&x95 ), *(word*)&tf96 ), pd92); }; SOURCE(4039, 33) { word x97; word x98; word x99; word x100; word x101; float tf102; return(( tf102 = (( x97 = (* (( (ptr) formal←c15360)+4) ), *(float*)&x97 ) * ( x98 = tx←v6524, *(float*)&x98 )) + ((( x99 = (* (ptr) &fc28 ), *(float*)&x99 ) - ( x100 = (* (( (ptr) formal←c15360)+4) ), *(float*)&x100 )) * ( x101 = ty←v6552, *(float*)&x101 )), *(word*)&tf102 )); }; } static void BrickFromFilter←P480(formal←c0157, brickSpec←v5156, filter←v5184, maxSample←v5212, trc←v5240) word formal←c0157; W4 brickSpec←v5156; word filter←v5184; word maxSample←v5212; word trc←v5240; { W15 var←c15392; register ptr gf←c15424 = (ptr) &globalframe; W3 var←c5388; /* declaration of var←c14464 skipped */ /* declaration of var←c14496 skipped */ /* declaration of var←c14528 skipped */ /* declaration of brickShape←v6596 skipped */ /* declaration of n←v6652 skipped */ /* declaration of m←v6680 skipped */ word list←v6736 = 0; word bitsPerSample←v6792; word sampleMap←v6820; word scale←v6848; word realMaxSample←v6876; /* BrickFromFilter: */ SOURCE(4490, 2119) { word tmpAddr103; tmpAddr103 = (word) (( (ptr) &var←c15392)+4)/* var←c14464 */ ; (* (ptr) tmpAddr103 ) = ( ((word) (fPt) Compare←P864) ); (* (( (ptr) tmpAddr103) + 1) ) = 1; }; { word tmpAddr104; tmpAddr104 = (word) (( (ptr) &var←c15392)+6)/* var←c14496 */ ; (* (ptr) tmpAddr104 ) = ( ((word) (fPt) Equidistribute←P804) ); (* (( (ptr) tmpAddr104) + 1) ) = 1; }; { word tmpAddr105; tmpAddr105 = (word) (( (ptr) &var←c15392)+8)/* var←c14528 */ ; (* (ptr) tmpAddr105 ) = ( ((word) (fPt) Encode←P744) ); (* (( (ptr) tmpAddr105) + 1) ) = 1; }; SOURCE(4636, 45) (* (W3Pt) (( (ptr) &var←c15392)+10)/* brickShape←v6596 */ ) = (* (W3Pt) &brickSpec←v5156 ); SOURCE(4796, 43) (* (( (ptr) &var←c15392)+13)/* n←v6652 */ ) = ((* (( (ptr) &var←c15392)+11) ) * (* (( (ptr) &var←c15392)+10) )); SOURCE(4841, 37) (* (( (ptr) &var←c15392)+14)/* m←v6680 */ ) = ( ((* (( (ptr) &var←c15392)+13)/* n←v6652 */ ) == 101) ? 53 : 101 ) ; SOURCE(5258, 130) { word var←c14560; var←c14560 = maxSample←v5212; if ((var←c14560 <= 255)) { bitsPerSample←v6792 = 8; } else { if ((var←c14560 <= 65535)) { bitsPerSample←v6792 = 16; } else { bitsPerSample←v6792 = 32; }; }; }; SOURCE(5390, 147) { W4 var←c14592; var←c14592.f0 = 0; var←c14592.f1 = 0; { word idx106; var←c14592.f2 = ( idx106 = (* (( (ptr) &var←c15392)+10) ), SGNCK(idx106) ); }; { word idx107; var←c14592.f3 = ( idx107 = (* (( (ptr) &var←c15392)+11) ), SGNCK(idx107) ); }; { word pd108; pd108 = (* (( (ptr) (* (( (ptr) gf←c15424)+26)/* var←c14624 */ ))+19) ); sampleMap←v6820 = (word) ( *( (fPt) ((* (ptr) pd108 ))))(var←c14592, BCK(bitsPerSample←v6792, 33), 0, pd108); }; }; SOURCE(5539, 25) { word x109; *(float*)&scale←v6848 = ( x109 = (* (ptr) &fc28 ), *(float*)&x109 ) / (float)(unsigned)(* (( (ptr) &var←c15392)+13)/* n←v6652 */ ); }; SOURCE(5566, 37) { float tf110; realMaxSample←v6876 = ( tf110 = (float)(unsigned)maxSample←v5212, *(word*)&tf110 ); }; SOURCE(5605, 29) { word pd111; pd111 = (* (( (ptr) (* (( (ptr) gf←c15424)+26)/* var←c14624 */ ))+48) ); (void) ( *( (fPt) ((* (ptr) pd111 ))))(sampleMap←v6820, pd111); }; SOURCE(5636, 444) { register word s←v7128 = 0; register word noName←c14656; { word idx112; noName←c14656 = ( idx112 = (* (( (ptr) &var←c15392)+10) ), SGNCK(idx112) ); }; if ((s←v7128 >= noName←c14656)) { goto lab←L100026; }; lab←L100029: ; SOURCE(5680, 400) { register word f←v7172 = 0; register word noName←c14688; { word idx113; noName←c14688 = ( idx113 = (* (( (ptr) &var←c15392)+11) ), SGNCK(idx113) ); }; if ((f←v7172 >= noName←c14688)) { goto lab←L100030; }; lab←L100033: ; { W2 p←v7216; SOURCE(5724, 88) { W2 var←c0145; { W2 var←c14720; { word x114; *(float*)&var←c14720.f0 = (float)(unsigned)s←v7128 + ( x114 = (* (ptr) &fc80 ), *(float*)&x114 ); }; { word x115; *(float*)&var←c14720.f1 = (float)(unsigned)f←v7172 + ( x115 = (* (ptr) &fc80 ), *(float*)&x115 ); }; { word pd116; pd116 = (* (( (ptr) (* (( (ptr) gf←c15424)+22)/* var←c13696 */ ))+42) ); (void) ( *( (fPt) ((* (ptr) pd116 ))))((word) &var←c0145, brickSpec←v5156.f3, var←c14720, pd116); }; }; p←v7216 = var←c0145; }; SOURCE(5814, 26) { word var←c14752; word var←c14816; { word x117; word x118; *(float*)&var←c14752 = ( x117 = p←v7216.f0, *(float*)&x117 ) - ( x118 = (* (ptr) &fc28 ), *(float*)&x118 ); }; { word x119; word x120; *(float*)&var←c14816 = ( x119 = p←v7216.f1, *(float*)&x119 ) - ( x120 = (* (ptr) &fc28 ), *(float*)&x120 ); }; p←v7216.f0 = var←c14752; p←v7216.f1 = var←c14816; }; SOURCE(5842, 42) lab←L100036: ; { word x121; word x122; if ((( x121 = p←v7216.f0, *(float*)&x121 ) > ( x122 = (* (ptr) &fc28 ), *(float*)&x122 ))) { } else { goto lab←L100034; }; }; SOURCE(5861, 23) { word x123; word x124; *(float*)&p←v7216.f0 = ( x123 = p←v7216.f0, *(float*)&x123 ) - ( x124 = (* (ptr) &fc85 ), *(float*)&x124 ); }; goto lab←L100036; lab←L100034: ; SOURCE(5886, 43) lab←L100039: ; { word x125; word x126; if ((( x125 = p←v7216.f0, *(float*)&x125 ) < ( x126 = (* (ptr) &fc29 ), *(float*)&x126 ))) { } else { goto lab←L100037; }; }; SOURCE(5906, 23) { word x127; word x128; *(float*)&p←v7216.f0 = ( x127 = p←v7216.f0, *(float*)&x127 ) + ( x128 = (* (ptr) &fc85 ), *(float*)&x128 ); }; goto lab←L100039; lab←L100037: ; SOURCE(5931, 42) lab←L100042: ; { word x129; word x130; if ((( x129 = p←v7216.f1, *(float*)&x129 ) > ( x130 = (* (ptr) &fc28 ), *(float*)&x130 ))) { } else { goto lab←L100040; }; }; SOURCE(5950, 23) { word x131; word x132; *(float*)&p←v7216.f1 = ( x131 = p←v7216.f1, *(float*)&x131 ) - ( x132 = (* (ptr) &fc85 ), *(float*)&x132 ); }; goto lab←L100042; lab←L100040: ; SOURCE(5975, 43) lab←L100045: ; { word x133; word x134; if ((( x133 = p←v7216.f1, *(float*)&x133 ) < ( x134 = (* (ptr) &fc29 ), *(float*)&x134 ))) { } else { goto lab←L100043; }; }; SOURCE(5995, 23) { word x135; word x136; *(float*)&p←v7216.f1 = ( x135 = p←v7216.f1, *(float*)&x135 ) + ( x136 = (* (ptr) &fc85 ), *(float*)&x136 ); }; goto lab←L100045; lab←L100043: ; SOURCE(6020, 60) { word var←c14848; word var←c14944; { word var←c14880; word var←c14912; var←c14880 = (word) ( *( (fPt) ((* (ptr) filter←v5184 ))))(p←v7216.f0, p←v7216.f1, filter←v5184); var←c14912 = XR←NewObject(12, (* (( (ptr) gf←c15424)+7) )); (* (ptr) var←c14912 ) = s←v7128; (* (( (ptr) var←c14912)+1) ) = f←v7172; (* (( (ptr) var←c14912)+2) ) = var←c14880; var←c14848 = var←c14912; }; var←c14944 = XR←NewObject(8, (* (( (ptr) gf←c15424)+6) )); (* (ptr) var←c14944 ) = var←c14848; (* (( (ptr) var←c14944)+1) ) = list←v6736; list←v6736 = var←c14944; }; }; f←v7172 = (f←v7172 + 1); if ((f←v7172 < noName←c14688)) { goto lab←L100033; }; lab←L100030: ; }; s←v7128 = (s←v7128 + 1); if ((s←v7128 < noName←c14656)) { goto lab←L100029; }; lab←L100026: ; }; SOURCE(6100, 50) { word pd137; pd137 = (* (( (ptr) (* (( (ptr) gf←c15424)+27)/* var←c14976 */ ))+27) ); list←v6736 = (word) ( *( (fPt) ((* (ptr) pd137 ))))(list←v6736, (word) (( (bPt) &var←c15392)+16)/* var←c14464 */ , pd137) ; }; SOURCE(6152, 396) { register word i←v7260 = 0; if ((i←v7260 >= (* (( (ptr) &var←c15392)+13)/* n←v6652 */ ))) { goto lab←L100046; }; lab←L100049: ; { word node←v7304; word rest←v7332; word valReal←v7360; SOURCE(6177, 38) node←v7304 = XR←Narrow((* (ptr) list←v6736 ), (* (( (ptr) gf←c15424)+7) )); SOURCE(6217, 6) rest←v7332 = (* (( (ptr) list←v6736)+1) ); SOURCE(6248, 29) { word x138; word x139; *(float*)&valReal←v7360 = ((float)(unsigned)i←v7260 + ( x138 = (* (ptr) &fc80 ), *(float*)&x138 )) * ( x139 = scale←v6848, *(float*)&x139 ); }; SOURCE(6279, 63) if ((trc←v5240 != 0)) { SOURCE(6299, 43) { word x140; float tf141; float tf142; word x143; float tf144; float tf145; word x146; float tf147; valReal←v7360 = ( tf147 = FMIN(FMAX(( x140 = (word) ( *( (fPt) ((* (ptr) trc←v5240 ))))(valReal←v7360, trc←v5240), *(float*)&x140 ), ( x143 = (* (ptr) &fc17 ), *(float*)&x143 ), tf141, tf142), ( x146 = (* (ptr) &fc28 ), *(float*)&x146 ), tf144, tf145), *(word*)&tf147 ); }; }; SOURCE(6345, 172) { word value←v7512; SOURCE(6347, 55) { word x148; word x149; float tf150; word idx151; value←v7512 = ( idx151 = (word) XR←REAL32←Fix(( tf150 = ( x148 = valReal←v7360, *(float*)&x148 ) * ( x149 = realMaxSample←v6876, *(float*)&x149 ), *(word*)&tf150 )), SGNCK(idx151) ); }; SOURCE(6404, 46) if ((value←v7512 >= maxSample←v5212)) { SOURCE(6431, 19) value←v7512 = (maxSample←v5212 - 1); }; SOURCE(6452, 63) { word pd152; pd152 = (* (( (ptr) (* (( (ptr) gf←c15424)+26)/* var←c14624 */ ))+43) ); (void) ( *( (fPt) ((* (ptr) pd152 ))))(sampleMap←v6820, (* (W2Pt) node←v7304 ), value←v7512, 0, pd152); }; }; SOURCE(6520, 15) (* (( (ptr) list←v6736)+1) ) = 0; SOURCE(6537, 11) list←v6736 = rest←v7332; }; i←v7260 = (i←v7260 + 1); if ((i←v7260 < (* (( (ptr) &var←c15392)+13)/* n←v6652 */ ))) { goto lab←L100049; }; lab←L100046: ; }; SOURCE(6559, 50) var←c5388.f0 = maxSample←v5212; var←c5388.f1 = sampleMap←v6820; { word idx153; var←c5388.f2 = ( idx153 = (* (( (ptr) &var←c15392)+12) ), SGNCK(idx153) ); }; /* removed tail goto */ (* (W3Pt) formal←c0157 ) = var←c5388; return; } static word Encode←P744(pos←v6952, formal←c15488) W2 pos←v6952; word formal←c15488; { register ptr gf←c15456 = (ptr) &globalframe; word var←c6996; formal←c15488 = (formal←c15488 - 32); /* Encode: */ SOURCE(4683, 110) SOURCE(4729, 64) { word pd154; word idx155; word idx156; pd154 = (* (( (ptr) (* (( (ptr) gf←c15456)+28)/* var←c15072 */ ))+9) ); return(((word) ( *( (fPt) ((* (ptr) pd154 ))))(( idx155 = (word) pos←v6952.f0, SGNCK(idx155) ), (* (( (ptr) formal←c15488)+11) ), pd154) + ( idx156 = (word) pos←v6952.f1, SGNCK(idx156) ))); }; } static word Equidistribute←P804(i←v7056, formal←c15520) word i←v7056; word formal←c15520; { word var←c7100; formal←c15520 = (formal←c15520 - 24); /* Equidistribute: */ SOURCE(4880, 74) SOURCE(4930, 24) return((((i←v7056 * (* (( (ptr) formal←c15520)+14) )) + 13) % (* (( (ptr) formal←c15520)+13) ))); } static word Compare←P864(ref1←v12416, ref2←v12444, formal←c15584) word ref1←v12416; word ref2←v12444; word formal←c15584; { register ptr gf←c15552 = (ptr) &globalframe; word var←c12488; word a←v7556; word b←v7584; word var←c15104; word var←c0182; word var←c15136; formal←c15584 = (formal←c15584 - 16); /* Compare: */ SOURCE(4975, 278) SOURCE(5005, 29) a←v7556 = XR←Narrow(ref1←v12416, (* (( (ptr) gf←c15552)+7) )); SOURCE(5036, 29) b←v7584 = XR←Narrow(ref2←v12444, (* (( (ptr) gf←c15552)+7) )); SOURCE(5067, 39) { word x157; word x158; if ((( x157 = (* (( (ptr) a←v7556)+2) ), *(float*)&x157 ) < ( x158 = (* (( (ptr) b←v7584)+2) ), *(float*)&x158 ))) { SOURCE(5093, 13) return(0); }; }; SOURCE(5108, 42) { word x159; word x160; if ((( x159 = (* (( (ptr) a←v7556)+2) ), *(float*)&x159 ) > ( x160 = (* (( (ptr) b←v7584)+2) ), *(float*)&x160 ))) { SOURCE(5134, 16) return(2); }; }; SOURCE(5152, 83) var←c15104 = (word) Encode←P744((* (W2Pt) a←v7556 ), (word) (( (bPt) formal←c15584)+32)); var←c0182 = (word) Equidistribute←P804(var←c15104, (word) (( (bPt) formal←c15584)+24)); var←c15136 = (word) Encode←P744((* (W2Pt) b←v7584 ), (word) (( (bPt) formal←c15584)+32)); if (((var←c0182 < (word) Equidistribute←P804(var←c15136, (word) (( (bPt) formal←c15584)+24))) )) { SOURCE(5222, 13) return(0); }; SOURCE(5237, 16) return(2); } /* file: ImagerBrickImpl, module: ImagerBrickImpl, compiled at: July 28, 1993 10:14:26 am PDT */ extern void XR←install←ImagerBrickImpl() { NoName←Q1500(); } extern void XR←run←ImagerBrickImpl() { XR←Start(&globalframe); }