private void writeResult( GL gl ) { int width = params.getScreenPixelsX(); int height = params.getScreenPixelsY(); BufferedImage resultImage = JOGLUtils.getFrameBufferRGB( gl, null, 0, 0, width, height, null ); try { File f = File.createTempFile( "wpvs_", ".jpg" ); ImageIO.write( resultImage, "jpg", f ); System.out.println( "Wrote file to: " + f.getAbsolutePath() ); } catch ( IOException e ) { // nottin } }
/** * Update the width and height to the configured ones. * * @param viewParams * @throws OWSException */ private void updateMaxWidthAndHeight( ViewParams viewParams ) throws OWSException { int width = viewParams.getScreenPixelsX(); int height = viewParams.getScreenPixelsY(); if ( width > this.maxRequestWidth || height > this.maxRequestHeight ) { StringBuilder errorMessage = new StringBuilder( "Requested" ); if ( width > this.maxRequestWidth ) { errorMessage.append( " width: " ).append( width ).append( " exceeds maximum request width: " ).append( maxRequestWidth ); } if ( height > this.maxRequestHeight ) { if ( width > this.maxRequestWidth ) { errorMessage.append( "," ); } errorMessage.append( " height: " ).append( height ).append( " exceeds maximum request height: " ).append( maxRequestHeight ); } throw new OWSException( errorMessage.toString(), OWSException.INVALID_PARAMETER_VALUE ); // double scale = ( width > height ) ? ( ( (double) this.maxRequestWidth ) / width ) // : ( ( (double) this.maxRequestHeight ) / height ); // viewParams.setScreenDimensions( (int) Math.floor( width * scale ), (int) Math.floor( height * scale ) ); } }
private void setBackground() { Texture skyImage = TexturePool.getTexture( glRenderContext, skyImageID ); if ( skyImage != null ) { draw2D( 0, 0, params.getScreenPixelsX(), params.getScreenPixelsY(), skyImage, false ); } }
this.viewParams = request.getViewParameters(); this.width = viewParams.getScreenPixelsX(); this.height = viewParams.getScreenPixelsY(); this.context = glRenderContext; this.colormap = colormap;
gl.glPushMatrix(); gl.glLoadIdentity(); glu.gluOrtho2D( 0, params.getScreenPixelsX(), 0, params.getScreenPixelsY() );