it.lilik.capturemjpeg
Class AxisURL

java.lang.Object
  extended by it.lilik.capturemjpeg.AxisURL

public class AxisURL
extends Object

This class can handle URL generation for a specific host (Axis camera).
Use the getURL() method to obtain a valid url string. See for a description of all the accepted parameters.

Author:
Alessio Caiazza, Cosimo Cecchi

Constructor Summary
AxisURL(String host)
          Creates a AxisURL for the specified host
host must be an IP or an hostname, without http:// or any trailing slash.
 
Method Summary
 String getURL()
          Transforms the AxisURL object in a correct URL string
 AxisURL setCamera(int camera)
          Selects the source camera (valid for video servers with more than a camera).
 AxisURL setColorLevel(int colorLevel)
          Sets the desired level of color/grayscale.
 AxisURL setDesiredFPS(int desiredFPS)
          Sets the desired framerate.
 AxisURL setQuad(boolean quad)
          Generates a quad image.
 AxisURL setRequiredFPS(int requiredFPS)
          Sets the required framerate.
 AxisURL setResolution(int width, int height)
          Sets the desired resolution.
 AxisURL setRotation(int rotation)
          Rotates the image clockwise (0, 90, 180, 270).
 AxisURL setShowClock(boolean showClock)
          Show/hides the timestamp.
 AxisURL setShowDate(boolean showDate)
          Show/hides the date.
 AxisURL setShowText(boolean showText)
          Show/hides the text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisURL

public AxisURL(String host)
Creates a AxisURL for the specified host
host must be an IP or an hostname, without http:// or any trailing slash.

Parameters:
host - the hostname or ip
Method Detail

getURL

public String getURL()
Transforms the AxisURL object in a correct URL string

Returns:
the URL in string form

setDesiredFPS

public AxisURL setDesiredFPS(int desiredFPS)
Sets the desired framerate.
This is encoded as des_fps parameter into the url.

Parameters:
desiredFPS - the framerate
Returns:
a reference to this

setRequiredFPS

public AxisURL setRequiredFPS(int requiredFPS)
Sets the required framerate.
This is encoded as req_fps parameter into the url.

Parameters:
requiredFPS - the framerate
Returns:
a reference to this

setResolution

public AxisURL setResolution(int width,
                             int height)
Sets the desired resolution.
This is encoded as resolution parameter into the url.

Parameters:
width - desired width of the image
height - desired height of the image
Returns:
a reference to this

setCamera

public AxisURL setCamera(int camera)
Selects the source camera (valid for video servers with more than a camera).
This is encoded as camera parameter into the url.

Parameters:
camera - the number of the camera to be shown.
Returns:
a reference to this

setColorLevel

public AxisURL setColorLevel(int colorLevel)
Sets the desired level of color/grayscale.
(0 = grayscale, 100 = full color).
This is encoded as colorlevel parameter into the url.

If you pass a colorlevel out of the bounds it will be automatically adjusted to the minimum or the maximum accordingly.

Parameters:
colorLevel - the desired color level
Returns:
a reference to this

setShowClock

public AxisURL setShowClock(boolean showClock)
Show/hides the timestamp.
This is encoded as clock parameter into the url.

Parameters:
showClock - whether to show the timestamp.
Returns:
a reference to this

setShowDate

public AxisURL setShowDate(boolean showDate)
Show/hides the date.
This is encoded as date parameter into the url.

Parameters:
showDate - whether to show the date.
Returns:
a reference to this

setQuad

public AxisURL setQuad(boolean quad)
Generates a quad image.
This is encoded as quad parameter into the url.

Parameters:
quad - whether to show a quad image.
Returns:
a reference to this

setShowText

public AxisURL setShowText(boolean showText)
Show/hides the text.
This is encoded as text parameter into the url.

Parameters:
showText - whether to show the text.
Returns:
a reference to this

setRotation

public AxisURL setRotation(int rotation)
Rotates the image clockwise (0, 90, 180, 270).
This is encoded as rotation parameter into the url.

If the provided rotation parameter is not valid, it will be rounded to the nearest valid one.

Parameters:
rotation - angle of rotation to be applied.
Returns:
a reference to this


Copyright © 2008-09 Alessio Caiazza, Cosimo Cecchi All Rights Reserved.