|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsafehome.device.netcamera.CameraPacket
public class CameraPacket
This class represents a network camera packet.
Network camera packets are used for communication between network cameras
and a camera viewer. A camera packet consists of a control signal and a camera image.
A control signal is pre-defined integer constant. A camera image is a byte array of
BufferedImage
in DeviceCamera
. A camera packet instance is
converted to byte array before socket communication.
Field Summary | |
---|---|
static int |
CONTROL_PAN_LEFT
|
static int |
CONTROL_PAN_RIGHT
|
static int |
CONTROL_SEND_IMAGE
|
static int |
CONTROL_ZOOM_IN
|
static int |
CONTROL_ZOOM_OUT
|
Constructor Summary | |
---|---|
CameraPacket(int type)
Constructs a camera packet for control transfer |
|
CameraPacket(int type,
BufferedImage img)
Construnts a camera packet for image data transfer with a BufferedImage |
|
CameraPacket(int type,
byte[] serializedImage)
Constructs a camera packet for image data transfer with a serialized image |
Method Summary | |
---|---|
BufferedImage |
getBufferedImage()
Returns an image of this camera packet |
int |
getType()
Returns a control signal of this instances |
byte[] |
toBytes()
Converts a camera packet instance to a serialized camera packet. |
static CameraPacket |
toPacket(byte[] data)
Converts a serialized camera packet to a camera packet instnace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CONTROL_SEND_IMAGE
public static final int CONTROL_PAN_LEFT
public static final int CONTROL_PAN_RIGHT
public static final int CONTROL_ZOOM_IN
public static final int CONTROL_ZOOM_OUT
Constructor Detail |
---|
public CameraPacket(int type)
type
- Control signalpublic CameraPacket(int type, byte[] serializedImage)
type
- Control signalserializedImage
- Serialized BufferedImage
instancepublic CameraPacket(int type, BufferedImage img)
BufferedImage
type
- Control sianelimg
- BufferedImage
instance to be serializedMethod Detail |
---|
public int getType()
public BufferedImage getBufferedImage()
BufferedImage
instance of this camera packetpublic byte[] toBytes()
public static CameraPacket toPacket(byte[] data)
data
- Serialized camera packet
CameraPacket
instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |