Package javax.media.j3d

Examples of javax.media.j3d.ImageComponent2D

As of Java 3D 1.5, an ImageComponent2D accepts an NioImageBuffer object as an alternative to a RenderedImage.


/*     */   public ImageComponent2D getScaledImage(float xScale, float yScale)
/*     */   {
/* 538 */     if ((xScale == 1.0F) && (yScale == 1.0F)) {
/* 539 */       return getImage();
/*     */     }
/* 541 */     return new ImageComponent2D(this.imageComponentFormat, getScaledImage(this.bufferedImage, xScale, yScale), this.byRef, this.yUp);
/*     */   }
View Full Code Here


/*     */   {
/* 557 */     if ((this.bufferedImage.getWidth() == width) && (this.bufferedImage.getHeight() == height))
/*     */     {
/* 559 */       return getImage();
/*     */     }
/* 561 */     return new ImageComponent2D(this.imageComponentFormat, getScaledImage(this.bufferedImage, width, height), this.byRef, this.yUp);
/*     */   }
View Full Code Here

/* 590 */         scaledBufferedImages = new BufferedImage[level];
/* 591 */         this.tex = new Texture2D(2, this.textureFormat, width, height);
/*     */
/* 594 */         for (int i = 0; i < level; i++) {
/* 595 */           scaledBufferedImages[i] = getScaledImage(origImage, newW, newH);
/* 596 */           scaledImageComponents[i] = new ImageComponent2D(this.imageComponentFormat, scaledBufferedImages[i], this.byRef, this.yUp);
/*     */
/* 600 */           this.tex.setImage(i, scaledImageComponents[i]);
/* 601 */           if (newW > 1) newW >>= 1;
/* 602 */           if (newH > 1) newH >>= 1;
/* 603 */           origImage = scaledBufferedImages[i];
/*     */         }
/*     */       }
/*     */       else {
/* 607 */         scaledImageComponents = new ImageComponent2D[1];
/* 608 */         scaledBufferedImages = new BufferedImage[1];
/*     */
/* 611 */         scaledBufferedImages[0] = getScaledImage(this.bufferedImage, width, height);
/*     */
/* 613 */         scaledImageComponents[0] = new ImageComponent2D(this.imageComponentFormat, scaledBufferedImages[0], this.byRef, this.yUp);
/*     */
/* 617 */         this.tex = new Texture2D(1, this.textureFormat, width, height);
/*     */
/* 619 */         this.tex.setImage(0, scaledImageComponents[0]);
/*     */       }
View Full Code Here

TOP

Related Classes of javax.media.j3d.ImageComponent2D

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.