<html>
	<head>
		<title>pjWebCam</title>
	</head>
	<body bgcolor=white text=0x00003f>
		<center>
		<table width=600 border=5 bgcolor=#e0e0e0 cellpadding=10><tr><td>
		<center><a name=top><h1>pjWebCam Documentation
		<br>Version 1.2a</h1></a></center>
		
		<h2>Overview</h2>
		<p>pjWebCam is a simple application to enable a windows video 
		capture device to be accessed across an intranet or internet.
		<p>The latest version of pjWebCam can be found at 
			<a href="http://www.homeusers.prestel.co.uk/cherryjam/utilities.html">
			http://www.homeusers.prestel.co.uk/cherryjam/utilities.html</a>
		<h2>Features</h2>
		pjWebCam supports the following.
		<dl>
			<dt>HTTP Server.</dt>
				<dd><p>This turns the machine that the camera is attached to into
				an HTTP (web) server. This responds to blank http requests by 
				sending the current image from the camera. 
				<p>Optionally a refresh interval can be configured, which will 
				cause some browsers to effect a &quot;client pull&quot; on 
				the image at the selected interval.<p></dd>
			<dt>FTP Client.</dt>
				<dd><p>Each time an image is captured (at the end of 
				each capture interval, or as a result of the user pressing the
				take button) the Image can be uploaded to an FTP server.<p></dd>
			<dt>Local Save.</dt>
				<dd><p>Each time an image is captured (at the end of 
				each capture interval, or as a result of the user pressing the
				take button) the Image can be saved locally. Incremental filenames
				are not currently supported.<p></dd>
			<dt>Captioned Images.</dt>
				<dd><p>Captured images can be captioned. This caption uses a 
				user defined, font, colors and message which can use escape 
				sequences to include time strings (using standard C strftime 
				escapes), using the host machines current locale settings.<p></dd>
			<dt>Overlayed Images.</dt>
				<dd><p>A Bitmap file can be superimposed on the captured image. This can
				be used to display a logo or other image on top of the capture.<p></dd>
			<dt>Image Processing.</dt>
				<dd><p>The captured image can be processed before being displayed. Processing 
				options include, blur, sharpen, negative, edge detect.<p></dd>
            <dt>Multiple Configurations.</dt>
                <dd><p>Multiple configurations can be stored. This allows simultaneous use 
                of multiple cameras, or simultaneous use of the same camera using different
                settings, for example ftp'ing captured images at different rates to 
                different locations. The configuration can be specified by name as a command 
                line parameter, so shortcuts can be setup to start pjWebCam with 
                different configurations.
                <p>Multiple instances of pjWebCam running the same configuration
                aren't allowed. If a second instance of pjWebCam is started with the
                same configuration as an already running instance then you are
		        prompted for different a configuration name.<p></dd>
            </dl>
		<h2>Configuration</h2>
		pjWebCam is configured entirely from its <a href=#main>main window</a>, and the dialogs that
		are created from there. The default configuration settings (those that are used if pjWebCam 
        is run without parameters)are stored in 
        the Registry in the key <strong>HKEY_CURRENT_USER\Software\Pacaro\pjWebCam</strong>
        and can be reset to defaults at any time by deleteing that key.
        <p>Named configurations are stored beneath that key, so a configuration
        <strong>foobar</strong> would be stored in the key
        <strong>HKEY_CURRENT_USER\Software\Pacaro\pjWebCam\foobar</strong>
		<h2>Banners</h2>
		<p>If you use pjWebCam on your site you might want to link back to my website. I
		have provided a couple of banners that you can use. The following html will 
		link back to the pjWebCam homepage.
		<pre>
&lt;a href=&quot;http://www.homeusers.prestel.co.uk/cherryjam/utilities.html&quot;&gt;
&lt;img src=pjWebCam.banner.jpg 
     width=256 height=64 border=0
     alt=&quot;Powered by pjWebCam&quot;&gt;&lt;/a&gt;
</pre>
		<a href="http://www.homeusers.prestel.co.uk/cherryjam/utilities.html">
		<img src=pjWebCam.banner.jpg 
			 width=256 height=64 border=0
			 alt="Powered by pjWebCam"></a>
		<p>This Banner is provided in three sizes...
		<table border=0>
		<tr><th>Normal</th><td><img src=pjWebCam.banner.jpg alt=pjWebCam.banner.jpg></td></tr>
		<tr><th>Small</th><td><img src=pjWebCam.small.banner.jpg alt=pjWebCam.small.banner.jpg></td></tr>
		<tr><th>Tiny</th><td><img src=pjWebCam.tiny.banner.jpg alt=pjWebCam.tiny.banner.jpg></td></tr>
		</table>
		<p>Any suggestions for better banners will be gratefully recieved!
		<h2>Legal Information</h2>
		<p>This program is copyright &copy; Paul Roberts 1998 - 2000.
		<p>This program is based in part on the work of the Independent Jpeg Group
		<p>This program is licensed free of charge and can be freely 
		distributed provided this file is distributed with it and that there 
		are no charges beyond those necessary for administrative purposes. 
		<p>
		<blockquote>BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO 
		WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 
		EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 
		OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY 
		KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 
		THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
		PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE 
		OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU 
		ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</blockquote> 
		<h2>I Wrote This</h2>
		<a href="mailto:pjWebCam@cherryjam.prestel.co.uk">
		Paul Roberts
		<br>pjWebCam@cherryjam.prestel.co.uk</a>
		<p>I Welcome your input and constructive criticism but may not have time
		to respond.
		<h2>Changes</h2>
		<h3>Version 1.2a - 23 June 2000</h3>
		Fixed memory leak in thread handling. Added more detailed FTP error reporting.
		<h3>Version 1.2 - 27 January 1999</h3>
		Added image overlays and preprocessing. Completely redesigned the caption dialog.
		<h3>Version 1.1b - 5 January 1999</h3>
		Added a "safe" capture mode. This should prevent the "black image" that some
		capture boards give. This mode shouldn't be used if you don't have this problem.
		If this fixes the problem for you please let me know. Thankyou.
		<h3>Version 1.1a - 2 January 1999</h3>
		Fixed ftp bug. Very long responses in some servers motd's caused crashes. 
		This is now fixed. Many thanks to <a href="http://www.xtao.demon.co.uk">Tao</a> for
		helping test this.
        <h3>Version 1.1 - 18 September 1998</h3>
        Added multiple configurations
        <br>Added PASV (passive) mode support for FTP
        <br>Improved storing of configuration, particularly time and local image capture.
        <br>Changed version numbering scheme. No more lettered versions :)
		<h3>Version 1.0d - 28 July 1998</h3>
		Added 300 second timeout on sockets, afterwhich that socket is killed.
		<br>Remembers the state of the preview window from session to session.
		<br>Added expiry header to http server.
		<h3>Version 1.0c - 23 June 1998</h3>
		Now &quot;remembers&quot; which capture device it last used.
		<br>Logging is now optional.
		<br>The log is not allowed to grow beyond 256 entries.
		<h3>Version 1.0b - 4 June 1998</h3>
		Support added for compressed mode capture.
		<br>Now allows selection of Capture Device if more than one is available.
		<br>FTP works better with some firewalls.
		<h3>Version 1.0a - 13 May 1998</h3>
		Support added for 8 bit capture. Both color and greyscale.
		<p><a href=#top>Top</a><hr>
		<center>
		<a name=main>
		<img src=dialog.gif border=0 width=500 height=397 usemap=#maindlg></a>
		</center>

		<p><a href=#top>Top</a><hr>
		<h2>Capture Settings</h2>
		<h3><a name=time>Capture Interval</a></h3>
		<p>This is the number of <a href=#interval>interval units</a>
		between captures.
		<h3><a name=interval>Interval Units</a></h3>
		<p>This is the units to use for counting <a href=#time>capture 
		intervals</a>, options are...
		<ul>
			<li>Seconds
			<li>Minutes
			<li>Hours
			<li>Days
			<li>Weeks
		</ul>
		<h3><a name=remain>Time Remaining</a></h3>
		<p>This displays the amount of time remaining until the next automatic
		capture.

		<p><a href=#top>Top</a><hr>
		<h2>Video Settings</h2>
        <h3><a name=device>Capture Device</a></h3>
        <p>This is the video capture device that pjWebCam is currently using.
		<h3><a name=preview>Preview Video</a></h3>
		<p>If this button is selected a video capture preview is displayed.
		<h3><a name=source>Source</a></h3>
		<p>Adjust settings for the video source.
		<h3><a name=format>Format</a></h3>
		<p>Adjust video format options.
		<h3><a name=display>Display</a></h3>
		<p>Adjust video display options.
		<h3><a name=quality>Quality</a></h3>
		<p>This specifies the &quot;quality&quot; setting to be used when
		encoding the jpeg file. This is a value between 0 and 100 where 
		0 represents the lowest quality (best compression) and 100 the 
		highest quality (least compression). The table shows the effects on file
		size of 5 different quality settings.
		<p><table border=1>
			<tr><th>Quality</th><th>Size in k</th><th>Image</th></tr>
			<tr><td>0</td><td>3</td><td><img src=test1.jpg width=320 height=240></td></tr>
			<tr><td>25</td><td>7</td><td><img src=test2.jpg width=320 height=240></td></tr>
			<tr><td>50</td><td>9</td><td><img src=test3.jpg width=320 height=240></td></tr>
			<tr><td>75</td><td>13</td><td><img src=test4.jpg width=320 height=240></td></tr>
			<tr><td>100</td><td>60</td><td><img src=test5.jpg width=320 height=240></td></tr>
		</table>
		<h3><a name=details>Details</a></h3>
		<p>This shows a summary of the current image capture options.

		<p><a href=#top>Top</a><hr>
		<h2>HTTP Server</h2>
		<h3><a name=http>Enable HTTP</a></h3>
		<p>If this is checked then pjWebCam operates as a simple HTTP server.
		Using the port number etc. specified in the http settings dialog.
		<h3><a name=httpsettings>HTTP Settings</a></h3>
		<p>This opens the http settings dialog.
		<h3>HTTP Settings Dialog</h3>
		<center>
		<img src=http.gif width=285 height=131 border=0 usemap=#http>
		</center>
		<h4><a name=httpport>Port Number</a></h4>
		<p>This specifies the port number that the http server listens on.
		The default port for http is 80, a common alternative (to avoid clashing
		with another webserver on the same address, or to avoid using a privilidged port)
		 is 8080.
		<h4><a name=httprefresh>Client Pull Refresh</a></h4>
		<p>If this is checked then the server will send and Http header asking
		the web client to perform a client pull after the time specified by the
		refresh interval.
		<h4><a name=httpinterval>Refresh Interval</a></h4>
		<p>This is the number of seconds the client should wait before performing
		a client pull.

		<p><a href=#top>Top</a><hr>
		<h2>FTP Settings</h2>
		<h3><a name=ftp>Enable FTP</a></h3>
		<p>If this is checked then each time pjWebCam captures and image it is
		uploaded to the ftp server specified in the ftp settings dialog.
		<h3><a name=ftpsettings>FTP Settings</a></h3>
		<p>This opens the ftp settings dialog.
		<h3>FTP Settings Dialog</h3>
		<center>
		<img src=ftp.gif width=300 height=244 border=0 usemap=#ftp>
		</center>
		<h4><a name=ftpuser>Username</a></h4>
		<p>This specifies the username to use when logging on to the ftp server.
		<h4><a name=ftppass>Password</a></h4>
		<p>This specifies the password to use when logging on to the ftp server.
		The password is stored (like all other pjWebCam configuration information) in 
		the registry. It is encrypted using a relatively simple encryption 
		mechanism. There is a potential security risk. If someone has access 
		to your registry they could break the encryption, given sufficient time and 
		expertise, thus giving them access to your ftp account.
		<h4><a name=ftpaccount>Account</a></h4>
		<p>This specifies an account name to connect to the ftp server with.
		This is not tested because i couldn't find an FTP server that uses this
		facility. The likelyhood is that you will not need to enter anything in this
		box.
		<h4><a name=ftpserver>Server</a></h4>
		<p>This is the internet address of your ftp server.
		<h4><a name=ftpdirectory>Directory</a></h4>
		<p>This is the subdirectory on that server that you wish to store the 
		image file in.
		<h4><a name=ftpfilename>Filename</a></h4>
		<p>This is the filename that you wish to store.
		<h4><a name=ftppassive>Passive Mode</a></h4>
		<p>If this is checked then the image file is ftp'd to the server in passive(PASV) mode. 
		An ftp session consists of 2 TCP/IP connectections between the clent and the server. 
		A control connection created from the client to the server, this is used to send control messages
		to the server, and a data connection (used to send and recieve data). Normally the server 
		connects to the client to create the data connection, in passive mode this is reversed. This can be
		helpful for ftp'ing through some firewalls.

		<p><a href=#top>Top</a><hr>
		<h2>Caption Settings</h2>
		<h3><a name=caption>Caption Image</a></h3>
		<p>If this is checked then any captured image has a caption using the
		settings specified in the caption settings dialog.
		<h3><a name=captionsettings>Overlay and Caption Settings</a></h3>
		<p>This opens the overlay and caption settings dialog.
		<h3>Overlay and Caption Settings Dialog</h3>
		<center>
		<img src=caption.gif width=365 height=510 border=0 usemap=#caption>
		</center>
		<h4><a name=captioncap>Caption</a></h4>
		<p>This specifies the string to be used as a caption. The following
		escapes are used to insert date and time information into the string.
		<p>
		<table border=1>
		<tr><th>Escape</th><th>Meaning</th></tr>
		<tr><td>%a</td><td>Abbreviated weekday name</td></tr>
		<tr><td>%A</td><td>Full weekday name</td></tr>
		<tr><td>%b</td><td>Abbreviated month name</td></tr>
		<tr><td>%B</td><td>Full month name</td></tr>
		<tr><td>%c</td><td>Date and time representation, appropriate for locale</td></tr>
		<tr><td>%d</td><td>Day of month as decimal number (01 - 31)</td></tr>
		<tr><td>%H</td><td>Hour in 24-hour format (00 - 23)</td></tr>
		<tr><td>%I</td><td>Hour in 12-hour format (01 - 12)</td></tr>
		<tr><td>%j</td><td>Day of year as decimal number (001 - 366)</td></tr>
		<tr><td>%m</td><td>Month as decimal number (01 - 12)</td></tr>
		<tr><td>%M</td><td>Minute as decimal number (00 - 59)</td></tr>
		<tr><td>%p</td><td>Current locale's A.M./P.M. indicator for 12-hour clock</td></tr>
		<tr><td>%S</td><td>Second as decimal number (00 - 59)</td></tr>
		<tr><td>%U</td><td>Week of year as decimal number, with Sunday as first day of week (00 - 51)</td></tr>
		<tr><td>%w</td><td>Weekday as decimal number (0 - 6; Sunday is 0)</td></tr>
		<tr><td>%W</td><td>Week of year as decimal number, with Monday as first day of week (00 - 51)</td></tr>
		<tr><td>%x</td><td>Date representation for current locale</td></tr>
		<tr><td>%X</td><td>Time representation for current locale</td></tr>
		<tr><td>%y</td><td>Year without century, as decimal number (00 - 99)</td></tr>
		<tr><td>%Y</td><td>Year with century, as decimal number</td></tr>
		<tr><td>%z, %Z</td><td>Time-zone name or abbreviation; no characters if time zone is unknown</td></tr>
		<tr><td>%%</td><td>Percent sign</td></tr>
		</table>
		<p>A flag <strong>#</strong> can be inserted in any escape, changing 
		the meanings as follows
		<p>
		<table border=1>
		<tr><th>Escape</th><th>Meaning</th></tr>
		<tr><td>%#a, %#A, %#b, %#B,<br>
				%#p, %#X, %#z, %#Z,<br>
				%#%</td><td># flag is ignored</td></tr>
		<tr><td>%#c</td><td>Long date and time representation, 
			appropriate for locale.</td></tr>
		<tr><td>%#x</td><td>Long date representation for current locale</td></tr>
		<tr><td>%#d, %#H, %#I, %#j,<br>
				%#m, %#M, %#S, %#U,<br> 
				%#w, %#W, %#y, %#Y</td><td>removes leading zeros (if any)</td></tr>
		</table>
		<h4><a name=captionvert>Vertical Position</a></h4>
		<p>Specifies the vertical position of the caption.
		<h4><a name=captionhorz>Horizontal Position</a></h4>
		<p>Specifies the horizontal position of the caption.
		<h4><a name=captiontrans>Transparent</a></h4>
		<p>If this is checked then the Caption is drawn onto the image 
		transparantly, other wise the text is drawn in a box.
		<h4><a name=captionfont>Caption Font</a></h4>
		<p>Clicking this button allows you to select a caption font.
		<h4><a name=captionfg>Foreground Colour</a></h4>
		<p>Clicking this button allows you to select the foreground colour of 
		the caption.
		<h4><a name=captionbg>Background Colour</a></h4>
		<p>Clicking this button allows you to select the background colour of 
		the caption. This is the colour of the box that the text is drawn onto 
		unless transparent is selected, in which case this is used as the outline
		colour for the text.
		<h4><a name=captionswap>Swap Colours</a></h4>
		<p>Clicking this button exchanges the current foreground and baground colours.
		<h4><a name=captionprocess>Image Processing</a></h4>
		<p>This combo box allows the selection of image processing. Available options are 
		<ul><li>Blur</li>
		<li>Sharpen</li>
		<li>Sharpen More</li>
		<li>Edge Detect</li>
		<li>Trace Contours</li>
		<li>Negative</li>
		</ul>
		<h4><a name=captionuse>Use Overlay</a></h4>
		<p>If this is selected then an overlay image will be used
		<h4><a name=captionbitmap>Bitmap</a></h4>
		<p>This is the name of the bitmap file to be used as an overlay image
		<h4><a name=captionbrowse>Bitmap browse</a></h4>
		<p>This allows you to browse for a bitmap file
		<h4><a name=captionmethod>Overlay Method</a></h4>
		<p>This is the method used to overlay the bitmap on the captured image. 
		The available methods are
		<dl>
			<dt>Average<dd>This averages the pixels in the captured and overlay images.
			<dt>Difference<dd>This subtracts the pixels in the captured image from the overlay image and 
					offsets the result by 128
			<dt>Distance<dd>This calculates the linear distance in color space of the pixels.
			<dt>Interlace<dd>This alternates lines from the two images.
			<dt>Alternate<dd>This alternates pixels from the two images
			<dt>Add<dd>This adds the pixels from the two images.
			<dt>Subtract<dd>This subtracts the source pixels from the overlay pixels.
			<dt>Multiply<dd>This multiplies the pixel values and divides by 256.
			<dt>TL Transparent<dd>Treats the colour of the top left pixel in the overlay image as a transparent
			colour.
		</dl>
		<h4><a name=captionpos>Overlay Position</a></h4>
		This selects the position of the overlay image on the source image. If Stretch is selected then
		the overlay image is stretched to the same size as the source image. If the overlay image is 
		smaller than the source image then pixels outside the overlay image area are assumed to have the 
		same colour as the top left pixel of the overlay image.
		<h4><a name=captionpreview>Caption Preview</a></h4>
		This shows a preview of the current overlay and caption settings.

		<p><a href=#top>Top</a><hr>
		<h2>File Settings</h2>
		<h3><a name=file>Save File</a></h3>
		<p>If this is checked then the captured image is saved locally.
		<h3><a name=filename>Filename</a></h3>
		<p>This is the filename of the image to save.
		<h3><a name=browse>Browse</a></h3>
		<p>This button allows you to browse for a filename to save as.

		<p><a href=#top>Top</a><hr>
		<h2>Other</h2>
		<h3><a name=progress>Progress Indicator</a></h3>
		<p>This shows an indication of outstanding file transfers.
		<h3><a name=take>Take</a></h3>
		<p>This button causes a capture to happen immediately, resetting the
		timer.
		<h3><a name=about>About</a></h3>
		<p>Displays copyright information about pjWebCam.
		<h3><a name=exit>Exit</a></h3>
		<p>Closes pjWebCam.

        <h3><a name=dolog>log - checkbox</a></h3>
        <p>The state of this checkbox determines whether or not actions are logged
        to the listbox.
		<h3><a name=log>log - listbox</a></h3>
		<p>This shows a log of actions in the current session, if loggin is enabled.
		</td></tr></table>
		</center>
		<map name=maindlg>
			<area shape=rect coords=111,51,154,73 href=#time>
			<area shape=rect coords=167,51,256,71 href=#interval>
			<area shape=rect coords=111,77,256,99 href=#remain>

			<area shape=rect coords=302,51,384,63 href=#http>
			<area shape=rect coords=398,45,472,67 href=#httpsettings>

			<area shape=rect coords=302,103,375,115 href=#ftp>
			<area shape=rect coords=398,97,472,119 href=#ftpsettings>

			<area shape=rect coords=302,156,387,168 href=#caption>
			<area shape=rect coords=398,150,472,172 href=#captionsettings>

            <area shape=rect coords=122,128,267,148 href=#device>
			<area shape=rect coords=23,155,105,177 href=#preview>
			<area shape=rect coords=122,154,148,179 href=#source>
			<area shape=rect coords=155,154,181,179 href=#format>
			<area shape=rect coords=188,154,214,179 href=#display>
			<area shape=rect coords=221,155,268,177 href=#quality>
			<area shape=rect coords=23,185,267,202 href=#details>

			<area shape=rect coords=23,238,84,250 href=#file>
			<area shape=rect coords=93,231,233,253 href=#filename>
			<area shape=rect coords=242,229,266,253 href=#browse>

			<area shape=rect coords=290,189,486,204 href=#progress>
			<area shape=rect coords=319,217,356,252 href=#take>
			<area shape=rect coords=365,217,403,252 href=#about>
			<area shape=rect coords=411,217,449,252 href=#exit>

			<area shape=rect coords=23,270,58,282 href=#dolog>
            <area shape=rect coords=14,290,485,378 href=#log>
		</map>
		<map name=http>
			<area shape=rect coords=108,33,160,55 href=#httpport>
			<area shape=rect coords=17,67,120,79 href=#httprefresh>
			<area shape=rect coords=108,94,160,116 href=#httpinterval>
		</map>
		<map name=ftp>
			<area shape=rect coords=68,33,217,55 href=#ftpuser>
			<area shape=rect coords=68,61,217,83 href=#ftppass>
			<area shape=rect coords=68,89,217,111 href=#ftpaccount>
			<area shape=rect coords=68,124,217,146 href=#ftpserver>
			<area shape=rect coords=68,152,217,174 href=#ftpdirectory>
			<area shape=rect coords=68,180,217,202 href=#ftpfilename>
			<area shape=rect coords=68,214,178,228 href=#ftppassive>
		</map>
		<map name=caption>
			<area shape=rect coords=23,52,174,95 href=#captioncap>
			<area shape=rect coords=23,117,91,133 href=#captionvert>
			<area shape=rect coords=23,145,91,164 href=#captionhorz>
			<area shape=rect coords=95,118,171,131 href=#captiontrans>
			<area shape=rect coords=146,137,172,162 href=#captionfont>
			<area shape=rect coords=138,173,164,198 href=#captionfg>
			<area shape=rect coords=138,209,164,235 href=#captionbg>
			<area shape=rect coords=42,194,115,215 href=#captionswap>
			<area shape=rect coords=198,38,350,58 href=#captionprocess>
			<area shape=rect coords=235,71,313,85 href=#captionuse>
			<area shape=rect coords=198,105,320,128 href=#captionbitmap>
			<area shape=rect coords=324,105,350,128 href=#captionbrowse>
			<area shape=rect coords=198,148,350,168 href=#captionmethod>
			<area shape=rect coords=198,189,350,210 href=#captionpos>
			<area shape=rect coords=20,255,343,498 href=#captionpreview>
		</map>
	</body>
</html>