com.android.ddmlib
Class RawImage

java.lang.Object
  extended by com.android.ddmlib.RawImage

public final class RawImage
extends Object

Data representing an image taken from a device frame buffer.


Field Summary
 int alpha_length
           
 int alpha_offset
           
 int blue_length
           
 int blue_offset
           
 int bpp
           
 byte[] data
           
 int green_length
           
 int green_offset
           
 int height
           
 int red_length
           
 int red_offset
           
 int size
           
 int version
           
 int width
           
 
Constructor Summary
RawImage()
           
 
Method Summary
 int getARGB(int index)
          Returns an ARGB integer value for the pixel at index in data.
 int getBlueMask()
          Returns the mask value for the blue color.
 int getGreenMask()
          Returns the mask value for the green color.
static int getHeaderSize(int version)
          Returns the size of the header for a specific version of the framebuffer adb protocol.
 int getRedMask()
          Returns the mask value for the red color.
 RawImage getRotated()
          Returns a rotated version of the image The image is rotated counter-clockwise.
 boolean readHeader(int version, ByteBuffer buf)
          Reads the header of a RawImage from a ByteBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public int version

bpp

public int bpp

size

public int size

width

public int width

height

public int height

red_offset

public int red_offset

red_length

public int red_length

blue_offset

public int blue_offset

blue_length

public int blue_length

green_offset

public int green_offset

green_length

public int green_length

alpha_offset

public int alpha_offset

alpha_length

public int alpha_length

data

public byte[] data
Constructor Detail

RawImage

public RawImage()
Method Detail

readHeader

public boolean readHeader(int version,
                          ByteBuffer buf)
Reads the header of a RawImage from a ByteBuffer.

The way the data is sent over adb is defined in system/core/adb/framebuffer_service.c

Parameters:
version - the version of the protocol.
buf - the buffer to read from.
Returns:
true if success

getRedMask

public int getRedMask()
Returns the mask value for the red color.

This value is compatible with org.eclipse.swt.graphics.PaletteData


getGreenMask

public int getGreenMask()
Returns the mask value for the green color.

This value is compatible with org.eclipse.swt.graphics.PaletteData


getBlueMask

public int getBlueMask()
Returns the mask value for the blue color.

This value is compatible with org.eclipse.swt.graphics.PaletteData


getHeaderSize

public static int getHeaderSize(int version)
Returns the size of the header for a specific version of the framebuffer adb protocol.

Parameters:
version - the version of the protocol
Returns:
the number of int that makes up the header.

getRotated

public RawImage getRotated()
Returns a rotated version of the image The image is rotated counter-clockwise.


getARGB

public int getARGB(int index)
Returns an ARGB integer value for the pixel at index in data.



Copyright © 2008-2012. All Rights Reserved.