Package javax.media.jai.util

Examples of javax.media.jai.util.ImagingException


/*  332 */         stream.read();
/*  333 */         stream.read();
/*  334 */         str = new String(b);
/*      */       } catch (Exception e) {
/*  336 */         String message = JaiI18N.getString("IIPResolution7");
/*  337 */         listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */       }
/*      */     }
/*      */     else
/*      */     {
/*  342 */       StringBuffer buf = new StringBuffer(16);
/*      */       try
/*      */       {
/*      */         int i;
/*  345 */         while ((i = stream.read()) != -1) {
/*  346 */           char c = (char)(0xFF & i);
/*  347 */           if (c == '\r') {
/*  348 */             stream.read();
/*  349 */             break;
/*      */           }
/*  351 */           buf.append(c);
/*      */         }
/*  353 */         str = buf.toString();
/*      */       } catch (Exception e) {
/*  355 */         String message = JaiI18N.getString("IIPResolution7");
/*  356 */         listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */       }
/*      */
/*      */     }
/*      */
/*  362 */     return str;
View Full Code Here


/*  375 */           stream.read();
/*  376 */           stream.read();
/*      */         }
/*      */       } catch (Exception e) {
/*  379 */         String message = JaiI18N.getString("IIPResolution8");
/*  380 */         listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */       }
/*      */     else
/*      */       try
/*      */       {
/*      */         int i;
/*  387 */         while ((i = stream.read()) != -1) {
/*  388 */           if ((char)(0xFF & i) == '\r')
/*  389 */             stream.read();
/*      */         }
/*      */       }
/*      */       catch (Exception e)
/*      */       {
/*  394 */         String message = JaiI18N.getString("IIPResolution8");
/*  395 */         listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */       }
/*      */   }
View Full Code Here

/*  935 */       raster = decoder.decodeAsRaster().createTranslatedChild(tx, ty);
/*      */     }
/*      */     catch (Exception e) {
/*  938 */       ImagingListener listener = ImageUtil.getImagingListener(this.renderHints);
/*      */
/*  940 */       listener.errorOccurred(JaiI18N.getString("IIPResolutionOpImage3"), new ImagingException(e), this, false);
/*      */     }
/*      */
/*  949 */     closeStream(byteStream);
/*      */
/*  951 */     if ((this.colorSpaceType == 3) && (colorConversion)) {
View Full Code Here

/*     */   }
/*     */
/*     */   private void sendExceptionToListener(String message, Exception e) {
/* 197 */     ImagingListener listener = ImageUtil.getImagingListener((RenderingHints)null);
/*     */
/* 199 */     listener.errorOccurred(message, new ImagingException(message, e), this, false);
/*     */   }
View Full Code Here

/*     */     try
/*     */     {
/* 325 */       this.i_transform = transform.createInverse();
/*     */     } catch (NoninvertibleTransformException e) {
/* 327 */       String message = JaiI18N.getString("MlibAffineOpImage0");
/* 328 */       this.listener.errorOccurred(message, new ImagingException(message, e), this, false);
/*     */     }
/*     */
/* 334 */     this.transform = ((AffineTransform)transform.clone());
/*     */
/* 341 */     this.f_transform = new double[6];
View Full Code Here

/* 1431 */           Object[] args = { sm };
/* 1432 */           cm = (ColorModel)cmMethod.invoke(null, args);
/*      */         } catch (Exception e) {
/* 1434 */           String message = JaiI18N.getString("ImageUtil4") + cmMethod.getName();
/*      */
/* 1436 */           sendExceptionToListener(message, new ImagingException(message, e));
/*      */         }
/*      */
/*      */       }
/*      */       else
/*      */       {
View Full Code Here

/*     */     try
/*     */     {
/* 389 */       this.i_transform = transform.createInverse();
/*     */     } catch (Exception e) {
/* 391 */       String message = JaiI18N.getString("AffineOpImage0");
/* 392 */       this.listener.errorOccurred(message, new ImagingException(message, e), this, false);
/*     */     }
/*     */
/* 397 */     this.f_transform = ((AffineTransform)transform.clone());
/*     */
/* 402 */     this.m00 = this.i_transform.getScaleX();
View Full Code Here

/*  344 */     Method method = null;
/*      */     try {
/*  346 */       method = GRAPHICS2D_CLASS.getMethod(name, argTypes);
/*      */     } catch (Exception e) {
/*  348 */       String message = JaiI18N.getString("TiledImageGraphics2") + name;
/*  349 */       sendExceptionToListener(message, new ImagingException(e));
/*      */     }
/*      */
/*  354 */     Rectangle bounds = new Rectangle(x, y, width, height);
/*  355 */     bounds = getTransform().createTransformedShape(bounds).getBounds();
/*      */
/*  358 */     int minTileX = this.tiledImage.XToTileX(bounds.x);
/*  359 */     if (minTileX < this.tileXMinimum)
/*  360 */       minTileX = this.tileXMinimum;
/*  361 */     int minTileY = this.tiledImage.YToTileY(bounds.y);
/*  362 */     if (minTileY < this.tileYMinimum)
/*  363 */       minTileY = this.tileYMinimum;
/*  364 */     int maxTileX = this.tiledImage.XToTileX(bounds.x + bounds.width - 1);
/*  365 */     if (maxTileX > this.tileXMaximum)
/*  366 */       maxTileX = this.tileXMaximum;
/*  367 */     int maxTileY = this.tiledImage.YToTileY(bounds.y + bounds.height - 1);
/*  368 */     if (maxTileY > this.tileYMaximum) {
/*  369 */       maxTileY = this.tileYMaximum;
/*      */     }
/*      */
/*  372 */     for (int tileY = minTileY; tileY <= maxTileY; tileY++) {
/*  373 */       int tileMinY = this.tiledImage.tileYToY(tileY);
/*  374 */       for (int tileX = minTileX; tileX <= maxTileX; tileX++) {
/*  375 */         int tileMinX = this.tiledImage.tileXToX(tileX);
/*      */
/*  378 */         WritableRaster wr = this.tiledImage.getWritableTile(tileX, tileY);
/*  379 */         wr = wr.createWritableTranslatedChild(0, 0);
/*      */
/*  382 */         BufferedImage bi = new BufferedImage(this.colorModel, wr, this.colorModel.isAlphaPremultiplied(), this.properties);
/*      */
/*  388 */         Graphics2D g2d = bi.createGraphics();
/*      */
/*  391 */         copyState(g2d);
/*      */         try
/*      */         {
/*  396 */           Point2D origin2D = g2d.getTransform().transform(new Point2D.Double(), null);
/*      */
/*  399 */           Point pt = new Point((int)origin2D.getX() - tileMinX, (int)origin2D.getY() - tileMinY);
/*      */
/*  401 */           Point2D pt2D = g2d.getTransform().inverseTransform(pt, null);
/*      */
/*  403 */           g2d.translate(pt2D.getX(), pt2D.getY());
/*      */         } catch (Exception e) {
/*  405 */           String message = JaiI18N.getString("TiledImageGraphics3");
/*  406 */           sendExceptionToListener(message, new ImagingException(e));
/*      */         }
/*      */
/*      */         try
/*      */         {
/*  412 */           Object retVal = method.invoke(g2d, args);
/*  413 */           if ((retVal != null) && (retVal.getClass() == Boolean.TYPE))
/*  414 */             returnValue = ((Boolean)retVal).booleanValue();
/*      */         }
/*      */         catch (Exception e) {
/*  417 */           String message = JaiI18N.getString("TiledImageGraphics3") + " " + name;
/*      */
/*  419 */           sendExceptionToListener(message, new ImagingException(e));
/*      */         }
/*      */
/*  424 */         g2d.dispose();
/*      */
/*  427 */         this.tiledImage.releaseWritableTile(tileX, tileY);
View Full Code Here

/*  327 */     Method method = null;
/*      */     try {
/*  329 */       method = GRAPHICS2D_CLASS.getMethod(name, argTypes);
/*      */     } catch (Exception e) {
/*  331 */       String message = JaiI18N.getString("TiledGraphicsGraphics2") + name;
/*  332 */       sendExceptionToListener(message, new ImagingException(e));
/*      */     }
/*      */
/*  338 */     this.opArgList.addLast(method);
/*  339 */     this.opArgList.addLast(args);
/*      */   }
View Full Code Here

/*      */       try
/*      */       {
/*  361 */         method.invoke(g2d, args);
/*      */       } catch (Exception e) {
/*  363 */         String message = JaiI18N.getString("TiledGraphicsGraphics4") + method;
/*  364 */         sendExceptionToListener(message, new ImagingException(e));
/*      */       }
/*      */     }
/*      */   }
View Full Code Here

TOP

Related Classes of javax.media.jai.util.ImagingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.