Class 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.
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • 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