public BufferedImage getDebugImageUPredBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int u; u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4]; c[0] = u; c[1] = u; c[2] = u; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageUBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int u; u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4]; c[0] = u; c[1] = u; c[2] = u; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageVPredBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int v; v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4]; c[0] = v; c[1] = v; c[2] = v; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageYPredBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int yy; yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getPredict()[x%4][y%4]; c[0] = yy; c[1] = yy; c[2] = yy; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageVDiffBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int v; v = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4]; c[0] = v; c[1] = v; c[2] = v; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; } public BufferedImage getDebugImageVPredBuffer() {
public BufferedImage getDebugImageUDiffBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int u; u = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4]; c[0] = u; c[1] = u; c[2] = u; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageVBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int v; v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4]; c[0] = v; c[1] = v; c[2] = v; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageYBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int yy; yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDest()[x%4][y%4]; c[0] = yy; c[1] = yy; c[2] = yy; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageYDiffBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int yy; yy = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDiff()[x%4][y%4]; c[0] = yy; c[1] = yy; c[2] = yy; for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImagePredict() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int yy, u, v; yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getPredict()[x%4][y%4]; u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4]; v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4]; c[0] = (int)( 1.164*(yy-16)+1.596*(v-128) ); c[1] = (int)( 1.164*(yy-16)-0.813*(v-128)-0.391*(u-128) ); c[2] = (int)( 1.164*(yy-16)+2.018*(u-128) ); for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public BufferedImage getDebugImageDiff() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int yy, u, v; yy = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDiff()[x%4][y%4]; u = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4]; v = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4]; c[0] = (int)( 1.164*(yy-16)+1.596*(v-128) ); c[1] = (int)( 1.164*(yy-16)-0.813*(v-128)-0.391*(u-128) ); c[2] = (int)( 1.164*(yy-16)+2.018*(u-128) ); for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } bufferCount++; return bi; }
public void useBufferedImage(BufferedImage dst) { WritableRaster imRas = dst.getWritableTile(0, 0); for(int x = 0; x< getWidth(); x++) { for(int y = 0; y< getHeight(); y++) { int c[] = new int[3]; int yy, u, v; yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDest()[x%4][y%4]; u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4]; v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4]; c[0] = (int)( 1.164*(yy-16)+1.596*(v-128) ); c[1] = (int)( 1.164*(yy-16)-0.813*(v-128)-0.391*(u-128) ); c[2] = (int)( 1.164*(yy-16)+2.018*(u-128) ); for(int z=0; z<3; z++) { if(c[z]<0) c[z]=0; if(c[z]>255) c[z]=255; } imRas.setPixel(x, y, c); } fireRGBProgressUpdate(100.0F*x/getWidth()); } } public void setFrame(ImageInputStream frame) {
edgesImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); edgesImage.getWritableTile(0, 0).setDataElements(0, 0, width, height, pixels);
private void writeEdges(int pixels[]) { //NOTE: There is currently no mechanism for obtaining the edge data //in any other format other than an INT_ARGB type BufferedImage. //This may be easily remedied by providing alternative accessors. if (edgesImage == null) { edgesImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); } edgesImage.getWritableTile(0, 0).setDataElements(0, 0, width, height, pixels); }
private void writeEdges(int pixels[]) { //NOTE: There is currently no mechanism for obtaining the edge data //in any other format other than an INT_ARGB type BufferedImage. //This may be easily remedied by providing alternative accessors. if (edgesImage == null) { edgesImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); } edgesImage.getWritableTile(0, 0).setDataElements(0, 0, width, height, pixels); }
private void writeEdges(int[] pixels) { //NOTE: There is currently no mechanism for obtaining the edge data //in any other format other than an INT_ARGB type BufferedImage. //This may be easily remedied by providing alternative accessors. if (edgesImage == null) { edgesImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); } edgesImage.getWritableTile(0, 0).setDataElements(0, 0, width, height, pixels); } }
public Raster readAsRaster() throws IOException { BufferedImage image = j2krparam.getDestination(); WritableRaster raster = null; if (image == null) { raster = Raster.createWritableRaster( sampleModel.createCompatibleSampleModel(destinationRegion.x + destinationRegion.width, destinationRegion.y + destinationRegion.height), new Point(0, 0)); } else raster = image.getWritableTile(0, 0); readSubsampledRaster(raster); return raster; }
public Raster readAsRaster() throws IOException { BufferedImage image = j2krparam.getDestination(); WritableRaster raster = null; if (image == null) { raster = Raster.createWritableRaster( sampleModel.createCompatibleSampleModel(destinationRegion.x + destinationRegion.width, destinationRegion.y + destinationRegion.height), new Point(0, 0)); } else raster = image.getWritableTile(0, 0); readSubsampledRaster(raster); return raster; }
public Raster readAsRaster() throws IOException { BufferedImage image = j2krparam.getDestination(); WritableRaster raster = null; if (image == null) { sampleModel = getSampleModel(); raster = Raster.createWritableRaster( sampleModel.createCompatibleSampleModel(destinationRegion.x + destinationRegion.width, destinationRegion.y + destinationRegion.height), new Point(0, 0)); } else raster = image.getWritableTile(0, 0); readSubsampledRaster(raster); return raster; }
public Raster readAsRaster() throws IOException { BufferedImage image = j2krparam.getDestination(); WritableRaster raster = null; if (image == null) { sampleModel = getSampleModel(); raster = Raster.createWritableRaster( sampleModel.createCompatibleSampleModel(destinationRegion.x + destinationRegion.width, destinationRegion.y + destinationRegion.height), new Point(0, 0)); } else raster = image.getWritableTile(0, 0); readSubsampledRaster(raster); return raster; }