@Override public void drawRect(int x, int y, int width, int height) { record("drawRect", new Object[] {new Integer(x), new Integer(y), new Integer(width), new Integer(height)}, new Class[] {int.class, int.class, int.class, int.class}); proc.drawRect(x, y, width, height); }
@Override public void drawRect(int x, int y, int width, int height) { record("drawRect", new Object[] {new Integer(x), new Integer(y), new Integer(width), new Integer(height)}, new Class[] {int.class, int.class, int.class, int.class}); proc.drawRect(x, y, width, height); }
public void drawPlot(int what, int offset, ImageProcessor ip) { //if (maxCount==0) maxCount = 1; int mode=histMode[what]; int YM=YMARGIN+offset; frame[what] = new Rectangle(XMARGIN, YM, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame[what].x-1, frame[what].y, frame[what].width+2, frame[what].height+1); int index, y; for (int i = 0; i<HIST_WIDTH; i++) { y = (int)(HIST_HEIGHT*histogram[what][i]/mode); if (y>HIST_HEIGHT) y = HIST_HEIGHT; ip.drawLine(i+XMARGIN, YM+HIST_HEIGHT, i+XMARGIN, YM+HIST_HEIGHT-y); } } /*
void drawPlot(long maxCount, ImageProcessor ip) { if(maxCount == 0) { maxCount = 1; } frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x - 1, frame.y, frame.width + 2, frame.height + 1); int index, y; for(int i = 0; i < HIST_WIDTH; i++) { index = (int) (i * (double) histogram.length / HIST_WIDTH); y = (int) (((double) HIST_HEIGHT * (double) histogram[index]) / maxCount); if(y > HIST_HEIGHT) { y = HIST_HEIGHT; } ip.drawLine(i + XMARGIN, YMARGIN + HIST_HEIGHT, i + XMARGIN, YMARGIN + HIST_HEIGHT - y); } }
void drawPlot(double minCount, double maxCount, ImageProcessor ip) { if (maxCount <= minCount) maxCount = minCount + 1; newMinCount = (int)minCount; newMaxCount = (int)maxCount; System.err.println("min/max: "+minCount+"/"+maxCount); frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x-1, frame.y, frame.width+2, frame.height+1); int index, y; for (int i = 0; i<HIST_WIDTH; i++) { index = (int)(i*(double)histogram.length/HIST_WIDTH); y = (int)(HIST_HEIGHT * (histogram[index] - minCount) / (maxCount - minCount)); if (y>HIST_HEIGHT) y = HIST_HEIGHT; ip.drawLine(i+XMARGIN, YMARGIN+HIST_HEIGHT, i+XMARGIN, YMARGIN+HIST_HEIGHT-y); } }
void drawLogPlot (int maxCount, ImageProcessor ip) { frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x-1, frame.y, frame.width+2, frame.height+1); double max = Math.log(maxCount); ip.setColor(Color.gray); int index, y; for (int i = 0; i<HIST_WIDTH; i++) { index = (int)(i*(double)histogram.length/HIST_WIDTH); y = histogram[index]==0?0:(int)(HIST_HEIGHT*Math.log(histogram[index])/max); if (y>HIST_HEIGHT) y = HIST_HEIGHT; ip.drawLine(i+XMARGIN, YMARGIN+HIST_HEIGHT, i+XMARGIN, YMARGIN+HIST_HEIGHT-y); } ip.setColor(Color.black); }
void drawLogPlot(long maxCount, ImageProcessor ip) { frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x - 1, frame.y, frame.width + 2, frame.height + 1); double max = Math.log(maxCount); ip.setColor(Color.gray); int index, y; for(int i = 0; i < HIST_WIDTH; i++) { index = (int) (i * (double) histogram.length / HIST_WIDTH); y = histogram[index] == 0 ? 0 : (int) (HIST_HEIGHT * Math.log(histogram[index]) / max); if(y > HIST_HEIGHT) { y = HIST_HEIGHT; } ip.drawLine(i + XMARGIN, YMARGIN + HIST_HEIGHT, i + XMARGIN, YMARGIN + HIST_HEIGHT - y); } ip.setColor(Color.black); }
void drawPlot(long maxCount, ImageProcessor ip) { if (maxCount==0) maxCount = 1; frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x-1, frame.y, frame.width+2, frame.height+1); if (histogram.length<=HIST_WIDTH) { int index, y; for (int i=0; i<HIST_WIDTH; i++) { index = (int)(i*(double)histogram.length/HIST_WIDTH); y = (int)(((double)HIST_HEIGHT*(double)histogram[index])/maxCount); if (y>HIST_HEIGHT) y = HIST_HEIGHT; ip.drawLine(i+XMARGIN, YMARGIN+HIST_HEIGHT, i+XMARGIN, YMARGIN+HIST_HEIGHT-y); } } else { double xscale = (double)HIST_WIDTH/histogram.length; for (int i=0; i<histogram.length; i++) { long value = histogram[i]; if (value>0L) { int y = (int)(((double)HIST_HEIGHT*(double)value)/maxCount); if (y>HIST_HEIGHT) y = HIST_HEIGHT; int x = (int)(i*xscale)+XMARGIN; ip.drawLine(x, YMARGIN+HIST_HEIGHT, x, YMARGIN+HIST_HEIGHT-y); } } } }
void drawPlot(long maxCount, ImageProcessor ip) { if (maxCount==0) maxCount = 1; frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x-1, frame.y, frame.width+2, frame.height+1); if (histogram.length<=HIST_WIDTH) { int index, y; for (int i=0; i<HIST_WIDTH; i++) { index = (int)(i*(double)histogram.length/HIST_WIDTH); y = (int)(((double)HIST_HEIGHT*(double)histogram[index])/maxCount); if (y>HIST_HEIGHT) y = HIST_HEIGHT; ip.drawLine(i+XMARGIN, YMARGIN+HIST_HEIGHT, i+XMARGIN, YMARGIN+HIST_HEIGHT-y); } } else { double xscale = (double)HIST_WIDTH/histogram.length; for (int i=0; i<histogram.length; i++) { long value = histogram[i]; if (value>0L) { int y = (int)(((double)HIST_HEIGHT*(double)value)/maxCount); if (y>HIST_HEIGHT) y = HIST_HEIGHT; int x = (int)(i*xscale)+XMARGIN; ip.drawLine(x, YMARGIN+HIST_HEIGHT, x, YMARGIN+HIST_HEIGHT-y); } } } }
void drawLogPlot (long maxCount, ImageProcessor ip) { frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x-1, frame.y, frame.width+2, frame.height+1); double max = Math.log(maxCount); ip.setColor(Color.gray); if (histogram.length<=HIST_WIDTH) { int index, y; for (int i = 0; i<HIST_WIDTH; i++) { index = (int)(i*(double)histogram.length/HIST_WIDTH); y = histogram[index]==0?0:(int)(HIST_HEIGHT*Math.log(histogram[index])/max); if (y>HIST_HEIGHT) y = HIST_HEIGHT; ip.drawLine(i+XMARGIN, YMARGIN+HIST_HEIGHT, i+XMARGIN, YMARGIN+HIST_HEIGHT-y); } } else { double xscale = (double)HIST_WIDTH/histogram.length; for (int i=0; i<histogram.length; i++) { long value = histogram[i]; if (value>0L) { int y = (int)(HIST_HEIGHT*Math.log(value)/max); if (y>HIST_HEIGHT) y = HIST_HEIGHT; int x = (int)(i*xscale)+XMARGIN; ip.drawLine(x, YMARGIN+HIST_HEIGHT, x, YMARGIN+HIST_HEIGHT-y); } } } ip.setColor(Color.black); }
void drawLogPlot (long maxCount, ImageProcessor ip) { frame = new Rectangle(XMARGIN, YMARGIN, HIST_WIDTH, HIST_HEIGHT); ip.drawRect(frame.x-1, frame.y, frame.width+2, frame.height+1); double max = Math.log(maxCount); ip.setColor(Color.gray); if (histogram.length<=HIST_WIDTH) { int index, y; for (int i = 0; i<HIST_WIDTH; i++) { index = (int)(i*(double)histogram.length/HIST_WIDTH); y = histogram[index]==0?0:(int)(HIST_HEIGHT*Math.log(histogram[index])/max); if (y>HIST_HEIGHT) y = HIST_HEIGHT; ip.drawLine(i+XMARGIN, YMARGIN+HIST_HEIGHT, i+XMARGIN, YMARGIN+HIST_HEIGHT-y); } } else { double xscale = (double)HIST_WIDTH/histogram.length; for (int i=0; i<histogram.length; i++) { long value = histogram[i]; if (value>0L) { int y = (int)(HIST_HEIGHT*Math.log(value)/max); if (y>HIST_HEIGHT) y = HIST_HEIGHT; int x = (int)(i*xscale)+XMARGIN; ip.drawLine(x, YMARGIN+HIST_HEIGHT, x, YMARGIN+HIST_HEIGHT-y); } } } ip.setColor(Color.black); }
protected void drawUnscaledColorBar(int color, ImageProcessor ip, int x, int y, int width, int height) { ImageProcessor bar = null; if (ip instanceof ColorProcessor) { bar = new ColorProcessor(width, height); for (int i = 0; i<256; i++) { switch (color) { case 0: //red bar.setColor(new Color(i&0xff, 0, 0)); break; case 1: //green bar.setColor(new Color(0, i&0xff, 0)); break; case 2: //blue bar.setColor(new Color(0, 0,i&0xff)); break; } bar.moveTo(i, 0); bar.lineTo(i, height); } ip.insert(bar, x,y); ip.setColor(Color.black); ip.drawRect(x-1, y, width+2, height); } }
/** Draws the selection outline on the specified ImageProcessor. @see ij.process.ImageProcessor#setColor @see ij.process.ImageProcessor#setLineWidth */ public void drawPixels(ImageProcessor ip) { endPaste(); int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); if (cornerDiameter>0) drawRoundedRect(ip); else { if (ip.getLineWidth()==1) ip.drawRect(x, y, width+1, height+1); else ip.drawRect(x, y, width, height); } ip.setLineWidth(saveWidth); if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
/** Draws the selection outline on the specified ImageProcessor. @see ij.process.ImageProcessor#setColor @see ij.process.ImageProcessor#setLineWidth */ public void drawPixels(ImageProcessor ip) { endPaste(); int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); if (cornerDiameter>0) drawRoundedRect(ip); else { if (ip.getLineWidth()==1) ip.drawRect(x, y, width+1, height+1); else ip.drawRect(x, y, width, height); } ip.setLineWidth(saveWidth); if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
public void drawUnscaledColorBar(ImageProcessor ip, int x, int y, int width, int height) { ImageProcessor bar = null; if (ip instanceof ColorProcessor) bar = new ColorProcessor(width, height); else bar = new ByteProcessor(width, height); if (mapSize == 0) { //no color table; draw a grayscale bar for (int i = 0; i < 256; i++) { bar.setColor(new Color(i, i, i)); bar.moveTo(i, 0); bar.lineTo(i, height); } } else { for (int i = 0; i<mapSize; i++) { bar.setColor(new Color(rLUT[i]&0xff, gLUT[i]&0xff, bLUT[i]&0xff)); bar.moveTo(i, 0); bar.lineTo(i, height); } } ip.insert(bar, x,y); ip.setColor(Color.black); ip.drawRect(x-1, y, width+2, height); }
public void drawUnscaledColorBar(ImageProcessor ip, int x, int y, int width, int height) { ImageProcessor bar = null; if (ip instanceof ColorProcessor) bar = new ColorProcessor(width, height); else bar = new ByteProcessor(width, height); if (mapSize == 0) { //no color table; draw a grayscale bar for (int i = 0; i < 256; i++) { bar.setColor(new Color(i, i, i)); bar.moveTo(i, 0); bar.lineTo(i, height); } } else { for (int i = 0; i<mapSize; i++) { bar.setColor(new Color(rLUT[i]&0xff, gLUT[i]&0xff, bLUT[i]&0xff)); bar.moveTo(i, 0); bar.lineTo(i, height); } } ip.insert(bar, x,y); ip.setColor(Color.black); ip.drawRect(x-1, y, width+2, height); }
void drawOrFill(int type) { int x = (int)getFirstArg(); int y = (int)getNextArg(); int width = (int)getNextArg(); int height = (int)getLastArg(); ImageProcessor ip = getProcessor(); if (!colorSet) setForegroundColor(ip); switch (type) { case DRAW_RECT: ip.drawRect(x, y, width, height); break; case FILL_RECT: ip.setRoi(x, y, width, height); ip.fill(); break; case DRAW_OVAL: ip.drawOval(x, y, width, height); break; case FILL_OVAL: ip.fillOval(x, y, width, height); break; } updateAndDraw(); }
void drawOrFill(int type) { int x = (int)getFirstArg(); int y = (int)getNextArg(); int width = (int)getNextArg(); int height = (int)getLastArg(); ImageProcessor ip = getProcessor(); if (!colorSet) setForegroundColor(ip); switch (type) { case DRAW_RECT: ip.drawRect(x, y, width, height); break; case FILL_RECT: ip.setRoi(x, y, width, height); ip.fill(); break; case DRAW_OVAL: ip.drawOval(x, y, width, height); break; case FILL_OVAL: ip.fillOval(x, y, width, height); break; } updateAndDraw(); }
Roi roi = overlay.get(i); Rectangle r = roi.getBounds(); ipLanes.drawRect(r.x, r.y, r.width, r.height); String s = ""+(i+1); if(isVertical) {
ip.insert(bar, x,y); ip.setColor(Color.black); ip.drawRect(x-1, y, width+2, height);