O2Plib.image
Class DrawPix

java.lang.Object
  extended by O2Plib.image.DrawPix

public class DrawPix
extends java.lang.Object


Field Summary
private static int[] char4x6table
          Small 4x6 character set [0:127,1:2]
private static int[] char5x7table
          Large 5x7 character set was designed by Jonathan Merril.
static int FONT4X6
          Font size codes for drawtext...()
static int FONT5X7
          Font size codes for drawtext...()
static int nth
          picture file iteration #
 
Constructor Summary
DrawPix()
          DrawPix() - Constructor
 
Method Summary
static void drawBoundariesForSpots(DbSample dbSample, char[] pix, int pixWidth, int color)
          drawBoundariesForSpots() - If generating the segmented spot image in pix5, and the -DRAWSPOTS:B<'O'riginal or 'Z'image> was set, draw a white boundary around each spot in the 'O'riginal or segmented 'Z' image (-DRAWSPOTS:BO default).
static void drawBoundariesForSpots(DbSample dbSample, int[] pix, int pixWidth, int color)
          drawBoundariesForSpots() - If generating the segmented spot image in pix5, and the -DRAWSPOTS:B<'O'riginal or 'Z'image> was set, draw a white boundary around each spot in the 'O'riginal or segmented 'Z' image (-DRAWSPOTS:BO default).
static void drawDotsInSpots(DbSample dbSample, char[] pix, int color, int pixWidth, boolean drawPlusFlag, boolean drawMinEnclRectFlag, boolean drawSxSyEllipseFlag)
          drawDotsInSpots() - draw symbol indicating the spots in the spot list in the pix.
static void drawDotsInSpots(DbSample dbSample, int[] pix, int color, int pixWidth, boolean drawPlusFlag, boolean drawMinEnclRectFlag, boolean drawSxSyEllipseFlag)
          drawDotsInSpots() - draw symbol indicating the spots in the spot list in the pix.
static void drawTextInPix(char[] pix, int x0, int y0, java.lang.String str, int gray, int font, int zoom, int pixWidth, int pixHeight, boolean clrBkgrdFlag)
          drawTextInPix() - Display the string 'str' starting at (x0,y0) in specified 'gray' value in either of two charcter sizes 4x6 (upper case only: font=0); or 5x7 (upper/lower case: font=1) and a 'zoom' factor of 1X (default) to 64X.
static void drawTextInPix(int[] pix, int x0, int y0, java.lang.String str, int gray, int font, int zoom, int pixWidth, int pixHeight, boolean clrBkgrdFlag)
          drawTextInPix() - Display the string 'str' starting at (x0,y0) in specified 'gray' value in either of two charcter sizes 4x6 (upper case only: font=0); or 5x7 (upper/lower case: font=1) and a 'zoom' factor of 1X (default) to 64X.
static int get2D(char[] pix, int pixWidth, int x, int y)
          get2D() - get the pixel at pix(x,y) computed at (y+pixelWidth+x)
static int get2D(int[] pix, int pixWidth, int x, int y)
          get2D() - get the pixel at pix(x,y) computed at (y+pixelWidth+x)
static int set2D(char[] pix, int pixWidth, int x, int y, int g)
          set2D() - save the pixel value g at pix(x,y) computed at (y+pixelWidth+x)
static int set2D(int[] pix, int pixWidth, int x, int y, int g)
          set2D() - save the pixel value g at pix(x,y) computed at (y+pixelWidth+x)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nth

public static int nth
picture file iteration #


FONT4X6

public static final int FONT4X6
Font size codes for drawtext...()

See Also:
Constant Field Values

FONT5X7

public static final int FONT5X7
Font size codes for drawtext...()

See Also:
Constant Field Values

char5x7table

private static final int[] char5x7table
Large 5x7 character set was designed by Jonathan Merril. [0:127,1:2]


char4x6table

private static final int[] char4x6table
Small 4x6 character set [0:127,1:2]

Constructor Detail

DrawPix

public DrawPix()
DrawPix() - Constructor

Method Detail

drawTextInPix

public static void drawTextInPix(int[] pix,
                                 int x0,
                                 int y0,
                                 java.lang.String str,
                                 int gray,
                                 int font,
                                 int zoom,
                                 int pixWidth,
                                 int pixHeight,
                                 boolean clrBkgrdFlag)
drawTextInPix() - Display the string 'str' starting at (x0,y0) in specified 'gray' value in either of two charcter sizes 4x6 (upper case only: font=0); or 5x7 (upper/lower case: font=1) and a 'zoom' factor of 1X (default) to 64X.
 NOTE:  Only 7-bits of the 8-bit ASCII character are used.
 NOTE:  These fonts are hardwired! 

Parameters:
pix - is the picture buffer to draw text in
x0 - is the upper left hand corner of box to draw text in
y0 - is the upper left hand corner of box to draw text in
str - is the text string to draw in pix
gray - is the color of text
font - is the font code: FONT4X6, FONT5X7
zoom - is the zoom factor 1X (default) to 64X max
pixWidth - is image width
pixHeight - is image height
clrBkgrdFlag - - if set, clear background w/complent gray

drawTextInPix

public static void drawTextInPix(char[] pix,
                                 int x0,
                                 int y0,
                                 java.lang.String str,
                                 int gray,
                                 int font,
                                 int zoom,
                                 int pixWidth,
                                 int pixHeight,
                                 boolean clrBkgrdFlag)
drawTextInPix() - Display the string 'str' starting at (x0,y0) in specified 'gray' value in either of two charcter sizes 4x6 (upper case only: font=0); or 5x7 (upper/lower case: font=1) and a 'zoom' factor of 1X (default) to 64X.
 NOTE:  Only 7-bits of the 8-bit ASCII character are used.
 NOTE:  These fonts are hardwired! 

Parameters:
pix - is the picture buffer to draw text in
x0 - is the upper left hand corner of box to draw text in
y0 - is the upper left hand corner of box to draw text in
str - is the text string to draw in pix
gray - is the color of text
font - is the font code: FONT4X6, FONT5X7
zoom - is the zoom factor 1X (default) to 64X max
pixWidth - is image width
pixHeight - is image height
clrBkgrdFlag - - if set, clear background w/complent gray

drawDotsInSpots

public static void drawDotsInSpots(DbSample dbSample,
                                   int[] pix,
                                   int color,
                                   int pixWidth,
                                   boolean drawPlusFlag,
                                   boolean drawMinEnclRectFlag,
                                   boolean drawSxSyEllipseFlag)
drawDotsInSpots() - draw symbol indicating the spots in the spot list in the pix. Always draw a dot in the centroid of the spot. If drawPlusSwitch, then draw a plus at each spot. NOTE: Draw a white 3x3 '+' which is nicer but slower than a DOT. If drawMinEnclRectFlag, then draw a minimum enclosing rectangle around each spot. If drawSxSyEllipseFlag, then draw an ellipse of size 2*sX,sY) at each spot. [TODO]

Parameters:
dbSample - to get spot list to draw.
pix - is the picture buffer to draw text in
pixWidth - is image width
color - is the color to draw the text
drawPlusSwitch - to draw "+" else draw dots at each spot.
drawMinEnclRectSwitch - to draw minimum enclosing rectangle at spots.
drawSxSyEllipseFlag - to draw ellipse at spots.

drawDotsInSpots

public static void drawDotsInSpots(DbSample dbSample,
                                   char[] pix,
                                   int color,
                                   int pixWidth,
                                   boolean drawPlusFlag,
                                   boolean drawMinEnclRectFlag,
                                   boolean drawSxSyEllipseFlag)
drawDotsInSpots() - draw symbol indicating the spots in the spot list in the pix. Always draw a dot in the centroid of the spot. If drawPlusSwitch, then draw a plus at each spot. NOTE: Draw a white 3x3 '+' which is nicer but slower than a DOT. If drawMinEnclRectFlag, then draw a minimum enclosing rectangle around each spot. If drawSxSyEllipseFlag, then draw an ellipse of size 2*sX,sY) at each spot. [TODO]

Parameters:
dbSample - to get spot list to draw.
pix - is the picture buffer to draw text in
pixWidth - is image width
color - is the color to draw the text
drawPlusSwitch - to draw "+" else draw dots at each spot.
drawMinEnclRectSwitch - to draw minimum enclosing rectangle at spots.
drawSxSyEllipseFlag - to draw ellipse at spots.

drawBoundariesForSpots

public static void drawBoundariesForSpots(DbSample dbSample,
                                          char[] pix,
                                          int pixWidth,
                                          int color)
drawBoundariesForSpots() - If generating the segmented spot image in pix5, and the -DRAWSPOTS:B<'O'riginal or 'Z'image> was set, draw a white boundary around each spot in the 'O'riginal or segmented 'Z' image (-DRAWSPOTS:BO default). The boundaries are in a list of DbBoundary lists listOfBnds[ccNumber] which is generated at the time the FBL is generated.

Parameters:
dbSample - to get spot list to draw.
pix - is the picture buffer to draw text in
pixWidth - is image width
color - is the color to draw the text

drawBoundariesForSpots

public static void drawBoundariesForSpots(DbSample dbSample,
                                          int[] pix,
                                          int pixWidth,
                                          int color)
drawBoundariesForSpots() - If generating the segmented spot image in pix5, and the -DRAWSPOTS:B<'O'riginal or 'Z'image> was set, draw a white boundary around each spot in the 'O'riginal or segmented 'Z' image (-DRAWSPOTS:BO default). The boundaries are in a list of DbBoundary lists listOfBnds[ccNumber] which is generated at the time the FBL is generated.

Parameters:
dbSample - to get spot list to draw.
pix - is the picture buffer to draw text in
pixWidth - is image width
color - is the color to draw the text

get2D

public static final int get2D(int[] pix,
                              int pixWidth,
                              int x,
                              int y)
get2D() - get the pixel at pix(x,y) computed at (y+pixelWidth+x)

Parameters:
pix - is the image buffer
pixWidth - is image width
x - of pixel
y - of pixel
Returns:
true if succeed

get2D

public static final int get2D(char[] pix,
                              int pixWidth,
                              int x,
                              int y)
get2D() - get the pixel at pix(x,y) computed at (y+pixelWidth+x)

Parameters:
pix - is the image buffer
pixWidth - is image width
x - of pixel
y - of pixel
Returns:
true if succeed

set2D

public static final int set2D(int[] pix,
                              int pixWidth,
                              int x,
                              int y,
                              int g)
set2D() - save the pixel value g at pix(x,y) computed at (y+pixelWidth+x)

Parameters:
pix - is the image buffer
pixWidth - is image width
x - of pixel
y - of pixel
g - is new int value to save
Returns:
g

set2D

public static final int set2D(char[] pix,
                              int pixWidth,
                              int x,
                              int y,
                              int g)
set2D() - save the pixel value g at pix(x,y) computed at (y+pixelWidth+x)

Parameters:
pix - is the image buffer
pixWidth - is image width
x - of pixel
y - of pixel
g - is new int value to save
Returns:
g