Package steganography.image.encoders
Class BuffImgEncoder
- java.lang.Object
-
- steganography.image.encoders.BuffImgEncoder
-
- Direct Known Subclasses:
PixelBit
public abstract class BuffImgEncoder extends java.lang.Object
This is a superclass to algorithms which encode and decode payloads into images using PixelCoordinateOverlays as image representation.
-
-
Field Summary
Fields Modifier and Type Field Description protected PixelCoordinateOverlay
overlay
-
Constructor Summary
Constructors Constructor Description BuffImgEncoder(PixelCoordinateOverlay overlay)
This is a superclass to algorithms which encode and decode payloads into images using PixelCoordinateOverlays as image representation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract byte[]
decode(int bLength)
Decodes pixels in the sequence provided by the overlay (given to the constructor) according to its algorithm.abstract void
encode(byte[] payload)
Encodes the payload in the sequence of pixels provided by the overlay given to the constructor.PixelCoordinateOverlay
getOverlay()
-
-
-
Field Detail
-
overlay
protected PixelCoordinateOverlay overlay
-
-
Constructor Detail
-
BuffImgEncoder
public BuffImgEncoder(PixelCoordinateOverlay overlay)
This is a superclass to algorithms which encode and decode payloads into images using PixelCoordinateOverlays as image representation.- Parameters:
overlay
- PixelCoordinateOverlay to get pixels from
-
-
Method Detail
-
getOverlay
public PixelCoordinateOverlay getOverlay()
-
encode
public abstract void encode(byte[] payload) throws ImageCapacityException
Encodes the payload in the sequence of pixels provided by the overlay given to the constructor.- Parameters:
payload
- payload or "message" to encode- Throws:
ImageCapacityException
- if the payload is larger than the available pixels
-
decode
public abstract byte[] decode(int bLength)
Decodes pixels in the sequence provided by the overlay (given to the constructor) according to its algorithm. Returns the result as a byte array.
Decoding will continue until the byte arrays length is equal to bLength.
- Parameters:
bLength
- number of bytes to decode- Returns:
- decoded bytes
-
-