There are many different ways to handle the picture capture data. You could
simply get the "raw" byte array containing the picture data, you could create a
BufferedImage, you could write the picture to disk, and so on.
You decide what to do with the picture data by using a
Some picture capture handler implementations are provided by
picam but you
are free to provide your own.
This is the definition for a picture capture handler:
The interface is a generic interface, the type parameter
the type of the object that the picture capture handler will return.
This could for example be a
that can show the image, or whatever else you need.
begin() is called before the first capture data is retrieved, typical uses
for this method would be to open a new file/stream, allocate a buffer and so
pictureData() is called when capture data is retrieved from the camera, this
method is likely to be called multiple times and typical implementations would
use this to write the picture data to a file/stream, or process the raw bytes
in some other way.
end() is called after the last capture data is retrieved, typically
implementations would clean up resources here like closing a file/stream.
result() method can be used by your application to get the capture
picam provides a number of picture capture handler implementations:
ByteArrayPictureCaptureHandler- capture picture data to a
FilePictureCaptureHandler- save captured pictures to a named
SequentialFilePictureCaptureHandler- save captured pictures to a
Filewith an automatic sequential numbering scheme
If you need a different implementation, implement it!