%!PS % PS Bitmap "Swings and Tilts" Architect's Perspective Untilt 3.0 % ================================================================ % by Don Lancaster % This NUTILT30.PSL does a swing and tilt only plus a FORCED white ( no pure red ) blocking % It has a new scaling that eliminates the distortion above 0.15 % and has been simplified and heavily revised. % "backwards" (stretch the top) subjects are currently treated by a double inversion and % thus may be somewhat longer executing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /inputfilename (shurstop.bmp) store % name of file to be tilted /tiltoutfilename (shurstopv.bmp) store % name of tilt only output file /inputfilename (zzzz.bmp) store % name of file to be tilted /tiltoutfilename (zzzzt7.bmp) store % name of tilt only output file /filenameprefix (C:\\Documents and Settings\\don 2\\Desktop\\Madeline Rework\\) store % input and tiltout files must presently be in the same subdirectory /vtiltaxis 0.75 store % the VERTICAL position at which no tilt adjustment will be made. % Usually 0.5 on a strictly limited 0 to 1.0 range. 0 = left 1 = right /htiltaxis 0.5 store % the HORIZONTAL position at which no tilt adustment will be made. % best results are often at 0.5 /howmuchtilt 0.158 store % amount of tilt to correct for. Typical range is 0.06 to 0.12 .06 = 6%. % positive values compress top of image (usual). % negative values compress bottom of image (rarely needed) /correcttilt true store % flag to fix tilt /addcrosshairs true store % add a red crosshair to htiltaxis, vtiltaxis? /adjustdistortion true store % flag to attempt to adjust distortion /distadjadj 1.0 pop 5 store % distortion ratio adjust 1.0 tracks howmuchtilt %% To run this file, select START then RUN then Acrodist-F. Drag and drop into Distiller. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright c 2003,2011 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 1.5 % PostScript-as-language utility reads a .BMP bitmap file and provides "view camera" % swing and tilt image distortion effects that make edges truly vertical. % To use, modify filenames and correction axis and percentage. Resave and send % to Acrobat Distiller USING "Acrodist-F" from the XP command line! % Alys run at highest possible resolution, preferably before any other post processing. % Some extreme left or right pixel columns may be lost during processing % and replaced by neighbor values. Pre-expand image if edge values are critical. % Several interpolations may be explored. Nearest neighbor should not be too much of a problem % if later reductions use bicubic elsewhere. % A "no Acrobat file produced" error is normal and expected. % ========= % IMPORTANT NOTE: Don Lancaster's file gonzo.ps is required for this program. % After obvious location mods, uncomment ONE of the following two lines: (C:\\Documents and Settings\\don\\Desktop\\gonzo\\gonzo.ps) run % use internal gonzo % (A:\\gonzo.ps) run % use external gonzo % NOTE THAT ALL PS FILENAME STRINGS !!!DEMAND!!! DOUBLE REVERSE SLASHES. % NOTE THAT DISTILLER DEMANDS EXECUTION FROM THE COMMAND LINE VIA "acrodist-F" % Otherwise most files can not be accessed % GONZO20A Guru Gonzo PostScript power tools (Interim release) % Includes gonzo justification and layout utilities. % Copyright c 1990, 1996, 2001, 2011 and later by Don Lancaster and Synergetics, Box 809, % Thatcher Arizona, 5552 (928) 428-4073 don@tinaja.com support % via http://www.tinaja.com All commercial rights and all electronic % media rights **FULLY** reserved. Reposting is expressly forbidden. % ======== /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def guru % activate gonzo utilities % ========= % gonzo excerpts /mt {moveto} store /black {0 setgray} store % timing utilities. use stopwatchon and stopwatchoff for simple % one shot timing. For multiple time totals, use resettimer % starttimer stoptimer ... starttimer stoptimer reporttimer /stopwatchoff {stoptimer reporttimer} def % for single shots /stopwatchon {resettimer starttimer} def % for single shots /reporttimer {mytime 1000 div (\nElapsed time: ) print 20 string cvs print ( seconds.\n) print flush} def % to host /resettimer {/mytime 0 def} def % reset timer /starttimer {usertime /mytimenow exch def} def % add to time so far /stoptimer {usertime mytimenow sub /mytime exch mytime add def} def % for multiple timing intervals % mergestr merges the two top stack strings into one top stack string /mergestr {2 copy length exch length add string dup dup 4 3 roll 4 index length exch putinterval 3 1 roll exch 0 exch putinterval} def % [yourarray] makestring converts an array to a string... /makestring {dup length string dup % new string of right size /NullEncode filter % make a file out of string 3 -1 roll {1 index exch write} forall pop } def /random {rand 65536 div 32768 div mul cvi} def % as in -- 6 random -- % no longer used %%%%%%%%% end gonzo excerpts % ========= /distadj [ 0.000 0.500 1.000 1.499 1.997 2.495 2.992 3.488 3.984 4.480 4.974 5.461 5.962 6.454 6.946 7.438 7.928 8.419 8.908 9.397 9.885 10.37 10.86 11.34 11.83 12.31 12.80 13.28 13.76 14.24 14.73 15.21 15.69 16.17 16.65 17.12 17.60 18.08 18.56 19.03 19.51 19.98 20.45 20.93 21.40 21.87 22.34 22.81 23.28 23.75 24.22 24.69 25.15 25.62 26.08 26.55 27.01 27.48 27.94 28.40 28.86 29.32 29.78 30.24 30.70 31.16 31.61 32.07 32.52 32.98 33.43 33.89 34.34 34.79 35.24 35.69 36.14 36.59 37.04 37.49 37.93 38.38 38.83 39.27 39.71 40.16 40.60 41.04 41.48 41.92 42.36 42.80 43.24 43.68 44.11 44.55 44.98 45.42 45.85 46.28 46.72 47.15 47.58 48.01 48.44 48.86 49.29 49.72 50.14 50.57 50.99 51.42 51.84 52.26 52.68 53.10 53.52 53.94 54.36 54.78 55.19 55.61 56.01 56.44 56.85 57.26 57.67 58.09 58.50 58.90 59.31 59.72 60.13 60.53 60.94 61.34 61.75 62.15 62.55 62.95 63.35 63.75 64.15 64.55 64.95 65.34 65.74 66.13 66.53 66.92 67.31 67.70 68.09 68.48 68.87 69.26 69.64 70.03 70.41 70.80 71.18 71.57 71.95 72.33 72.71 73.09 73.47 73.84 74.22 74.59 74.97 75.34 75.72 76.09 76.46 76.83 77.20 77.57 77.94 78.30 78.67 79.03 79.40 79.76 80.12 80.48 80.85 81.20 81.56 81.92 82.28 82.63 82.99 83.34 83.70 84.05 84.40 85.10 85.45 85.80 86.14 86.49 86.83 87.18 87.52 87.86 88.20 88.54 88.88 89.22 89.56 89.89 90.23 90.56 90.90 91.23 91.56 91.89 92.22 92.55 92.88 93.20 93.53 93.85 94.18 94.50 94.82 95.14 95.46 95.78 96.10 96.41 96.73 97.04 97.36 97.67 97.98 98.29 98.60 98.91 99.22 99.53 99.83 100.1 100.4 100.7 101.0 101.3 101.6 101.9 102.2 102.5 102.8 103.1 103.4 103.7 104.0 104.2 104.5 104.8 105.1 105.4 105.7 106.0 106.2 106.5 106.8 107.1 107.4 107.6 107.9 108.2 108.5 108.7 109.0 109.3 109.5 109.8 110.1 110.3 110.6 110.9 111.1 111.4 111.7 111.9 112.2 112.4 112.7 112.9 113.2 113.4 113.7 114.0 114.2 114.4 114.7 114.9 115.2 115.4 115.7 115.9 116.1 116.4 116.6 116.9 117.1 117.3 117.6 117.8 118.0 118.3 118.5 118.7 118.9 119.2 119.4 119.6 119.8 120.0 120.3 120.5 120.7 120.9 121.1 121.3 121.5 121.7 122.0 122.2 122.4 122.6 122.8 123.0 123.2 123.4 123.6 123.8 124.0 124.2 124.4 124.5 124.7 124.9 125.1 125.3 125.5 125.7 125.8 126.0 126.2 126.4 126.6 126.7 126.9 127.1 127.3 127.4 127.6 127.8 127.9 128.1 128.3 128.4 128.6 128.7 128.9 129.1 129.2 129.4 129.5 129.7 129.8 130.0 130.1 130.3 130.4 130.6 130.7 130.8 131.0 131.1 131.2 131.4 131.5 131.6 131.8 131.9 132.0 132.2 132.3 132.4 132.5 132.6 132.8 132.9 133.0 133.1 133.2 133.3 133.4 133.6 133.7 133.8 133.9 134.0 134.1 134.2 134.3 134.4 134.5 134.6 134.6 134.7 134.8 134.9 135.0 135.1 135.2 135.1 135.3 135.4 135.5 135.6 135.6 135.7 135.8 135.8 135.9 136.0 136.0 136.1 136.2 136.2 136.3 136.3 136.4 136.4 136.5 136.5 136.6 136.6 136.7 136.7 136.7 136.8 136.8 136.9 136.9 136.9 137.0 137.0 137.0 137.0 137.1 137.1 137.1 137.1 137.1 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.2 137.1 137.1 137.1 137.1 137.1 137.0 137.0 137.0 137.0 136.9 136.9 136.8 136.8 136.8 136.7 136.7 136.6 136.6 136.5 136.5 136.4 136.4 136.3 136.3 136.2 136.2 136.1 136.0 136.0 135.9 135.8 135.7 135.7 135.6 135.5 135.4 135.1 135.3 135.2 135.1 135.0 134.9 134.8 134.7 134.6 134.5 134.4 134.3 134.2 134.1 134.0 133.8 133.7 133.6 133.5 133.4 133.2 133.1 133.0 132.9 132.7 132.6 132.4 132.3 132.2 132.0 131.9 131.7 131.6 131.4 131.3 131.1 131.0 130.8 130.6 130.5 130.3 130.1 130.0 129.8 129.6 129.4 129.2 129.1 128.9 128.7 128.5 128.3 128.1 127.9 127.7 127.5 127.3 127.1 126.9 126.7 126.4 126.2 126.0 125.8 125.6 125.1 125.1 124.9 124.6 124.4 124.2 123.9 123.7 123.4 123.2 122.9 122.7 122.4 122.2 121.9 121.7 121.4 121.1 120.8 120.6 120.3 120.0 119.7 119.5 119.2 118.9 118.6 118.3 118.0 117.7 117.4 117.1 116.8 116.5 116.2 115.8 115.5 115.2 114.9 114.6 114.1 113.9 113.6 113.2 112.9 112.6 112.2 111.9 111.5 111.2 110.8 110.4 110.1 109.7 109.3 109.0 108.6 108.2 107.8 107.5 107.1 106.7 106.3 105.9 105.5 105.1 104.7 104.3 103.9 103.5 103.1 102.7 102.2 101.8 101.4 101.0 100.5 100.1 99.70 99.26 98.82 98.37 97.92 97.47 97.01 96.55 96.09 95.62 95.15 94.68 94.21 93.73 93.25 92.76 92.27 91.78 91.29 90.79 90.29 89.79 89.28 88.77 88.25 87.74 87.22 86.69 86.16 85.63 85.10 84.56 84.02 83.48 82.93 82.38 81.82 81.27 80.70 80.14 79.57 79.00 78.42 77.85 77.26 76.68 76.09 75.11 74.90 74.30 73.69 73.09 72.48 71.86 71.24 70.62 70.00 69.37 68.73 68.10 67.46 66.81 66.17 65.51 64.86 64.20 63.54 62.87 62.20 61.53 60.85 60.17 59.48 58.79 58.10 57.40 56.70 55.99 55.28 54.57 53.85 53.13 52.41 51.68 50.94 50.21 49.47 48.72 47.97 47.22 46.46 45.70 44.93 44.16 43.39 42.61 41.83 41.04 40.25 39.45 38.65 37.85 37.04 36.23 35.41 34.59 33.76 32.93 32.10 31.26 30.42 29.57 28.72 27.86 27.00 26.13 25.26 24.39 23.51 22.62 21.74 20.84 19.94 19.04 18.14 17.22 16.31 15.39 14.46 13.53 12.59 11.65 10.71 9.764 8.810 7.851 6.887 5.917 4.944 3.965 2.981 1.992 0.991 0.000 ] store 70 70 20 setgrid 20 20 showgrid % first the real plot 1 0 0 setrgbcolor 0 0 mt 0 1 distadj length 1 sub { /curpos exch store curpos 800 div 20 mul distadj curpos get 137.2 div 20 mul lineto } for line3 stroke % then a cubic spline /tension 0.724 store 0 0 1 setrgbcolor 0 0 mt [0 0 70.9 20 0 -80 ] curvetrace line2 stroke % plot solution below /a -2.8843 store /b .45267 store /c 2.4317 store 0 0 mt line1 0 0.01 1 {/cur exch store cur 20 mul a cur mul cur mul cur mul b cur mul cur mul add c cur mul add 20 mul lineto } for 0 1 0 setrgbcolor line1 stroke % plot inverse atan x - x3/3 + x5/5 0 0 mt 0.3 0.01 1.0 {/cur exch store cur 20 mul cur cur dup mul cur mul 1 div sub % cur dup mul dup mul cur mul add 5 div % fifth % cur dup mul dup mul dup mul cur mul sub 20 mul 8 div 20 mul 1.04 mul lineto } for 0 0 0 setrgbcolor 0 setlinewidth stroke showpage % EOF % solve axxx + bcc + cx slope is 3axx + 2 bx + c = 0 at x = 0.58 slope % 1.0092a + 1.1600b + c = 0 at x = 0.58 slope % .1951a + .33640b + .5800c = 1 at x = 0.58 amplitude % a + b + c = 0 at x = 1 amplitude % 1.0092a + 1.1600b + c = 0 at x = 0.58 slope % a + b + c = 0 at x = 1 amplitude % subtracting % 0.0092a + 0.1600b = 0 c cancels % 0.0092a = -0.1600b % a = -17.39b % c = -a -b % .1951a + .33640b + .5800c = 1 % .1951a + .33640b - .5800a -.5800b = 1 % -.3849a - .2436b = 1 % 6.6934b - .2436b = 1 % 6.4498b = 1 % b = 0.15504 % a = -2.6962 % c = 2.5411 % check at 1 should be zero % check amplitude at .58 should be .58 % check slope at .58 should be 0 % real zero slope is 0.585 % 1.02668a + 1.1700b + c = 0 at x = 0.585 slope % .20020a + .3422b + .5850c = 1 at x = 0.585 amplitude % a + b + c = 0 at x = 1 amplitude % 1.02668a + 1.1700b + c = 0 at x = 0.58 slope % a + b + c = 0 at x = 1 amplitude % subtracting % 0.02668a + 0.1700 b = 0 % a = -6.3718b % c = -a - b % .20020a + .3422b + .5850c = 1 % .20020a + .3422b - .5850a -.5850b = 1 % -.3848a - .24280b = 1 % 2.4519b - .24280b = 1 % 2.2091b = 1 % b = .45267 % a = -2.8843 % c = 2.4317