coders
Class LSBEncoder

java.lang.Object
  extended by coders.LSBEncoder

public class LSBEncoder
extends java.lang.Object

Encodes/decodes messages into 24-bit color bitmaps potentially using the LSB of each color of each pixel. Currently, one bit from each pixel will be used. The first 32 pixels / bits will be used to encode the length of the message in bytes. Probably want to change these routines to be payload-driven instead of pixel-driven.

Author:
Jonathan L Dautrich Jr.

Constructor Summary
LSBEncoder()
           
 
Method Summary
private static boolean bit(byte x, int y)
          Returns true if and only if bit y in byte x is set.
private static boolean bit(long x, int y)
          Returns true if and only if bit y in long x is set.
static java.lang.String decode(Bitmap bitmap)
           
static byte[] decodeBytes(Bitmap bitmap)
           
static void encode(Bitmap bitmap, byte[] bytes)
           
static void encode(Bitmap bitmap, java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSBEncoder

public LSBEncoder()
Method Detail

encode

public static void encode(Bitmap bitmap,
                          java.lang.String s)

encode

public static void encode(Bitmap bitmap,
                          byte[] bytes)

decode

public static java.lang.String decode(Bitmap bitmap)

decodeBytes

public static byte[] decodeBytes(Bitmap bitmap)

bit

private static boolean bit(byte x,
                           int y)
Returns true if and only if bit y in byte x is set.

Parameters:
x -
y -
Returns:

bit

private static boolean bit(long x,
                           int y)
Returns true if and only if bit y in long x is set.

Parameters:
x -
y -
Returns: