public class PictureConfig extends CameraControlOptions
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BASE_COMMAND
Path to the raspistill executable.
|
static int |
DEFAULT_HEIGHT
Default image height, in pixels.
|
static int |
DEFAULT_QUALITY
Default image quality, in percent.
|
static int |
DEFAULT_THUMBNAIL_QUALITY
Default thumbnail quality value, in percent.
|
static int |
DEFAULT_THUMBNAIL_X
Default thumbnail x value, in pixels.
|
static int |
DEFAULT_THUMBNAIL_Y
Default thumbnail y value, in pixels.
|
static int |
DEFAULT_TIMEOUT
Default timeout value, in milliseconds.
|
static int |
DEFAULT_WIDTH
Default image width, in pixels.
|
static int |
MAX_HEIGHT
Maximum image height, in pixels.
|
static int |
MAX_QUALITY
Maximum quality, in percent.
|
static int |
MAX_THUMBNAIL_QUALITY
Maximum thumbnail quality value, in percent.
|
static int |
MAX_WIDTH
Maximum image width, in pixels.
|
static int |
MIN_HEIGHT
Minimum image height, in pixels.
|
static int |
MIN_QUALITY
Minimum quality, in percent.
|
static int |
MIN_THUMBNAIL_QUALITY
Minimum thumbnail quality value, in percent.
|
static int |
MIN_THUMBNAIL_X
Minimum thumbnail x value, in pixels.
|
static int |
MIN_THUMBNAIL_Y
Minimum thumbnail y value, in pixels.
|
static int |
MIN_TIMELAPSE
Minimum time-lapse, in milliseconds.
|
static int |
MIN_TIMEOUT
Minimum timeout value, in milliseconds.
|
static int |
MIN_WIDTH
Minimum image width, in pixels.
|
DEFAULT_BRIGHTNESS, DEFAULT_CONTRAST, DEFAULT_EV_COMPENSATION, DEFAULT_SATURATION, DEFAULT_SHARPNESS, MAX_BRIGHTNESS, MAX_CONTRAST, MAX_EV_COMPENSATION, MAX_ISO, MAX_SATURATION, MAX_SHARPNESS, MIN_BRIGHTNESS, MIN_CONTRAST, MIN_EV_COMPENSATION, MIN_ISO, MIN_SATURATION, MIN_SHARPNESS
Constructor and Description |
---|
PictureConfig()
Constructor for a new PictureConfig using only default values
for parameters.
|
PictureConfig(int width,
int height)
Constructor for a new PictureConfig using specific values for
the width and the height.
|
PictureConfig(int width,
int height,
int quality)
Constructor for a new PictureConfig using specific values for
the width, the height and the quality.
|
PictureConfig(java.lang.String outputFilename,
int width,
int height)
Constructor for a new PictureConfig using specific values for
the output file name, the width and the height.
|
PictureConfig(java.lang.String outputFilename,
int width,
int height,
int quality)
Constructor for a new PictureConfig using specific values for
the output file name, the width, the height and the quality.
|
Modifier and Type | Method and Description |
---|---|
void |
disableThumbnail()
Disable the thumbnail.
|
void |
enableKeypressMode(boolean enable)
Enable/disable the keypress mode.
|
void |
enableRawBayerData(boolean enable)
Enable/disable the insertion of raw Bayer data into the jpeg metadata.
|
java.lang.String |
getCommand()
Get the complete command to execute to take a picture with the requested parameters.
|
java.lang.String |
getOutputFilenameWithExtension()
Returns the output filename, with the extension.
|
void |
setEncoding(PictureEncoding encoding)
Set the encoding to use for output file.
|
void |
setHeight(int height)
Set the image height.
|
void |
setOutputFilename(java.lang.String filename)
Specify the output filename.
|
void |
setQuality(int quality)
Set the jpeg quality.
|
void |
setThumbnail(int x,
int y,
int quality)
Allows specification of the thumbnail image inserted in to the JPEG file.
|
void |
setTimelapse(int timelapse)
Set the time-lapse value.
|
void |
setTimeout(int timeout)
Sets the time (in ms) before taking a picture and shuts down.
|
void |
setVerbose(boolean verbose)
Enable/disable the verbose mode.
|
void |
setWidth(int width)
Set the image width.
|
annotate, getOptions, setAWBMode, setBrightness, setCameraMode, setContrast, setEVCompensation, setExposureMode, setHorizontalFlip, setImageEffect, setISO, setRotationDegree, setSaturation, setSharpness, setVerticalFlip
public static final java.lang.String BASE_COMMAND
public static final int DEFAULT_WIDTH
public static final int MAX_WIDTH
public static final int MIN_WIDTH
public static final int DEFAULT_HEIGHT
public static final int MAX_HEIGHT
public static final int MIN_HEIGHT
public static final int DEFAULT_QUALITY
public static final int MAX_QUALITY
public static final int MIN_QUALITY
public static final int DEFAULT_TIMEOUT
public static final int MIN_TIMEOUT
public static final int MIN_TIMELAPSE
public static final int DEFAULT_THUMBNAIL_X
public static final int MIN_THUMBNAIL_X
public static final int DEFAULT_THUMBNAIL_Y
public static final int MIN_THUMBNAIL_Y
public static final int DEFAULT_THUMBNAIL_QUALITY
public static final int MAX_THUMBNAIL_QUALITY
public static final int MIN_THUMBNAIL_QUALITY
public PictureConfig()
public PictureConfig(int width, int height)
width
- the width to use for the new picture, in pixels.height
- the height to use for the new picture, in pixels.public PictureConfig(int width, int height, int quality)
width
- the width to use for the new picture, in pixels.height
- the height to use for the new picture, in pixels.quality
- the quality for the new picture, in percent.public PictureConfig(java.lang.String outputFilename, int width, int height)
outputFilename
- the output file name, without the extension part.width
- the width to use for the new picture, in pixels.height
- the height to use for the new picture, in pixels.public PictureConfig(java.lang.String outputFilename, int width, int height, int quality)
outputFilename
- the output file name, without the extension part.width
- the width to use for the new picture, in pixels.height
- the height to use for the new picture, in pixels.quality
- the quality for the new picture, in percent.public void setWidth(int width)
width
- the new width to apply for future pictures.public void setHeight(int height)
height
- the new height to apply for future pictures.public void setQuality(int quality)
Quality 100 is almost completely uncompressed. 75 is a good all round value.
quality
- the new quality to apply for future pictures.public void enableRawBayerData(boolean enable)
If true, this option inserts the raw Bayer data from the camera into the jpeg metadata.
enable
- true to enable the insertion of raw Bayer data into the jpeg metadata. False otherwise.public void setOutputFilename(java.lang.String filename)
If not specified (filename = null), a default name is given. If the filename is '-', then all output is sent to stdout.
filename
- the output file name, without the extension.public java.lang.String getOutputFilenameWithExtension()
public void setVerbose(boolean verbose)
If true, outputs debugging/information messages during the program run.
verbose
- true to output debugging/information messages during the program run.public void setTimeout(int timeout)
The program will run for a duration of timeout milliseconds, and then take the capture (if output is specified). If not specified, this timeout is set to 1 millisecond.
timeout
- the new timeout to apply for future pictures.public void setTimelapse(int timelapse)
This specific value is the time between shots in milliseconds. Note you should specify %04d at the point in the filename where you want a frame count number to appear. e.g:
-t 30000 -tl 2000 -o image%04d.jpg
will produce a capture every 2 seconds, over a total period of 30s, named image0001.jpg, image0002.jpg..image0015.jpg. Note that the %04d indicates a 4 digit number with leading zero's added to pad to the required number of digits. So, for example, %08d would result in an 8 digit number.
If a time-lapse value of 0 is entered, the application will take pictures as fast as possible. Note there is an minimum enforced pause of 30ms between captures to ensure that exposure calculations can be made.
timelapse
- the new timelapse value to apply for future pictures. -1 to disable timelapse mode.public void disableThumbnail()
If disabled, no thumbnail information will be placed in the file. This reduces the file size slightly.
public void setThumbnail(int x, int y, int quality)
If not specified, defaults are a size of 64x48 at quality 35.
x
- the new thumbnail x value to apply for future pictures.y
- the new thumbnail y value to apply for future pictures.quality
- the new thumbnail quality to apply for future picture.public void setEncoding(PictureEncoding encoding)
Valid options are jpg, bmp, gif and png. Note that unaccelerated image types (gif, png, bmp) will take much longer to save than JPG which is hardware accelerated.
Also note that the filename suffix is completely ignored when deciding the encoding of a file.
encoding
- null if disabled.public void enableKeypressMode(boolean enable)
The camera is run for the requested time (-t), and a captures can be initiated throughout that by pressing the Enter key. Press X then Enter will exit the application before the timeout is reached. If the timeout is set to 0, the camera will run indefinitely until X then Enter is typed. Using the verbose option (-v) will display a prompt asking for user input, otherwise no prompt is displayed.
enable
- true to enable the keypress mode. False to disable.public java.lang.String getCommand()