org.marre.sms.nokia
Class OtaBitmap

java.lang.Object
  extended byorg.marre.sms.nokia.OtaBitmap

public class OtaBitmap
extends java.lang.Object

Nokia OTA Bitmap format

This class can currently only handle non-animated B/W OTA Bitmaps.

Format is:

                     Octet 1 -> 0 : Not sure what this is
                     Octet 2 -> <width> : Width of image
                     Octet 3 -> <height> : Height of image
                     Octet 4 -> 1 : Number of colors?? B/W == 1?
                     Octet 5-n -> <imgdata> : Image data 1 bit for each pixel
 
I have only verified this class with BufferedImages of type TYPE_INT_ARGB

Author:
Markus Eriksson

Constructor Summary
OtaBitmap(java.awt.image.BufferedImage theImg)
          Creates an OtaBitmap object from an BufferedImage.
OtaBitmap(byte[] otaBitmap)
          Initialise with a raw Ota Bitmap
 
Method Summary
 byte[] getBytes()
          Returns the encoded OtaBitmap
 int getHeight()
           
 byte[] getImageData()
          Returns the created image data (not including image header)
 int getWidth()
           
 void setHeight(int i)
           
 void setWidth(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OtaBitmap

public OtaBitmap(byte[] otaBitmap)
Initialise with a raw Ota Bitmap

Parameters:
otaBitmap -

OtaBitmap

public OtaBitmap(java.awt.image.BufferedImage theImg)
Creates an OtaBitmap object from an BufferedImage.

Every pixel that is not white will be converted to black.

Parameters:
theImg - Image to convert.
Method Detail

getImageData

public byte[] getImageData()
Returns the created image data (not including image header)

Returns:
Image data

getBytes

public byte[] getBytes()
Returns the encoded OtaBitmap

Returns:
An encoded OtaBitmap

getHeight

public int getHeight()
Returns:

getWidth

public int getWidth()
Returns:

setHeight

public void setHeight(int i)
Parameters:
i -

setWidth

public void setWidth(int i)
Parameters:
i -


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.