annotate servlet/doc/Scaler.html @ 281:60a064f27d25

Servlet version 1.22b1 - more fast searching (hopefully all working now) - some simple synchronisation - some reshuffling of methods to eliminate cruft
author robcast
date Fri, 15 Oct 2004 16:59:47 +0200
parents 250f3b8762e4
children c9b2938861cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
183
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
1 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
2 <html>
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
3 <head>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
4 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
82
6f4c01ab13c4 Small doc update.
robcast
parents: 81
diff changeset
5 <TITLE>Scaler servlet</TITLE>
183
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
6 </head>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
7 <BODY>
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
8 <H1>Scaler</H1>
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
9
178
3258490649b5 Servlet version 1.17b2
robcast
parents: 170
diff changeset
10 <p>A Servlet for scaling images. (Version 1.16b2)</p>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
11
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
12 <h2>Web API</h2>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
13
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
14 <p>The Scaler servlet takes parameters in the http request format:
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
15 <code>Scaler/request_path/?param1=value1&param2=value2&...</code>
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
16 Unknown parameters will be silently ignored.</p>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
17
183
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
18 <p>Recognised parameters:</p>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
19 <ul>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
20 <li><b>request_path</b> path to file or directory.</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
21
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
22 <li><b>fn</b> path to file or directory below <code>/docuserver/images</code>
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
23 (or other configured image directory).
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
24 This path will be added to the <code>request_path</code> behind the servlet name.
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
25 Either parameter can be empty.</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
26
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
27 <li><b>pn</b> page number. Index into the (alphabetically sorted) directory
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
28 given by the path. Starts with 1. Ignored if the path points to a file.
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
29 Default: 1.</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
30
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
31 <li><b>dw</b> destination image width (pixels). If omitted the image is scaled to fit
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
32 dh.</li>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
33
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
34 <li><b>dh</b> destination image height (pixels). If omitted the image is scaled to fit
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
35 dw.</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
36
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
37 <li><b>wx</b> relative x offset of the image area to be sent (0 &lt;= wx &lt;= 1).
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
38 Default: 0.</li>
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
39
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
40 <li><b>wy</b> relative y offset of the image area to be sent (0 &lt;= wy &lt;= 1).
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
41 Default: 0.</li>
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
42
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
43 <li><b>ww</b> relative width of the image area to be sent (0 &lt;= ww &lt;= 1).
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
44 Default: 1.</li>
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
45
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
46 <li><b>wh</b> relative height of the image area to be sent (0 &lt;= wh &lt;= 1).
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
47 Default: 1.</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
48
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
49 <li><b>ws</b> additional scaling factor. The resulting image will have the size
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
50 <code>[ws*dw,ws*dh]</code>. Default: 1.</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
51
109
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
52 <li><b>mo</b> flags for the mode of operation separated by ",".
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
53 <ul>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
54 <li><b>fit</b>: always scale the image to fit
109
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
55 <code>[dw,dh]</code>.<br>
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
56
109
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
57 <b>file</b>: send the file as-is (may
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
58 be very large and all sorts of image types!). If configuration
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
59 doesn't allow sending files
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
60 (<code>sendfile-allowed=false</code>) revert to
109
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
61 <code>clip</code>.<br>
182
31367c3c8202 Servlet version 1.18b1
robcast
parents: 178
diff changeset
62
31367c3c8202 Servlet version 1.18b1
robcast
parents: 178
diff changeset
63 <b>rawfile</b>: send the file as-is with a mime-type of
31367c3c8202 Servlet version 1.18b1
robcast
parents: 178
diff changeset
64 <code>application/octet-stream</code> so it can be downloaded with
31367c3c8202 Servlet version 1.18b1
robcast
parents: 178
diff changeset
65 the browser.<br>
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
66
109
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
67 <b>clip</b>: send the file in its
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
68 original resolution, cropped to fit <code>[dw,dh]</code>.<br> If
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
69 none of these flags is set heuristics is used (send unzoomed GIF
131
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
70 as-is).<br>
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
71
131
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
72 <b>osize</b>: scale to original size based on the image resolution
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
73 (from the image metadata) and display resolution (from parameter
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
74 <code>ddpi</code>). Fails if either resolution is unknown.
131
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
75 </li>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
76
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
77 <li><b>errtxt</b>: send error response as HTML.<br>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
78 <b>errimg</b>: response as image (default).</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
79
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
80 <li><b>q0</b>-<b>q2</b>: quality of interpolation in scaling
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
81 (<code>q0</code>: worst, default).</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
82
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
83 <li><b>lores</b>: try to use scaled image (default)<br>
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
84
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
85 <b>hires</b>: always use unscaled image.<br>
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
86
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
87 If the image is zoomed (ww, wh &lt; 1) the unscaled image is
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
88 used in any case.</li>
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
89
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
90 <li><b>vmir</b>: mirror image vertically.<br>
170
d40922628e4a Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 131
diff changeset
91
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
92 <b>hmir</b>: mirror image horizontally.</li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
93 </ul>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
94 </li>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
95
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
96 <li><b>cont</b>: change contrast of the image. Negative value
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
97 reduces contrast, positive value enhances contrast. Pixel value is
81
c7e6d92e7fd5 Small doc update.
robcast
parents: 80
diff changeset
98 multiplied by 2^cont. Default: 0</li>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
99
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
100 <li><b>brgt</b>: change brightness of image. Negative value reduces
109
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
101 brightness, positive value enhances brightness. The value brgt is
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
102 added to the pixel value. Default: 0</li>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
103
109
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
104 <li><b>rot</b>: rotate image. Rotation angle is given in
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
105 degrees. Default: 0</li>
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
106
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
107 <li><b>rgbm</b>: modify color by multiplication. The contrast of the
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
108 red green and blue components of the image can be reduced or
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
109 enhanced similar to the <code>cont</code> parameter. The factors for
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
110 red, green and blue are separated by slashes (for example
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
111 0.86/0/-0.5). Default: 0/0/0</li>
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
112
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
113 <li><b>rgba</b>: modify color by addition. The brightness of the red
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
114 green and blue components of the image can be reduced or enhanced
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
115 similar to the <code>brgt</code> parameter. The factors for red,
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
116 green and blue are separated by slashes (for example
200584e60a0b Updated with Version 1.9
robcast
parents: 82
diff changeset
117 100/0/25). Default: 0/0/0</li>
80
4d0e75042673 Docu update to match Scaler servlet version 1.6b.
robcast
parents: 1
diff changeset
118
131
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
119 <li><b>ddpi</b>: resolution of client display for <code>osize</code> mode.
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
120 Either <code>ddpi</code> or <code>ddpix</code> and <code>ddpiy</code> must
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
121 be set to use <code>osize</code> mode.</li>
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
122
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
123 <li><b>ddpix</b>: resolution of client display in x direction for
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
124 <code>osize</code> mode.</li>
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
125
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
126 <li><b>ddpiy</b>: resolution of client display in y direction for
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
127 <code>osize</code> mode.</li>
737f5cd647e1 Docu for osize.
robcast
parents: 109
diff changeset
128
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
129 </ul>
183
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
130
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
131 <p>The image to be loaded can be specified by the
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
132 <code>request_path</code> (deprecated) or the <code>fn</code>
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
133 (preferred) parameter and the optional index <code>pn</code></p>
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
134 <ul>
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
135 <li> if <code>fn</code> points to a directory then the file with
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
136 the index <code>pn</code> (in alphabetical order according to
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
137 ASCII) will be loaded</li>
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
138
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
139 <li>if <code>fn</code> points to a file (with or without
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
140 extension) then this file will be loaded</li>
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
141 </ul>
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
142
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
143 <p>The image will be scaled equally in horizontal and vertical
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
144 direction such that the resulting image does not exceed the rectangle
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
145 <code>[dw,dh]</code>. If only either height or width is given the
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
146 image is scaled to match only the given parameter. The size of the
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
147 resulting image in the other parameter is determined by the aspect
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
148 ratio of the image.
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
149 </p>
1
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
150
0ff3ede32060 Initial revision
robcast
parents:
diff changeset
151 </BODY>
183
250f3b8762e4 updated Scaler docu
robcast
parents: 182
diff changeset
152 </html>