From 5e9c02bce7b241a0bf95c8abca9a91cd25e51ed3 Mon Sep 17 00:00:00 2001
From: Harvey Harrison
- * Otherwise destroy is being flagged to be called within the next + * Otherwise destroy is being flagged to be called within the next * call of display(). *
*@@ -270,9 +270,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe */ protected final void destroyAvoidAwareOfLocking() { final NativeSurface ns = getNativeSurface(); - + final GLAnimatorControl ctrl = helper.getAnimator(); - + // Is an animator thread perform rendering? if ( helper.isAnimatorStartedOnOtherThread() ) { // Pause animations before initiating safe destroy. @@ -292,7 +292,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe destroy(); } } - + /** * Calls {@link #destroyImplInLock()} while claiming the lock. */ @@ -305,7 +305,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe lock.unlock(); } } - + /** * Default implementation to destroys the drawable and context of this GLAutoDrawable: *
- *
+ *
* Note that because the enumerated value used for the binding of a
* buffer object (e.g. GL_ARRAY_BUFFER) is different than that used to
* query the binding using glGetIntegerv (e.g.
@@ -77,16 +77,16 @@ import com.jogamp.common.util.IntIntHashMap;
public class GLBufferStateTracker {
protected static final boolean DEBUG;
-
+
static {
Debug.initSingleton();
DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferStateTracker", true);
}
-
+
// Maps binding targets to buffer objects. A null value indicates
// that the binding is unknown. A zero value indicates that it is
- // known that no buffer is bound to the target, according to the
- // OpenGL specifications.
+ // known that no buffer is bound to the target, according to the
+ // OpenGL specifications.
// http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
private IntIntHashMap bindingMap;
@@ -108,7 +108,7 @@ public class GLBufferStateTracker {
public final void setBoundBufferObject(int target, int value) {
bindingMap.put(target, value);
if (DEBUG) {
- System.err.println("GLBufferStateTracker.setBoundBufferObject() target 0x" +
+ System.err.println("GLBufferStateTracker.setBoundBufferObject() target 0x" +
Integer.toHexString(target) + " -> mapped bound buffer 0x" +
Integer.toHexString(value));
// Thread.dumpStack();
@@ -146,7 +146,7 @@ public class GLBufferStateTracker {
value = 0;
}
if (DEBUG) {
- System.err.println("GLBufferStateTracker.getBoundBufferObject() glerr[pre 0x"+Integer.toHexString(glerrPre)+", post 0x"+Integer.toHexString(glerrPost)+"], [queried value]: target 0x" +
+ System.err.println("GLBufferStateTracker.getBoundBufferObject() glerr[pre 0x"+Integer.toHexString(glerrPre)+", post 0x"+Integer.toHexString(glerrPost)+"], [queried value]: target 0x" +
Integer.toHexString(target) + " / query 0x"+Integer.toHexString(queryTarget)+
" -> mapped bound buffer 0x" + Integer.toHexString(value));
}
@@ -156,7 +156,7 @@ public class GLBufferStateTracker {
return 0;
}
if (DEBUG) {
- System.err.println("GLBufferStateTracker.getBoundBufferObject() [mapped value]: target 0x" +
+ System.err.println("GLBufferStateTracker.getBoundBufferObject() [mapped value]: target 0x" +
Integer.toHexString(target) + " -> mapped bound buffer 0x" +
Integer.toHexString(value));
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 7f9f20a21..7c3a5922b 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -106,14 +106,14 @@ public abstract class GLContextImpl extends GLContext {
private final GLStateTracker glStateTracker = new GLStateTracker();
private GLDebugMessageHandler glDebugHandler = null;
private final int[] boundFBOTarget = new int[] { 0, 0 }; // { draw, read }
- private int defaultVAO = 0;
-
+ private int defaultVAO = 0;
+
protected GLDrawableImpl drawable;
protected GLDrawableImpl drawableRead;
-
+
private volatile boolean pixelDataEvaluated;
private int /* pixelDataInternalFormat, */ pixelDataFormat, pixelDataType;
-
+
protected GL gl;
protected static final Object mappedContextTypeObjectLock;
@@ -161,7 +161,7 @@ public abstract class GLContextImpl extends GLContext {
glStateTracker.setEnabled(false);
glStateTracker.clearStates();
}
-
+
@Override
protected void resetStates(boolean isInit) {
if( !isInit ) {
@@ -177,12 +177,12 @@ public abstract class GLContextImpl extends GLContext {
glRenderer = glVendor;
glRendererLowerCase = glRenderer;
glVersion = glVendor;
-
+
if (boundFBOTarget != null) { //
* Method calls 'void finalizeInit()' of instance 'gl' as retrieved by reflection, if exist.
@@ -1138,7 +1138,7 @@ public abstract class GLContextImpl extends GLContext {
* ie for GLXExt, EGLExt, ..
*/
public abstract ProcAddressTable getPlatformExtProcAddressTable();
-
+
/**
* Part of
@@ -1154,7 +1154,7 @@ public abstract class GLContextImpl extends GLContext {
* Provides platform-independent access to the
@@ -1278,7 +1278,7 @@ public abstract class GLContextImpl extends GLContext {
* version for given arrays.
*
* If the GL query fails, major will be zero.
- * GL_NV_vertex_array_range
.
* wglFreeMemoryNV
/
* glXFreeMemoryNV
.
*
* Note: Non ARB ctx is limited to GL 3.0. *
@@ -1292,20 +1292,20 @@ public abstract class GLContextImpl extends GLContext { if(DEBUG) { Thread.dumpStack(); } - return false; + return false; } else { glGetIntegervInt(GL2GL3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv); glGetIntegervInt(GL2GL3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv); limitNonARBContextVersion(glIntMajor, glIntMinor, ctp); - return true; + return true; } } - + protected final int getCtxOptions() { return ctxOptions; } - + /** * Sets the OpenGL implementation class and * the cache of which GL functions are available for calling through this @@ -1325,8 +1325,8 @@ public abstract class GLContextImpl extends GLContext { *major.minor
version, andfalse
.
- * @return returns true
if successful, otherwise false
. See strictMatch
.
- * If false
is returned, no data has been cached or mapped, i.e. ProcAddressTable, Extensions, Version, etc.
+ * @return returns true
if successful, otherwise false
. See strictMatch
.
+ * If false
is returned, no data has been cached or mapped, i.e. ProcAddressTable, Extensions, Version, etc.
* @see #setContextVersion
* @see javax.media.opengl.GLContext#CTX_OPTION_ANY
* @see javax.media.opengl.GLContext#CTX_PROFILE_COMPAT
@@ -1340,7 +1340,7 @@ public abstract class GLContextImpl extends GLContext {
if ( 0 < major && !GLContext.isValidGLVersion(ctxProfileBits, major, minor) ) {
throw new GLException("Invalid GL Version Request "+GLContext.getGLVersion(major, minor, ctxProfileBits, null));
}
-
+
if(null==this.gl || !verifyInstance(gl.getGLProfile(), "Impl", this.gl)) {
setGL( createGL( getGLDrawable().getGLProfile() ) );
}
@@ -1348,7 +1348,7 @@ public abstract class GLContextImpl extends GLContext {
final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration();
final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
-
+
{
final boolean initGLRendererAndGLVersionStringsOK = initGLRendererAndGLVersionStrings();
if( !initGLRendererAndGLVersionStringsOK ) {
@@ -1367,7 +1367,7 @@ public abstract class GLContextImpl extends GLContext {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Given "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, glVersion));
}
}
-
+
//
// Validate GL version either by GL-Integer or GL-String
//
@@ -1377,8 +1377,8 @@ public abstract class GLContextImpl extends GLContext {
boolean versionValidated = false;
boolean versionGL3IntFailed = false;
{
- // Validate the requested version w/ the GL-version from an integer query.
- final int[] glIntMajor = new int[] { 0 }, glIntMinor = new int[] { 0 };
+ // Validate the requested version w/ the GL-version from an integer query.
+ final int[] glIntMajor = new int[] { 0 }, glIntMinor = new int[] { 0 };
final boolean getGLIntVersionOK = getGLIntVersion(glIntMajor, glIntMinor, ctxProfileBits);
if( !getGLIntVersionOK ) {
final String errMsg = "Fetching GL Integer Version failed. "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, null);
@@ -1392,14 +1392,14 @@ public abstract class GLContextImpl extends GLContext {
// unusable GL context - non query mode - hard fail!
throw new GLException(errMsg);
}
- }
+ }
if (DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: version verification (Int): "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
}
-
+
// Only validate if a valid int version was fetched, otherwise cont. w/ version-string method -> 3.0 > Version || Version > MAX!
if ( GLContext.isValidGLVersion(ctxProfileBits, glIntMajor[0], glIntMinor[0]) ) {
- if( glIntMajor[0]* Method exists merely for code validation of {@link #isCurrent()}. - *
+ * */ public final boolean isOwner(Thread thread) { return lock.isOwner(thread); } - - /** + + /** * Returns true if there are other threads waiting for this GLContext to {@link #makeCurrent()}, otherwise false. ** Since method does not perform any synchronization, accurate result are returned if lock is hold - only. - *
+ * */ public final boolean hasWaiters() { return lock.getQueueLength()>0; } - - /** + + /** * Returns the number of hold locks. See {@link RecursiveLock#getHoldCount()} for semantics. ** Since method does not perform any synchronization, accurate result are returned if lock is hold - only. - *
+ * */ public final int getLockCount() { return lock.getHoldCount(); } - + //--------------------------------------------------------------------------- // Special FBO hook // - + /** * Tracks {@link GL#GL_FRAMEBUFFER}, {@link GL2GL3#GL_DRAW_FRAMEBUFFER} and {@link GL2GL3#GL_READ_FRAMEBUFFER} * to be returned via {@link #getBoundFramebuffer(int)}. - * + * *Invoked by {@link GL#glBindFramebuffer(int, int)}.
- * - *Assumes valid framebufferName
range of [0..{@link Integer#MAX_VALUE}]
Assumes valid framebufferName
range of [0..{@link Integer#MAX_VALUE}]
Does not throw an exception if target
is unknown or framebufferName
invalid.
An instance must be bound to the current thread's GLContext to achieve thread safety.
- * - *A native callback function is registered at {@link #enable(boolean) enable(true)}, - * which forwards received messages to the added {@link GLDebugListener} directly. + * + *
A native callback function is registered at {@link #enable(boolean) enable(true)}, + * which forwards received messages to the added {@link GLDebugListener} directly. * Hence the {@link GLDebugListener#messageSent(GLDebugMessage)} implementation shall * return as fast as possible.
- * + * *In case no GL_ARB_debug_output is available, but GL_AMD_debug_output, * the messages are translated to ARB {@link GLDebugMessage}, using {@link GLDebugMessage#translateAMDEvent(javax.media.opengl.GLContext, long, int, int, int, String)}.
*/ public class GLDebugMessageHandler { private static final boolean DEBUG = Debug.debug("GLDebugMessageHandler"); - + private static final int EXT_ARB = 1; - private static final int EXT_AMD = 2; - + private static final int EXT_AMD = 2; + static { if ( !initIDs0() ) { throw new NativeWindowException("Failed to initialize GLDebugMessageHandler jmethodIDs"); - } + } } - - private final GLContextImpl ctx; + + private final GLContextImpl ctx; private final ListenerSyncedImplStubdevice
{@link AbstractGraphicsDevice#getConnection()},
* either a pre-existing or newly created, or null
if creation failed or not supported.null
for the platform's default device.
* @param requestedCaps
* @param chooser the custom chooser, may be null for default
- * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
+ * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
* The latter is platform specific and small
* @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
* The latter is platform specific and small
@@ -419,7 +419,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
device.unlock();
}
}
-
+
/**
* A dummy surface is not visible on screen and will not be used to render directly to,
* it maybe on- or offscreen.
@@ -433,22 +433,22 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @param chosenCaps
* @param requestedCaps
* @param chooser the custom chooser, may be null for default
- * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
+ * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
* The latter is platform specific and small
* @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
* The latter is platform specific and small
* @return the created {@link ProxySurface} instance w/o defined surface handle but platform specific {@link UpstreamSurfaceHook}.
*/
- public abstract ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
+ public abstract ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height);
//---------------------------------------------------------------------------
//
// ProxySurface (Wrapped pre-existing native surface) construction
//
-
+
@Override
- public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
+ public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
@@ -473,7 +473,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @param upstream TODO
*/
- protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
+ protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream);
//---------------------------------------------------------------------------
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index 5418fbaf3..2cf384fd7 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -63,12 +63,12 @@ import javax.media.opengl.GLRunnable;
public class GLDrawableHelper {
/** true if property jogl.debug.GLDrawable.PerfStats
is defined. */
private static final boolean PERF_STATS;
-
+
static {
Debug.initSingleton();
PERF_STATS = Debug.isPropertyDefined("jogl.debug.GLDrawable.PerfStats", true);
}
-
+
protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
private final Object listenersLock = new Object();
private final ArrayList
* The oldCtx
will be destroyed if destroyPrevCtx
is true
,
- * otherwise dis-associate oldCtx
from drawable
+ * otherwise dis-associate oldCtx
from drawable
* via {@link GLContext#setGLDrawable(GLDrawable, boolean) oldCtx.setGLDrawable(null, true);}.
*
- * Re-associate newCtx
with drawable
+ * Re-associate newCtx
with drawable
* via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.
*
+ *
* If the old or new context was current on this thread, it is being released before switching the drawable. *
** No locking is being performed on the drawable, caller is required to take care of it. *
- * + * * @param drawable the drawable which context is changed * @param oldCtx the old context, maybenull
.
* @param destroyOldCtx if true
, destroy the oldCtx
* @param newCtx the new context, maybe null
for dis-association.
* @param newCtxCreationFlags additional creation flags if newCtx is not null and not been created yet, see {@link GLContext#setContextCreationFlags(int)}
- *
+ *
* @see GLAutoDrawable#setContext(GLContext, boolean)
*/
public static final void switchContext(GLDrawable drawable, GLContext oldCtx, boolean destroyOldCtx, GLContext newCtx, int newCtxCreationFlags) {
@@ -178,16 +178,16 @@ public class GLDrawableHelper {
oldCtx.setGLDrawable(null, true); // dis-associate old pair
}
}
-
+
if(null!=newCtx) {
newCtx.setContextCreationFlags(newCtxCreationFlags);
- newCtx.setGLDrawable(drawable, true); // re-associate new pair
+ newCtx.setGLDrawable(drawable, true); // re-associate new pair
}
}
-
+
/**
* If the drawable is not realized, OP is a NOP.
- *
* Locking is performed via {@link GLContext#makeCurrent()} on the passed context
.
*
* The {@link GLDrawableImpl}'s {@link NativeSurface} is being locked during operation. - * In case the holder is an auto drawable or similar, it's lock shall be claimed by the caller. + * In case the holder is an auto drawable or similar, it's lock shall be claimed by the caller. *
** May recreate the drawable via {@link #recreateGLDrawable(GLDrawableImpl, GLContext)} @@ -257,10 +257,10 @@ public class GLDrawableHelper { * FBO drawables are resized w/o drawable destruction. *
*- * Offscreen resize operation is validated w/ drawable size in the end. + * Offscreen resize operation is validated w/ drawable size in the end. * An exception is thrown if not successful. *
- * + * * @param drawable * @param context * @param newWidth the new width, it's minimum is capped to 1 @@ -270,7 +270,7 @@ public class GLDrawableHelper { * @throws GLException may be thrown a resize operation */ public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, GLContext context, int newWidth, int newHeight) - throws NativeWindowException, GLException + throws NativeWindowException, GLException { if(drawable.getChosenGLCapabilities().isOnscreen()) { throw new NativeWindowException("Drawable is not offscreen: "+drawable); @@ -288,7 +288,7 @@ public class GLDrawableHelper { } if(0>=newWidth) { newWidth = 1; validateSize=false; } if(0>=newHeight) { newHeight = 1; validateSize=false; } - // propagate new size + // propagate new size if(ns instanceof ProxySurface) { final ProxySurface ps = (ProxySurface) ns; final UpstreamSurfaceHook ush = ps.getUpstreamSurfaceHook(); @@ -301,7 +301,7 @@ public class GLDrawableHelper { System.err.println("GLDrawableHelper.resizeOffscreenDrawable: Drawable's offscreen surface n.a. ProxySurface, but "+ns.getClass().getName()+": "+ns); } if(drawable instanceof GLFBODrawable) { - if( null != context && context.isCreated() ) { + if( null != context && context.isCreated() ) { ((GLFBODrawable) drawable).resetSize(context.getGL()); } } else { @@ -315,7 +315,7 @@ public class GLDrawableHelper { } return drawable; } - + public final void addGLEventListener(GLEventListener listener) { addGLEventListener(-1, listener); } @@ -328,14 +328,14 @@ public class GLDrawableHelper { // GLEventListener may be added after context is created, // hence we earmark initialization for the next display call. listenersToBeInit.add(listener); - + listeners.add(index, listener); } } /** * Note that no {@link GLEventListener#dispose(GLAutoDrawable)} call is being issued - * due to the lack of a current context. + * due to the lack of a current context. * Consider calling {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}. * @return the removed listener, or null if listener was not added */ @@ -356,11 +356,11 @@ public class GLDrawableHelper { return listener; } } - + public final int getGLEventListenerCount() { synchronized(listenersLock) { return listeners.size(); - } + } } public final GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException { @@ -371,13 +371,13 @@ public class GLDrawableHelper { return listeners.get(index); } } - + public final boolean getGLEventListenerInitState(GLEventListener listener) { synchronized(listenersLock) { return !listenersToBeInit.contains(listener); } } - + public final void setGLEventListenerInitState(GLEventListener listener, boolean initialized) { synchronized(listenersLock) { if(initialized) { @@ -387,16 +387,16 @@ public class GLDrawableHelper { } } } - + /** - * Disposes the given {@link GLEventListener} via {@link GLEventListener#dispose(GLAutoDrawable)} + * Disposes the given {@link GLEventListener} via {@link GLEventListener#dispose(GLAutoDrawable)} * if it has been initialized and added to this queue. *
* If remove
is true
, the {@link GLEventListener} is removed from this drawable queue before disposal,
* otherwise marked uninitialized.
*
- * Please consider using {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)} + * Please consider using {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)} * for correctness, i.e. encapsulating all calls w/ makeCurrent etc. *
* @param autoDrawable @@ -405,9 +405,9 @@ public class GLDrawableHelper { */ public final GLEventListener disposeGLEventListener(GLAutoDrawable autoDrawable, GLEventListener listener, boolean remove) { synchronized(listenersLock) { - if( remove ) { + if( remove ) { if( listeners.remove(listener) ) { - if( !listenersToBeInit.remove(listener) ) { + if( !listenersToBeInit.remove(listener) ) { listener.dispose(autoDrawable); } return listener; @@ -417,12 +417,12 @@ public class GLDrawableHelper { listener.dispose(autoDrawable); listenersToBeInit.add(listener); return listener; - } + } } } return null; } - + /** * Disposes all added initialized {@link GLEventListener}s via {@link GLEventListener#dispose(GLAutoDrawable)}. *@@ -456,20 +456,20 @@ public class GLDrawableHelper { listenersToBeInit.add(listener); disposeCount++; } - } + } } } return disposeCount; } /** - * Principal helper method which runs {@link #disposeGLEventListener(GLAutoDrawable, GLEventListener, boolean)} + * Principal helper method which runs {@link #disposeGLEventListener(GLAutoDrawable, GLEventListener, boolean)} * with the context made current. *
- * If an {@link GLAnimatorControl} is being attached and the current thread is different + * If an {@link GLAnimatorControl} is being attached and the current thread is different * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation. *
- * + * * @param autoDrawable * @param context * @param listener @@ -477,7 +477,7 @@ public class GLDrawableHelper { */ public final GLEventListener disposeGLEventListener(final GLAutoDrawable autoDrawable, final GLDrawable drawable, - final GLContext context, + final GLContext context, final GLEventListener listener, final boolean remove) { synchronized(listenersLock) { @@ -485,7 +485,7 @@ public class GLDrawableHelper { if( listenersToBeInit.contains(listener) ) { if( remove ) { listenersToBeInit.remove(listener); - return listeners.remove(listener) ? listener : null; + return listeners.remove(listener) ? listener : null; } return null; } @@ -498,21 +498,21 @@ public class GLDrawableHelper { } }; invokeGL(drawable, context, action, nop); - + if(isPaused) { animatorCtrl.resume(); } return res[0]; } - + /** - * Principal helper method which runs {@link #disposeAllGLEventListener(GLAutoDrawable, boolean)} + * Principal helper method which runs {@link #disposeAllGLEventListener(GLAutoDrawable, boolean)} * with the context made current. *- * If an {@link GLAnimatorControl} is being attached and the current thread is different + * If an {@link GLAnimatorControl} is being attached and the current thread is different * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation. *
- * + * * @param autoDrawable * @param context * @param remove @@ -521,21 +521,21 @@ public class GLDrawableHelper { final GLDrawable drawable, final GLContext context, final boolean remove) { - + final boolean isPaused = isAnimatorAnimatingOnOtherThread() && animatorCtrl.pause(); - + final Runnable action = new Runnable() { public void run() { disposeAllGLEventListener(autoDrawable, remove); } }; invokeGL(drawable, context, action, nop); - + if(isPaused) { animatorCtrl.resume(); } } - + private final void init(GLEventListener l, GLAutoDrawable drawable, boolean sendReshape, boolean setViewport) { l.init(drawable); if(sendReshape) { @@ -543,8 +543,8 @@ public class GLDrawableHelper { } } - /** - * The default init action to be called once after ctx is being created @ 1st makeCurrent(). + /** + * The default init action to be called once after ctx is being created @ 1st makeCurrent(). * @param sendReshape set to true if the subsequent display call won't reshape, otherwise false to avoid double reshape. **/ public final void init(GLAutoDrawable drawable, boolean sendReshape) { @@ -554,7 +554,7 @@ public class GLDrawableHelper { if( listenerCount > 0 ) { for (int i=0; i < listenerCount; i++) { final GLEventListener listener = _listeners.get(i) ; - + // If make ctx current, invoked by invokGL(..), results in a new ctx, init gets called. // This may happen not just for initial setup, but for ctx recreation due to resource change (drawable/window), // hence it must be called unconditional, always. @@ -571,7 +571,7 @@ public class GLDrawableHelper { public final void display(GLAutoDrawable drawable) { displayImpl(drawable); if( glRunnables.size()>0 && !execGLRunnables(drawable) ) { // glRunnables volatile OK; execGL.. only executed if size > 0 - displayImpl(drawable); + displayImpl(drawable); } } private final void displayImpl(GLAutoDrawable drawable) { @@ -580,7 +580,7 @@ public class GLDrawableHelper { final int listenerCount = _listeners.size(); for (int i=0; i < listenerCount; i++) { final GLEventListener listener = _listeners.get(i) ; - // GLEventListener may need to be init, + // GLEventListener may need to be init, // in case this one is added after the realization of the GLAutoDrawable if( listenersToBeInit.remove(listener) ) { init( listener, drawable, true /* sendReshape */, listenersToBeInit.size() + 1 == listenerCount /* setViewport if 1st init */ ); @@ -589,11 +589,11 @@ public class GLDrawableHelper { } } } - + private final void reshape(GLEventListener listener, GLAutoDrawable drawable, int x, int y, int width, int height, boolean setViewport, boolean checkInit) { if(checkInit) { - // GLEventListener may need to be init, + // GLEventListener may need to be init, // in case this one is added after the realization of the GLAutoDrawable synchronized(listenersLock) { if( listenersToBeInit.remove(listener) ) { @@ -627,7 +627,7 @@ public class GLDrawableHelper { _glRunnables = null; } } - + if(null!=_glRunnables) { for (int i=0; i < _glRunnables.size(); i++) { res = _glRunnables.get(i).run(drawable) && res; @@ -648,7 +648,7 @@ public class GLDrawableHelper { _glRunnables = null; } } - + if(null!=_glRunnables) { for (int i=0; i < _glRunnables.size(); i++) { _glRunnables.get(i).flush(); @@ -656,7 +656,7 @@ public class GLDrawableHelper { } } } - + public final void setAnimator(GLAnimatorControl animator) throws GLException { synchronized(glRunnablesLock) { if(animatorCtrl!=animator && null!=animator && null!=animatorCtrl) { @@ -693,7 +693,7 @@ public class GLDrawableHelper { * Ifwait
is true
the call blocks until the glRunnable
* has been executed.*
- * If
* Default non-exclusive behavior is requested via
* To release a previous made exclusive thread, a user issues
* Note: Setting a new exclusive thread without properly releasing a previous one
@@ -833,7 +833,7 @@ public class GLDrawableHelper {
* and spare redundant context switches.
*
* If The surface is locked.
- * If
- * If
* Must be paired w/ {@link #createHandle()}.
- * wait
is true
and
+ * If wait
is true
and
* {@link GLDrawable#isRealized()} returns false
or {@link GLAutoDrawable#getContext()} returns null
,
* the call is ignored and returns false
.
* This helps avoiding deadlocking the caller.
@@ -709,7 +709,7 @@ public class GLDrawableHelper {
wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
return false;
}
-
+
GLRunnableTask rTask = null;
Object rTaskLock = new Object();
Throwable throwable = null;
@@ -743,13 +743,13 @@ public class GLDrawableHelper {
}
return true;
}
-
+
public final boolean invoke(GLAutoDrawable drawable, boolean wait, List
* The thread will exclusively claim the {@link GLContext} via {@link #display()} and not release it
- * until {@link #destroy()} or setExclusiveContextThread(null)
has been called.
+ * until {@link #destroy()} or setExclusiveContextThread(null)
has been called.
* setExclusiveContextThread(null)
,
- * which will cause the next call of {@link #display()} on the exclusive thread to
- * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()}
+ * which will cause the next call of {@link #display()} on the exclusive thread to
+ * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()}
* will return null
.
* setExclusiveContextThread(null)
- * and may poll {@link #getExclusiveContextThread()} until it returns null
,
- * while the exclusive thread is still running.
+ * and may poll {@link #getExclusiveContextThread()} until it returns null
,
+ * while the exclusive thread is still running.
* null
for default operation.
- * @return previous exclusive context thread
+ * @return previous exclusive context thread
* @throws GLException If an exclusive thread is still active but a new one is attempted to be set
*/
public final Thread setExclusiveContextThread(Thread t, GLContext context) throws GLException {
@@ -857,7 +857,7 @@ public class GLDrawableHelper {
ex.printStackTrace();
throw new GLException(ex);
}
- }
+ }
exclusiveContextThread = t;
}
if (DEBUG) {
@@ -865,14 +865,14 @@ public class GLDrawableHelper {
}
return oldExclusiveContextThread;
}
-
+
/**
- * @see #setExclusiveContextThread(Thread, GLContext)
+ * @see #setExclusiveContextThread(Thread, GLContext)
*/
public final Thread getExclusiveContextThread() {
return exclusiveContextThread;
}
-
+
private static final ThreadLocaldestroyContext
is true
the context is destroyed in the end while holding the lock.
@@ -940,7 +940,7 @@ public class GLDrawableHelper {
}
}
- int res;
+ int res;
try {
res = context.makeCurrent();
if (GLContext.CONTEXT_NOT_CURRENT != res) {
@@ -975,7 +975,7 @@ public class GLDrawableHelper {
private final void invokeGLImpl(final GLDrawable drawable,
final GLContext context,
final Runnable runnable,
- final Runnable initAction) {
+ final Runnable initAction) {
final Thread currentThread = Thread.currentThread();
// Exclusive Cases:
@@ -1013,7 +1013,7 @@ public class GLDrawableHelper {
lastContext.release();
}
}
-
+
try {
final boolean releaseContext;
if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1110,7 +1110,7 @@ public class GLDrawableHelper {
long tdX = 0; // release
boolean ctxClaimed = false;
boolean ctxReleased = false;
- boolean ctxDestroyed = false;
+ boolean ctxDestroyed = false;
try {
final boolean releaseContext;
if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1129,7 +1129,7 @@ public class GLDrawableHelper {
}
initAction.run();
}
- tdR = System.currentTimeMillis();
+ tdR = System.currentTimeMillis();
tdA = tdR - t0; // makeCurrent
runnable.run();
tdS = System.currentTimeMillis();
@@ -1172,5 +1172,5 @@ public class GLDrawableHelper {
}
protected static String getThreadName() { return Thread.currentThread().getName(); }
-
+
}
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
index e1088da29..a79a3cf25 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
@@ -53,11 +53,11 @@ import javax.media.opengl.GLProfile;
public abstract class GLDrawableImpl implements GLDrawable {
protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG;
-
+
protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
this(factory, comp, (GLCapabilitiesImmutable) comp.getGraphicsConfiguration().getRequestedCapabilities(), realized);
}
-
+
protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, GLCapabilitiesImmutable requestedCapabilities, boolean realized) {
this.factory = factory;
this.surface = comp;
@@ -100,20 +100,20 @@ public abstract class GLDrawableImpl implements GLDrawable {
}
} finally {
unlockSurface();
- }
+ }
surface.surfaceUpdated(this, surface, System.currentTimeMillis());
}
-
+
/**
* Platform and implementation depending surface swap.
* doubleBuffered
is true
,
+ * If doubleBuffered
is true
,
* an actual platform dependent surface swap shall be executed.
* doubleBuffered
is false
,
- * {@link GL#glFlush()} has been called already and
+ * If doubleBuffered
is false
,
+ * {@link GL#glFlush()} has been called already and
* the implementation may execute implementation specific code.
*
* Must be paired w/ {@link #destroyHandle()}. - *
+ * */ protected void createHandle() {} @@ -213,16 +213,16 @@ public abstract class GLDrawableImpl implements GLDrawable { System.err.println(getThreadName() + ": setRealized: "+getClass().getName()+" "+this.realized+" == "+realizedArg); } } - + /** - * Platform specific realization of drawable + * Platform specific realization of drawable */ protected abstract void setRealizedImpl(); /** * Callback for special implementations, allowing *construct
, destroy
.true
create an association, otherwise remove it
*/
protected void associateContext(GLContext ctx, boolean bound) { }
-
- /**
+
+ /**
* Callback for special implementations, allowing GLContext to trigger GL related lifecycle: makeCurrent
, release
.
*
* If current
is true
, the context has just been made current.
@@ -252,13 +252,13 @@ public abstract class GLDrawableImpl implements GLDrawable {
* Being called by {@link GLContextImpl#contextMadeCurrent(boolean)}.
*
* If drawable is {@link #setRealized(boolean) realized}, - * the {@link #getHandle() drawable handle} is valid after successfully {@link NativeSurface#lockSurface() locking} + * the {@link #getHandle() drawable handle} is valid after successfully {@link NativeSurface#lockSurface() locking} * it's {@link NativeSurface surface} until being {@link #unlockSurface() unlocked}. *
*- * In case the {@link NativeSurface surface} has changed as indicated by it's + * In case the {@link NativeSurface surface} has changed as indicated by it's * {@link NativeSurface#lockSurface() lock} result {@link NativeSurface#LOCK_SURFACE_CHANGED}, - * the implementation is required to update this information as needed within it's implementation. + * the implementation is required to update this information as needed within it's implementation. *
- * + * * @see NativeSurface#lockSurface() * @see #getHandle() */ @@ -312,7 +312,7 @@ public abstract class GLDrawableImpl implements GLDrawable { final long _handle1 = getHandle(); destroyHandle(); createHandle(); - final long _handle2 = getHandle(); + final long _handle2 = getHandle(); if(DEBUG) { if( _handle1 != _handle2) { System.err.println(getThreadName() + ": Drawable handle changed: "+toHexString(_handle1)+" -> "+toHexString(_handle2)); @@ -320,14 +320,14 @@ public abstract class GLDrawableImpl implements GLDrawable { } } return lockRes; - + } - /** + /** * {@link NativeSurface#unlockSurface() Unlocks} the underlying windowing toolkit {@link NativeSurface surface}, * which may render the {@link #getHandle() drawable handle} invalid. - * - * @see NativeSurface#unlockSurface() + * + * @see NativeSurface#unlockSurface() * @see #getHandle() */ public final void unlockSurface() { diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java index 8ba9f617b..640e181ae 100644 --- a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,12 +20,12 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ - + package jogamp.opengl; import com.jogamp.common.os.DynamicLibraryBundle; @@ -36,7 +36,7 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle protected GLDynamicLibraryBundleInfo() { } - /** + /** * Returnstrue
,
* since we might load a desktop GL library and allow symbol access to subsequent libs.
* @@ -47,19 +47,19 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle *
*/ public final boolean shallLinkGlobal() { return true; } - + /** * {@inheritDoc} *
* Returns false
.
*
- * It utilizes the context current hook {@link #contextMadeCurrent(GLContext, boolean) contextMadeCurrent(context, true)} + * It utilizes the context current hook {@link #contextMadeCurrent(GLContext, boolean) contextMadeCurrent(context, true)} * to {@link FBObject#bind(GL) bind} the FBO. *
* See {@link GLFBODrawable} for double buffering details. - * + * * @see GLDrawableImpl#contextRealized(GLContext, boolean) * @see GLDrawableImpl#contextMadeCurrent(GLContext, boolean) * @see GLDrawableImpl#getDefaultDrawFramebuffer() @@ -39,21 +39,21 @@ import com.jogamp.opengl.JoglVersion; public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { protected static final boolean DEBUG; protected static final boolean DEBUG_SWAP; - + static { Debug.initSingleton(); DEBUG = GLDrawableImpl.DEBUG || Debug.debug("FBObject"); DEBUG_SWAP = DEBUG || Debug.isPropertyDefined("jogl.debug.FBObject.Swap", true); } - + private final GLDrawableImpl parent; private GLCapabilitiesImmutable origParentChosenCaps; - + private boolean initialized; private int texUnit; private int samples; private boolean fboResetQuirk; - + private FBObject[] fbos; private int fboIBack; // points to GL_BACK buffer private int fboIFront; // points to GL_FRONT buffer @@ -64,19 +64,19 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { private boolean fboSwapped; /** dump fboResetQuirk info only once pre ClassLoader and only in DEBUG mode */ - private static volatile boolean resetQuirkInfoDumped = false; - + private static volatile boolean resetQuirkInfoDumped = false; + /** number of FBOs for double buffering. TODO: Possible to configure! */ - private static final int bufferCount = 2; - + private static final int bufferCount = 2; + // private DoubleBufferMode doubleBufferMode; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support - + private SwapBufferContext swapBufferContext; - + public static interface SwapBufferContext { public void swapBuffers(boolean doubleBuffered); } - + /** * @param factory * @param parent @@ -84,7 +84,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { * @param fboCaps the requested FBO capabilities * @param textureUnit */ - protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface, + protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface, GLCapabilitiesImmutable fboCaps, int textureUnit) { super(factory, surface, fboCaps, false); this.initialized = false; @@ -94,13 +94,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { this.texUnit = textureUnit; this.samples = fboCaps.getNumSamples(); fboResetQuirk = false; - + // default .. // TODO: Add or remove TEXTURE (only) DoubleBufferMode support // this.doubleBufferMode = ( samples > 0 || fboCaps.getDoubleBuffered() ) ? DoubleBufferMode.FBO : DoubleBufferMode.NONE ; - + this.swapBufferContext = null; } - + private final void initialize(boolean realize, GL gl) { if( !initialized && !realize ) { if( DEBUG ) { @@ -114,7 +114,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { } if(realize) { final GLCapabilities chosenFBOCaps = (GLCapabilities) getChosenGLCapabilities(); // cloned at setRealized(true) - + final int maxSamples = gl.getMaxRenderbufferSamples(); { final int newSamples = samples <= maxSamples ? samples : maxSamples; @@ -123,7 +123,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { } samples = newSamples; } - + final int fbosN; if(samples > 0) { fbosN = 1; @@ -136,7 +136,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { fbos = new FBObject[fbosN]; fboIBack = 0; // head fboIFront = fbos.length - 1; // tail - + for(int i=0; i@@ -150,17 +150,17 @@ public class GLGraphicsConfigurationUtil { * @param device the device on which the drawable will be created, maybe null for the {@link GLDrawableFactory#getDefaultDevice() default device}. * @return either the given requested {@link GLCapabilitiesImmutable} instance if no modifications were required, or a modified {@link GLCapabilitiesImmutable} instance. */ - public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested, + public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested, GLDrawableFactory factory, AbstractGraphicsDevice device) { if( !capsRequested.isOnscreen() ) { return fixOffscreenGLCapabilities(capsRequested, factory, device); } return capsRequested; } - + public static GLCapabilitiesImmutable fixOnscreenGLCapabilities(GLCapabilitiesImmutable capsRequested) { - if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) { + if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) { // fix caps .. final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable(); caps2.setBitmap (false); @@ -174,7 +174,7 @@ public class GLGraphicsConfigurationUtil { public static GLCapabilitiesImmutable fixOffscreenBitOnly(GLCapabilitiesImmutable capsRequested) { - if( capsRequested.isOnscreen() ) { + if( capsRequested.isOnscreen() ) { // fix caps .. final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable(); caps2.setOnscreen(false); @@ -182,7 +182,7 @@ public class GLGraphicsConfigurationUtil { } return capsRequested; } - + /** * Fixes the requested {@link GLCapabilitiesImmutable} according to: *
drawable yet,
* may be null
for lazy initialization
@@ -55,16 +55,16 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public GLOffscreenAutoDrawableImpl(GLDrawable drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
super(drawable, context, upstreamWidget, true, lock);
}
-
+
@Override
public void setSize(int newWidth, int newHeight) throws NativeWindowException, GLException {
this.defaultWindowResizedOp(newWidth, newHeight);
}
-
- public static class FBOImpl extends GLOffscreenAutoDrawableImpl implements GLOffscreenAutoDrawable.FBO {
+
+ public static class FBOImpl extends GLOffscreenAutoDrawableImpl implements GLOffscreenAutoDrawable.FBO {
/**
* @param drawable a valid {@link GLDrawable}, may not be {@link GLDrawable#isRealized() realized} yet.
- * @param context a valid {@link GLContext},
+ * @param context a valid {@link GLContext},
* may not have been made current (created) yet,
* may not be associated w/ drawable yet,
* may be null
for lazy initialization
@@ -74,7 +74,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public FBOImpl(GLFBODrawableImpl drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
super(drawable, context, upstreamWidget, lock);
}
-
+
@Override
public boolean isInitialized() {
return ((GLFBODrawableImpl)drawable).isInitialized();
@@ -84,7 +84,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public final int getTextureUnit() {
return ((GLFBODrawableImpl)drawable).getTextureUnit();
}
-
+
@Override
public final void setTextureUnit(int unit) {
((GLFBODrawableImpl)drawable).setTextureUnit(unit);
@@ -94,23 +94,23 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public final int getNumSamples() {
return ((GLFBODrawableImpl)drawable).getNumSamples();
}
-
+
@Override
public final void setNumSamples(GL gl, int newSamples) throws GLException {
((GLFBODrawableImpl)drawable).setNumSamples(gl, newSamples);
windowRepaintOp();
}
-
+
@Override
public final int setNumBuffers(int bufferCount) throws GLException {
return ((GLFBODrawableImpl)drawable).setNumBuffers(bufferCount);
}
-
+
@Override
public final int getNumBuffers() {
return ((GLFBODrawableImpl)drawable).getNumBuffers();
}
-
+
/** // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
@Override
public DoubleBufferMode getDoubleBufferMode() {
@@ -119,14 +119,14 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
@Override
public void setDoubleBufferMode(DoubleBufferMode mode) throws GLException {
- ((GLFBODrawableImpl)drawable).setDoubleBufferMode(mode);
+ ((GLFBODrawableImpl)drawable).setDoubleBufferMode(mode);
} */
-
+
@Override
- public final FBObject getFBObject(int bufferName) {
+ public final FBObject getFBObject(int bufferName) {
return ((GLFBODrawableImpl)drawable).getFBObject(bufferName);
}
-
+
public final FBObject.TextureAttachment getTextureBuffer(int bufferName) {
return ((GLFBODrawableImpl)drawable).getTextureBuffer(bufferName);
}
@@ -134,6 +134,6 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
@Override
public void resetSize(GL gl) throws GLException {
((GLFBODrawableImpl)drawable).resetSize(gl);
- }
+ }
}
}
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
index b8841d6e2..c32957b86 100644
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
@@ -51,7 +51,7 @@ import com.jogamp.common.util.locks.RecursiveLock;
public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
public GLPbufferImpl(GLDrawableImpl pbufferDrawable, GLContextImpl pbufferContext) {
- super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
+ super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
}
//
@@ -60,26 +60,26 @@ public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
//
// GLDrawable delegation
- //
-
+ //
+
@Override
public final void swapBuffers() throws GLException {
defaultSwapBuffers();
}
-
+
//
// GLAutoDrawable completion
//
private final RecursiveLock lock = LockFactory.createRecursiveLock(); // instance wide lock
-
+
@Override
protected final RecursiveLock getLock() { return lock; }
-
+
@Override
public final Object getUpstreamWidget() {
return null;
}
-
+
@Override
public void destroy() {
defaultDestroy();
@@ -92,7 +92,7 @@ public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
@Override
public final void display() {
- final RecursiveLock _lock = lock;
+ final RecursiveLock _lock = lock;
_lock.lock(); // sync: context/drawable could been recreated/destroyed while animating
try {
if( null != context ) {
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
index 244a3fd79..2238d49bc 100644
--- a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.opengl;
import javax.media.opengl.GLRunnable;
@@ -86,41 +86,41 @@ public class GLRunnableTask implements GLRunnable {
}
return res;
}
-
- /**
+
+ /**
* Simply flush this task and notify a waiting executor.
* The executor which might have been blocked until notified
* will be unblocked and the task removed from the queue.
- *
+ *
* @see #isFlushed()
* @see #isInQueue()
- */
+ */
public void flush() {
if(!isExecuted() && null != notifyObject) {
synchronized (notifyObject) {
isFlushed=true;
- notifyObject.notifyAll();
+ notifyObject.notifyAll();
}
}
}
-
+
/**
* @return !{@link #isExecuted()} && !{@link #isFlushed()}
*/
public boolean isInQueue() { return !isExecuted && !isFlushed; }
-
+
/**
* @return whether this task has been executed.
* @see #isInQueue()
*/
public boolean isExecuted() { return isExecuted; }
-
+
/**
* @return whether this task has been flushed.
* @see #isInQueue()
*/
public boolean isFlushed() { return isFlushed; }
-
+
public Throwable getThrowable() { return runnableException; }
}
diff --git a/src/jogl/classes/jogamp/opengl/GLStateTracker.java b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
index 01c3716e0..307fd0a15 100644
--- a/src/jogl/classes/jogamp/opengl/GLStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -53,47 +53,47 @@ import java.util.ArrayList;
* Currently supported states: PixelStorei
*/
public class GLStateTracker {
-
- /** Minimum value of MAX_CLIENT_ATTRIB_STACK_DEPTH */
+
+ /** Minimum value of MAX_CLIENT_ATTRIB_STACK_DEPTH */
public static final int MIN_CLIENT_ATTRIB_STACK_DEPTH = 16;
-
+
/** static size of pixel state map */
static final int PIXEL_STATE_MAP_SIZE = 16;
/** avoid rehash of static size pixel state map */
static final int PIXEL_STATE_MAP_CAPACITY = 32;
-
+
private volatile boolean enabled = true;
private IntIntHashMap pixelStateMap;
private final ArrayList stack;
-
+
private static class SavedState {
/**
* Empty pixel-store state
- */
+ */
private IntIntHashMap pixelStateMap;
-
+
/**
* set (client) pixel-store state, deep copy
- */
+ */
private final void setPixelStateMap(IntIntHashMap pixelStateMap) {
this.pixelStateMap = (IntIntHashMap) pixelStateMap.clone();
}
-
+
/**
* get (client) pixel-store state, return reference
- */
+ */
private final IntIntHashMap getPixelStateMap() { return pixelStateMap; }
}
-
- public GLStateTracker() {
+
+ public GLStateTracker() {
pixelStateMap = new IntIntHashMap(PIXEL_STATE_MAP_CAPACITY, 0.75f);
pixelStateMap.setKeyNotFoundValue(0xFFFFFFFF);
resetStates();
-
+
stack = new ArrayList(MIN_CLIENT_ATTRIB_STACK_DEPTH);
}
@@ -102,18 +102,18 @@ public class GLStateTracker {
}
public final void setEnabled(boolean on) {
- enabled = on;
+ enabled = on;
}
public final boolean isEnabled() {
return enabled;
}
- /** @return true if found in our map, otherwise false,
+ /** @return true if found in our map, otherwise false,
* which forces the caller to query GL. */
public final boolean getInt(int pname, int[] params, int params_offset) {
if(enabled) {
- final int value = pixelStateMap.get(pname);
+ final int value = pixelStateMap.get(pname);
if(0xFFFFFFFF != value) {
params[params_offset] = value;
return true;
@@ -122,7 +122,7 @@ public class GLStateTracker {
return false;
}
- /** @return true if found in our map, otherwise false,
+ /** @return true if found in our map, otherwise false,
* which forces the caller to query GL. */
public final boolean getInt(int pname, IntBuffer params, int dummy) {
if(enabled) {
@@ -158,7 +158,7 @@ public class GLStateTracker {
throw new GLException("stack contains no elements");
}
SavedState state = stack.remove(stack.size()-1); // pop
-
+
if(null==state) {
throw new GLException("null stack element (remaining stack size "+stack.size()+")");
}
@@ -166,7 +166,7 @@ public class GLStateTracker {
if ( null != state.getPixelStateMap() ) {
// use pulled client pixel-store state from stack
pixelStateMap = state.getPixelStateMap();
- } // else: empty-slot, not pushed by GL_CLIENT_PIXEL_STORE_BIT
+ } // else: empty-slot, not pushed by GL_CLIENT_PIXEL_STORE_BIT
}
}
diff --git a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
index e4187b35b..431c1a387 100644
--- a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
+++ b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
@@ -43,9 +43,9 @@ public class GLVersionNumber extends VersionNumberString {
super(val[0], val[1], val[2], strEnd, state, versionString);
this.valid = valid;
}
-
+
private static java.util.regex.Pattern getUnderscorePattern() {
- if( null == _Pattern ) { // volatile dbl-checked-locking OK
+ if( null == _Pattern ) { // volatile dbl-checked-locking OK
synchronized( VersionNumber.class ) {
if( null == _Pattern ) {
_Pattern = getVersionNumberPattern("_");
@@ -55,7 +55,7 @@ public class GLVersionNumber extends VersionNumberString {
return _Pattern;
}
private static volatile java.util.regex.Pattern _Pattern = null;
-
+
public static final GLVersionNumber create(String versionString) {
int[] val = new int[] { 0, 0, 0 };
int strEnd = 0;
@@ -73,7 +73,7 @@ public class GLVersionNumber extends VersionNumberString {
strEnd = version.endOfStringMatch();
val[0] = version.getMajor();
val[1] = version.getMinor();
- state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) |
+ state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) |
( version.hasMinor() ? VersionNumber.HAS_MINOR : (short)0 ) );
valid = version.hasMajor() && version.hasMinor(); // Requires at least a defined major and minor version component!
} catch (Exception e) {
@@ -82,16 +82,16 @@ public class GLVersionNumber extends VersionNumberString {
val[0] = 1;
val[1] = 0;
}
- }
+ }
return new GLVersionNumber(val, strEnd, state, versionString, valid);
}
public final boolean isValid() {
return valid;
}
-
- /**
- * Returns the optional vendor version at the end of the
+
+ /**
+ * Returns the optional vendor version at the end of the
* GL_VERSION
string if exists, otherwise the {@link VersionNumberString#zeroVersion zero version} instance.
*
* 2.1 Mesa 7.0.3-rc2 -> 7.0.3 (7.0.3-rc2)
@@ -105,14 +105,14 @@ public class GLVersionNumber extends VersionNumberString {
if (versionString == null || versionString.length() <= 0) {
return null;
}
-
+
// Skip the 1st GL version
String str;
{
final GLVersionNumber glv = create(versionString);
str = versionString.substring(glv.endOfStringMatch()).trim();
}
-
+
while ( str.length() > 0 ) {
final VersionNumberString version = new VersionNumberString(str, getDefaultVersionNumberPattern());
final int eosm = version.endOfStringMatch();
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index 112dfcb64..979c6dc0a 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -67,7 +67,7 @@ public class GLWorkerThread {
private static volatile Runnable work;
// Queue of Runnables to be asynchronously invoked
private static List queue = new ArrayList();
-
+
/** Should only be called by Threading class if creation of the
GLWorkerThread was requested via the opengl.1thread system
property.
@@ -149,7 +149,7 @@ public class GLWorkerThread {
}
}
- public static void invoke(boolean wait, Runnable runnable)
+ public static void invoke(boolean wait, Runnable runnable)
throws InvocationTargetException, InterruptedException {
if(wait) {
invokeAndWait(runnable);
@@ -157,7 +157,7 @@ public class GLWorkerThread {
invokeLater(runnable);
}
}
-
+
public static void invokeAndWait(Runnable runnable)
throws InvocationTargetException, InterruptedException {
if (!started) {
@@ -220,7 +220,7 @@ public class GLWorkerThread {
}
protected static String getThreadName() { return Thread.currentThread().getName(); }
-
+
static class WorkerRunnable implements Runnable {
public void run() {
// Notify starting thread that we're ready
@@ -244,7 +244,7 @@ public class GLWorkerThread {
break;
}
}
-
+
if (shouldTerminate) {
lock.notifyAll();
thread = null;
diff --git a/src/jogl/classes/jogamp/opengl/GLXExtensions.java b/src/jogl/classes/jogamp/opengl/GLXExtensions.java
index 36c6c4665..9325c6f68 100644
--- a/src/jogl/classes/jogamp/opengl/GLXExtensions.java
+++ b/src/jogl/classes/jogamp/opengl/GLXExtensions.java
@@ -28,9 +28,9 @@
package jogamp.opengl;
/**
- * Class holding GLX/WGL/.. extension strings, commonly used by JOGL's implementation.
+ * Class holding GLX/WGL/.. extension strings, commonly used by JOGL's implementation.
*/
-public class GLXExtensions {
+public class GLXExtensions {
public static final String GLX_MESA_swap_control = "GLX_MESA_swap_control";
public static final String GLX_SGI_swap_control = "GLX_SGI_swap_control";
public static final String GLX_NV_swap_group = "GLX_NV_swap_group";
diff --git a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
index 1cde551be..a64a2f5cd 100644
--- a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
+++ b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
@@ -33,9 +33,9 @@ import java.util.ArrayList;
/**
* Simple locked listener implementation stub to be used for listener handler,
* synchronized on it's instance.
- *
+ *
* Utilizing simple locking via synchronized.
- *
+ *
* @param The listener type
*/
public class ListenerSyncedImplStub {
@@ -48,7 +48,7 @@ public class ListenerSyncedImplStub {
public synchronized final void reset() {
listeners = new ArrayList();
}
-
+
public synchronized final void destroy() {
listeners.clear();
listeners = null;
@@ -57,7 +57,7 @@ public class ListenerSyncedImplStub {
public synchronized final int size() {
return listeners.size();
}
-
+
public synchronized final void addListener(E listener) {
addListener(-1, listener);
}
@@ -68,12 +68,12 @@ public class ListenerSyncedImplStub {
}
listeners.add(index, listener);
}
-
+
public synchronized final void removeListener(E listener) {
listeners.remove(listener);
}
public final ArrayList getListeners() {
return listeners;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/ProjectFloat.java b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
index 439ddc76e..d4fd1c935 100644
--- a/src/jogl/classes/jogamp/opengl/ProjectFloat.java
+++ b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
@@ -6,9 +6,9 @@
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
** except that Section 2.2 and 11 are omitted. Any differences between
** the Alternative License and the SGI License are offered solely by Sun
** and not by SGI.
-**
+**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,34 +45,34 @@
** $Header$
*/
-/*
+/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
+ * modification, are permitted provided that the following conditions are
* met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * * Neither the name of 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@@ -80,22 +80,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2011 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -108,7 +108,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -129,14 +129,14 @@ import com.jogamp.opengl.math.FloatUtil;
*
* Created 11-jan-2004
*
- *
+ *
* @author Erik Duijs
* @author Kenneth Russell
* @author Sven Gothel
*/
public class ProjectFloat {
public static final int getRequiredFloatBufferSize() { return 1*16; }
-
+
// Note that we have cloned parts of the implementation in order to
// support incoming Buffers. The reason for this is to avoid loading
// non-direct buffer subclasses unnecessarily, because doing so can
@@ -162,22 +162,22 @@ public class ProjectFloat {
public ProjectFloat() {
this(true);
}
-
+
public ProjectFloat(boolean useBackingArray) {
- this(useBackingArray ? null : Buffers.newDirectByteBuffer(getRequiredFloatBufferSize() * Buffers.SIZEOF_FLOAT),
- useBackingArray ? new float[getRequiredFloatBufferSize()] : null,
+ this(useBackingArray ? null : Buffers.newDirectByteBuffer(getRequiredFloatBufferSize() * Buffers.SIZEOF_FLOAT),
+ useBackingArray ? new float[getRequiredFloatBufferSize()] : null,
0);
}
/**
* @param floatBuffer source buffer, may be ByteBuffer (recommended) or FloatBuffer or null
.
- * If used, shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
+ * If used, shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
* Buffer's position is ignored and floatPos is being used.
* @param floatArray source float array or null
.
* If used, size shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
* @param floatOffset Offset for either of the given sources (buffer or array)
*/
- public ProjectFloat(Buffer floatBuffer, float[] floatArray, int floatOffset) {
+ public ProjectFloat(Buffer floatBuffer, float[] floatArray, int floatOffset) {
matrixBuf = Buffers.slice2Float(floatBuffer, floatArray, floatOffset, 16);
}
@@ -259,7 +259,7 @@ public class ProjectFloat {
/**
* @param src
* @param inverse
- *
+ *
* @return
*/
public boolean gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
@@ -268,7 +268,7 @@ public class ProjectFloat {
final int srcPos = src.position();
final int invPos = inverse.position();
-
+
final float[][] temp = tempInvertMatrix;
for (i = 0; i < 4; i++) {
@@ -297,7 +297,7 @@ public class ProjectFloat {
t = temp[i][k];
temp[i][k] = temp[swap][k];
temp[swap][k] = t;
-
+
t = inverse.get(i*4+k + invPos);
inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
inverse.put(swap*4+k + invPos, t);
@@ -335,7 +335,7 @@ public class ProjectFloat {
/**
* Method gluOrtho2D.
- *
+ *
* @param left
* @param right
* @param bottom
@@ -347,7 +347,7 @@ public class ProjectFloat {
/**
* Method gluPerspective.
- *
+ *
* @param fovy
* @param aspect
* @param zNear
@@ -380,7 +380,7 @@ public class ProjectFloat {
/**
* Method gluLookAt
- *
+ *
* @param eyex
* @param eyey
* @param eyez
@@ -436,7 +436,7 @@ public class ProjectFloat {
/**
* Map object coordinates to window coordinates.
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -444,7 +444,7 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(float objx, float objy, float objz,
@@ -518,13 +518,13 @@ public class ProjectFloat {
win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
win_pos[2+win_pos_offset] = in[2];
-
+
return true;
}
-
+
/**
* Map object coordinates to window coordinates.
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -532,7 +532,7 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(float objx, float objy, float objz,
@@ -576,7 +576,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -584,7 +584,7 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(float winx, float winy, float winz,
@@ -633,7 +633,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -646,7 +646,7 @@ public class ProjectFloat {
* @return
*/
public boolean gluUnProject(float winx, float winy, float winz,
- FloatBuffer modelMatrix,
+ FloatBuffer modelMatrix,
FloatBuffer projMatrix,
int[] viewport, int viewport_offset,
float[] obj_pos, int obj_pos_offset) {
@@ -674,7 +674,7 @@ public class ProjectFloat {
in[2] = in[2] * 2 - 1;
FloatUtil.multMatrixVecf(matrixBuf, in, out);
-
+
if (out[3] == 0.0) {
return false;
}
@@ -687,10 +687,10 @@ public class ProjectFloat {
return true;
}
-
+
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -698,11 +698,11 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(float winx, float winy, float winz,
- FloatBuffer modelMatrix,
+ FloatBuffer modelMatrix,
FloatBuffer projMatrix,
IntBuffer viewport,
FloatBuffer obj_pos) {
@@ -722,7 +722,7 @@ public class ProjectFloat {
// Map x and y from window coordinates
final int vPos = viewport.position();
- final int oPos = obj_pos.position();
+ final int oPos = obj_pos.position();
in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
@@ -749,7 +749,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -760,7 +760,7 @@ public class ProjectFloat {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(float winx,
@@ -815,7 +815,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -826,7 +826,7 @@ public class ProjectFloat {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(float winx,
@@ -857,7 +857,7 @@ public class ProjectFloat {
in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
in[2] = (in[2] - near) / (far - near);
-
+
// Map to range -1 to 1
in[0] = in[0] * 2 - 1;
in[1] = in[1] * 2 - 1;
@@ -873,14 +873,14 @@ public class ProjectFloat {
obj_pos.put(0+oPos, out[0]);
obj_pos.put(1+oPos, out[1]);
obj_pos.put(2+oPos, out[2]);
- obj_pos.put(3+oPos, out[3]);
+ obj_pos.put(3+oPos, out[3]);
return true;
}
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
@@ -907,7 +907,7 @@ public class ProjectFloat {
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index e5f5ee09a..eddb36975 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -52,30 +52,30 @@ public class SharedResourceRunner implements Runnable {
*
* Called within synchronized block.
*
- * @param connection for creation a {@link AbstractGraphicsDevice} instance.
- * @return true
if the device supports all protocols required for the implementation, otherwise false
.
+ * @param connection for creation a {@link AbstractGraphicsDevice} instance.
+ * @return true
if the device supports all protocols required for the implementation, otherwise false
.
*/
boolean isDeviceSupported(String connection);
-
+
/**
*
* Called within synchronized block.
*
- * @param connection for creation a {@link AbstractGraphicsDevice} instance.
- * @return A new shared resource instance
+ * @param connection for creation a {@link AbstractGraphicsDevice} instance.
+ * @return A new shared resource instance
*/
Resource createSharedResource(String connection);
-
- /** Called within synchronized block. */
+
+ /** Called within synchronized block. */
void releaseSharedResource(Resource shared);
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
void clear();
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
Resource mapPut(String connection, Resource resource);
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
Resource mapGet(String connection);
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
Collection mapValues();
}
@@ -103,7 +103,7 @@ public class SharedResourceRunner implements Runnable {
this.impl = impl;
resetState();
}
-
+
private void resetState() { // synchronized call
devicesTried.clear();
thread = null;
@@ -114,12 +114,12 @@ public class SharedResourceRunner implements Runnable {
releaseConnection = null;
}
- /**
+ /**
* Start the shared resource runner thread, if not running.
*
* Validate the thread upfront and release all related resource if it was killed.
*
- *
+ *
* @return the shared resource runner thread.
*/
public Thread start() {
@@ -132,7 +132,7 @@ public class SharedResourceRunner implements Runnable {
releaseSharedResources();
thread = null;
running = false;
- }
+ }
if( null == thread ) {
if (DEBUG) {
System.err.println("SharedResourceRunner.start() - start new Thread - "+getThreadName());
@@ -150,7 +150,7 @@ public class SharedResourceRunner implements Runnable {
}
return thread;
}
-
+
public void stop() {
synchronized (this) {
if(null != thread) {
@@ -160,7 +160,7 @@ public class SharedResourceRunner implements Runnable {
synchronized (this) {
shouldRelease = true;
this.notifyAll();
-
+
while (running) {
try {
this.wait();
@@ -170,7 +170,7 @@ public class SharedResourceRunner implements Runnable {
}
}
}
-
+
public SharedResourceRunner.Resource getOrCreateShared(AbstractGraphicsDevice device) {
SharedResourceRunner.Resource sr = null;
if(null != device) {
@@ -203,7 +203,7 @@ public class SharedResourceRunner implements Runnable {
if(null != device) {
synchronized (this) {
final String connection = device.getConnection();
- sr = impl.mapGet(connection);
+ sr = impl.mapGet(connection);
if (null != sr) {
removeDeviceTried(connection);
if (DEBUG) {
@@ -261,7 +261,7 @@ public class SharedResourceRunner implements Runnable {
synchronized (this) {
running = true;
-
+
while (!shouldRelease) {
try {
// wait for stop or init
@@ -271,7 +271,7 @@ public class SharedResourceRunner implements Runnable {
}
notifyAll();
this.wait();
- } catch (InterruptedException ex) {
+ } catch (InterruptedException ex) {
shouldRelease = true;
if(DEBUG) {
System.err.println("SharedResourceRunner.run(): INTERRUPTED - "+threadName);
@@ -311,7 +311,7 @@ public class SharedResourceRunner implements Runnable {
} catch (Exception e) {
e.printStackTrace();
}
- }
+ }
}
}
initConnection = null;
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index d55a2c976..6ffe46b36 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.opengl;
@@ -49,14 +49,14 @@ import com.jogamp.common.util.ReflectionUtil;
public class ThreadingImpl {
public enum Mode {
- MT(0), ST_AWT(1), ST_WORKER(2);
-
+ MT(0), ST_AWT(1), ST_WORKER(2);
+
public final int id;
Mode(int id){
this.id = id;
}
- }
+ }
protected static final boolean DEBUG = Debug.debug("Threading");
@@ -68,7 +68,7 @@ public class ThreadingImpl {
private static boolean _isX11;
private static final ToolkitThreadingPlugin threadingPlugin;
-
+
static {
threadingPlugin =
AccessController.doPrivileged(new PrivilegedAction() {
@@ -94,7 +94,7 @@ public class ThreadingImpl {
// default setting
singleThreaded = true;
mode = ( hasAWT ? Mode.ST_AWT : Mode.ST_WORKER );
-
+
if (singleThreadProp != null) {
if (singleThreadProp.equals("true") ||
singleThreadProp.equals("auto")) {
@@ -113,7 +113,7 @@ public class ThreadingImpl {
throw new RuntimeException("Unsupported value for property jogl.1thread: "+singleThreadProp+", should be [true/auto, worker, awt or false]");
}
}
-
+
ToolkitThreadingPlugin threadingPlugin=null;
if(hasAWT) {
// try to fetch the AWTThreadingPlugin
@@ -139,9 +139,9 @@ public class ThreadingImpl {
public static boolean isX11() { return _isX11; }
public static Mode getMode() { return mode; }
- /** If an implementation of the javax.media.opengl APIs offers a
- multithreading option but the default behavior is single-threading,
- this API provides a mechanism for end users to disable single-threading
+ /** If an implementation of the javax.media.opengl APIs offers a
+ multithreading option but the default behavior is single-threading,
+ this API provides a mechanism for end users to disable single-threading
in this implementation. Users are strongly discouraged from
calling this method unless they are aware of all of the
consequences and are prepared to enforce some amount of
@@ -151,7 +151,7 @@ public class ThreadingImpl {
GLPbuffer. Currently there is no supported way to re-enable it
once disabled, partly to discourage careless use of this
method. This method should be called as early as possible in an
- application. */
+ application. */
public static final void disableSingleThreading() {
singleThreaded = false;
if (Debug.verbose()) {
@@ -183,7 +183,7 @@ public class ThreadingImpl {
throw new InternalError("Illegal single-threading mode " + mode);
}
}
-
+
public static final boolean isToolkitThread() throws GLException {
if(null!=threadingPlugin) {
return threadingPlugin.isToolkitThread();
@@ -215,7 +215,7 @@ public class ThreadingImpl {
throw new InternalError("Illegal single-threading mode " + mode);
}
}
-
+
public static final void invokeOnWorkerThread(boolean wait, Runnable r) throws GLException {
GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
try {
@@ -224,6 +224,6 @@ public class ThreadingImpl {
throw new GLException(e.getTargetException());
} catch (InterruptedException e) {
throw new GLException(e);
- }
+ }
}
}
diff --git a/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
index 22972953a..06fb0fe91 100644
--- a/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -46,7 +46,7 @@ public interface ToolkitThreadingPlugin {
/** Indicates whether the current thread is the designated toolkit thread,
if such semantics exists. */
public boolean isToolkitThread() throws GLException;
-
+
/** Indicates whether the current thread is the thread on
which this implementation of the javax.media.opengl APIs
performs all of its OpenGL-related work. This method should only
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index 56f00b370..cd1bb45c9 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -57,7 +57,7 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
public final boolean isToolkitThread() throws GLException {
return EventQueue.isDispatchThread();
}
-
+
public final boolean isOpenGLThread() throws GLException {
switch (ThreadingImpl.getMode()) {
case ST_AWT:
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 9bdceff48..5faee1307 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -67,19 +67,19 @@ import com.jogamp.opengl.util.awt.AWTGLPixelBuffer.AWTGLPixelBufferProvider;
*/
public class AWTTilePainter {
private static final boolean DEBUG_TILES = Debug.debug("TileRenderer.PNG");
-
+
public final TileRenderer renderer;
public final int componentCount;
public final double scaleMatX, scaleMatY;
public final int customTileWidth, customTileHeight, customNumSamples;
public final boolean verbose;
-
+
public boolean flipVertical;
private AWTGLPixelBuffer tBuffer = null;
private BufferedImage vFlipImage = null;
private Graphics2D g2d = null;
- private AffineTransform saveAT = null;
-
+ private AffineTransform saveAT = null;
+
public static void dumpHintsAndScale(Graphics2D g2d) {
final RenderingHints rHints = g2d.getRenderingHints();
final Set> rEntries = rHints.entrySet();
@@ -92,13 +92,13 @@ public class AWTTilePainter {
if( null != aTrans ) {
System.err.println(" type "+aTrans.getType());
System.err.println(" scale "+aTrans.getScaleX()+" x "+aTrans.getScaleY());
- System.err.println(" move "+aTrans.getTranslateX()+" x "+aTrans.getTranslateY());
+ System.err.println(" move "+aTrans.getTranslateX()+" x "+aTrans.getTranslateY());
System.err.println(" mat "+aTrans);
} else {
System.err.println(" null transform");
}
}
-
+
/**
* @return resulting number of samples by comparing w/ {@link #customNumSamples} and the caps-config, 0 if disabled
*/
@@ -114,12 +114,12 @@ public class AWTTilePainter {
return caps.getNumSamples();
}
}
-
- /**
+
+ /**
* Assumes a configured {@link TileRenderer}, i.e.
* an {@link TileRenderer#attachAutoDrawable(GLAutoDrawable) attached}
* {@link GLAutoDrawable} with {@link TileRenderer#setTileSize(int, int, int) set tile size}.
- *
+ *
* Sets the renderer to {@link TileRenderer#TR_TOP_TO_BOTTOM} row order.
*
*
@@ -129,7 +129,7 @@ public class AWTTilePainter {
* @param componentCount
* @param scaleMatX {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatX * width pixels
* @param scaleMatY {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatY * height pixels
- * @param numSamples custom multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
+ * @param numSamples custom multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
* @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param verbose
@@ -146,13 +146,13 @@ public class AWTTilePainter {
this.verbose = verbose;
this.flipVertical = true;
}
-
+
public String toString() { return renderer.toString(); }
-
+
public void setIsGLOriented(boolean v) {
flipVertical = v;
}
-
+
private static Rectangle2D getClipBounds2D(Graphics2D g) {
final Shape shape = g.getClip();
return null != shape ? shape.getBounds2D() : null;
@@ -170,7 +170,7 @@ public class AWTTilePainter {
}
return new Rectangle2D.Double(x, y, width, height);
}
-
+
/**
* Caches the {@link Graphics2D} instance for rendering.
*
@@ -201,9 +201,9 @@ public class AWTTilePainter {
final Rectangle2D dClipOrigR = getClipBounds2D(g2d);
final Rectangle2D dClipOrig = clipNegative(dClipOrigR);
final Rectangle2D dImageSizeOrig = new Rectangle2D.Double(0, 0, width, height);
-
+
// Retrieve scaled image-size and clip-bounds
- // Note: Clip bounds lie within image-size!
+ // Note: Clip bounds lie within image-size!
final Rectangle2D dImageSizeScaled, dClipScaled;
{
final AffineTransform scaledATI;
@@ -230,10 +230,10 @@ public class AWTTilePainter {
// GL y-offset is lower-left origin, AWT y-offset upper-left.
scaledYOffset = iClipScaled.y;
renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
-
+
// Scale actual Grahics2D matrix
g2d.scale(scaleMatX, scaleMatY);
-
+
if( verbose ) {
System.err.println("AWT print.0: image "+dImageSizeOrig + " -> " + dImageSizeScaled + " -> " + iImageSizeScaled);
System.err.println("AWT print.0: clip "+dClipOrigR + " -> " + dClipOrig + " -> " + dClipScaled + " -> " + iClipScaled);
@@ -241,12 +241,12 @@ public class AWTTilePainter {
}
}
private int scaledYOffset;
-
+
/** See {@ #setupGraphics2DAndClipBounds(Graphics2D)}. */
- public void resetGraphics2D() {
+ public void resetGraphics2D() {
g2d.setTransform(saveAT);
}
-
+
/**
* Disposes resources and {@link TileRenderer#detachAutoDrawable() detaches}
* the {@link TileRenderer}'s {@link GLAutoDrawable}.
@@ -263,7 +263,7 @@ public class AWTTilePainter {
vFlipImage = null;
}
}
-
+
final GLEventListener preTileGLEL = new GLEventListener() {
@Override
public void init(GLAutoDrawable drawable) {}
@@ -275,7 +275,7 @@ public class AWTTilePainter {
if( null == tBuffer ) {
final int tWidth = renderer.getParam(TileRenderer.TR_TILE_WIDTH);
final int tHeight = renderer.getParam(TileRenderer.TR_TILE_HEIGHT);
- final AWTGLPixelBufferProvider printBufferProvider = new AWTGLPixelBufferProvider( true /* allowRowStride */ );
+ final AWTGLPixelBufferProvider printBufferProvider = new AWTGLPixelBufferProvider( true /* allowRowStride */ );
final GLPixelAttributes pixelAttribs = printBufferProvider.getAttributes(gl, componentCount);
tBuffer = printBufferProvider.allocate(gl, pixelAttribs, tWidth, tHeight, 1, true, 0);
renderer.setTileBuffer(tBuffer);
@@ -300,7 +300,7 @@ public class AWTTilePainter {
@Override
public void dispose(GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(GLAutoDrawable drawable) {
final DimensionImmutable cis = renderer.getClippedImageSize();
final int tWidth = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_WIDTH);
final int tHeight = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_HEIGHT);
@@ -309,26 +309,26 @@ public class AWTTilePainter {
final int imgYOff = flipVertical ? 0 : renderer.getParam(TileRenderer.TR_TILE_HEIGHT) - tHeight; // imgYOff will be cut-off via sub-image
final int pX = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS); // tileX == pX
final int pY = cis.getHeight() - ( tY - tYOff + tHeight ) + scaledYOffset;
-
+
// Copy temporary data into raster of BufferedImage for faster
// blitting Note that we could avoid this copy in the cases
// where !offscreenDrawable.isGLOriented(),
// but that's the software rendering path which is very slow anyway.
final BufferedImage dstImage;
if( DEBUG_TILES ) {
- final String fname = String.format("file_%03d_0_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
- _counter,
+ final String fname = String.format("file_%03d_0_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
+ _counter,
renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
tWidth, tHeight,
pX, tY, tYOff, pX, pY).replace(' ', '_');
System.err.println("XXX file "+fname);
- final File fout = new File(fname);
+ final File fout = new File(fname);
try {
ImageIO.write(tBuffer.image, "png", fout);
} catch (IOException e) {
e.printStackTrace();
}
- }
+ }
if( flipVertical ) {
final BufferedImage srcImage = tBuffer.image;
dstImage = vFlipImage;
@@ -347,20 +347,20 @@ public class AWTTilePainter {
dstImage = tBuffer.image;
}
if( DEBUG_TILES ) {
- final String fname = String.format("file_%03d_1_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
- _counter,
+ final String fname = String.format("file_%03d_1_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
+ _counter,
renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
tWidth, tHeight,
pX, tY, tYOff, pX, pY).replace(' ', '_');
System.err.println("XXX file "+fname);
- final File fout = new File(fname);
+ final File fout = new File(fname);
try {
ImageIO.write(dstImage, "png", fout);
} catch (IOException e) {
e.printStackTrace();
}
_counter++;
- }
+ }
// Draw resulting image in one shot
final BufferedImage outImage = dstImage.getSubimage(0, imgYOff, tWidth, tHeight);
final boolean drawDone = g2d.drawImage(outImage, pX, pY, null); // Null ImageObserver since image data is ready.
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
index e15e538c2..dc286ca59 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -85,7 +85,7 @@ public class AWTUtil {
NativeWindowFactory.getAWTToolkitLock().lock();
}
} catch (Exception e) { j2dOk=false; }
- }
+ }
if(!j2dOk) {
NativeWindowFactory.getAWTToolkitLock().lock();
}
@@ -108,7 +108,7 @@ public class AWTUtil {
NativeWindowFactory.getAWTToolkitLock().unlock();
}
} catch (Exception e) { j2dOk=false; }
- }
+ }
if(!j2dOk) {
NativeWindowFactory.getAWTToolkitLock().unlock();
}
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
index edf9e89f8..7a8ddf0b4 100644
--- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -144,7 +144,7 @@ public class Java2D {
} else {
if (DEBUG) {
System.err.println("Java2D support disabled: by Property "+java2dOGLDisabledByProp+", by OS "+java2dOGLDisabledByOS);
- }
+ }
cfg = null;
cfgName = "nil";
}
@@ -154,8 +154,8 @@ public class Java2D {
System.err.println("Java2D support: default GraphicsConfiguration = " + cfgName);
}
isOGLPipelineActive = cfgName.startsWith("sun.java2d.opengl");
- isOGLPipelineResourceCompatible = isOGLPipelineActive;
-
+ isOGLPipelineResourceCompatible = isOGLPipelineActive;
+
if (isOGLPipelineActive) {
try {
// Try to get methods we need to integrate
@@ -179,19 +179,19 @@ public class Java2D {
Integer.TYPE
});
getOGLViewportMethod.setAccessible(true);
-
+
getOGLScissorBoxMethod = utils.getDeclaredMethod("getOGLScissorBox",
new Class[] {
Graphics.class
});
getOGLScissorBoxMethod.setAccessible(true);
-
+
getOGLSurfaceIdentifierMethod = utils.getDeclaredMethod("getOGLSurfaceIdentifier",
new Class[] {
Graphics.class
});
getOGLSurfaceIdentifierMethod.setAccessible(true);
-
+
// Try to get additional methods required for proper FBO support
fbObjectSupportInitialized = true;
try {
@@ -201,7 +201,7 @@ public class Java2D {
Runnable.class
});
invokeWithOGLSharedContextCurrentMethod.setAccessible(true);
-
+
getOGLSurfaceTypeMethod = utils.getDeclaredMethod("getOGLSurfaceType",
new Class[] {
Graphics.class
@@ -214,7 +214,7 @@ public class Java2D {
System.err.println("Info: Disabling Java2D/JOGL FBO support");
}
}
-
+
// Try to get an additional method for FBO support in recent Mustang builds
try {
getOGLTextureTypeMethod = utils.getDeclaredMethod("getOGLTextureType",
@@ -228,7 +228,7 @@ public class Java2D {
System.err.println("Info: GL_ARB_texture_rectangle FBO support disabled");
}
}
-
+
// Try to set up APIs for enabling the bridge on OS X,
// where it isn't possible to create generalized
// external GLDrawables
@@ -244,7 +244,7 @@ public class Java2D {
if (cglSurfaceData != null) {
// FIXME: for now, assume that FBO support is not enabled on OS X
fbObjectSupportInitialized = false;
-
+
// We need to find these methods in order to make the bridge work on OS X
createOGLContextOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("createOGLContextOnSurface",
new Class[] {
@@ -252,14 +252,14 @@ public class Java2D {
Long.TYPE
});
createOGLContextOnSurfaceMethod.setAccessible(true);
-
+
makeOGLContextCurrentOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("makeOGLContextCurrentOnSurface",
new Class[] {
Graphics.class,
Long.TYPE
});
makeOGLContextCurrentOnSurfaceMethod.setAccessible(true);
-
+
destroyOGLContextMethod = cglSurfaceData.getDeclaredMethod("destroyOGLContext",
new Class[] {
Long.TYPE
@@ -273,7 +273,7 @@ public class Java2D {
System.err.println("Info: Disabling Java2D/JOGL integration");
}
isOGLPipelineActive = false;
- isOGLPipelineResourceCompatible = false;
+ isOGLPipelineResourceCompatible = false;
}
}
} catch (HeadlessException e) {
@@ -297,7 +297,7 @@ public class Java2D {
public static boolean isOGLPipelineActive() {
return isOGLPipelineActive;
}
-
+
public static boolean isOGLPipelineResourceCompatible() {
return isOGLPipelineResourceCompatible;
}
@@ -317,7 +317,7 @@ public class Java2D {
throw (InternalError) new InternalError().initCause(e);
}
}
-
+
/** Makes current the OpenGL context associated with the passed
Graphics object and runs the given Runnable on the Queue
Flushing Thread in one atomic action. */
@@ -556,7 +556,7 @@ public class Java2D {
throw new GLException("Java2D OpenGL pipeline not active");
}
}
-
+
private static void checkCompatible() {
if ( !isOGLPipelineResourceCompatible() ) {
throw new GLException("Java2D OpenGL pipeline not resource compatible");
diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
index 55fb3f9a2..a29d1e6aa 100644
--- a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
+++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
@@ -42,7 +42,7 @@ public class VersionApplet extends Applet {
va.init();
frame.add(va, BorderLayout.CENTER);
frame.validate();
-
+
frame.setVisible(true);
va.start();
}
@@ -68,7 +68,7 @@ public class VersionApplet extends Applet {
if(null != canvas) { return; }
setEnabled(true);
-
+
GLProfile glp = GLProfile.getDefault();
GLCapabilities glcaps = new GLCapabilities(glp);
@@ -87,7 +87,7 @@ public class VersionApplet extends Applet {
/*
s = NativeWindowVersion.getInstance().toString();
System.err.println(s);
- tareaVersion.append(NativeWindowVersion.getInstance().toString());
+ tareaVersion.append(NativeWindowVersion.getInstance().toString());
*/
s = JoglVersion.getInstance().toString();
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 3d59d1d53..1179e2b7f 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.opengl.egl;
import java.util.*;
@@ -60,12 +60,12 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
public final boolean useToolGetProcAdressFirst(String funcName) {
return true;
}
-
+
public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
final List libsGL = new ArrayList();
-
- // Be aware that on DRI systems, eg ATI fglrx, etc,
+
+ // Be aware that on DRI systems, eg ATI fglrx, etc,
// you have to set LIBGL_DRIVERS_PATH env variable.
// Eg on Ubuntu 64bit systems this is:
// export LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
@@ -82,15 +82,15 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
// OSX (guess ES2 on OSX will never happen)
libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
-
+
// last but not least .. the generic one
libsGL.add("GL");
-
+
libsList.add(libsGL);
return libsList;
- }
-
+ }
+
public final List getGlueLibNames() {
return glueLibNames;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index 179cb7504..3de910369 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -115,7 +115,7 @@ public class EGLContext extends GLContextImpl {
if (EGL.eglGetCurrentContext() != contextHandle) {
final long dpy = drawable.getNativeSurface().getDisplayHandle();
if (!EGL.eglMakeCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
- throw new GLException("Error making context " + toHexString(contextHandle) +
+ throw new GLException("Error making context " + toHexString(contextHandle) +
" current on Thread " + getThreadName() +
" with display " + toHexString(dpy) +
", drawableWrite " + toHexString(drawable.getHandle()) +
@@ -128,7 +128,7 @@ public class EGLContext extends GLContextImpl {
@Override
protected void releaseImpl() throws GLException {
if (!EGL.eglMakeCurrent(drawable.getNativeSurface().getDisplayHandle(), EGL.EGL_NO_SURFACE, EGL.EGL_NO_SURFACE, EGL.EGL_NO_CONTEXT)) {
- throw new GLException("Error freeing OpenGL context " + toHexString(contextHandle) +
+ throw new GLException("Error freeing OpenGL context " + toHexString(contextHandle) +
": error code " + toHexString(EGL.eglGetError()));
}
}
@@ -138,7 +138,7 @@ public class EGLContext extends GLContextImpl {
if (!EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), contextHandle)) {
final int eglError = EGL.eglGetError();
if(EGL.EGL_SUCCESS != eglError) { /* oops, Mesa EGL impl. may return false, but has no EGL error */
- throw new GLException("Error destroying OpenGL context " + toHexString(contextHandle) +
+ throw new GLException("Error destroying OpenGL context " + toHexString(contextHandle) +
": error code " + toHexString(eglError));
}
}
@@ -285,11 +285,11 @@ public class EGLContext extends GLContextImpl {
//
// Accessible ..
//
-
+
/* pp */ void mapCurrentAvailableGLVersion(AbstractGraphicsDevice device) {
mapStaticGLVersion(device, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
}
- /* pp */ int getContextOptions() { return ctxOptions; }
+ /* pp */ int getContextOptions() { return ctxOptions; }
/* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps) {
final GLProfile glp = caps.getGLProfile();
final int[] reqMajorCTP = new int[2];
@@ -305,7 +305,7 @@ public class EGLContext extends GLContextImpl {
reqMajorCTP[1] |= GLContext.CTX_IMPL_ACCEL_SOFT;
}
mapStaticGLVersion(device, reqMajorCTP[0], 0, reqMajorCTP[1]);
- }
+ }
/* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, final int major) {
int ctp = GLContext.CTX_PROFILE_ES;
if( major >= 3 ) {
@@ -324,20 +324,20 @@ public class EGLContext extends GLContextImpl {
if(! ( device instanceof EGLGraphicsDevice ) ) {
final EGLGraphicsDevice eglDevice = new EGLGraphicsDevice(device.getHandle(), EGL.EGL_NO_DISPLAY, device.getConnection(), device.getUnitID(), null);
GLContext.mapAvailableGLVersion(eglDevice, reqMajor, reqProfile, major, minor, ctp);
- }
+ }
}
}
protected static String getGLVersion(int major, int minor, int ctp, String gl_version) {
return GLContext.getGLVersion(major, minor, ctp, gl_version);
}
-
+
protected static boolean getAvailableGLVersionsSet(AbstractGraphicsDevice device) {
return GLContext.getAvailableGLVersionsSet(device);
}
protected static void setAvailableGLVersionsSet(AbstractGraphicsDevice device) {
GLContext.setAvailableGLVersionsSet(device);
}
-
+
protected static String toHexString(int hex) {
return GLContext.toHexString(hex);
}
@@ -358,7 +358,7 @@ public class EGLContext extends GLContextImpl {
public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
throw new GLException("Should not call this");
}
-
+
@Override
public final void glFreeMemoryNV(ByteBuffer pointer) {
throw new GLException("Should not call this");
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
index f2efb0479..89f34432d 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -41,8 +41,8 @@ import jogamp.opengl.Debug;
import com.jogamp.common.util.LongObjectHashMap;
import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
-/**
- * This implementation provides recursive calls to
+/**
+ * This implementation provides recursive calls to
* {@link EGL#eglInitialize(long, IntBuffer, IntBuffer)} and {@link EGL#eglTerminate(long)},
* where eglInitialize(..)
is issued only for the 1st call per eglDisplay
* and eglTerminate(..)
is issued only for the last call.
@@ -53,30 +53,30 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
*/
public class EGLDisplayUtil {
protected static final boolean DEBUG = Debug.debug("EGLDisplayUtil");
-
+
private static class DpyCounter {
final long eglDisplay;
final Throwable createdStack;
int refCount;
-
+
private DpyCounter(long eglDisplay) {
this.eglDisplay = eglDisplay;
this.refCount = 0;
this.createdStack = DEBUG ? new Throwable() : null;
}
-
+
public String toString() {
return "EGLDisplay[0x"+Long.toHexString(eglDisplay)+": refCnt "+refCount+"]";
}
}
static final LongObjectHashMap eglDisplayCounter;
-
+
static {
eglDisplayCounter = new LongObjectHashMap();
eglDisplayCounter.setKeyNotFoundValue(null);
}
- /**
+ /**
* @return number of unclosed EGL Displays.
*/
public static int shutdown(boolean verbose) {
@@ -91,7 +91,7 @@ public class EGLDisplayUtil {
}
return eglDisplayCounter.size();
}
-
+
public static void dumpOpenDisplayConnections() {
System.err.println("EGLDisplayUtil: Open EGL Display Connections: "+eglDisplayCounter.size());
int i=0;
@@ -104,7 +104,7 @@ public class EGLDisplayUtil {
}
}
}
-
+
public static long eglGetDisplay(long nativeDisplay_id) {
final long eglDisplay = EGL.eglGetDisplay(nativeDisplay_id);
if(DEBUG) {
@@ -114,16 +114,16 @@ public class EGLDisplayUtil {
}
return eglDisplay;
}
-
+
/**
* @param eglDisplay
* @param major
* @param minor
* @return true if the eglDisplay is valid and it's reference counter becomes one and {@link EGL#eglInitialize(long, IntBuffer, IntBuffer)} was successful, otherwise false
- *
+ *
* @see EGL#eglInitialize(long, IntBuffer, IntBuffer)
*/
- public static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor) {
+ public static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor) {
if( EGL.EGL_NO_DISPLAY == eglDisplay) {
return false;
}
@@ -157,16 +157,16 @@ public class EGLDisplayUtil {
}
return res;
}
-
+
/**
* @param nativeDisplayID
* @param eglDisplay array of size 1 holding return value if successful, otherwise {@link EGL#EGL_NO_DISPLAY}.
- * @param eglErr array of size 1 holding the EGL error value as retrieved by {@link EGL#eglGetError()} if not successful.
+ * @param eglErr array of size 1 holding the EGL error value as retrieved by {@link EGL#eglGetError()} if not successful.
* @param major
* @param minor
- * @return {@link EGL#EGL_SUCCESS} if successful, otherwise {@link EGL#EGL_BAD_DISPLAY} if {@link #eglGetDisplay(long)} failed
+ * @return {@link EGL#EGL_SUCCESS} if successful, otherwise {@link EGL#EGL_BAD_DISPLAY} if {@link #eglGetDisplay(long)} failed
* or {@link EGL#EGL_NOT_INITIALIZED} if {@link #eglInitialize(long, IntBuffer, IntBuffer)} failed.
- *
+ *
* @see #eglGetDisplay(long)
* @see #eglInitialize(long, IntBuffer, IntBuffer)
*/
@@ -184,7 +184,7 @@ public class EGLDisplayUtil {
eglDisplay[0] = _eglDisplay;
return EGL.EGL_SUCCESS;
}
-
+
/**
* @param nativeDisplayID in/out array of size 1, passing the requested nativeVisualID, may return a different revised nativeVisualID handle
* @return the initialized EGL display ID
@@ -209,7 +209,7 @@ public class EGLDisplayUtil {
}
throw new GLException("Failed to created/initialize EGL display incl. fallback default: native "+EGLContext.toHexString(nativeDisplayID[0])+", error "+EGLContext.toHexString(eglRes)+"/"+EGLContext.toHexString(eglError[0]));
}
-
+
/**
* @param eglDisplay the EGL display handle
* @return true if the eglDisplay is valid and it's reference counter becomes zero and {@link EGL#eglTerminate(long)} was successful, otherwise false
@@ -218,7 +218,7 @@ public class EGLDisplayUtil {
if( EGL.EGL_NO_DISPLAY == eglDisplay) {
return false;
}
- final boolean res;
+ final boolean res;
final int refCnt;
final DpyCounter d;
{
@@ -237,7 +237,7 @@ public class EGLDisplayUtil {
} else {
if(0 < refCnt) { // no negative refCount
d.refCount = refCnt;
- }
+ }
res = true;
}
if(DEBUG) {
@@ -246,7 +246,7 @@ public class EGLDisplayUtil {
}
return res;
}
-
+
public static final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback = new EGLGraphicsDevice.EGLDisplayLifecycleCallback() {
public long eglGetAndInitDisplay(long[] nativeDisplayID) {
return eglGetDisplayAndInitialize(nativeDisplayID);
@@ -255,25 +255,25 @@ public class EGLDisplayUtil {
EGLDisplayUtil.eglTerminate(eglDisplayHandle);
}
};
-
+
/**
* @param nativeDisplayID
* @param connection
* @param unitID
- * @return an initialized EGLGraphicsDevice
+ * @return an initialized EGLGraphicsDevice
* @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails
- * @see EGLGraphicsDevice#EGLGraphicsDevice(long, long, String, int, com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLDisplayLifecycleCallback)
+ * @see EGLGraphicsDevice#EGLGraphicsDevice(long, long, String, int, com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLDisplayLifecycleCallback)
*/
public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(long nativeDisplayID, String connection, int unitID) {
final EGLGraphicsDevice eglDisplay = new EGLGraphicsDevice(nativeDisplayID, EGL.EGL_NO_DISPLAY, connection, unitID, eglLifecycleCallback);
eglDisplay.open();
return eglDisplay;
}
-
+
/**
* @param surface
- * @return an initialized EGLGraphicsDevice
- * @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails incl fallback
+ * @return an initialized EGLGraphicsDevice
+ * @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails incl fallback
*/
public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(NativeSurface surface) {
final long nativeDisplayID;
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index 2edf26145..bf269c548 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -59,15 +59,15 @@ public abstract class EGLDrawable extends GLDrawableImpl {
@Override
public abstract GLContext createContext(GLContext shareWith);
- protected abstract long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle);
+ protected abstract long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle);
private final long createEGLSurface() {
final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
- final EGLGraphicsConfiguration eglConfig = (EGLGraphicsConfiguration) eglws.getGraphicsConfiguration();
+ final EGLGraphicsConfiguration eglConfig = (EGLGraphicsConfiguration) eglws.getGraphicsConfiguration();
final NativeSurface upstreamSurface = eglws.getUpstreamSurface();
-
+
long eglSurface = createSurface(eglConfig, eglws.getWidth(), eglws.getHeight(), upstreamSurface.getSurfaceHandle());
-
+
int eglError0;
if (EGL.EGL_NO_SURFACE == eglSurface) {
eglError0 = EGL.eglGetError();
@@ -104,7 +104,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
if(DEBUG) {
System.err.println(getThreadName() + ": createHandle of "+eglws);
- }
+ }
if( eglws.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
if( EGL.EGL_NO_SURFACE != eglws.getSurfaceHandle() ) {
throw new InternalError("Set surface but claimed to be invalid: "+eglws);
@@ -114,12 +114,12 @@ public abstract class EGLDrawable extends GLDrawableImpl {
throw new InternalError("Nil surface but claimed to be valid: "+eglws);
}
}
-
- protected void destroyHandle() {
+
+ protected void destroyHandle() {
final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
if(DEBUG) {
System.err.println(getThreadName() + ": destroyHandle of "+eglws);
- }
+ }
if( EGL.EGL_NO_SURFACE == eglws.getSurfaceHandle() ) {
throw new InternalError("Nil surface but claimed to be valid: "+eglws);
}
@@ -134,7 +134,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
if( 0 == surfaceHandle ) {
return false;
}
- final IntBuffer val = Buffers.newDirectIntBuffer(1);
+ final IntBuffer val = Buffers.newDirectIntBuffer(1);
final boolean eglSurfaceValid = EGL.eglQuerySurface(eglDisplayHandle, surfaceHandle, EGL.EGL_CONFIG_ID, val);
if( !eglSurfaceValid ) {
final int eglErr = EGL.eglGetError();
@@ -144,7 +144,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
}
return eglSurfaceValid;
}
-
+
@Override
protected final void setRealizedImpl() {
if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index 5d99e3eba..a0d896e3a 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -83,14 +83,14 @@ import com.jogamp.opengl.GLRendererQuirks;
public class EGLDrawableFactory extends GLDrawableFactoryImpl {
protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG; // allow package access
-
+
/* package */ static final boolean QUERY_EGL_ES_NATIVE_TK;
-
+
static {
Debug.initSingleton();
QUERY_EGL_ES_NATIVE_TK = Debug.isPropertyDefined("jogl.debug.EGLDrawableFactory.QueryNativeTK", true);
}
-
+
private static GLDynamicLookupHelper eglES1DynamicLookupHelper = null;
private static GLDynamicLookupHelper eglES2DynamicLookupHelper = null;
@@ -109,7 +109,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
dl.isFunctionAvailable("glEnableClientState") &&
dl.isFunctionAvailable("glColorPointer");
}
-
+
public EGLDrawableFactory() {
super();
@@ -189,10 +189,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
} else {
if( isANGLE && ( DEBUG || GLProfile.DEBUG ) ) {
System.err.println("Info: EGLDrawableFactory.init - EGL/ES2 ANGLE enabled");
- }
+ }
sharedMap = new HashMap();
sharedMapCreateAttempt = new HashSet();
-
+
// FIXME: Following triggers eglInitialize(..) which crashed on Windows w/ Chrome/Angle, FF/Angle!
defaultDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
}
@@ -204,8 +204,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
protected final boolean isComplete() {
return null != sharedMap; // null != eglES2DynamicLookupHelper || null != eglES1DynamicLookupHelper;
}
-
-
+
+
@Override
protected final void destroy() {
if(null != sharedMap) {
@@ -247,7 +247,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
EGLGraphicsConfigurationFactory.unregisterFactory();
EGLDisplayUtil.shutdown(DEBUG);
}
-
+
private void dumpMap() {
synchronized(sharedMap) {
System.err.println("EGLDrawableFactory.map "+sharedMap.size());
@@ -265,7 +265,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
private HashMap sharedMap = null;
- private HashSet sharedMapCreateAttempt = null;
+ private HashSet sharedMapCreateAttempt = null;
private EGLGraphicsDevice defaultDevice = null;
private SharedResource defaultSharedResource = null;
private boolean isANGLE = false;
@@ -286,9 +286,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
private final boolean hasPBufferES1;
private final boolean hasPBufferES3ES2;
- SharedResource(EGLGraphicsDevice dev,
- boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,
- boolean wasContextES2Created, boolean wasContextES3Created,
+ SharedResource(EGLGraphicsDevice dev,
+ boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,
+ boolean wasContextES2Created, boolean wasContextES3Created,
boolean hasPBufferES3ES2, GLRendererQuirks rendererQuirksES3ES2, int ctpES3ES2) {
this.device = dev;
// this.contextES1 = ctxES1;
@@ -296,7 +296,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
this.hasPBufferES1= hasPBufferES1;
this.rendererQuirksES1 = rendererQuirksES1;
this.ctpES1 = ctpES1;
-
+
// this.contextES2 = ctxES2;
// this.contextES3 = ctxES3;
this.wasES2ContextCreated = wasContextES2Created;
@@ -314,7 +314,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
// final EGLContext getContextES1() { return contextES1; }
// final EGLContext getContextES2() { return contextES2; }
// final EGLContext getContextES3() { return contextES3; }
-
+
@Override
public AbstractGraphicsScreen getScreen() {
return null;
@@ -329,7 +329,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
public GLRendererQuirks getRendererQuirks() {
- return null != rendererQuirksES3ES2 ? rendererQuirksES3ES2 : rendererQuirksES1 ;
+ return null != rendererQuirksES3ES2 ? rendererQuirksES3ES2 : rendererQuirksES1 ;
}
}
@@ -359,18 +359,18 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return new ArrayList(0);
}
-
- private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int esProfile,
+
+ private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int esProfile,
boolean[] hasPBuffer, GLRendererQuirks[] rendererQuirks, int[] ctp) {
final String profileString;
switch( esProfile ) {
case 3:
- profileString = GLProfile.GLES3; break;
+ profileString = GLProfile.GLES3; break;
case 2:
- profileString = GLProfile.GLES2; break;
- case 1:
+ profileString = GLProfile.GLES2; break;
+ case 1:
profileString = GLProfile.GLES1; break;
- default:
+ default:
throw new GLException("Invalid ES profile number "+esProfile);
}
if ( !GLProfile.isAvailable(adevice, profileString) ) {
@@ -394,23 +394,23 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
ProxySurface upstreamSurface = null; // X11, GLX, ..
boolean success = false;
boolean deviceFromUpstreamSurface = false;
- try {
+ try {
final GLCapabilities reqCapsAny = new GLCapabilities(glp);
reqCapsAny.setRedBits(5); reqCapsAny.setGreenBits(5); reqCapsAny.setBlueBits(5); reqCapsAny.setAlphaBits(0);
reqCapsAny.setDoubleBuffered(false);
-
+
if( mapsADeviceToDefaultDevice ) {
// In this branch, any non EGL device is mapped to EGL default shared resources (default behavior).
- // Only one default shared resource instance is ever be created.
+ // Only one default shared resource instance is ever be created.
final GLCapabilitiesImmutable reqCapsPBuffer = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(reqCapsAny);
final List availablePBufferCapsL = getAvailableEGLConfigs(defaultDevice, reqCapsPBuffer);
hasPBuffer[0] = availablePBufferCapsL.size() > 0;
-
+
// 1st case: adevice is not the EGL default device, map default shared resources
if( adevice != defaultDevice ) {
if(null == defaultSharedResource) {
return false;
- }
+ }
switch(esProfile) {
case 3:
if( !defaultSharedResource.wasES3ContextCreated ) {
@@ -419,14 +419,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
rendererQuirks[0] = defaultSharedResource.rendererQuirksES3ES2;
ctp[0] = defaultSharedResource.ctpES3ES2;
break;
- case 2:
+ case 2:
if( !defaultSharedResource.wasES2ContextCreated ) {
return false;
}
rendererQuirks[0] = defaultSharedResource.rendererQuirksES3ES2;
ctp[0] = defaultSharedResource.ctpES3ES2;
break;
- case 1:
+ case 1:
if( !defaultSharedResource.wasES1ContextCreated ) {
return false;
}
@@ -437,11 +437,11 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
EGLContext.mapStaticGLVersion(adevice, esProfile, 0, ctp[0]);
return true;
}
-
+
// attempt to created the default shared resources ..
-
+
eglDevice = defaultDevice; // reuse
-
+
if( hasPBuffer[0] ) {
// 2nd case create defaultDevice shared resource using pbuffer surface
surface = createDummySurfaceImpl(eglDevice, false, reqCapsPBuffer, reqCapsPBuffer, null, 64, 64); // egl pbuffer offscreen
@@ -459,15 +459,15 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if(DEBUG) {
System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig() no pbuffer config available, detected !pbuffer config: "+success);
EGLGraphicsConfigurationFactory.printCaps("!PBufferCaps", capsAnyL, System.err);
- }
- }
+ }
+ }
} else {
- // 4th case always creates a true mapping of given device to EGL
+ // 4th case always creates a true mapping of given device to EGL
surface = desktopFactory.createDummySurface(adevice, reqCapsAny, null, 64, 64); // X11, WGL, .. dummy window
upstreamSurface = ( surface instanceof ProxySurface ) ? (ProxySurface)surface : null ;
if(null != upstreamSurface) {
upstreamSurface.createNotify();
- }
+ }
eglDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(surface);
deviceFromUpstreamSurface = true;
hasPBuffer[0] = true;
@@ -482,7 +482,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
context.makeCurrent(); // could cause exception
if(context.isCurrent()) {
final String glVersion = context.getGL().glGetString(GL.GL_VERSION);
- if(null != glVersion) {
+ if(null != glVersion) {
context.mapCurrentAvailableGLVersion(eglDevice);
if(eglDevice != adevice) {
context.mapCurrentAvailableGLVersion(adevice);
@@ -493,7 +493,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
} else {
// Oops .. something is wrong
if(DEBUG) {
- System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+eglDevice+", "+context.getGLVersion()+" - VERSION is null, dropping availability!");
+ System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+eglDevice+", "+context.getGLVersion()+" - VERSION is null, dropping availability!");
}
}
}
@@ -510,7 +510,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
} catch (Throwable t) {
if(DEBUG) {
- System.err.println("Catched Exception on thread "+getThreadName());
+ System.err.println("Catched Exception on thread "+getThreadName());
t.printStackTrace();
}
success = false;
@@ -518,7 +518,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if(eglDevice == defaultDevice) {
if(null != upstreamSurface) {
upstreamSurface.destroyNotify();
- }
+ }
} else if( deviceFromUpstreamSurface ) {
if(null != eglDevice) {
eglDevice.close();
@@ -529,7 +529,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
} else {
if(null != upstreamSurface) {
upstreamSurface.destroyNotify();
- }
+ }
if(null != eglDevice) {
eglDevice.close();
}
@@ -553,9 +553,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return false;
}
- }
+ }
}
-
+
@Override
protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
if(null == sharedMap) { // null == eglES1DynamicLookupHelper && null == eglES2DynamicLookupHelper
@@ -571,27 +571,27 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
dumpMap();
throw new InternalError("defaultSharedResource already exist: "+defaultSharedResource);
}
- defaultSharedResource = createEGLSharedResourceImpl(defaultDevice);
+ defaultSharedResource = createEGLSharedResourceImpl(defaultDevice);
}
-
+
final String key = adevice.getUniqueID();
if( defaultDevice.getUniqueID().equals(key) ) {
return defaultSharedResource;
} else {
- if( null == defaultSharedResource) { // defaultDevice must be initialized before host-device
+ if( null == defaultSharedResource) { // defaultDevice must be initialized before host-device
dumpMap();
- throw new InternalError("defaultSharedResource does not exist");
+ throw new InternalError("defaultSharedResource does not exist");
}
final SharedResource[] existing = new SharedResource[] { null };
if ( !needsToCreateSharedResource(key, existing) ) {
return existing[0];
- }
+ }
return createEGLSharedResourceImpl(adevice);
}
}
-
+
private SharedResource createEGLSharedResourceImpl(AbstractGraphicsDevice adevice) {
- final boolean madeCurrentES1;
+ final boolean madeCurrentES1;
final boolean madeCurrentES2;
final boolean madeCurrentES3;
boolean[] hasPBufferES1 = new boolean[] { false };
@@ -602,12 +602,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
GLRendererQuirks[] rendererQuirksES3ES2 = new GLRendererQuirks[] { null };
int[] ctpES1 = new int[] { -1 };
int[] ctpES3ES2 = new int[] { -1 };
-
-
+
+
if (DEBUG) {
System.err.println("EGLDrawableFactory.createShared(): device "+adevice);
}
-
+
if( null != eglES1DynamicLookupHelper ) {
madeCurrentES1 = mapAvailableEGLESConfig(adevice, 1, hasPBufferES1, rendererQuirksES1, ctpES1);
} else {
@@ -625,10 +625,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
madeCurrentES2 = false;
madeCurrentES3 = false;
}
-
+
if( !EGLContext.getAvailableGLVersionsSet(adevice) ) {
// Even though we override the non EGL native mapping intentionally,
- // avoid exception due to double 'set' - carefull exception of the rule.
+ // avoid exception due to double 'set' - carefull exception of the rule.
EGLContext.setAvailableGLVersionsSet(adevice);
}
if( hasX11 ) {
@@ -637,7 +637,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
final SharedResource sr = new SharedResource(defaultDevice, madeCurrentES1, hasPBufferES1[0], rendererQuirksES1[0], ctpES1[0],
madeCurrentES2, madeCurrentES3, hasPBufferES3ES2[0], rendererQuirksES3ES2[0], ctpES3ES2[0]);
-
+
synchronized(sharedMap) {
sharedMap.put(adevice.getUniqueID(), sr);
}
@@ -650,7 +650,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return sr;
}
-
+
private void handleDontCloseX11DisplayQuirk(GLRendererQuirks quirks) {
if( null != quirks && quirks.exist( GLRendererQuirks.DontCloseX11Display ) ) {
jogamp.nativewindow.x11.X11Util.markAllDisplaysUnclosable();
@@ -692,7 +692,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return new EGLOnscreenDrawable(this, EGLWrappedSurface.get(target));
}
-
+
@Override
protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
if (target == null) {
@@ -715,8 +715,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
+ protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
+ GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
final boolean ownDevice;
final EGLGraphicsDevice device;
@@ -732,21 +732,21 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
final DefaultGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
final EGLGraphicsConfiguration config = EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen, VisualIDHolder.VID_UNDEFINED, false);
if(null == config) {
- throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
- }
+ throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
+ }
return new WrappedSurface(config, 0, upstreamHook, ownDevice);
}
-
+
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
+ public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
- chosenCaps = GLGraphicsConfigurationUtil.fixOffscreenBitOnly(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above
+ chosenCaps = GLGraphicsConfigurationUtil.fixOffscreenBitOnly(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above
return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new EGLDummyUpstreamSurfaceHook(width, height));
}
-
+
/**
- * @param ms {@link MutableSurface} which dimensions and config are being used to create the pbuffer surface.
- * It will also hold the resulting pbuffer surface handle.
+ * @param ms {@link MutableSurface} which dimensions and config are being used to create the pbuffer surface.
+ * It will also hold the resulting pbuffer surface handle.
* @param useTexture
* @return the passed {@link MutableSurface} which now has the EGL pbuffer surface set as it's handle
*/
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
index 162e7166a..eb6578ec5 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
@@ -9,17 +9,17 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
/**
- * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
- * not the actual dummy surface width.
+ * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+ * not the actual dummy surface width.
* The latter is platform specific and small
- * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
+ * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
* not the actual dummy surface height,
* The latter is platform specific and small
*/
public EGLDummyUpstreamSurfaceHook(int width, int height) {
super(width, height);
}
-
+
@Override
public final void create(ProxySurface s) {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
@@ -31,14 +31,14 @@ public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
}
if( EGL.EGL_NO_SURFACE == s.getSurfaceHandle() ) {
s.setSurfaceHandle( EGLDrawableFactory.createPBufferSurfaceImpl((EGLGraphicsConfiguration)s.getGraphicsConfiguration(), 64, 64, false) );
- s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
+ s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
}
s.addUpstreamOptionBits(ProxySurface.OPT_UPSTREAM_WINDOW_INVISIBLE);
} finally {
eglDevice.unlock();
}
}
-
+
@Override
public final void destroy(ProxySurface s) {
if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
index 778f0cb38..ac880ebc0 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.opengl.egl;
import com.jogamp.common.os.AndroidVersion;
@@ -52,7 +52,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
super();
}
- /**
+ /**
* Returns true
on Android
,
* and false
otherwise.
*/
@@ -65,7 +65,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
// default behavior for other platforms
return false;
}
-
+
@Override
public final List getToolGetProcAddressFuncNameList() {
List res = new ArrayList();
@@ -87,26 +87,26 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
return true;
}
}
-
+
protected final List getEGLLibNamesList() {
List eglLibNames = new ArrayList();
-
- // this is the default EGL lib name, according to the spec
+
+ // this is the default EGL lib name, according to the spec
eglLibNames.add("libEGL.so.1");
-
+
// try these as well, if spec fails
eglLibNames.add("libEGL.so");
eglLibNames.add("EGL");
-
- // for windows distributions using the 'unlike' lib prefix,
+
+ // for windows distributions using the 'unlike' lib prefix,
// where our tool does not add it.
eglLibNames.add("libEGL");
-
+
return eglLibNames;
}
@Override
public final List getGlueLibNames() {
return glueLibNames;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
index dd3d6faea..9ffcea864 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.opengl.egl;
import java.util.*;
@@ -39,29 +39,29 @@ public final class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
final List> libsList = new ArrayList>();
{
final List libsGL = new ArrayList();
-
- // this is the default lib name, according to the spec
+
+ // this is the default lib name, according to the spec
libsGL.add("libGLESv1_CM.so.2");
-
+
// try these as well, if spec fails
libsGL.add("libGLESv1_CM.so");
- libsGL.add("GLESv1_CM");
+ libsGL.add("GLESv1_CM");
// alternative names
libsGL.add("GLES_CM");
libsGL.add("GLES_CL");
-
- // for windows distributions using the 'unlike' lib prefix,
+
+ // for windows distributions using the 'unlike' lib prefix,
// where our tool does not add it.
libsGL.add("libGLESv1_CM");
libsGL.add("libGLES_CM");
libsGL.add("libGLES_CL");
-
+
libsList.add(libsGL);
}
libsList.add(getEGLLibNamesList());
-
+
return libsList;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
index 0d20fd4e8..de1f0a42e 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,17 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.opengl.egl;
import java.util.*;
-/**
+/**
*
* Covering ES3 and ES2.
*
@@ -44,12 +44,12 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
final List> libsList = new ArrayList>();
{
final List libsGL = new ArrayList();
-
- // ES3: This is the default lib name, according to the spec
+
+ // ES3: This is the default lib name, according to the spec
libsGL.add("libGLESv3.so.3");
-
+
// ES3: Try these as well, if spec fails
- libsGL.add("libGLESv3.so");
+ libsGL.add("libGLESv3.so");
libsGL.add("GLESv3");
// ES3: Alternative names
@@ -59,12 +59,12 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
// where our tool does not add it.
libsGL.add("libGLESv3");
libsGL.add("libGLES30");
-
- // ES2: This is the default lib name, according to the spec
+
+ // ES2: This is the default lib name, according to the spec
libsGL.add("libGLESv2.so.2");
-
+
// ES2: Try these as well, if spec fails
- libsGL.add("libGLESv2.so");
+ libsGL.add("libGLESv2.so");
libsGL.add("GLESv2");
// ES2: Alternative names
@@ -75,14 +75,14 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
// where our tool does not add it.
libsGL.add("libGLESv2");
libsGL.add("libGLESv2_CM");
- libsGL.add("libGLES20");
-
+ libsGL.add("libGLES20");
+
libsList.add(libsGL);
}
libsList.add(getEGLLibNamesList());
-
+
return libsList;
- }
-
+ }
+
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index b1ffe608e..f3592c150 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -57,7 +57,7 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
-
+
public final long getNativeConfig() {
return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfig();
}
@@ -66,7 +66,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfigID();
}
- EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen,
+ EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen,
EGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
super(absScreen, capsChosen, capsRequested);
this.chooser = chooser;
@@ -77,7 +77,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
* @param absScreen
* @param eglConfigID {@link EGL#EGL_CONFIG_ID} for which the config is being created for.
* @return
- * @throws GLException if invalid EGL display.
+ * @throws GLException if invalid EGL display.
*/
public static EGLGraphicsConfiguration create(GLCapabilitiesImmutable capsRequested, AbstractGraphicsScreen absScreen, int eglConfigID) {
final AbstractGraphicsDevice absDevice = absScreen.getDevice();
@@ -101,9 +101,9 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
public Object clone() {
return super.clone();
}
-
+
void updateGraphicsConfiguration() {
- CapabilitiesImmutable capsChosen = getChosenCapabilities();
+ CapabilitiesImmutable capsChosen = getChosenCapabilities();
EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
GraphicsConfigurationFactory.getFactory(getScreen().getDevice(), capsChosen).chooseGraphicsConfiguration(
capsChosen, getRequestedCapabilities(), chooser, getScreen(), VisualIDHolder.VID_UNDEFINED);
@@ -140,7 +140,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return false;
}
final IntBuffer val = Buffers.newDirectIntBuffer(1);
-
+
// get the configID
if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val)) {
final int eglErr = EGL.eglGetError();
@@ -169,7 +169,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
}
if ( 0 != ( _stype & EGL.EGL_PBUFFER_BIT ) ) {
val |= GLGraphicsConfigurationUtil.PBUFFER_BIT |
- GLGraphicsConfigurationUtil.FBO_BIT;
+ GLGraphicsConfigurationUtil.FBO_BIT;
}
return val;
}
@@ -189,7 +189,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
final int cfgID;
final int rType;
final int visualID;
-
+
// get the configID
if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val)) {
if(DEBUG) {
@@ -199,7 +199,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return null;
}
cfgID = val.get(0);
-
+
if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_RENDERABLE_TYPE, val)) {
if(DEBUG) {
System.err.println("EGL couldn't retrieve EGL_RENDERABLE_TYPE for config "+toHexString(config)+", error "+toHexString(EGL.eglGetError()));
@@ -213,8 +213,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
} else {
visualID = VisualIDHolder.VID_UNDEFINED;
}
-
- EGLGLCapabilities caps = null;
+
+ EGLGLCapabilities caps = null;
try {
if(null == glp) {
glp = EGLGLCapabilities.getCompatible(device, rType);
@@ -232,8 +232,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
System.err.println("config "+toHexString(config)+": "+gle);
}
return null;
- }
-
+ }
+
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_CAVEAT, val)) {
if( EGL.EGL_SLOW_CONFIG == val.get(0) ) {
caps.setHardwareAccelerated(false);
@@ -244,11 +244,11 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
caps.setNumSamples(val.get(0));
}
if(!caps.getSampleBuffers()) {
- // try NV_coverage_sample extension
+ // try NV_coverage_sample extension
if(EGL.eglGetConfigAttrib(display, config, EGLExt.EGL_COVERAGE_BUFFERS_NV, val)) {
if(val.get(0)>0 &&
EGL.eglGetConfigAttrib(display, config, EGLExt.EGL_COVERAGE_SAMPLES_NV, val)) {
- caps.setSampleExtension(GLGraphicsConfigurationUtil.NV_coverage_sample);
+ caps.setSampleExtension(GLGraphicsConfigurationUtil.NV_coverage_sample);
caps.setSampleBuffers(true);
caps.setNumSamples(val.get(0));
}
@@ -269,7 +269,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_BLUE_VALUE, val)) {
caps.setTransparentBlueValue(val.get(0)==EGL.EGL_DONT_CARE?-1:val.get(0));
}
- /** Not defined in EGL
+ /** Not defined in EGL
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_ALPHA_VALUE, val)) {
caps.setTransparentAlphaValue(val.get(0)==EGL.EGL_DONT_CARE?-1:val.get(0));
} */
@@ -294,16 +294,16 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
caps.setDepthBits(val.get(0));
}
- // Since the passed GLProfile may be null,
+ // Since the passed GLProfile may be null,
// we use EGL_RENDERABLE_TYPE derived profile as created in the EGLGLCapabilities constructor.
- final int availableTypeBits = EGLConfigDrawableTypeBits(device, config);
+ final int availableTypeBits = EGLConfigDrawableTypeBits(device, config);
final int drawableTypeBits = winattrmask & availableTypeBits;
if( 0 == drawableTypeBits ) {
return null;
}
-
- return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
+
+ return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
}
public static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
@@ -313,7 +313,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
attrs.put(idx++, EGL.EGL_SURFACE_TYPE);
final int surfaceType;
if( caps.isOnscreen() ) {
- surfaceType = EGL.EGL_WINDOW_BIT;
+ surfaceType = EGL.EGL_WINDOW_BIT;
} else if( caps.isFBO() ) {
surfaceType = EGL.EGL_PBUFFER_BIT; // native replacement!
} else if( caps.isPBuffer() ) {
@@ -338,7 +338,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
attrs.put(idx++, EGL.EGL_ALPHA_SIZE);
attrs.put(idx++, caps.getAlphaBits());
}
-
+
if(caps.getStencilBits()>0) {
attrs.put(idx++, EGL.EGL_STENCIL_SIZE);
attrs.put(idx++, caps.getStencilBits());
@@ -382,7 +382,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
attrs.put(idx++, caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():EGL.EGL_DONT_CARE; */
}
- // 28
+ // 28
attrs.put(idx++, EGL.EGL_RENDERABLE_TYPE);
if(caps.getGLProfile().usesNativeGLES1()) {
attrs.put(idx++, EGL.EGL_OPENGL_ES_BIT);
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
index b44e08500..5764a6178 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -75,10 +75,10 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
static GraphicsConfigurationFactory nativeGraphicsConfigurationFactory = null;
static GraphicsConfigurationFactory kdeglGraphicsConfigurationFactory = null;
static GraphicsConfigurationFactory fallbackGraphicsConfigurationFactory = null;
-
+
static void registerFactory() {
GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory();
-
+
// become the pre-selector for X11/.. to match the native visual id w/ EGL, if native ES is selected
final String nwType = NativeWindowFactory.getNativeWindowType(false);
if(NativeWindowFactory.TYPE_X11 == nwType) {
@@ -86,32 +86,32 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
if(null != nativeGraphicsConfigurationFactory) {
fallbackGraphicsConfigurationFactory = nativeGraphicsConfigurationFactory;
} else {
- fallbackGraphicsConfigurationFactory = GraphicsConfigurationFactory.getFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class);
+ fallbackGraphicsConfigurationFactory = GraphicsConfigurationFactory.getFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class);
}
} /* else if(NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false)) {
nativeGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, eglFactory);
- } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
+ } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
} */
-
+
// become the selector for KD/EGL ..
- kdeglGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, eglFactory);
+ kdeglGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, eglFactory);
}
-
+
static void unregisterFactory() {
final String nwType = NativeWindowFactory.getNativeWindowType(false);
if(NativeWindowFactory.TYPE_X11 == nwType) {
- GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, GLCapabilitiesImmutable.class, nativeGraphicsConfigurationFactory);
+ GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, GLCapabilitiesImmutable.class, nativeGraphicsConfigurationFactory);
} /* else if(NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false)) {
GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, nativeGraphicsConfigurationFactory);
- } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
+ } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
} */
nativeGraphicsConfigurationFactory = null;
fallbackGraphicsConfigurationFactory = null;
-
+
GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, kdeglGraphicsConfigurationFactory);
kdeglGraphicsConfigurationFactory = null;
}
-
+
private EGLGraphicsConfigurationFactory() {
}
@@ -139,21 +139,21 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
AbstractGraphicsDevice absDevice = absScreen.getDevice();
if(null==absDevice) {
throw new GLException("Null AbstractGraphicsDevice");
- }
-
+ }
+
AbstractGraphicsConfiguration cfg = null;
-
+
if( absDevice instanceof EGLGraphicsDevice ) {
cfg = chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable) capsChosen,
(GLCapabilitiesImmutable) capsRequested,
(GLCapabilitiesChooser) chooser,
- absScreen, nativeVisualID, false);
+ absScreen, nativeVisualID, false);
} else {
- // handle non native cases (X11, ..)
+ // handle non native cases (X11, ..)
if(null == fallbackGraphicsConfigurationFactory) {
throw new InternalError("Native fallback GraphicsConfigurationFactory is null, but call issued for device: "+absDevice+" of type "+absDevice.getClass().getSimpleName());
}
-
+
if(glCapsChosen.getGLProfile().usesNativeGLES()) {
if(DEBUG) {
System.err.println("EGLGraphicsConfigurationFactory.choose..: Handle native device "+absDevice.getClass().getSimpleName());
@@ -175,7 +175,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
System.err.println("EGLGraphicsConfigurationFactory.choose..: Delegate to "+fallbackGraphicsConfigurationFactory.getClass().getSimpleName());
}
cfg = fallbackGraphicsConfigurationFactory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, absScreen, nativeVisualID);
- }
+ }
}
return cfg;
}
@@ -219,7 +219,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
public static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
GLCapabilitiesImmutable capsReq,
GLCapabilitiesChooser chooser,
- AbstractGraphicsScreen absScreen, int nativeVisualID,
+ AbstractGraphicsScreen absScreen, int nativeVisualID,
boolean forceTransparentFlag) {
if (capsChosen == null) {
capsChosen = new GLCapabilities(null);
@@ -232,7 +232,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
if(null==absDevice) {
throw new GLException("Null AbstractGraphicsDevice");
}
-
+
final EGLGraphicsDevice eglDevice;
final boolean ownEGLDisplay;
if( absDevice instanceof EGLGraphicsDevice ) {
@@ -253,7 +253,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
if(DEBUG) {
System.err.println("eglChooseConfig failed with given capabilities "+capsChosen);
}
-
+
// Last try .. add a fixed embedded profile [ATI, Nokia, Intel, ..]
//
// rgb888 - d16, s4
@@ -268,7 +268,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
fixedCaps.setOnscreen(false);
fixedCaps.setPBuffer(capsChosen.isPBuffer());
fixedCaps.setFBO(capsChosen.isFBO());
- }
+ }
if(DEBUG) {
System.err.println("trying fixed caps (1): "+fixedCaps);
}
@@ -286,7 +286,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
fixedCaps.setOnscreen(false);
fixedCaps.setPBuffer(capsChosen.isPBuffer());
fixedCaps.setFBO(capsChosen.isFBO());
- }
+ }
if(DEBUG) {
System.err.println("trying fixed caps (2): "+fixedCaps);
}
@@ -306,7 +306,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
fixedCaps.setOnscreen(false);
fixedCaps.setPBuffer(capsChosen.isPBuffer());
fixedCaps.setFBO(capsChosen.isFBO());
- }
+ }
if(DEBUG) {
System.err.println("trying fixed caps (3): "+fixedCaps);
}
@@ -322,8 +322,8 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
return res;
}
-
- static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device,
+
+ static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device,
GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
GLCapabilitiesChooser chooser,
AbstractGraphicsScreen absScreen,
@@ -354,7 +354,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
final IntBuffer attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen);
PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
- // 1st choice: get GLCapabilities based on users GLCapabilities
+ // 1st choice: get GLCapabilities based on users GLCapabilities
// setting recommendedIndex as preferred choice
// skipped if nativeVisualID is given
if( VisualIDHolder.VID_UNDEFINED != nativeVisualID || !EGL.eglChooseConfig(eglDisplay, attrs, configs, configs.capacity(), numConfigs) ) {
@@ -387,7 +387,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
throw new GLException("EGLGraphicsConfiguration.eglChooseConfig: #2 Get all configs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
}
if (numConfigs.get(0) > 0) {
- availableCaps = eglConfigs2GLCaps(device, glp, configs, numConfigs.get(0), winattrmask, forceTransparentFlag);
+ availableCaps = eglConfigs2GLCaps(device, glp, configs, numConfigs.get(0), winattrmask, forceTransparentFlag);
}
}
@@ -400,7 +400,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
}
return null;
}
-
+
if(DEBUG) {
System.err.println("EGLGraphicsConfiguration.eglChooseConfig: got configs: "+availableCaps.size());
for(int i=0; i this "+surface.getClass().getSimpleName()+" ): ";
- System.err.println(dbgPrefix+this);
+ System.err.println(dbgPrefix+this);
} else {
dbgPrefix = null;
}
-
+
if(upstreamSurface instanceof ProxySurface) {
- // propagate createNotify(..) so upstreamSurface will be created
+ // propagate createNotify(..) so upstreamSurface will be created
((ProxySurface)upstreamSurface).createNotify();
}
-
+
// lock upstreamSurface, so it can be used in case EGLDisplay is derived from it!
if(NativeSurface.LOCK_SURFACE_NOT_READY >= upstreamSurface.lockSurface()) {
throw new GLException("Could not lock: "+upstreamSurface);
@@ -73,16 +73,16 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
evalUpstreamSurface(dbgPrefix, surface);
} finally {
upstreamSurface.unlockSurface();
- }
+ }
}
-
+
private final void evalUpstreamSurface(String dbgPrefix, ProxySurface surface) {
//
// evaluate nature of upstreamSurface, may create EGL instances if required
//
-
+
boolean isEGLSurfaceValid = true; // assume yes
-
+
final EGLGraphicsDevice eglDevice;
final AbstractGraphicsConfiguration aConfig;
{
@@ -92,14 +92,14 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
System.err.println(dbgPrefix+"SurfaceDevice: "+surfaceDevice.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(surfaceDevice.hashCode())+", "+surfaceDevice);
System.err.println(dbgPrefix+"SurfaceConfig: "+surfaceConfig.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(surfaceConfig.hashCode())+", "+surfaceConfig);
}
-
- final AbstractGraphicsConfiguration upstreamConfig = upstreamSurface.getGraphicsConfiguration();
+
+ final AbstractGraphicsConfiguration upstreamConfig = upstreamSurface.getGraphicsConfiguration();
final AbstractGraphicsDevice upstreamDevice = upstreamConfig.getScreen().getDevice();
if(DEBUG) {
System.err.println(dbgPrefix+"UpstreamDevice: "+upstreamDevice.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(upstreamDevice.hashCode())+", "+upstreamDevice);
System.err.println(dbgPrefix+"UpstreamConfig: "+upstreamConfig.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(upstreamConfig.hashCode())+", "+upstreamConfig);
}
-
+
if( surfaceDevice instanceof EGLGraphicsDevice ) {
eglDevice = (EGLGraphicsDevice) surfaceDevice;
aConfig = surfaceConfig;
@@ -129,13 +129,13 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
surface.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
}
}
-
+
final GLCapabilitiesImmutable capsRequested = (GLCapabilitiesImmutable) aConfig.getRequestedCapabilities();
final EGLGraphicsConfiguration eglConfig;
if( aConfig instanceof EGLGraphicsConfiguration ) {
// Config is already in EGL type - reuse ..
final EGLGLCapabilities capsChosen = (EGLGLCapabilities) aConfig.getChosenCapabilities();
- if( !isEGLSurfaceValid || !EGLGraphicsConfiguration.isEGLConfigValid(eglDevice.getHandle(), capsChosen.getEGLConfig()) ) {
+ if( !isEGLSurfaceValid || !EGLGraphicsConfiguration.isEGLConfigValid(eglDevice.getHandle(), capsChosen.getEGLConfig()) ) {
// 'refresh' the native EGLConfig handle
capsChosen.setEGLConfig(EGLGraphicsConfiguration.EGLConfigId2EGLConfig(eglDevice.getHandle(), capsChosen.getEGLConfigID()));
if( 0 == capsChosen.getEGLConfig() ) {
@@ -166,7 +166,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
isEGLSurfaceValid = false;
}
surface.setGraphicsConfiguration(eglConfig);
-
+
if(isEGLSurfaceValid) {
isEGLSurfaceValid = EGLDrawable.isValidEGLSurface(eglDevice.getHandle(), upstreamSurface.getSurfaceHandle());
}
@@ -182,15 +182,15 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
if(DEBUG) {
System.err.println(dbgPrefix+"Fin: EGL surface n/a - TBD: "+upstreamSurface);
}
- }
+ }
}
@Override
public final void destroy(ProxySurface surface) {
if(EGLDrawableFactory.DEBUG) {
- System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);
+ System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);
}
- surface.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
+ surface.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
if(upstreamSurface instanceof ProxySurface) {
((ProxySurface)upstreamSurface).destroyNotify();
}
@@ -205,7 +205,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
public final int getHeight(ProxySurface s) {
return upstreamSurface.getHeight();
}
-
+
@Override
public String toString() {
final String us_s = null != upstreamSurface ? ( upstreamSurface.getClass().getName() + ": 0x" + Long.toHexString(upstreamSurface.getSurfaceHandle()) ) : "nil";
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
index f816151c7..e6d43d957 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
@@ -19,16 +19,16 @@ public class EGLWrappedSurface extends WrappedSurface {
}
return new EGLWrappedSurface(surface);
}
-
+
public EGLWrappedSurface(NativeSurface surface) {
super(surface.getGraphicsConfiguration(), EGL.EGL_NO_SURFACE, new EGLUpstreamSurfaceHook(surface), false /* tbd in UpstreamSurfaceHook */);
if(EGLDrawableFactory.DEBUG) {
- System.err.println("EGLWrappedSurface.ctor(): "+this);
+ System.err.println("EGLWrappedSurface.ctor(): "+this);
}
}
@Override
- public final NativeSurface getUpstreamSurface() {
- return ((EGLUpstreamSurfaceHook)super.getUpstreamSurfaceHook()).getUpstreamSurface();
- }
+ public final NativeSurface getUpstreamSurface() {
+ return ((EGLUpstreamSurfaceHook)super.getUpstreamSurfaceHook()).getUpstreamSurface();
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
index 9165dbc4b..a4aa1c7c5 100644
--- a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
+++ b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
@@ -6,9 +6,9 @@
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
** except that Section 2.2 and 11 are omitted. Any differences between
** the Alternative License and the SGI License are offered solely by Sun
** and not by SGI.
-**
+**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,56 +45,56 @@
** $Header$
*/
-/*
+/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
+ * modification, are permitted provided that the following conditions are
* met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * * Neither the name of 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -107,7 +107,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -125,7 +125,7 @@ import com.jogamp.common.nio.Buffers;
*
*
* Created 11-jan-2004
- *
+ *
* @author Erik Duijs
* @author Kenneth Russell
*/
@@ -155,7 +155,7 @@ public class ProjectDouble {
private final double[] forward = new double[3];
private final double[] side = new double[3];
private final double[] up = new double[3];
-
+
// Buffer-based implementation
private DoubleBuffer locbuf;
private final DoubleBuffer matrixBuf;
@@ -227,7 +227,7 @@ public class ProjectDouble {
/**
* Method __gluMultMatrixVecd
- *
+ *
* @param matrix
* @param in
* @param out
@@ -244,7 +244,7 @@ public class ProjectDouble {
/**
* Method __gluMultMatrixVecd
- *
+ *
* @param matrix
* @param in
* @param out
@@ -265,7 +265,7 @@ public class ProjectDouble {
/**
* @param src
* @param inverse
- *
+ *
* @return
*/
private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
@@ -335,7 +335,7 @@ public class ProjectDouble {
/**
* @param src
* @param inverse
- *
+ *
* @return
*/
private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
@@ -525,7 +525,7 @@ public class ProjectDouble {
/**
* Method gluOrtho2D.
- *
+ *
* @param left
* @param right
* @param bottom
@@ -537,7 +537,7 @@ public class ProjectDouble {
/**
* Method gluPerspective.
- *
+ *
* @param fovy
* @param aspect
* @param zNear
@@ -570,7 +570,7 @@ public class ProjectDouble {
/**
* Method gluLookAt
- *
+ *
* @param eyex
* @param eyey
* @param eyez
@@ -631,7 +631,7 @@ public class ProjectDouble {
/**
* Method gluProject
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -639,7 +639,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(double objx,
@@ -685,7 +685,7 @@ public class ProjectDouble {
/**
* Method gluProject
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -693,7 +693,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(double objx,
@@ -738,7 +738,7 @@ public class ProjectDouble {
/**
* Method gluUnproject
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -746,7 +746,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(double winx,
@@ -799,7 +799,7 @@ public class ProjectDouble {
/**
* Method gluUnproject
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -807,7 +807,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(double winx,
@@ -858,7 +858,7 @@ public class ProjectDouble {
/**
* Method gluUnproject4
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -869,7 +869,7 @@ public class ProjectDouble {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(double winx,
@@ -923,7 +923,7 @@ public class ProjectDouble {
/**
* Method gluUnproject4
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -934,7 +934,7 @@ public class ProjectDouble {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(double winx,
@@ -987,7 +987,7 @@ public class ProjectDouble {
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
@@ -1014,7 +1014,7 @@ public class ProjectDouble {
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index 7cd7da53e..b4383c2e6 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -6,15 +6,15 @@
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
+**
** NOTE: The Original Code (as defined below) has been licensed to Sun
** Microsystems, Inc. ("Sun") under the SGI Free Software License B
** (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,56 +45,56 @@
** $Header$
*/
-/*
+/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
+ * modification, are permitted provided that the following conditions are
* met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * * Neither the name of 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -107,7 +107,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -124,8 +124,8 @@ import com.jogamp.opengl.util.glsl.ShaderState;
/**
* GLUquadricImpl.java
- *
- *
+ *
+ *
* Created 22-dec-2003 (originally Quadric.java)
* @author Erik Duijs
* @author Kenneth Russell, Sven Gothel
@@ -197,19 +197,19 @@ public class GLUquadricImpl implements GLUquadric {
ImmModeSink res = immModeSink;
if(useGLSL) {
if(null != shaderState) {
- immModeSink = ImmModeSink.createGLSL (32,
- 3, GL.GL_FLOAT, // vertex
+ immModeSink = ImmModeSink.createGLSL (32,
+ 3, GL.GL_FLOAT, // vertex
0, GL.GL_FLOAT, // color
USE_NORM?3:0, normalType, // normal
USE_TEXT?2:0, GL.GL_FLOAT, // texCoords
GL.GL_STATIC_DRAW, shaderState);
} else {
- immModeSink = ImmModeSink.createGLSL (32,
- 3, GL.GL_FLOAT, // vertex
+ immModeSink = ImmModeSink.createGLSL (32,
+ 3, GL.GL_FLOAT, // vertex
0, GL.GL_FLOAT, // color
USE_NORM?3:0, normalType, // normal
USE_TEXT?2:0, GL.GL_FLOAT, // texCoords
- GL.GL_STATIC_DRAW, shaderProgram);
+ GL.GL_STATIC_DRAW, shaderProgram);
}
} else {
immModeSink = ImmModeSink.createFixed(32,
@@ -229,7 +229,7 @@ public class GLUquadricImpl implements GLUquadric {
}
/**
- * specifies the draw style for quadrics.
+ * specifies the draw style for quadrics.
*
* The legal values are as follows:
*
@@ -243,7 +243,7 @@ public class GLUquadricImpl implements GLUquadric {
* separating coplanar faces will not be drawn.
*
* GLU.POINT: Quadrics are rendered as a set of points.
- *
+ *
* @param drawStyle The drawStyle to set
*/
public void setDrawStyle(int drawStyle) {
@@ -260,7 +260,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* GLU.SMOOTH: One normal is generated for every vertex of a quadric. This
* is the default.
- *
+ *
* @param normals The normals to set
*/
public void setNormals(int normals) {
@@ -277,7 +277,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* Note that the interpretation of outward and inward depends on the quadric
* being drawn.
- *
+ *
* @param orientation The orientation to set
*/
public void setOrientation(int orientation) {
@@ -292,7 +292,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* The manner in which texture coordinates are generated depends upon the
* specific quadric rendered.
- *
+ *
* @param textureFlag The textureFlag to set
*/
public void setTextureFlag(boolean textureFlag) {
@@ -512,10 +512,10 @@ public class GLUquadricImpl implements GLUquadric {
glNormal3f(gl, 0.0f, 0.0f, -1.0f);
}
}
-
+
da = 2.0f * PI / slices;
dr = (outerRadius - innerRadius) / loops;
-
+
switch (drawStyle) {
case GLU.GLU_FILL:
{
@@ -648,18 +648,18 @@ public class GLUquadricImpl implements GLUquadric {
* through startAngle + sweepAngle is included (where 0 degrees is along
* the +y axis, 90 degrees along the +x axis, 180 along the -y axis, and
* 270 along the -x axis).
- *
+ *
* The partial disk has a radius of outerRadius, and contains a concentric
* circular hole with a radius of innerRadius. If innerRadius is zero, then
* no hole is generated. The partial disk is subdivided around the z axis
* into slices (like pizza slices), and also about the z axis into rings
* (as specified by slices and loops, respectively).
- *
+ *
* With respect to orientation, the +z side of the partial disk is
* considered to be outside (see gluQuadricOrientation). This means that if
* the orientation is set to GLU.GLU_OUTSIDE, then any normals generated point
* along the +z axis. Otherwise, they point along the -z axis.
- *
+ *
* If texturing is turned on (with gluQuadricTexture), texture coordinates
* are generated linearly such that where r=outerRadius, the value at (r, 0, 0)
* is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
@@ -1204,7 +1204,7 @@ public class GLUquadricImpl implements GLUquadric {
*/
private void normal3f(GL gl, float x, float y, float z) {
float mag;
-
+
mag = (float)Math.sqrt(x * x + y * y + z * z);
if (mag > 0.00001F) {
x /= mag;
diff --git a/src/jogl/classes/jogamp/opengl/glu/Glue.java b/src/jogl/classes/jogamp/opengl/glu/Glue.java
index 636d17f29..2ad3d8c89 100644
--- a/src/jogl/classes/jogamp/opengl/glu/Glue.java
+++ b/src/jogl/classes/jogamp/opengl/glu/Glue.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -89,15 +89,15 @@ public class Glue {
"null control point reference",
"duplicate point on piecewise linear trimming curve"
} ;
-
+
/** Creates a new instance of Glue */
public Glue() {
}
-
+
public static String __gluNURBSErrorString( int errno ) {
return( __gluNurbsErrors[ errno ] );
}
-
+
private static String[] __gluTessErrors = {
" ",
"gluTessBeginPolygon() must precede a gluTessEndPolygon",
@@ -107,7 +107,7 @@ public class Glue {
"a coordinate is too large",
"need combine callback"
};
-
+
public static String __gluTessErrorString( int errno ) {
return( __gluTessErrors[ errno ] );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/error/Error.java b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
index 2f49db9a4..ffb8d9471 100644
--- a/src/jogl/classes/jogamp/opengl/glu/error/Error.java
+++ b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
@@ -6,9 +6,9 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
* except that Section 2.2 and 11 are omitted. Any differences between
* the Alternative License and the SGI License are offered solely by Sun
* and not by SGI.
- *
+ *
* Original Code. The Original Code is: OpenGL Sample Implementation,
* Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -53,7 +53,7 @@ import jogamp.opengl.glu.Glue;
* @author Administrator
*/
public class Error {
-
+
private static String[] glErrorStrings = {
"invalid enumerant",
"invalid value",
@@ -63,7 +63,7 @@ public class Error {
"out of memory",
"invalid framebuffer operation"
};
-
+
private static String[] gluErrorStrings = {
"invalid enumerant",
"invalid value",
@@ -71,11 +71,11 @@ public class Error {
"",
"invalid operation"
};
-
+
/** Creates a new instance of Error */
public Error() {
}
-
+
public static String gluErrorString( int errorCode ) {
if( errorCode == 0 ) {
return( "no error" );
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index 2ef4468e5..f57c2310f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -48,7 +48,7 @@ import javax.media.opengl.glu.gl2.GLUgl2;
class GL2CurveEvaluator implements CurveEvaluator {
/**
- * Output triangles (for callback) or render curve
+ * Output triangles (for callback) or render curve
*/
private boolean output_triangles;
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
index 58b565484..f83b3a805 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -43,9 +43,9 @@ import javax.media.opengl.glu.GLUnurbs;
/**
* Base object for working with NURBS curves and surfaces
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class GLUgl2nurbsImpl implements GLUnurbs {
@@ -272,7 +272,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Sets domain distance for dom.dist. sampling in u direction
- *
+ *
* @param d
* distance
*/
@@ -283,7 +283,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Sets domain distance for dom.dist. sampling in v direction
- *
+ *
* @param d
* distance
*/
@@ -303,7 +303,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Calls a method with given name and passes argumet
- *
+ *
* @param name
* name of a method to be called
* @param arg
@@ -329,7 +329,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Calls a method with given name
- *
+ *
* @param name
* name of a method to be called
*/
@@ -349,7 +349,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Begins a NURBS curve
- *
+ *
* @param o_curve
* curve object
*/
@@ -381,7 +381,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Begins new surface
- *
+ *
* @param o_surface
* surface object
*/
@@ -503,7 +503,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Method for handling error codes
- *
+ *
* @param i
* error code
*/
@@ -539,7 +539,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Make a NURBS curve
- *
+ *
* @param nknots
* number of knots in knot vector
* @param knot
@@ -587,7 +587,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Check knot vector specification
- *
+ *
* @param knots
* knot vector
* @param msg
@@ -607,7 +607,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Draw a curve
- *
+ *
* @param o_nurbscurve
* NURBS curve object
*/
@@ -660,7 +660,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Draw NURBS surface
- *
+ *
* @param o_nurbssurface
* NURBS surface object
*/
@@ -704,7 +704,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Define a map of given properties
- *
+ *
* @param type
* map type
* @param rational
@@ -719,7 +719,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Set NURBS property
- *
+ *
* @param type
* property type
* @param tag
@@ -744,7 +744,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Set parameters of existing property
- *
+ *
* @param prop
* property
*/
@@ -755,7 +755,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Set given property to rendering hints
- *
+ *
* @param prop
* property to be set
*/
@@ -767,7 +767,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Sets wheteher we use domain distance sampling
- *
+ *
* @param i
* domain distance sampling flag
*/
@@ -805,7 +805,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Make NURBS surface
- *
+ *
* @param sknot_count
* number of knots in s direction
* @param sknot
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
index f5fe17a7b..81a99beab 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -64,7 +64,7 @@ public class BuildMipmap {
/** Creates a new instance of BuildMipmap */
public BuildMipmap() {
}
-
+
public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
int width, int widthPowerOf2, int format, int type, int userLevel,
int baseLevel, int maxLevel, ByteBuffer data ) {
@@ -78,34 +78,34 @@ public class BuildMipmap {
int maxsize;
int cmpts;
PixelStorageModes psm = new PixelStorageModes();
-
+
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 );
-
+
newwidth = widthPowerOf2;
levels = Mipmap.computeLog( newwidth );
-
+
levels += userLevel;
-
+
Mipmap.retrieveStoreModes( gl, psm );
try {
- newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
newImage_width = width;
-
+
Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
cmpts = Mipmap.elements_per_group( format, type );
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-
+
// if swap_bytes was set, swapping occurred in fill_image
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-
+
for( level = userLevel; level <= levels; level++ ) {
if( newImage_width == newwidth ) {
// user newimage for this level
@@ -132,10 +132,10 @@ public class BuildMipmap {
imageTemp = otherImage;
otherImage = newImage;
newImage = imageTemp;
-
+
newImage_width = newwidth;
if( baseLevel <= level && level <= maxLevel ) {
- gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
+ gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
format, GL2.GL_UNSIGNED_SHORT, newImage );
}
}
@@ -148,10 +148,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-
+
return( 0 );
}
-
+
public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
int width, int height, int format, int type, ByteBuffer data ) {
int newwidth[] = new int[1];
@@ -166,37 +166,37 @@ public class BuildMipmap {
int maxsize;
int cmpts;
PixelStorageModes psm = new PixelStorageModes();
-
+
Mipmap.retrieveStoreModes( gl, psm );
-
+
Mipmap.closestFit( gl, target, width, height, internalFormat, format, type, newwidth, newheight );
-
+
levels = Mipmap.computeLog( newwidth[0] );
level = Mipmap.computeLog( newheight[0] );
if( level > levels ) {
levels = level;
}
-
+
try {
- newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
newImage_width = width;
newImage_height = height;
-
+
Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
-
+
cmpts = Mipmap.elements_per_group( format, type );
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-
+
// if swap_bytes is set, swapping occurred in fill_image
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-
+
for( level = 0; level < levels; level++ ) {
if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
newImage.rewind();
@@ -216,13 +216,13 @@ public class BuildMipmap {
return( GLU.GLU_OUT_OF_MEMORY );
}
}
- ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height,
+ ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height,
newImage, newwidth[0], newheight[0], otherImage );
// swap newImage and otherImage
tempImage = otherImage;
otherImage = newImage;
newImage = tempImage;
-
+
newImage_width = newwidth[0];
newImage_height = newheight[0];
newImage.rewind();
@@ -241,10 +241,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-
+
return( 0 );
}
-
+
public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
int width, int height, int widthPowerOf2, int heightPowerOf2,
int format, int type, int userLevel, int baseLevel, int maxLevel,
@@ -263,19 +263,19 @@ public class BuildMipmap {
int maxsize;
int cmpts;
int mark=-1;
-
+
boolean myswap_bytes;
int groups_per_line, element_size, group_size;
int rowsize, padding;
PixelStorageModes psm = new PixelStorageModes();
-
+
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 && height >= 1 );
-
+
if( type == GL2.GL_BITMAP ) {
return( bitmapBuild2DMipmaps( gl, target, internalFormat, width, height, format, type, data ) );
}
-
+
newwidth = widthPowerOf2;
newheight = heightPowerOf2;
levels = Mipmap.computeLog( newwidth );
@@ -283,9 +283,9 @@ public class BuildMipmap {
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
-
+
Mipmap.retrieveStoreModes( gl, psm );
myswap_bytes = psm.getUnpackSwapBytes();
cmpts = Mipmap.elements_per_group( format, type );
@@ -294,28 +294,28 @@ public class BuildMipmap {
} else {
groups_per_line = width;
}
-
+
element_size = Mipmap.bytes_per_element( type );
group_size = element_size * cmpts;
if( element_size == 1 ) {
myswap_bytes = false;
}
-
+
rowsize = groups_per_line * group_size;
padding = ( rowsize % psm.getUnpackAlignment() );
if( padding != 0 ) {
rowsize += psm.getUnpackAlignment() - padding;
}
-
+
mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
data.position( mark );
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-
+
level = userLevel;
-
+
// already power of two square
if( width == newwidth && height == newheight ) {
// use usersImage for level userLevel
@@ -333,7 +333,7 @@ public class BuildMipmap {
}
int nextWidth = newwidth / 2;
int nextHeight = newheight / 2;
-
+
// clamp to 1
if( nextWidth < 1 ) {
nextWidth = 1;
@@ -342,7 +342,7 @@ public class BuildMipmap {
nextHeight = 1;
}
memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
-
+
try {
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
@@ -452,7 +452,7 @@ public class BuildMipmap {
if( newheight < 1 ) {
newheight = 1;
}
-
+
myswap_bytes = false;
rowsize = newwidth * group_size;
memReq = Mipmap.image_size( newwidth, newheight, format, type );
@@ -498,7 +498,7 @@ public class BuildMipmap {
level = userLevel + 1;
} else { // user's image is not nice powerof2 size square
memReq = Mipmap.image_size( newwidth, newheight, format, type );
- try {
+ try {
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
case( GL2.GL_BYTE ):
@@ -535,15 +535,15 @@ public class BuildMipmap {
data.position( mark );
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
- ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
+ ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
newwidth, newheight, dstImage, element_size, rowsize, group_size );
break;
case( GL2.GL_BYTE ):
- ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
+ ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, group_size );
break;
case( GL2.GL_UNSIGNED_SHORT ):
- ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
+ ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
case( GL2.GL_SHORT ):
@@ -620,7 +620,7 @@ public class BuildMipmap {
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( levels != 0 ) { // use as little memory as possible
int nextWidth = newwidth / 2;
int nextHeight = newheight / 2;
@@ -630,7 +630,7 @@ public class BuildMipmap {
if( nextHeight < 1 ) {
nextHeight = 1;
}
-
+
memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
try {
switch( type ) {
@@ -670,7 +670,7 @@ public class BuildMipmap {
// level userLevel is in srcImage; nothing saved yet
level = userLevel;
}
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
if( baseLevel <= level && level <= maxLevel ) {
srcImage.rewind();
@@ -685,7 +685,7 @@ public class BuildMipmap {
}
}
}
-
+
level++; // update current level for the loop
for( ; level <= levels; level++ ) {
srcImage.rewind();
@@ -754,12 +754,12 @@ public class BuildMipmap {
assert( false );
break;
}
-
+
// swap dstImage and srcImage
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( newwidth > 1 ) {
newwidth /= 2;
rowsize /= 2;
@@ -769,7 +769,7 @@ public class BuildMipmap {
}
// compute amount to pad per row if any
int rowPad = rowsize % psm.getUnpackAlignment();
-
+
// should row be padded
if( rowPad == 0 ) {
// call teximage with srcImage untouched since its not padded
@@ -792,7 +792,7 @@ public class BuildMipmap {
int ii, jj;
int dstTrav;
int srcTrav;
-
+
// allocate new image for mipmap of size newRowLength x newheight
ByteBuffer newMipmapImage = null;
try {
@@ -813,7 +813,7 @@ public class BuildMipmap {
newMipmapImage.put( srcImage.get() );
}
}
-
+
// and use this new image for mipmapping instead
if( baseLevel <= level && level <= maxLevel ) {
newMipmapImage.rewind();
@@ -833,10 +833,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-
+
return( 0 );
}
-
+
public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
int components, int width, int height, int format, int type, ByteBuffer data ) {
int[] newwidth = new int[1];
@@ -850,22 +850,22 @@ public class BuildMipmap {
int memReq;
int maxsize;
int cmpts;
-
- Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
+
+ Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
newheight );
-
+
levels = Mipmap.computeLog( newwidth[0] );
level = Mipmap.computeLog( newheight[0] );
if( level > levels ) {
levels = level;
}
-
+
cmpts = Mipmap.elements_per_group( format, type );
-
+
otherImage = null;
// No need to copy the user data if its packed correctly.
// Make sure that later routines don't change that data.
-
+
if( psm.getUnpackSkipRows() == 0 && psm.getUnpackSkipPixels() == 0 ) {
newImage = data;
newImage_width = width;
@@ -878,7 +878,7 @@ public class BuildMipmap {
int iter;
int iter2;
int i, j;
-
+
try {
newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
} catch( OutOfMemoryError err ) {
@@ -896,7 +896,7 @@ public class BuildMipmap {
rowsize = group_per_line * cmpts;
elements_per_line = width * cmpts;
start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * cmpts;
-
+
for( i = 0; i < height; i++ ) {
iter = start;
data.position( iter );
@@ -906,13 +906,13 @@ public class BuildMipmap {
start += rowsize;
}
}
-
+
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-
+
for( level = 0; level <= levels; level++ ) {
if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
// use newImage for this level
@@ -937,7 +937,7 @@ public class BuildMipmap {
imageTemp = otherImage;
otherImage = newImage;
newImage = imageTemp;
-
+
newImage_width = newwidth[0];
newImage_height = newheight[0];
newImage.rewind();
@@ -956,10 +956,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
-
+
return( 0 );
}
-
+
public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
@@ -977,19 +977,19 @@ public class BuildMipmap {
int maxSize;
int cmpts;
int mark=-1;
-
+
boolean myswapBytes;
int groupsPerLine, elementSize, groupSize;
int rowsPerImage, imageSize;
int rowSize, padding;
PixelStorageModes psm = new PixelStorageModes();
-
+
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 && height >= 1 && depth >= 1 );
assert( type != GL2.GL_BITMAP );
-
+
srcImage = dstImage = null;
-
+
newWidth = widthPowerOf2;
newHeight = heightPowerOf2;
newDepth = depthPowerOf2;
@@ -1002,9 +1002,9 @@ public class BuildMipmap {
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
-
+
Mipmap.retrieveStoreModes3D( gl, psm );
myswapBytes = psm.getUnpackSwapBytes();
cmpts = Mipmap.elements_per_group( format, type );
@@ -1013,42 +1013,42 @@ public class BuildMipmap {
} else {
groupsPerLine = width;
}
-
+
elementSize = Mipmap.bytes_per_element( type );
groupSize = elementSize * cmpts;
if( elementSize == 1 ) {
myswapBytes = false;
}
-
+
// 3dstuff
if( psm.getUnpackImageHeight() > 0 ) {
rowsPerImage = psm.getUnpackImageHeight();
} else {
rowsPerImage = height;
}
-
+
rowSize = groupsPerLine * groupSize;
padding = ( rowSize % psm.getUnpackAlignment() );
if( padding != 0 ) {
rowSize += psm.getUnpackAlignment() - padding;
}
-
+
imageSize = rowsPerImage * rowSize;
-
+
usersImage = ByteBuffer.wrap(data.array());
mark = psm.getUnpackSkipRows() * rowSize +
psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize;
usersImage.position( mark );
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
-
+
level = userLevel;
-
+
if( width == newWidth && height == newHeight && depth == newDepth ) {
// use usersImage for level userlevel
if( baseLevel <= level && level <= maxLevel ) {
@@ -1068,7 +1068,7 @@ public class BuildMipmap {
int nextWidth = newWidth / 2;
int nextHeight = newHeight / 2;
int nextDepth = newDepth / 2;
-
+
// clamp to one
if( nextWidth < 1 ) {
nextWidth = 1;
@@ -1116,13 +1116,13 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
if( dstImage != null ) {
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
- usersImage, dstImage, elementSize,
+ usersImage, dstImage, elementSize,
groupSize, rowSize, imageSize, myswapBytes );
} else {
HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
@@ -1145,7 +1145,7 @@ public class BuildMipmap {
usersImage, dstImage, elementSize, groupSize, rowSize,
imageSize, myswapBytes );
} else {
- HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
+ HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
@@ -1257,7 +1257,7 @@ public class BuildMipmap {
if( newDepth < 1 ) {
newDepth = 1;
}
-
+
myswapBytes = false;
rowSize = newWidth * groupSize;
imageSize = rowSize * newHeight;
@@ -1302,7 +1302,7 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
// level userLevel + 1 is in srcImage; level userLevel already saved
level = userLevel + 1;
} else {
@@ -1343,10 +1343,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
ScaleInternal.gluScaleImage3D( gl, format, width, height, depth, type,
usersImage, newWidth, newHeight, newDepth, type, dstImage );
-
+
myswapBytes = false;
rowSize = newWidth * groupSize;
imageSize = rowSize * newHeight;
@@ -1354,7 +1354,7 @@ public class BuildMipmap {
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( levels != 0 ) {
int nextWidth = newWidth / 2;
int nextHeight = newHeight / 2;
@@ -1409,7 +1409,7 @@ public class BuildMipmap {
// level userLevel is in srcImage; nothing saved yet
level = userLevel;
}
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
if( baseLevel <= level && level <= maxLevel ) {
usersImage.position( mark );
@@ -1541,11 +1541,11 @@ public class BuildMipmap {
assert( false );
break;
}
-
+
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( newWidth > 1 ) {
newWidth /= 2;
rowSize /= 2;
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
index a564269fb..0eee9bf32 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
index 10ea1d729..5269024b4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract1010102 implements Extract {
-
+
/** Creates a new instance of Extract1010102 */
public Extract1010102() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111111,11000000,00000000,00000000 == 0xFFC00000
// 00000000,00111111,11110000,00000000 == 0x003F0000
// 00000000,00000000,00001111,11111100 == 0x00000FFC
// 00000000,00000000,00000000,00000011 == 0x00000003
-
+
extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
extractComponents[2] = (float)( ( uint & 0x00000FFC ) >> 2 ) / 1023.0f;
extractComponents[3] = (float)( ( uint & 0x00000003 ) ) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) << 22) & 0xFFC00000 );
uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) << 12) & 0x003FF000 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
index 1234da5f8..6982931d3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract1555rev implements Extract {
-
+
/** Creates a new instance of Extract1555rev */
public Extract1555rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 00000000,00011111 == 0x001F
// 00000011,11100000 == 0x03E0
// 01111100,00000000 == 0x7C00
// 10000000,00000000 == 0x8000
-
+
extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x003E ) >> 5 ) / 31.0f;
extractComponents[2] = (float)( ( ushort & 0x7C00 ) >> 10) / 31.0f;
extractComponents[3] = (float)( ( ushort & 0x8000 ) >> 15);
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 00000000,00011111 == 0x001F
// 00000011,11100000 == 0x03E0
// 01111100,00000000 == 0x7C00
// 10000000,00000000 == 0x8000
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) << 5) & 0x000003E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
index 226254f99..1c7db6218 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract2101010rev implements Extract {
-
+
/** Creates a new instance of Extract2101010 */
public Extract2101010rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111111,11000000,00000000,00000000 == 0xFFC00000
// 00000000,00111111,11110000,00000000 == 0x003F0000
// 00000000,00000000,00001111,11111100 == 0x00000FFC
// 00000000,00000000,00000000,00000011 == 0x00000003
-
+
extractComponents[0] = (float)( ( uint & 0x000003FF ) ) / 1023.0f;
extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) ) & 0x000003FF );
uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) << 10) & 0x000FFC00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
index 9fa2a3a54..672c86c32 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract233rev implements Extract {
-
+
/** Creates a new instance of Extract223rev */
public Extract233rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
@@ -65,16 +65,16 @@ public class Extract233rev implements Extract {
extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
// 00000011 == 0x03
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) ) & 0x07 );
b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 3 ) & 0x38 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
index 92d141be5..6cdbc5cb0 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract332 implements Extract {
-
+
/** Creates a new instance of Extract332 */
public Extract332() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
@@ -65,16 +65,16 @@ public class Extract332 implements Extract {
extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
// 00000011 == 0x03
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) << 5 ) & 0xE0 );
b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 2 ) & 0x1C );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
index af99d154c..b36b9fb82 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,41 +51,41 @@ import java.nio.*;
* @author Administrator
*/
public class Extract4444 implements Extract {
-
+
/** Creates a new instance of Extract4444 */
public Extract4444() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
extractComponents[3] = (float)( ( ushort & 0x000F ) ) / 15.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) << 12) & 0x0000F000 );
ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 8) & 0x00000F00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
index e5bce60d8..b7a3ed55f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract4444rev implements Extract {
-
+
/** Creates a new instance of Extract4444rev */
public Extract4444rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 00000000,00001111 == 0x000F
// 00000000,11110000 == 0x00F0
// 00001111,00000000 == 0x0F00
// 11110000,00000000 == 0xF000
-
+
extractComponents[0] = (float)( ( ushort & 0x000F ) ) / 15.0f;
extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) ) & 0x0000000F );
ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 4) & 0x000000F0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
index 5c383103e..4dc566b25 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract5551 implements Extract {
-
+
/** Creates a new instance of Extract5551 */
public Extract5551() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11000000 == 0x07C0
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
-
+
extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 6 ) / 31.0f;
extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 1 ) / 31.0f;
extractComponents[3] = (float)( ( ushort & 0xF000 ) );
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) << 6) & 0x000007C0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
index f6193dd2d..e198e46d4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,38 +51,38 @@ import java.nio.*;
* @author Administrator
*/
public class Extract565 implements Extract {
-
+
/** Creates a new instance of Extract565 */
public Extract565() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11100000 == 0x07E0
// 00000000,00111111 == 0x001F
-
+
extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11111000,00000000 == 0xF800
// 00000111,11100000 == 0x07E0
// 00000000,00111111 == 0x001F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
index 2e455adfa..fe19540ee 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,38 +51,38 @@ import java.nio.*;
* @author Administrator
*/
public class Extract565rev implements Extract {
-
+
/** Creates a new instance of Extract565rev */
public Extract565rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 00000000,00011111 == 0x001F
// 00000111,11100000 == 0x07E0
// 11111000,00000000 == 0xF800
-
+
extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 00000000,00111111 == 0x001F
// 00000111,11100000 == 0x07E0
// 11111000,00000000 == 0xF800
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
index 137fa3c21..4602f2af9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract8888 implements Extract {
-
+
/** Creates a new instance of Extract8888 */
public Extract8888() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11000000 == 0x07C0
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
-
+
extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
extractComponents[3] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 255) + 0.5f) << 24) & 0xFF000000 );
uint |= (((int)((shoveComponents[1] * 255) + 0.5f) << 16) & 0x00FF0000 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
index 2ac942c84..373cb102a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract8888rev implements Extract {
-
+
/** Creates a new instance of Extract8888rev */
public Extract8888rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11000000 == 0x07C0
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
-
+
extractComponents[0] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 255) + 0.5f) ) & 0x000000FF );
uint |= (((int)((shoveComponents[1] * 255) + 0.5f) << 8) & 0x0000FF00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
index 52c2191b9..ac0f2f290 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractFloat implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractFloat */
public ExtractFloat() {
}
-
+
public double extract( boolean isSwap, ByteBuffer data ) {
float f = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractFloat implements ExtractPrimitive {
assert( f <= 1.0f );
return( f );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 1.0);
data.asFloatBuffer().put( index, (float)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
index 926096649..a44fb9508 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
index 2e1a9a0a6..399386e30 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,17 +51,17 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class ExtractSByte implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractUByte */
public ExtractSByte() {
}
-
+
public double extract( boolean isSwap, ByteBuffer sbyte ) {
byte b = sbyte.get();
assert( b <= 127 );
return( b );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
data.position( index );
data.put( (byte)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
index ca80747c4..be3fb3092 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractSInt implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractSInt */
public ExtractSInt() {
}
-
+
public double extract( boolean isSwap, ByteBuffer uint ) {
int i = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractSInt implements ExtractPrimitive {
assert( i <= 0x7FFFFFFF );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < Integer.MAX_VALUE);
IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
index 979c3b449..1e123c9b4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractSShort implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractSShort */
public ExtractSShort() {
}
-
+
public double extract( boolean isSwap, ByteBuffer ushort ) {
short s = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractSShort implements ExtractPrimitive {
assert( s <= 32767 );
return( s );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 32768.0);
ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
index 4d14212ab..26ca5cd40 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,17 +51,17 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class ExtractUByte implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractUByte */
public ExtractUByte() {
}
-
+
public double extract( boolean isSwap, ByteBuffer ubyte ) {
int i = 0x000000FF & ubyte.get();
assert( i <= 255 );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 256.0);
data.position( index );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
index c088ca301..8c94c89fc 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractUInt implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractUInt */
public ExtractUInt() {
}
-
+
public double extract( boolean isSwap, ByteBuffer uint ) {
long i = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractUInt implements ExtractPrimitive {
assert( i <= 0xFFFFFFFF );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 0xFFFFFFFF);
IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
index 81db60f0f..55115c6f7 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractUShort implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtracUShort */
public ExtractUShort() {
}
-
+
public double extract( boolean isSwap, ByteBuffer ushort ) {
int i = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractUShort implements ExtractPrimitive {
assert( i <= 65535 );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 65536.0);
ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
index 7549044ba..184c5fda8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -52,11 +52,11 @@ import java.nio.*;
* @author Administrator
*/
public class HalveImage {
-
+
private static final int BOX2 = 2;
private static final int BOX4 = 4;
private static final int BOX8 = 8;
-
+
public static void halveImage( int components, int width, int height,
ShortBuffer datain, ShortBuffer dataout ) {
int i, j, k;
@@ -64,11 +64,11 @@ public class HalveImage {
int delta;
int t = 0;
short temp = 0;
-
+
newwidth = width / 2;
newheight = height /2;
delta = width * components;
-
+
// Piece of cake
for( i = 0; i < newheight; i++ ) {
for( j = 0; j < newwidth; j++ ) {
@@ -91,7 +91,7 @@ public class HalveImage {
t += delta;
}
}
-
+
public static void halveImage_ubyte( int components, int width, int height,
ByteBuffer datain, ByteBuffer dataout,
int element_size, int ysize, int group_size ) {
@@ -99,19 +99,19 @@ public class HalveImage {
int newwidth, newheight;
int s;
int t;
-
+
// Handle case where there is only 1 column/row
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) ); // can't be 1x1
halve1Dimage_ubyte( components, width, height, datain, dataout, element_size, ysize, group_size );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
s = 0;
t = 0;
-
+
int temp = 0;
// piece of cake
for( i = 0; i < newheight; i++ ) {
@@ -133,9 +133,9 @@ public class HalveImage {
t += ysize;
}
}
-
+
public static void halve1Dimage_ubyte( int components, int width, int height,
- ByteBuffer datain, ByteBuffer dataout,
+ ByteBuffer datain, ByteBuffer dataout,
int element_size, int ysize, int group_size ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
@@ -143,14 +143,14 @@ public class HalveImage {
int dest = 0;
int jj;
int temp = 0;
-
+
assert( width == 1 || height == 1 ); // Must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -161,7 +161,7 @@ public class HalveImage {
temp /= 2;
dataout.put( (byte)temp );
/*
- dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
+ dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
(0x000000FF & datain.setIndexInBytes( src + group_size ).getByte())) / 2 ) );
*/
src += element_size;
@@ -188,7 +188,7 @@ public class HalveImage {
temp /= 2;
dataout.put( (byte)temp );
/*
- dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
+ dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
(0x000000FF & datain.setIndexInBytes(src + ysize).getByte()) ) / 2 ) );
*/
src += element_size;
@@ -202,7 +202,7 @@ public class HalveImage {
assert( src == ysize * height );
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_byte( int components, int width, int height,
ByteBuffer datain, ByteBuffer dataout, int element_size,
int ysize, int group_size ) {
@@ -211,7 +211,7 @@ public class HalveImage {
int s = 0;
int t = 0;
byte temp = (byte)0;
-
+
// handle case where there is only 1 column
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) );
@@ -219,10 +219,10 @@ public class HalveImage {
ysize, group_size );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
for( i = 0; i < newheight; i++ ) {
for( j = 0; j < newwidth; j++ ) {
for( k = 0; k < components; k++ ) {
@@ -244,7 +244,7 @@ public class HalveImage {
t += ysize;
}
}
-
+
public static void halve1Dimage_byte( int components, int width, int height,
ByteBuffer datain, ByteBuffer dataout,
int element_size, int ysize, int group_size ) {
@@ -254,14 +254,14 @@ public class HalveImage {
int dest = 0;
int jj;
byte temp = (byte)0;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -284,7 +284,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -303,7 +303,7 @@ public class HalveImage {
}
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_ushort( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -319,10 +319,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -364,7 +364,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_ushort( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -373,14 +373,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < halfHeight; kk++ ) {
@@ -410,7 +410,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -437,7 +437,7 @@ public class HalveImage {
}
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_short( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -453,10 +453,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -504,7 +504,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_short( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -513,14 +513,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -550,7 +550,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -577,7 +577,7 @@ public class HalveImage {
}
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
-
+
public static void halveImage_uint( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -586,7 +586,7 @@ public class HalveImage {
int s = 0;
int t = 0;
double temp = 0;
-
+
// handle case where there is only 1 column/row
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) ); // can't be 1x1
@@ -594,10 +594,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -643,7 +643,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_uint( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -652,14 +652,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < halfHeight; kk++ ) {
@@ -689,7 +689,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -716,7 +716,7 @@ public class HalveImage {
}
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_int( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -725,7 +725,7 @@ public class HalveImage {
int s = 0;
int t = 0;
int temp = 0;
-
+
// handle case where there is only 1 column/row
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) ); // can't be 1x1
@@ -733,10 +733,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -785,7 +785,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_int( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -794,14 +794,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -831,7 +831,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -858,7 +858,7 @@ public class HalveImage {
}
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
-
+
public static void halveImage_float( int components, int width, int height,
ByteBuffer datain, FloatBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -874,10 +874,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -920,7 +920,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_float( int components, int width, int height,
ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -929,14 +929,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -966,7 +966,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -993,9 +993,9 @@ public class HalveImage {
}
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
-
- public static void halveImagePackedPixel( int components, Extract extract, int width,
- int height, ByteBuffer datain, ByteBuffer dataout,
+
+ public static void halveImagePackedPixel( int components, Extract extract, int width,
+ int height, ByteBuffer datain, ByteBuffer dataout,
int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) );
@@ -1004,19 +1004,19 @@ public class HalveImage {
return;
}
int ii, jj;
-
+
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
-
+
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX4][4];
int cc;
-
+
datain.position( src );
extract.extract( isSwap, datain, extractTotals[0] );
datain.position( src + pixelSizeInBytes );
@@ -1045,7 +1045,7 @@ public class HalveImage {
assert( src == rowSizeInBytes * height );
assert( outIndex == halfWidth * halfHeight );
}
-
+
public static void halve1DimagePackedPixel( int components, Extract extract, int width,
int height, ByteBuffer datain, ByteBuffer dataout,
int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
@@ -1053,23 +1053,23 @@ public class HalveImage {
int halfHeight = height / 2;
int src = 0;
int jj;
-
+
assert( width == 1 || height == 1 );
assert( width != height );
-
+
if( height == 1 ) {
int outIndex = 0;
-
+
assert( width != 1 );
halfHeight = 1;
-
+
// one horizontal row with possible pad bytes
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
float[] totals = new float[4];
float[][] extractTotals = new float[BOX2][4];
int cc;
-
+
datain.position( src );
extract.extract( isSwap, datain, extractTotals[0] );
datain.position( src + pixelSizeInBytes );
@@ -1090,17 +1090,17 @@ public class HalveImage {
}
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
src += padBytes;
-
+
assert( src == rowSizeInBytes );
assert( outIndex == halfWidth * halfHeight );
} else if( width == 1 ) {
int outIndex = 0;
-
+
assert( height != 1 );
halfWidth = 1;
// one vertical volumn with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
float[] totals = new float[4];
float[][] extractTotals = new float[BOX2][4];
@@ -1128,7 +1128,7 @@ public class HalveImage {
assert( outIndex == halfWidth * halfHeight );
}
}
-
+
public static void halveImagePackedPixelSlice( int components, Extract extract,
int width, int height, int depth, ByteBuffer dataIn,
ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
@@ -1140,26 +1140,26 @@ public class HalveImage {
int src = 0;
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
-
+
assert( (width == 1 || height == 1) && depth >= 2 );
-
+
if( width == height ) {
assert( width == 1 && height == 1 );
assert( depth >= 2 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX2][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[1] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
-
+
// average only 2 pixels since a column
totals[cc]= 0.0f;
for( kk = 0; kk < BOX2; kk++ ) {
@@ -1167,7 +1167,7 @@ public class HalveImage {
}
totals[cc] /= BOX2;
} // for cc
-
+
extract.shove( totals, outIndex, dataOut );
outIndex++;
// skip over to next group of 2
@@ -1175,13 +1175,13 @@ public class HalveImage {
} // for ii
} else if( height == 1 ) {
assert( width != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX4][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + pixelSizeInBytes );
@@ -1190,10 +1190,10 @@ public class HalveImage {
extract.extract( isSwap, dataIn, extractTotals[2] );
dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[3] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
-
+
// grab 4 pixels to average
totals[cc] = 0.0f;
for( kk = 0; kk < BOX4; kk++ ) {
@@ -1209,13 +1209,13 @@ public class HalveImage {
}
} else if( width == 1 ) {
assert( height != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX4][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + rowSizeInBytes );
@@ -1224,10 +1224,10 @@ public class HalveImage {
extract.extract( isSwap, dataIn, extractTotals[2] );
dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[3] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
-
+
// grab 4 pixels to average
totals[cc] = 0.0f;
for( kk = 0; kk < BOX4; kk++ ) {
@@ -1243,7 +1243,7 @@ public class HalveImage {
}
}
}
-
+
public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
@@ -1255,25 +1255,25 @@ public class HalveImage {
int src = 0;
int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
int outIndex = 0;
-
+
assert( (width == 1 || height == 1) && depth >= 2 );
-
+
if( width == height ) {
assert( width == 1 && height == 1 );
assert( depth >= 2 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
int cc;
for( cc = 0; cc < components; cc++ ) {
double[] totals = new double[4];
double[][] extractTotals = new double[BOX2][4];
int kk;
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + imageSizeInBytes );
extractTotals[1][cc] = extract.extract( isSwap, dataIn );
-
+
// average 2 pixels since only a column
totals[cc] = 0.0f;
// totals[red] = extractTotals[0][red] + extractTotals[1][red];
@@ -1282,7 +1282,7 @@ public class HalveImage {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX2;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
src += elementSizeInBytes;
@@ -1290,12 +1290,12 @@ public class HalveImage {
// skip over next group of 2
src += rowSizeInBytes;
} // for ii
-
+
assert( src == rowSizeInBytes * height * depth );
assert( outIndex == halfDepth * components );
} else if( height == 1 ) {
assert( width != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
int cc;
@@ -1303,7 +1303,7 @@ public class HalveImage {
int kk;
double totals[] = new double[4];
double extractTotals[][] = new double[BOX4][4];
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + groupSizeInBytes );
@@ -1312,7 +1312,7 @@ public class HalveImage {
extractTotals[2][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-
+
// grab 4 pixels to average
totals[cc] = 0.0f;
// totals[red] = extractTotals[0][red] + extractTotals[1][red] +
@@ -1322,7 +1322,7 @@ public class HalveImage {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX4;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
src += elementSizeInBytes;
@@ -1337,7 +1337,7 @@ public class HalveImage {
assert( outIndex == halfWidth * halfDepth * components );
} else if( width == 1 ) {
assert( height != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfHeight; jj++ ) {
int cc;
@@ -1345,7 +1345,7 @@ public class HalveImage {
int kk;
double totals[] = new double[4];
double extractTotals[][] = new double[BOX4][4];
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + rowSizeInBytes );
@@ -1354,8 +1354,8 @@ public class HalveImage {
extractTotals[2][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-
-
+
+
// grab 4 pixels to average
totals[cc] = 0.0f;
// totals[red] = extractTotals[0][red] + extractTotals[1][red] +
@@ -1365,7 +1365,7 @@ public class HalveImage {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX4;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
src += elementSizeInBytes;
@@ -1380,32 +1380,32 @@ public class HalveImage {
assert( outIndex == halfWidth * halfDepth * components );
}
}
-
+
public static void halveImage3D( int components, ExtractPrimitive extract,
int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
int imageSizeInBytes, boolean isSwap ) {
assert( depth > 1 );
-
+
// horizontal/vertical/onecolumn slice viewed from top
if( width == 1 || height == 1 ) {
assert( 1 <= depth );
-
+
halveImageSlice( components, extract, width, height, depth, dataIn, dataOut,
elementSizeInBytes, groupSizeInBytes, rowSizeInBytes, imageSizeInBytes,
isSwap );
return;
}
-
+
int ii, jj, dd;
-
+
int halfWidth = width / 2;
int halfHeight = height / 2;
int halfDepth = depth / 2;
int src = 0;
int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
int outIndex = 0;
-
+
for( dd = 0; dd < halfDepth; dd++ ) {
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
@@ -1414,7 +1414,7 @@ public class HalveImage {
int kk;
double totals[] = new double[4];
double extractTotals[][] = new double[BOX8][4];
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + groupSizeInBytes );
@@ -1431,17 +1431,17 @@ public class HalveImage {
extractTotals[6][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + rowSizeInBytes + imageSizeInBytes + groupSizeInBytes );
extractTotals[7][cc] = extract.extract( isSwap, dataIn );
-
+
totals[cc] = 0.0f;
-
+
for( kk = 0; kk < BOX8; kk++ ) {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX8;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
-
+
src += elementSizeInBytes;
} // for cc
// skip over to next square of 4
@@ -1456,40 +1456,40 @@ public class HalveImage {
assert( src == rowSizeInBytes * height * depth );
assert( outIndex == halfWidth * halfHeight * halfDepth * components );
}
-
+
public static void halveImagePackedPixel3D( int components, Extract extract,
- int width, int height, int depth, ByteBuffer dataIn,
+ int width, int height, int depth, ByteBuffer dataIn,
ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
int imageSizeInBytes, boolean isSwap ) {
if( depth == 1 ) {
assert( 1 <= width && 1 <= height );
-
+
halveImagePackedPixel( components, extract, width, height, dataIn, dataOut,
pixelSizeInBytes, rowSizeInBytes, isSwap );
return;
} else if( width == 1 || height == 1 ) { // a horizontal or vertical slice viewed from top
assert( 1 <= depth );
-
+
halveImagePackedPixelSlice( components, extract, width, height, depth, dataIn,
dataOut, pixelSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap );
return;
}
int ii, jj, dd;
-
+
int halfWidth = width / 2;
int halfHeight = height / 2;
int halfDepth = depth / 2;
int src = 0;
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
-
+
for( dd = 0; dd < halfDepth; dd++ ) {
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4]; // 4 is max components
float extractTotals[][] = new float[BOX8][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + pixelSizeInBytes );
@@ -1506,7 +1506,7 @@ public class HalveImage {
extract.extract( isSwap, dataIn, extractTotals[6] );
dataIn.position( src + rowSizeInBytes + pixelSizeInBytes + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[7] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
// grab 8 pixels to average
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
index b610ce86b..18f814dde 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -53,18 +53,18 @@ import java.nio.*;
* @author Administrator
*/
public class Image {
-
+
/** Creates a new instance of Image */
public Image() {
}
-
+
public static short getShortFromByteArray( byte[] array, int index ) {
short s;
s = (short)(array[index] << 8 );
s |= (short)(0x00FF & array[index+1]);
return( s );
}
-
+
public static int getIntFromByteArray( byte[] array, int index ) {
int i;
i = ( array[index] << 24 ) & 0xFF000000;
@@ -73,12 +73,12 @@ public class Image {
i |= ( array[index+3] ) & 0x000000FF;
return( i );
}
-
+
public static float getFloatFromByteArray( byte[] array, int index ) {
int i = getIntFromByteArray( array, index );
return( Float.intBitsToFloat(i) );
}
-
+
/*
* Extract array from user's data applying all pixel store modes.
* The internal format used is an array of unsigned shorts.
@@ -98,7 +98,7 @@ public class Image {
int iter2;
int i, j, k;
boolean myswap_bytes;
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -139,7 +139,7 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
myswap_bytes = psm.getUnpackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getUnpackRowLength() > 0 ) {
@@ -147,12 +147,12 @@ public class Image {
} else {
groups_per_line = width;
}
-
+
// All formats except GL_BITMAP fall out trivially
if( type == GL2.GL_BITMAP ) {
int bit_offset;
int current_bit;
-
+
rowsize = ( groups_per_line * components + 7 ) / 8;
padding = ( rowsize % psm.getUnpackAlignment() );
if( padding != 0 ) {
@@ -200,7 +200,7 @@ public class Image {
if( element_size == 1 ) {
myswap_bytes = false;
}
-
+
rowsize = groups_per_line * group_size;
padding = ( rowsize % psm.getUnpackAlignment() );
if( padding != 0 ) {
@@ -208,7 +208,7 @@ public class Image {
}
start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
elements_per_line = width * components;
-
+
iter2 = 0;
for( i = 0; i < height; i++ ) {
iter = start;
@@ -364,7 +364,7 @@ public class Image {
// want iter pointing at start, not within, row for assertion purposes
iter = start;
} // for i
-
+
// iterators should be one byte past end
if( !Mipmap.isTypePackedPixel( type ) ) {
assert( iter2 == ( width * height * components ) );
@@ -374,16 +374,16 @@ public class Image {
assert( iter == ( rowsize * height + psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size ) );
}
}
-
+
/*
* Insert array into user's data applying all pixel store modes.
* Theinternal format is an array of unsigned shorts.
* empty_image() because it is the opposet of fill_image().
*/
- public static void empty_image( PixelStorageModes psm, int width, int height,
- int format, int type, boolean index_format,
+ public static void empty_image( PixelStorageModes psm, int width, int height,
+ int format, int type, boolean index_format,
ShortBuffer oldimage, ByteBuffer userdata ) {
-
+
int components;
int element_size;
int rowsize;
@@ -396,7 +396,7 @@ public class Image {
int iter2;
int i, j, k;
boolean myswap_bytes;
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -437,7 +437,7 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
myswap_bytes = psm.getPackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getPackRowLength() > 0 ) {
@@ -445,12 +445,12 @@ public class Image {
} else {
groups_per_line = width;
}
-
+
// all formats except GL_BITMAP fall out trivially
if( type == GL2.GL_BITMAP ) {
int bit_offset;
int current_bit;
-
+
rowsize = ( groups_per_line * components + 7 ) / 8;
padding = ( rowsize % psm.getPackAlignment() );
if( padding != 0 ) {
@@ -472,7 +472,7 @@ public class Image {
current_bit = 0;
}
}
-
+
if( current_bit != 0 ) {
if( psm.getPackLsbFirst() ) {
userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 1 << bit_offset ) ) ) );
@@ -488,7 +488,7 @@ public class Image {
userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 7 - bit_offset ) ) ) );
}
}
-
+
bit_offset++;
if( bit_offset == 8 ) {
bit_offset = 0;
@@ -500,13 +500,13 @@ public class Image {
}
} else {
float shoveComponents[] = new float[4];
-
+
element_size = Mipmap.bytes_per_element( type );
group_size = element_size * components;
if( element_size == 1 ) {
myswap_bytes = false;
}
-
+
rowsize = groups_per_line * group_size;
padding = ( rowsize % psm.getPackAlignment() );
if( padding != 0 ) {
@@ -514,13 +514,13 @@ public class Image {
}
start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size;
elements_per_line = width * components;
-
+
iter2 = 0;
for( i = 0; i < height; i++ ) {
iter = start;
for( j = 0; j < elements_per_line; j++ ) {
Type_Widget widget = new Type_Widget();
-
+
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
for( k = 0; k < 3; k++ ) {
@@ -799,7 +799,7 @@ public class Image {
assert( iter == rowsize * height + psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size );
}
}
-
+
public static void fillImage3D( PixelStorageModes psm, int width, int height,
int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
ShortBuffer newImage ) {
@@ -819,7 +819,7 @@ public class Image {
int ww, hh, dd, k;
Type_Widget widget = new Type_Widget();
float extractComponents[] = new float[4];
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -860,7 +860,7 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
myswapBytes = psm.getUnpackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getUnpackRowLength() > 0 ) {
@@ -873,7 +873,7 @@ public class Image {
if( elementSize == 1 ) {
myswapBytes = false;
}
-
+
// 3dstuff begin
if( psm.getUnpackImageHeight() > 0 ) {
rowsPerImage = psm.getUnpackImageHeight();
@@ -881,27 +881,27 @@ public class Image {
rowsPerImage = height;
}
// 3dstuff end
-
+
rowSize = groupsPerLine * groupSize;
padding = rowSize % psm.getUnpackAlignment();
if( padding != 0 ) {
rowSize += psm.getUnpackAlignment() - padding;
}
-
+
imageSize = rowsPerImage * rowSize; // 3dstuff
-
- start = psm.getUnpackSkipRows() * rowSize +
- psm.getUnpackSkipPixels() * groupSize +
+
+ start = psm.getUnpackSkipRows() * rowSize +
+ psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize;
elementsPerLine = width * components;
-
+
iter2 = 0;
for( dd = 0; dd < depth; dd++ ) {
rowStart = start;
for( hh = 0; hh < height; hh++ ) {
iter = rowStart;
for( ww = 0; ww < elementsPerLine; ww++ ) {
-
+
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
if( indexFormat ) {
@@ -1063,18 +1063,18 @@ public class Image {
} // for hh
start += imageSize;
}// for dd
-
+
// iterators should be one byte past end
if( !Mipmap.isTypePackedPixel( type ) ) {
assert( iter2 == width * height * depth * components );
} else {
assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
}
- assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize +
+ assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize +
psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize );
}
-
+
public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
boolean myswapBytes;
@@ -1092,7 +1092,7 @@ public class Image {
int imageSize;
Type_Widget widget = new Type_Widget();
float[] shoveComponents = new float[4];
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -1133,9 +1133,9 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
iter = 0;
-
+
myswapBytes = psm.getPackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getPackRowLength() > 0 ) {
@@ -1143,44 +1143,44 @@ public class Image {
} else {
groupsPerLine = width;
}
-
+
elementSize = Mipmap.bytes_per_element( type );
groupSize = elementSize * components;
if( elementSize == 1 ) {
myswapBytes = false;
}
-
+
// 3dstuff begin
if( psm.getPackImageHeight() > 0 ) {
rowsPerImage = psm.getPackImageHeight();
} else {
rowsPerImage = height;
}
-
+
// 3dstuff end
-
+
rowSize = groupsPerLine * groupSize;
padding = rowSize % psm.getPackAlignment();
if( padding != 0 ) {
rowSize += psm.getPackAlignment() - padding;
}
-
+
imageSize = rowsPerImage * rowSize;
-
+
start = psm.getPackSkipRows() * rowSize +
psm.getPackSkipPixels() * groupSize +
psm.getPackSkipImages() * imageSize;
elementsPerLine = width * components;
-
+
iter2 = 0;
for( dd = 0; dd < depth; dd++ ) {
rowStart = start;
-
+
for( ii = 0; ii < height; ii++ ) {
iter = rowStart;
-
+
for( jj = 0; jj < elementsPerLine; jj++ ) {
-
+
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
if( indexFormat ) {
@@ -1392,20 +1392,20 @@ public class Image {
default:
assert( false );
}
-
+
iter += elementSize;
} // for jj
rowStart += rowSize;
} // for ii
start += imageSize;
} // for dd
-
+
if( !Mipmap.isTypePackedPixel( type ) ) {
assert( iter2 == width * height * depth * components );
} else {
assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
}
- assert( iter == rowSize * height * depth +
+ assert( iter == rowSize * height * depth +
psm.getUnpackSkipRows() * rowSize +
psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
index b74d0a6b8..938873ec5 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -57,11 +57,11 @@ import com.jogamp.common.nio.Buffers;
* @author Administrator
*/
public class Mipmap {
-
+
/** Creates a new instance of Mipmap */
public Mipmap() {
}
-
+
public static int computeLog( int value ) {
int i = 0;
// Error
@@ -79,7 +79,7 @@ public class Mipmap {
i++;
}
}
-
+
/* Compute the nearest power of 2 number. This algorithm is a little strange
* but it works quite well.
*/
@@ -99,7 +99,7 @@ public class Mipmap {
i *= 2;
}
}
-
+
public static short GLU_SWAP_2_BYTES( short s ) {
byte b = 0;
b = (byte)( s >>> 8 );
@@ -107,7 +107,7 @@ public class Mipmap {
s = (short)( s | (0x00FF & b) );
return( s );
}
-
+
public static int GLU_SWAP_4_BYTES( int i ) {
int t = i << 24;
t |= 0x00FF0000 & ( i << 8 );
@@ -115,13 +115,13 @@ public class Mipmap {
t |= 0x000000FF & ( i >>> 24 );
return( t );
}
-
+
public static float GLU_SWAP_4_BYTES( float f ) {
int i = Float.floatToRawIntBits( f );
float temp = Float.intBitsToFloat( i );
return( temp );
}
-
+
public static int checkMipmapArgs( int internalFormat, int format, int type ) {
if( !legalFormat( format ) || !legalType( type ) ) {
return( GLU.GLU_INVALID_ENUM );
@@ -134,7 +134,7 @@ public class Mipmap {
}
return( 0 );
}
-
+
public static boolean legalFormat( int format ) {
switch( format ) {
case( GL2.GL_COLOR_INDEX ):
@@ -155,7 +155,7 @@ public class Mipmap {
return( false );
}
}
-
+
public static boolean legalType( int type ) {
switch( type ) {
case( GL2.GL_BITMAP ):
@@ -183,10 +183,10 @@ public class Mipmap {
return( false );
}
}
-
+
public static boolean isTypePackedPixel( int type ) {
assert( legalType( type ) );
-
+
if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
@@ -203,20 +203,20 @@ public class Mipmap {
}
return( false );
}
-
+
public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
// if not a packed pixel type then return true
if( isTypePackedPixel( type ) ) {
return( true );
}
-
+
// 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
if( (type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 || type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
& format != GL2GL3.GL_RGB ) {
return( false );
}
-
+
// 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
// 10_10_10_2/2_10_10_10_REV are only campatible with RGBA, BGRA & ARGB_EXT
if( ( type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
@@ -232,7 +232,7 @@ public class Mipmap {
}
return( true );
}
-
+
public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
int totalLevels ) {
if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
@@ -241,7 +241,7 @@ public class Mipmap {
}
return( true );
}
-
+
/* Given user requested textures size, determine if it fits. If it doesn't then
* halve both sides and make the determination again until it does fit ( for
* IR only ).
@@ -257,7 +257,7 @@ public class Mipmap {
int heightPowerOf2 = nearestPower( height );
int[] proxyWidth = new int[1];
boolean noProxyTextures = false;
-
+
// Some drivers (in particular, ATI's) seem to set a GL error
// when proxy textures are used even though this is in violation
// of the spec. Guard against this and interactions with the
@@ -268,20 +268,20 @@ public class Mipmap {
int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
int proxyTarget;
-
+
assert( widthAtLevelOne > 0 );
assert( heightAtLevelOne > 0 );
-
+
// does width x height at level 1 & all their mipmaps fit?
if( target == GL2GL3.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_2D;
gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
heightAtLevelOne, 0, format, type, null );
- } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
+ } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
(target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_CUBE_MAP;
gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
@@ -289,7 +289,7 @@ public class Mipmap {
} else {
assert( target == GL2GL3.GL_TEXTURE_1D || target == GL2GL3.GL_PROXY_TEXTURE_1D );
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_1D;
- gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne,
+ gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne,
0, format, type, null );
}
if(gl.isGL2GL3()) {
@@ -336,15 +336,15 @@ public class Mipmap {
newHeight[0] = maxsize[0];
}
}
-
- public static void closestFit3D( GL gl, int target, int width, int height, int depth,
+
+ public static void closestFit3D( GL gl, int target, int width, int height, int depth,
int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
int[] newDepth ) {
int widthPowerOf2 = nearestPower( width );
int heightPowerOf2 = nearestPower( height );
int depthPowerOf2 = nearestPower( depth );
int[] proxyWidth = new int[1];
-
+
do {
// compute level 1 width & height & depth, clamping each at 1
int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
@@ -354,7 +354,7 @@ public class Mipmap {
assert( widthAtLevelOne > 0 );
assert( heightAtLevelOne > 0 );
assert( depthAtLevelOne > 0 );
-
+
// does width x height x depth at level 1 & all their mipmaps fit?
if( target == GL2GL3.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_3D;
@@ -378,16 +378,16 @@ public class Mipmap {
}
} while( proxyWidth[0] == 0 );
// loop must terminate
-
+
// return the width & height at level 0 that fits
newWidth[0] = widthPowerOf2;
newHeight[0] = heightPowerOf2;
newDepth[0] = depthPowerOf2;
}
-
+
public static int elements_per_group( int format, int type ) {
// Return the number of elements per grtoup of a specified gromat
-
+
// If the type is packedpixels then answer is 1
if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
@@ -403,7 +403,7 @@ public class Mipmap {
type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
return( 1 );
}
-
+
// Types are not packed pixels so get elements per group
switch( format ) {
case( GL2GL3.GL_RGB ):
@@ -418,10 +418,10 @@ public class Mipmap {
return( 1 );
}
}
-
+
public static int bytes_per_element( int type ) {
// return the number of bytes per element, based on the element type
-
+
switch( type ) {
case( GL2.GL_BITMAP ):
case( GL2GL3.GL_BYTE ):
@@ -450,17 +450,17 @@ public class Mipmap {
return( 4 );
}
}
-
+
public static boolean is_index( int format ) {
return( format == GL2.GL_COLOR_INDEX || format == GL2GL3.GL_STENCIL_INDEX );
}
-
+
/* Compute memory required for internal packed array of data of given type and format. */
-
+
public static int image_size( int width, int height, int format, int type ) {
int bytes_per_row;
int components;
-
+
assert( width > 0 );
assert( height > 0 );
components = elements_per_group( format, type );
@@ -471,17 +471,17 @@ public class Mipmap {
}
return( bytes_per_row * height * components );
}
-
+
public static int imageSize3D( int width, int height, int depth, int format, int type ) {
int components = elements_per_group( format, type );
int bytes_per_row = bytes_per_element( type ) * width;
-
+
assert( width > 0 && height > 0 && depth > 0 );
assert( type != GL2.GL_BITMAP );
-
+
return( bytes_per_row * height * depth * components );
}
-
+
public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
int[] a = new int[1];
gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
@@ -496,7 +496,7 @@ public class Mipmap {
psm.setUnpackLsbFirst( ( a[0] == 1 ) );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
psm.setUnpackSwapBytes( ( a[0] == 1 ) );
-
+
gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
psm.setPackAlignment( a[0] );
gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
@@ -510,7 +510,7 @@ public class Mipmap {
gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0);
psm.setPackSwapBytes( ( a[0] == 1 ) );
}
-
+
public static void retrieveStoreModes3D( GL gl, PixelStorageModes psm ) {
int[] a = new int[1];
gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
@@ -529,7 +529,7 @@ public class Mipmap {
psm.setUnpackSkipImages( a[0] );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
psm.setUnpackImageHeight( a[0] );
-
+
gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
psm.setPackAlignment( a[0] );
gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
@@ -547,9 +547,9 @@ public class Mipmap {
gl.glGetIntegerv( GL2GL3.GL_PACK_IMAGE_HEIGHT, a, 0 );
psm.setPackImageHeight( a[0] );
}
-
- public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
- int typein, ByteBuffer datain, int widthout, int heightout,
+
+ public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
+ int typein, ByteBuffer datain, int widthout, int heightout,
int typeout, ByteBuffer dataout ) {
int datainPos = datain.position();
int dataoutPos = dataout.position();
@@ -559,7 +559,7 @@ public class Mipmap {
ByteBuffer beforeimage;
ByteBuffer afterimage;
PixelStorageModes psm = new PixelStorageModes();
-
+
if( (widthin == 0) || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
return( 0 );
}
@@ -580,20 +580,20 @@ public class Mipmap {
if( beforeimage == null || afterimage == null ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
retrieveStoreModes( gl, psm );
Image.fill_image( psm, widthin, heightin, format, typein, is_index( format ), datain, beforeimage.asShortBuffer() );
components = elements_per_group( format, 0 );
ScaleInternal.scale_internal( components, widthin, heightin, beforeimage.asShortBuffer(), widthout, heightout, afterimage.asShortBuffer() );
Image.empty_image( psm, widthout, heightout, format, typeout, is_index( format ), afterimage.asShortBuffer(), dataout );
-
+
return( 0 );
} finally {
datain.position(datainPos);
dataout.position(dataoutPos);
}
}
-
+
public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
int width, int format, int type, int userLevel, int baseLevel,
int maxLevel, ByteBuffer data ) {
@@ -601,30 +601,30 @@ public class Mipmap {
try {
int levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
levels = computeLog( width );
-
+
levels += userLevel;
if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, width,
width, format, type, userLevel, baseLevel, maxLevel, data ) );
} finally {
data.position(dataPos);
}
}
-
+
public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
int format, int type, ByteBuffer data ) {
int dataPos = data.position();
@@ -633,54 +633,54 @@ public class Mipmap {
int[] widthPowerOf2 = new int[1];
int levels;
int[] dummy = new int[1];
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
closestFit( gl, target, width, 1, internalFormat, format, type, widthPowerOf2, dummy );
levels = computeLog( widthPowerOf2[0] );
-
- return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat,
+
+ return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat,
width, widthPowerOf2[0], format, type, 0, 0, levels, data ) );
} finally {
data.position(dataPos);
}
}
-
+
public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
int width, int height, int format, int type, int userLevel,
int baseLevel, int maxLevel, Object data ) {
int dataPos = 0;
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
levels = computeLog( width );
level = computeLog( height );
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
//PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
ByteBuffer buffer = null;
if( data instanceof ByteBuffer ) {
@@ -706,7 +706,7 @@ public class Mipmap {
FloatBuffer fb = buffer.asFloatBuffer();
fb.put( array );
}
-
+
try {
return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
width, height, width, height, format, type, userLevel, baseLevel,
@@ -716,7 +716,7 @@ public class Mipmap {
}
}
-
+
public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
int width, int height, int format, int type, Object data ) {
int dataPos = 0;
@@ -724,25 +724,25 @@ public class Mipmap {
int[] widthPowerOf2 = new int[1];
int[] heightPowerOf2 = new int[1];
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
- closestFit( gl, target, width, height, internalFormat, format, type,
+
+ closestFit( gl, target, width, height, internalFormat, format, type,
widthPowerOf2, heightPowerOf2 );
-
+
levels = computeLog( widthPowerOf2[0] );
level = computeLog( heightPowerOf2[0] );
if( level > levels ) {
levels = level;
}
-
+
//PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
ByteBuffer buffer = null;
if( data instanceof ByteBuffer ) {
@@ -768,17 +768,17 @@ public class Mipmap {
FloatBuffer fb = buffer.asFloatBuffer();
fb.put( array );
}
-
+
try {
- return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
- width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0,
+ return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
+ width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0,
0, levels, buffer ) );
} finally {
buffer.position(dataPos);
}
}
-
-
+
+
public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
int width, int height, int depth, int format, int type, ByteBuffer data ) {
int dataPos = data.position();
@@ -788,23 +788,23 @@ public class Mipmap {
int[] heightPowerOf2 = new int[1];
int[] depthPowerOf2 = new int[1];
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 || depth < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
if( type == GL2.GL_BITMAP ) {
return( GLU.GLU_INVALID_ENUM );
}
-
+
closestFit3D( gl, target, width, height, depth, internalFormat, format,
type, widthPowerOf2, heightPowerOf2, depthPowerOf2 );
-
+
levels = computeLog( widthPowerOf2[0] );
level = computeLog( heightPowerOf2[0] );
if( level > levels ) {
@@ -814,7 +814,7 @@ public class Mipmap {
if( level > levels ) {
levels = level;
}
-
+
return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
height, depth, widthPowerOf2[0], heightPowerOf2[0], depthPowerOf2[0],
format, type, 0, 0, levels, data ) );
@@ -822,27 +822,27 @@ public class Mipmap {
data.position(dataPos);
}
}
-
+
public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
int width, int height, int depth, int format, int type, int userLevel,
int baseLevel, int maxLevel, ByteBuffer data ) {
int dataPos = data.position();
try {
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 || depth < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
if( type == GL2.GL_BITMAP ) {
return( GLU.GLU_INVALID_ENUM );
}
-
+
levels = computeLog( width );
level = computeLog( height );
if( level > levels ) {
@@ -852,12 +852,12 @@ public class Mipmap {
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
height, depth, width, height, depth, format, type, userLevel,
baseLevel, maxLevel, data ) );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
index 0b1af8323..7eb98db35 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -129,7 +129,7 @@ public class PixelStorageModes {
* Holds value of property unpackImageHeight.
*/
private int unpackImageHeight;
-
+
/** Creates a new instance of PixelStorageModes */
public PixelStorageModes() {
}
@@ -421,6 +421,6 @@ public class PixelStorageModes {
this.unpackImageHeight = unpackImageHeight;
}
-
-
+
+
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
index 9c95ae304..9aca1fb03 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -55,9 +55,9 @@ import com.jogamp.common.nio.Buffers;
* @author Administrator
*/
public class ScaleInternal {
-
+
public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
-
+
public static void scale_internal( int components, int widthin, int heightin,
ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
float x, lowx, highx, convx, halfconvx;
@@ -69,7 +69,7 @@ public class ScaleInternal {
float area;
int i, j, k, yint, xint, xindex, yindex;
int temp;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
HalveImage.halveImage( components, widthin, heightin, datain, dataout );
return;
@@ -101,7 +101,7 @@ public class ScaleInternal {
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
area = 0.0f;
-
+
y = lowy;
yint = (int)Math.floor( y );
while( y < highy ) {
@@ -111,10 +111,10 @@ public class ScaleInternal {
} else {
ypercent = yint + 1 - y;
}
-
+
x = lowx;
xint = (int)Math.floor( x );
-
+
while( x < highx ) {
xindex = ( xint + widthin ) % widthin;
if( highx < xint + 1 ) {
@@ -122,21 +122,21 @@ public class ScaleInternal {
} else {
xpercent = xint + 1 - x;
}
-
+
percent = xpercent * ypercent;
area += percent;
temp = ( xindex + ( yindex * widthin) ) * components;
for( k = 0; k < components; k++ ) {
- totals[k] += datain.get( temp + k ) * percent;
+ totals[k] += datain.get( temp + k ) * percent;
}
-
+
xint++;
x = xint;
}
yint++;
y = yint;
}
-
+
temp = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
// totals[] should be rounded in the case of enlarging an RGB
@@ -146,9 +146,9 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_ubyte( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
+ ByteBuffer datain, int widthout, int heightout,
ByteBuffer dataout, int element_size, int ysize, int group_size ) {
float x, convx;
float y, convy;
@@ -157,11 +157,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -169,9 +169,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size );
return;
}
@@ -181,14 +181,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -204,19 +204,19 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -239,7 +239,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += ( 0x000000FF & datain.get() ) * percent;
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -261,7 +261,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += ( 0x000000FF & datain.get() ) * percent;
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -339,7 +339,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -371,9 +371,9 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_byte( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
+ ByteBuffer datain, int widthout, int heightout,
ByteBuffer dataout, int element_size, int ysize,
int group_size ) {
float x, convx;
@@ -383,11 +383,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -395,9 +395,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size );
return;
}
@@ -407,14 +407,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -430,18 +430,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -464,7 +464,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += datain.get() * percent;
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -486,7 +486,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += datain.get() * percent;
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -550,7 +550,7 @@ public class ScaleInternal {
totals[k] += datain.get() * percent;
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -564,7 +564,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -596,10 +596,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_ushort( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- ShortBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ ShortBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -608,11 +608,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -620,9 +620,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -632,14 +632,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -655,18 +655,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -701,7 +701,7 @@ public class ScaleInternal {
totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -735,7 +735,7 @@ public class ScaleInternal {
totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -834,7 +834,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -852,7 +852,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -884,10 +884,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_short( int components, int widthin, int heightin,
ByteBuffer datain, int widthout, int heightout,
- ShortBuffer dataout, int element_size, int ysize,
+ ShortBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -896,11 +896,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -908,11 +908,11 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
int swapbuf; // unsigned buffer
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_short( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_short( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -922,14 +922,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -945,18 +945,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -994,7 +994,7 @@ public class ScaleInternal {
totals[k] += datain.getShort() * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1031,7 +1031,7 @@ public class ScaleInternal {
totals[k] += datain.getShort() * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -1137,7 +1137,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1156,7 +1156,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -1188,10 +1188,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_uint( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- IntBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -1200,11 +1200,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -1212,9 +1212,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -1224,14 +1224,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -1247,18 +1247,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -1293,7 +1293,7 @@ public class ScaleInternal {
totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1327,7 +1327,7 @@ public class ScaleInternal {
totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -1427,7 +1427,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1445,7 +1445,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
float value = 0.0f;
for( k = 0; k < components; k++ ) {
@@ -1483,10 +1483,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_int( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- IntBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -1495,11 +1495,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -1507,11 +1507,11 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
long swapbuf; // unsigned buffer
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_int( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_int( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -1521,14 +1521,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -1544,18 +1544,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -1593,7 +1593,7 @@ public class ScaleInternal {
totals[k] += datain.getInt() * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1630,7 +1630,7 @@ public class ScaleInternal {
totals[k] += datain.getInt() * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -1736,7 +1736,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1755,7 +1755,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -1787,10 +1787,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_float( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- FloatBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ FloatBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -1799,11 +1799,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -1811,11 +1811,11 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
float swapbuf; // unsigned buffer
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_float( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_float( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -1825,14 +1825,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -1848,18 +1848,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -1897,7 +1897,7 @@ public class ScaleInternal {
totals[k] += datain.getFloat() * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1934,7 +1934,7 @@ public class ScaleInternal {
totals[k] += datain.getFloat() * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -2040,7 +2040,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -2059,7 +2059,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -2091,28 +2091,28 @@ public class ScaleInternal {
}
}
}
-
- public static void scaleInternalPackedPixel( int components, Extract extract,
+
+ public static void scaleInternalPackedPixel( int components, Extract extract,
int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
int rowSizeInBytes, boolean isSwap ) {
float x, convx;
float y, convy;
float percent;
-
+
// max components in a format is 4, so
float[] totals = new float[4];
float[] extractTotals = new float[4];
float[] extractMoreTotals = new float[4];
float[] shoveTotals = new float[4];
-
+
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outIndex = 0;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -2120,7 +2120,7 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( widthIn == widthOut * 2 && heightIn == heightOut * 2 ) {
HalveImage.halveImagePackedPixel( components, extract, widthIn, heightIn, dataIn, dataOut,
pixelSizeInBytes, rowSizeInBytes, isSwap );
@@ -2132,14 +2132,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convx_float;
-
+
for( i = 0; i < heightOut; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightIn)
@@ -2148,16 +2148,16 @@ public class ScaleInternal {
lowx_float = 0.0f;
highx_int = convx_int;
highx_float = convx_float;
-
+
for( j = 0; j < widthOut; j++ ) {
// ok now apply box filter to box that goes from( lowx, lowy )
// to ( highx, highy ) on input data into this pixel on output data
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// calculate that value for pixels in the 1st row
xindex = lowx_int * pixelSizeInBytes;
if( (highy_int > lowy_int) && (highx_int > lowx_int) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * rowSizeInBytes;
percent = y_percent * ( 1 - lowx_float );
@@ -2184,7 +2184,7 @@ public class ScaleInternal {
totals[k] += extractTotals[k] * percent;
}
// calculate the value for pixels in the last row
-
+
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
temp = xindex + highy_int * rowSizeInBytes;
@@ -2207,7 +2207,7 @@ public class ScaleInternal {
for( k = 0; k < components; k++ ) {
totals[k] += extractTotals[k] * percent;
}
-
+
// calculate the value for pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += rowSizeInBytes;
@@ -2277,7 +2277,7 @@ public class ScaleInternal {
totals[k] += extractTotals[k] * percent;
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + pixelSizeInBytes + ( lowy_int + 1 ) * rowSizeInBytes;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -2292,7 +2292,7 @@ public class ScaleInternal {
}
temp0 += rowSizeInBytes;
}
-
+
outIndex = ( j + ( i * widthOut ) );
for( k = 0; k < components; k++ ) {
shoveTotals[k] = totals[k] / area;
@@ -2325,7 +2325,7 @@ public class ScaleInternal {
}
assert( outIndex == ( widthOut * heightOut - 1) );
}
-
+
public static void scaleInternal3D( int components, int widthIn, int heightIn,
int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
int depthOut, ShortBuffer dataOut ) {
@@ -2339,9 +2339,9 @@ public class ScaleInternal {
float volume;
int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
int temp;
-
+
lowy = highy = lowx = highx = 0.0f;
-
+
convz = (float)depthIn / depthOut;
convy = (float)heightIn / heightOut;
convx = (float)widthIn / widthOut;
@@ -2375,13 +2375,13 @@ public class ScaleInternal {
highz = x + 0.5f;
lowz = x - 0.5f;
}
-
+
// Ok, now apply box filter to box that goes from ( lowx, lowy, lowz )
// to ( highx, highy, highz ) on input data into this pixel on output data
-
+
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
volume = 0.0f;
-
+
z = lowz;
zint = (int)(Math.floor( z ) );
while( z < highz ) {
@@ -2391,7 +2391,7 @@ public class ScaleInternal {
} else {
zpercent = zint + 1 - z;
}
-
+
y = lowy;
yint = (int)(Math.floor( y ) );
while( y < highy ) {
@@ -2401,10 +2401,10 @@ public class ScaleInternal {
} else {
ypercent = yint + 1 - y;
}
-
+
x = lowx;
xint = (int)(Math.floor( x ) );
-
+
while( x < highx ) {
xindex = (xint + widthIn ) % widthIn;
if( highx < xint + 1 ) {
@@ -2412,10 +2412,10 @@ public class ScaleInternal {
} else {
xpercent = xint + 1 - x;
}
-
+
percent = xpercent * ypercent * zpercent;
volume += percent;
-
+
temp = (xindex + ( yindex *widthIn) + (zindex * widthIn *heightIn)) * components;
for( k = 0; k < components; k++ ) {
assert( 0 <= (temp+k) && (temp+k) < (widthIn * heightIn * depthIn * components) );
@@ -2430,7 +2430,7 @@ public class ScaleInternal {
zint++;
z = zint;
} // while z
-
+
temp = ( j + ( i * widthOut ) + (d * widthOut * heightOut ) ) * components;
for( k = 0; k < components; k++ ) {
// totals should be rounded in the case of enlarging an rgb ramp when the type is 332 or 4444
@@ -2441,48 +2441,48 @@ public class ScaleInternal {
}
}
}
-
- public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
- int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
+
+ public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
+ int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
int depthOut, int typeOut, ByteBuffer dataOut ) {
int components;
ShortBuffer beforeImage, afterImage;
PixelStorageModes psm = new PixelStorageModes();
-
+
if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
return( 0 );
}
-
+
if( widthIn < 0 || heightIn < 0 || depthIn < 0 ||
widthOut < 0 || heightOut < 0 || depthOut < 0 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
- if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) ||
+
+ if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) ||
!Mipmap.legalType(typeOut) || typeIn == GL2.GL_BITMAP ||
typeOut == GL2.GL_BITMAP ) {
return( GLU.GLU_INVALID_ENUM );
}
-
+
if( !Mipmap.isLegalFormatForPackedPixelType( format, typeIn ) ) {
return( GLU.GLU_INVALID_OPERATION );
}
-
+
if( !Mipmap.isLegalFormatForPackedPixelType( format, typeOut ) ) {
return( GLU.GLU_INVALID_OPERATION );
}
-
+
try {
- beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
+ beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
- afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
+ afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError err ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
Mipmap.retrieveStoreModes3D( gl, psm );
-
+
Image.fillImage3D( psm, widthIn, heightIn, depthIn, format, typeIn,
Mipmap.is_index( format ), dataIn, beforeImage );
components = Mipmap.elements_per_group( format, 0 );
@@ -2490,7 +2490,7 @@ public class ScaleInternal {
beforeImage, widthOut, heightOut, depthOut, afterImage );
Image.emptyImage3D( psm, widthOut, heightOut, depthOut, format, typeOut,
Mipmap.is_index( format ), afterImage, dataOut );
-
+
return( 0 );
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
index 38113f601..dc401880d 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,176 +51,176 @@ import java.nio.*;
* @author Administrator
*/
public class Type_Widget {
-
+
ByteBuffer buffer;
-
+
/** Creates a new instance of Type_Widget */
public Type_Widget() {
// can't make this direct, because JVM doesn't allocate small direct buffers efficiently
// see https://jogamp.org/bugzilla/show_bug.cgi?id=463 for details
buffer = ByteBuffer.allocate( 4 );
}
-
+
public void setUB0( byte b ) {
buffer.position( 0 );
buffer.put( b );
}
-
+
public byte getUB0() {
buffer.position( 0 );
return( buffer.get() );
}
-
+
public void setUB1( byte b ) {
buffer.position( 1 );
buffer.put( b );
}
-
+
public byte getUB1() {
buffer.position( 1 );
return( buffer.get() );
}
-
+
public void setUB2( byte b ) {
buffer.position( 2 );
buffer.put( b );
}
-
+
public byte getUB2() {
buffer.position( 2 );
return( buffer.get() );
}
-
+
public void setUB3( byte b ) {
buffer.position( 3 );
buffer.put( b );
}
-
+
public byte getUB3() {
buffer.position( 3 );
return( buffer.get() );
}
-
+
public void setUS0( short s ) {
buffer.position( 0 );
buffer.putShort( s );
}
-
+
public short getUS0() {
buffer.position( 0 );
return( buffer.getShort() );
}
-
+
public void setUS1( short s ) {
buffer.position( 2 );
buffer.putShort( s );
}
-
+
public short getUS1() {
buffer.position( 2 );
return( buffer.getShort() );
}
-
+
public void setUI( int i ) {
buffer.position( 0 );
buffer.putInt( i );
}
-
+
public int getUI() {
buffer.position( 0 );
return( buffer.getInt() );
}
-
+
public void setB0( byte b ) {
buffer.position( 0 );
buffer.put( b );
}
-
+
public byte getB0() {
buffer.position( 0 );
return( buffer.get() );
}
-
+
public void setB1( byte b ) {
buffer.position( 1 );
buffer.put( b );
}
-
+
public byte getB1() {
buffer.position( 1 );
return( buffer.get() );
}
-
+
public void setB2( byte b ) {
buffer.position( 2 );
buffer.put( b );
}
-
+
public byte getB2() {
buffer.position( 2 );
return( buffer.get() );
}
-
+
public void setB3( byte b ) {
buffer.position( 3 );
buffer.put( b );
}
-
+
public byte getB3() {
buffer.position( 3 );
return( buffer.get() );
}
-
+
public void setS0( short s ) {
buffer.position( 0 );
buffer.putShort( s );
}
-
+
public short getS0() {
buffer.position( 0 );
return( buffer.getShort() );
}
-
+
public void setS1( short s ) {
buffer.position( 2 );
buffer.putShort( s );
}
-
+
public short getS1() {
buffer.position( 2 );
return( buffer.getShort() );
}
-
+
public void setI( int i ) {
buffer.position( 0 );
buffer.putInt( i );
}
-
+
public int getI() {
buffer.position( 0 );
return( buffer.getInt() );
}
-
+
public void setF( float f ) {
buffer.position( 0 );
buffer.putFloat( f );
}
-
+
public float getF() {
buffer.position( 0 );
return( buffer.getFloat() );
}
-
+
public ByteBuffer getBuffer() {
buffer.rewind();
return( buffer );
}
-
+
public static void main( String args[] ) {
Type_Widget t = new Type_Widget();
t.setI( 1000000 );
-
+
System.out.println("int: " + Integer.toHexString( t.getI() ) );
-
+
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
index 422f8d4df..df2b9a147 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
@@ -72,7 +72,7 @@ public class Arc {
/**
* Makes new arc at specified side
- *
+ *
* @param side
* which side doeas this arc form
*/
@@ -86,7 +86,7 @@ public class Arc {
/**
* Sets side the arc is at
- *
+ *
* @param side
* arc side
*/
@@ -104,7 +104,7 @@ public class Arc {
type &= ~(0x7 << 8);
}
- // this one replaces enum arc_side
+ // this one replaces enum arc_side
/**
* Side not specified
*/
@@ -147,7 +147,7 @@ public class Arc {
/**
* Appends arc to the list
- *
+ *
* @param jarc
* arc to be append
* @return this
@@ -169,7 +169,7 @@ public class Arc {
/**
* Unused
- *
+ *
* @return true
*/
public boolean check() {
@@ -187,7 +187,7 @@ public class Arc {
/**
* Returns tail of linked list coords
- *
+ *
* @return tail coords
*/
public float[] tail() {
@@ -197,7 +197,7 @@ public class Arc {
/**
* Returns head of linked list coords
- *
+ *
* @return head coords
*/
public float[] head() {
@@ -207,7 +207,7 @@ public class Arc {
/**
* Returns whether arc is marked with arc_tag
- *
+ *
* @return is arc marked with arc_tag
*/
public boolean ismarked() {
@@ -241,7 +241,7 @@ public class Arc {
/**
* Returns whether arc is marked tail
- *
+ *
* @return is tail
*/
public boolean getitail() {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
index f4ad70193..c299b10af 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
@@ -44,7 +44,7 @@ public class ArcSdirSorter {
/**
* Makes new ArcSdirSorter with Subdivider
* @param subdivider subdivider
- */
+ */
public ArcSdirSorter(Subdivider subdivider) {
//TODO
// System.out.println("TODO arcsdirsorter.constructor");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
index be72c53d2..1a584c396 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
@@ -43,7 +43,7 @@ public class ArcTdirSorter {
/**
* Makes new ArcSdirSorter with Subdivider
* @param subdivider subdivider
- */
+ */
public ArcTdirSorter(Subdivider subdivider) {
// TODO Auto-generated constructor stub
// System.out.println("TODO arcTsorter.konstruktor");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
index 610a19556..3e974247b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
@@ -67,7 +67,7 @@ public abstract class Backend {
protected SurfaceEvaluator surfaceEvaluator;
/**
- * Makes new backend
+ * Makes new backend
*/
public Backend() {
// curveEvaluator = new OpenGLCurveEvaluator();
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
index df8b16ab5..17437ef01 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
@@ -143,7 +143,7 @@ public class Bin {
/**
* Returns next arc in linked list
* @return next arc
- *
+ *
*/
private Arc nextarc() {
// DONE
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
index f45571dac..f84640d28 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class holding break point parameters
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Breakpt {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
index aaa8cb5f2..b67764c30 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfArcs {
/**
@@ -24,7 +24,7 @@ public class CArrayOfArcs {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -38,7 +38,7 @@ public class CArrayOfArcs {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -50,7 +50,7 @@ public class CArrayOfArcs {
/**
* Makes new CArray with pointer set to 0
- *
+ *
* @param ctlarray
* underlaying array
*/
@@ -61,7 +61,7 @@ public class CArrayOfArcs {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public Arc get() {
@@ -78,7 +78,7 @@ public class CArrayOfArcs {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -89,7 +89,7 @@ public class CArrayOfArcs {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -100,7 +100,7 @@ public class CArrayOfArcs {
/**
* Returns array element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @return element at relative index
@@ -111,7 +111,7 @@ public class CArrayOfArcs {
/**
* Sets value of element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @param value
@@ -123,7 +123,7 @@ public class CArrayOfArcs {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -134,7 +134,7 @@ public class CArrayOfArcs {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -143,7 +143,7 @@ public class CArrayOfArcs {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -156,7 +156,7 @@ public class CArrayOfArcs {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
@@ -175,7 +175,7 @@ public class CArrayOfArcs {
/**
* Returns underlaying array
- *
+ *
* @return underlaying array
*/
public Arc[] getArray() {
@@ -184,7 +184,7 @@ public class CArrayOfArcs {
/**
* Sets underlaying array
- *
+ *
* @param array
* underlaying array
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
index 5112b07fc..b5f588960 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfBreakpts {
/**
@@ -19,7 +19,7 @@ public class CArrayOfBreakpts {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -32,7 +32,7 @@ public class CArrayOfBreakpts {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -43,7 +43,7 @@ public class CArrayOfBreakpts {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public Breakpt get() {
@@ -59,7 +59,7 @@ public class CArrayOfBreakpts {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -70,7 +70,7 @@ public class CArrayOfBreakpts {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -81,7 +81,7 @@ public class CArrayOfBreakpts {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -92,7 +92,7 @@ public class CArrayOfBreakpts {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -101,7 +101,7 @@ public class CArrayOfBreakpts {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -111,7 +111,7 @@ public class CArrayOfBreakpts {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
index 39ef841ec..d9e4d0ff1 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfFloats {
@@ -25,7 +25,7 @@ public class CArrayOfFloats {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -39,7 +39,7 @@ public class CArrayOfFloats {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -51,7 +51,7 @@ public class CArrayOfFloats {
/**
* Makes new CArray with pointer set to 0
- *
+ *
* @param ctlarray
* underlaying array
*/
@@ -62,7 +62,7 @@ public class CArrayOfFloats {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public float get() {
@@ -79,7 +79,7 @@ public class CArrayOfFloats {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -90,7 +90,7 @@ public class CArrayOfFloats {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -101,7 +101,7 @@ public class CArrayOfFloats {
/**
* Returns array element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @return element at relative index
@@ -112,7 +112,7 @@ public class CArrayOfFloats {
/**
* Sets value of element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @param value
@@ -124,7 +124,7 @@ public class CArrayOfFloats {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -135,7 +135,7 @@ public class CArrayOfFloats {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -144,7 +144,7 @@ public class CArrayOfFloats {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -157,7 +157,7 @@ public class CArrayOfFloats {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
@@ -176,7 +176,7 @@ public class CArrayOfFloats {
/**
* Returns underlaying array
- *
+ *
* @return underlaying array
*/
public float[] getArray() {
@@ -185,7 +185,7 @@ public class CArrayOfFloats {
/**
* Sets underlaying array
- *
+ *
* @param array
* underlaying array
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
index 4b21f2d50..e7bbac16a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfQuiltspecs {
/**
@@ -19,7 +19,7 @@ public class CArrayOfQuiltspecs {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -32,7 +32,7 @@ public class CArrayOfQuiltspecs {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -43,7 +43,7 @@ public class CArrayOfQuiltspecs {
/**
* Makes new CArray with pointer set to 0
- *
+ *
* @param array
* underlaying array
*/
@@ -54,7 +54,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public Quiltspec get() {
@@ -70,7 +70,7 @@ public class CArrayOfQuiltspecs {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -81,7 +81,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -92,7 +92,7 @@ public class CArrayOfQuiltspecs {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -103,7 +103,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -112,7 +112,7 @@ public class CArrayOfQuiltspecs {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -122,7 +122,7 @@ public class CArrayOfQuiltspecs {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
@@ -141,7 +141,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns underlaying array
- *
+ *
* @return underlaying array
*/
public Quiltspec[] getArray() {
@@ -150,7 +150,7 @@ public class CArrayOfQuiltspecs {
/**
* Sets underlaying array
- *
+ *
* @param array
* underlaying array
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
index 786781723..ea3a3d14e 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
@@ -103,7 +103,7 @@ public class Curve {
/**
* Makes new Curve
- *
+ *
* @param geo
* @param pta
* @param ptb
@@ -143,7 +143,7 @@ public class Curve {
range[0] = qs.get().breakpoints[qs.get().index];
range[1] = qs.get().breakpoints[qs.get().index + 1];
range[2] = range[1] - range[0];
- // TODO it is necessary to solve problem with "this" pointer here
+ // TODO it is necessary to solve problem with "this" pointer here
if (range[0] != pta[0]) {
// System.out.println("TODO curve.Curve-range0");
// Curve lower=new Curve(this,pta,0);
@@ -229,7 +229,7 @@ public class Curve {
/**
* Tells whether curve needs subdivision
- *
+ *
* @return curve needs subdivison
*/
public boolean needsSamplingSubdivision() {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
index 6983691d9..f9c4c2d6f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
@@ -45,12 +45,12 @@ public class Flist {
/**
* Data elements end index
- *
+ *
*/
public int end;
/**
- *Data elements start index
+ *Data elements start index
*/
public int start;
@@ -80,7 +80,7 @@ public class Flist {
}
/**
- * Removes duplicate array elemnts
+ * Removes duplicate array elemnts
*/
public void filter() {
// INFO the aim of this method is to remove duplicates from array
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
index 114832a1c..1dcf393a9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Knot vector specification
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Knotspec {
@@ -314,7 +314,7 @@ public class Knotspec {
/**
* Copies control points
- *
+ *
* @param _inpt
* input control points
* @param _outpt
@@ -346,7 +346,7 @@ public class Knotspec {
/**
* Copies one control point to other
- *
+ *
* @param topt
* source control point
* @param frompt
@@ -374,7 +374,7 @@ public class Knotspec {
/**
* Inserts a knot
- *
+ *
* @param _p
* inserted knot
*/
@@ -402,7 +402,7 @@ public class Knotspec {
}
}
- } else {//code for curve
+ } else {//code for curve
if (this.equals(kspectotrans)) {
insert(p);
} else {
@@ -428,7 +428,7 @@ public class Knotspec {
/**
* Inserts a knot and computes new control points
- *
+ *
* @param p
* inserted knot
*/
@@ -490,7 +490,7 @@ public class Knotspec {
/**
* Copies one control point to another
- *
+ *
* @param topt
* source ctrl point
* @param frompt
@@ -519,7 +519,7 @@ public class Knotspec {
/**
* Computes new control point
- *
+ *
* @param x
* first point
* @param y
@@ -549,7 +549,7 @@ public class Knotspec {
* z.getRelative(0)));
break;
default:
- //no need of default - see previous method and its case statement
+ //no need of default - see previous method and its case statement
// System.out.println("TODO pt_oo_sum default");
break;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
index aac4dfc52..571f44f06 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Knot vector used in curve specification
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Knotvector {
@@ -75,7 +75,7 @@ public class Knotvector {
/**
* Makes new knotvector
- *
+ *
* @param nknots
* number of knots
* @param stride
@@ -92,7 +92,7 @@ public class Knotvector {
/**
* Initializes knotvector
- *
+ *
* @param nknots
* number of knots
* @param stride
@@ -116,7 +116,7 @@ public class Knotvector {
/**
* Validates knot vector parameters
- *
+ *
* @return knot vector validity
*/
public int validate() {
@@ -154,7 +154,7 @@ public class Knotvector {
/**
* Show specified message
- *
+ *
* @param msg
* message to be shown
*/
@@ -166,7 +166,7 @@ public class Knotvector {
/**
* Compares two knots for equality
- *
+ *
* @param a
* first knot
* @param b
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
index bd5d2db98..86638a827 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
@@ -112,7 +112,7 @@ public class Mapdesc {
float clampfactor;
/**
- * Value of N_MINSAVINGS property
+ * Value of N_MINSAVINGS property
*/
private float minsavings;
@@ -162,7 +162,7 @@ public class Mapdesc {
private float[] bboxsize;
/**
- * Makes new mapdesc
+ * Makes new mapdesc
* @param type map type
* @param rational is rational
* @param ncoords number of control points coords
@@ -318,7 +318,7 @@ public class Mapdesc {
}
/**
- * Tells whether map is culling
+ * Tells whether map is culling
* @return is map culling
*/
public boolean isCulling() {
@@ -327,7 +327,7 @@ public class Mapdesc {
}
/**
- * Tells whether map is constantly sampling
+ * Tells whether map is constantly sampling
* @return is map constant sampling
*/
public boolean isConstantSampling() {
@@ -335,7 +335,7 @@ public class Mapdesc {
}
/**
- * Tells whether map is domain sampling
+ * Tells whether map is domain sampling
* @return is map domain sampling
*/
public boolean isDomainSampling() {
@@ -343,7 +343,7 @@ public class Mapdesc {
}
/**
- * Returns property of specified tag value
+ * Returns property of specified tag value
* @param tag property tag
* @return property value
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
index 05c89ebcf..a686da696 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
@@ -68,7 +68,7 @@ public class O_nurbscurve {
/**
* Makes new O_nurbscurve
- * @param realType type of curve
+ * @param realType type of curve
*/
public O_nurbscurve(int realType) {
// DONE
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
index f1e499a28..8c2922565 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
@@ -52,7 +52,7 @@ public class Patchlist {
private Patch patch;
/**
- * Makes new list of patches
+ * Makes new list of patches
* @param quilts list of quilts
* @param pta low border
* @param ptb high border
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
index 25b4dc441..79f36ce43 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class representing property
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Property {
@@ -59,7 +59,7 @@ public class Property {
/**
* Makes new property with given parameters
- *
+ *
* @param type
* property type
* @param tag
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
index 4729e2421..7c636122f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
@@ -35,7 +35,7 @@ package jogamp.opengl.glu.nurbs;
*/
/**
- * Class holding rendering params
+ * Class holding rendering params
* @author Tomas Hrasky
*
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
index 37774f811..4d8296cca 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
@@ -41,7 +41,7 @@ package jogamp.opengl.glu.nurbs;
*/
public class Subdivider {
/**
- * Cull type
+ * Cull type
*/
public static final int CULL_TRIVIAL_REJECT = 0;
@@ -76,7 +76,7 @@ public class Subdivider {
private int subdivisions;
/**
- * U step when using domain distance sampling
+ * U step when using domain distance sampling
*/
private float domain_distance_u_rate;
@@ -375,7 +375,7 @@ public class Subdivider {
}
/**
- * Sample
+ * Sample
* @param source
* @param patchlist
* @param subdivisions
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
index e88d69709..1025afb7c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Holds vertex used in trim
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class TrimVertex {
diff --git a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
index 3d669d9bb..9c8523e51 100644
--- a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
+++ b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import javax.media.opengl.glu.GLU;
* @author Administrator
*/
public class Registry {
-
+
/** Creates a new instance of Registry */
public Registry() {
}
-
+
public static String gluGetString(int name) {
if( name == GLU.GLU_VERSION ) {
return( "1.3" );
@@ -64,7 +64,7 @@ public class Registry {
}
return( null );
}
-
+
public static boolean gluCheckExtension( String extName, String extString ) {
if( extName == null || extString == null ) {
return( false );
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 0828d1dc3..5cc4003fe 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -80,7 +80,7 @@ import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
public class MacOSXCGLContext extends GLContextImpl
-{
+{
// Abstract interface for implementation of this context (either
// NSOpenGL-based or CGL-based)
protected interface GLBackendImpl {
@@ -140,13 +140,13 @@ public class MacOSXCGLContext extends GLContextImpl
}
private static final String shaderBasename = "texture01_xxx";
-
+
private static ShaderProgram createCALayerShader(GL3ES3 gl) {
// Create & Link the shader program
final ShaderProgram sp = new ShaderProgram();
- final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class,
+ final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class,
"../../shader", "../../shader/bin", shaderBasename, true);
- final ShaderCode fp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MacOSXCGLContext.class,
+ final ShaderCode fp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MacOSXCGLContext.class,
"../../shader", "../../shader/bin", shaderBasename, true);
vp.defaultShaderCustomization(gl, true, true);
fp.defaultShaderCustomization(gl, true, true);
@@ -162,7 +162,7 @@ public class MacOSXCGLContext extends GLContextImpl
pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
- pmvMatrix.glLoadIdentity();
+ pmvMatrix.glLoadIdentity();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
pmvMatrixUniform.setLocation(gl, sp.program());
gl.glUniform(pmvMatrixUniform);
@@ -170,8 +170,8 @@ public class MacOSXCGLContext extends GLContextImpl
sp.useProgram(gl, false);
return sp;
}
-
-
+
+
private boolean haveSetOpenGLMode = false;
private GLBackendType openGLMode = GLBackendType.NSOPENGL;
@@ -185,7 +185,7 @@ public class MacOSXCGLContext extends GLContextImpl
private long updateHandle = 0;
private int lastWidth, lastHeight;
-
+
protected MacOSXCGLContext(GLDrawableImpl drawable,
GLContext shareWith) {
super(drawable, shareWith);
@@ -303,7 +303,7 @@ public class MacOSXCGLContext extends GLContextImpl
@Override
protected void makeCurrentImpl() throws GLException {
/** FIXME: won't work w/ special drawables (like FBO) - check for CGL mode regressions!
- *
+ *
if (getOpenGLMode() != ((MacOSXCGLDrawable)drawable).getOpenGLMode()) {
setOpenGLMode(((MacOSXCGLDrawable)drawable).getOpenGLMode());
} */
@@ -327,7 +327,7 @@ public class MacOSXCGLContext extends GLContextImpl
throw new GLException("Error destroying OpenGL Context: "+this);
}
}
-
+
private final long getUpdateHandle() {
if( 0 == updateHandle ) {
lastWidth = -1;
@@ -340,7 +340,7 @@ public class MacOSXCGLContext extends GLContextImpl
} else {
incompleteView = false;
}
- if(!incompleteView) {
+ if(!incompleteView) {
updateHandle = CGL.updateContextRegister(contextHandle, drawable.getHandle());
if(0 == updateHandle) {
throw new InternalError("XXX2");
@@ -350,14 +350,14 @@ public class MacOSXCGLContext extends GLContextImpl
}
return updateHandle;
}
-
+
private final void releaseUpdateHandle() {
if ( 0 != updateHandle ) {
CGL.updateContextUnregister(updateHandle);
updateHandle = 0;
- }
+ }
}
-
+
@Override
protected void drawableUpdatedNotify() throws GLException {
if( drawable.getChosenGLCapabilities().isOnscreen() ) {
@@ -376,7 +376,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
}
}
-
+
@Override
protected void associateDrawable(boolean bound) {
// context stuff depends on drawable stuff
@@ -390,12 +390,12 @@ public class MacOSXCGLContext extends GLContextImpl
super.associateDrawable(false); // 2) free drawable stuff
}
}
-
+
/* pp */ void detachPBuffer() {
impl.detachPBuffer();
}
-
+
@Override
protected void copyImpl(GLContext source, int mask) throws GLException {
if( isNSContext() != ((MacOSXCGLContext)source).isNSContext() ) {
@@ -429,7 +429,7 @@ public class MacOSXCGLContext extends GLContextImpl
// FIXME: apparently the Apple extension doesn't require a custom memory allocator
throw new GLException("Not yet implemented");
}
-
+
@Override
protected final void updateGLXProcAddressTable() {
final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration();
@@ -520,11 +520,11 @@ public class MacOSXCGLContext extends GLContextImpl
private int lastWidth=0, lastHeight=0; // allowing to detect size change
private boolean needsSetContextPBuffer = false;
private ShaderProgram gl3ShaderProgram = null;
-
+
@Override
public boolean isNSContext() { return true; }
-
+
/** Only returns a valid NSView. If !NSView, return null and mark either pbuffer and FBO. */
private long getNSViewHandle(boolean[] isPBuffer, boolean[] isFBO) {
final long nsViewHandle;
@@ -558,11 +558,11 @@ public class MacOSXCGLContext extends GLContextImpl
needsSetContextPBuffer = isPBuffer[0];
return nsViewHandle;
}
-
+
@Override
public long create(long share, int ctp, int major, int minor) {
long ctx = 0;
- final NativeSurface surface = drawable.getNativeSurface();
+ final NativeSurface surface = drawable.getNativeSurface();
final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) surface.getGraphicsConfiguration();
final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
final long nsViewHandle;
@@ -606,7 +606,7 @@ public class MacOSXCGLContext extends GLContextImpl
if( !_fixedCaps.isPBuffer() && isPBuffer ) {
throw new InternalError("handle is PBuffer, fixedCaps not: "+drawable);
}
- // determine on-/offscreen caps, since pformat is ambiguous
+ // determine on-/offscreen caps, since pformat is ambiguous
_fixedCaps.setPBuffer( isPBuffer ); // exclusive
_fixedCaps.setBitmap( false ); // n/a in our OSX impl.
_fixedCaps.setOnscreen( !isFBO && !isPBuffer );
@@ -632,7 +632,7 @@ public class MacOSXCGLContext extends GLContextImpl
// Thread.dumpStack();
}
config.setChosenCapabilities(fixedCaps);
-
+
final IntBuffer viewNotReady = Buffers.newDirectIntBuffer(1);
// Try to allocate a context with this
ctx = CGL.createContext(share, nsViewHandle, incompleteView,
@@ -665,12 +665,12 @@ public class MacOSXCGLContext extends GLContextImpl
*
* Since NSOpenGLLayer creation requires this context for it's shared context creation,
* this method attempts to acquire the surface and context lock with {@link #screenVSyncTimeout}/2 maximum wait time.
- * If the surface and context lock could not be acquired, this runnable is being re-queued for later execution.
+ * If the surface and context lock could not be acquired, this runnable is being re-queued for later execution.
*
*
* Hence this method blocks the main-thread only for a short period of time.
*
- */
+ */
class AttachGLLayerCmd implements Runnable {
final OffscreenLayerSurface ols;
final long ctx;
@@ -685,7 +685,7 @@ public class MacOSXCGLContext extends GLContextImpl
long nsOpenGLLayer;
/** Synchronized by instance's monitor */
boolean valid;
-
+
AttachGLLayerCmd(OffscreenLayerSurface ols, long ctx, int shaderProgram, long pfmt, long pbuffer, int texID, boolean isOpaque, int width, int height) {
this.ols = ols;
this.ctx = ctx;
@@ -699,23 +699,23 @@ public class MacOSXCGLContext extends GLContextImpl
this.valid = false;
this.nsOpenGLLayer = 0;
}
-
+
public final String contentToString() {
return "valid "+valid+", size "+width+"x"+height+", ctx "+toHexString(ctx)+", opaque "+isOpaque+", texID "+texID+", pbuffer "+toHexString(pbuffer)+", nsOpenGLLayer "+toHexString(nsOpenGLLayer);
}
-
+
@Override
public final String toString() {
return "AttachGLLayerCmd["+contentToString()+"]";
}
-
+
@Override
public void run() {
synchronized(this) {
if( !valid ) {
try {
final int maxwait = screenVSyncTimeout/2000; // TO 1/2 of current screen-vsync in [ms]
- final RecursiveLock surfaceLock = ols.getLock();
+ final RecursiveLock surfaceLock = ols.getLock();
if( surfaceLock.tryLock( maxwait ) ) {
try {
if( MacOSXCGLContext.this.lock.tryLock( maxwait ) ) {
@@ -752,19 +752,19 @@ public class MacOSXCGLContext extends GLContextImpl
}
}
AttachGLLayerCmd attachGLLayerCmd = null;
-
+
class DetachGLLayerCmd implements Runnable {
final AttachGLLayerCmd cmd;
-
+
DetachGLLayerCmd(AttachGLLayerCmd cmd) {
this.cmd = cmd;
}
-
+
@Override
public final String toString() {
return "DetachGLLayerCmd["+cmd.contentToString()+"]";
}
-
+
@Override
public void run() {
synchronized( cmd ) {
@@ -777,7 +777,7 @@ public class MacOSXCGLContext extends GLContextImpl
ols.detachSurfaceLayer();
}
} catch(Throwable t) {
- System.err.println("Catched Exception on thread "+getThreadName());
+ System.err.println("Catched Exception on thread "+getThreadName());
t.printStackTrace();
}
CGL.releaseNSOpenGLLayer(cmd.nsOpenGLLayer);
@@ -790,27 +790,27 @@ public class MacOSXCGLContext extends GLContextImpl
System.err.println("NSOpenGLLayer.Detach: Skipped "+toHexString(cmd.nsOpenGLLayer)+" - "+getThreadName());
}
}
- }
+ }
}
-
+
@Override
public void associateDrawable(boolean bound) {
backingLayerHost = NativeWindowFactory.getOffscreenLayerSurface(drawable.getNativeSurface(), true);
-
+
if(DEBUG) {
System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable: "+bound+", ctx "+toHexString(contextHandle)+
", hasBackingLayerHost "+(null!=backingLayerHost)+", attachGLLayerCmd "+attachGLLayerCmd);
// Thread.dumpStack();
- }
-
- if( bound ) {
+ }
+
+ if( bound ) {
if( null != backingLayerHost ) {
final GLCapabilitiesImmutable chosenCaps;
final long ctx;
final int texID;
final long pbufferHandle;
final int gl3ShaderProgramName;
-
+
//
// handled layered surface
//
@@ -823,8 +823,8 @@ public class MacOSXCGLContext extends GLContextImpl
pbufferHandle = 0;
fbod.setSwapBufferContext(new GLFBODrawableImpl.SwapBufferContext() {
public void swapBuffers(boolean doubleBuffered) {
- MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
- } } ) ;
+ MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
+ } } ) ;
} else if( CGL.isNSOpenGLPixelBuffer(drawableHandle) ) {
texID = 0;
pbufferHandle = drawableHandle;
@@ -847,19 +847,19 @@ public class MacOSXCGLContext extends GLContextImpl
gl3ShaderProgramName = gl3ShaderProgram.program();
} else {
gl3ShaderProgramName = 0;
- }
-
+ }
+
// All CALayer lifecycle ops are deferred on main-thread
- attachGLLayerCmd = new AttachGLLayerCmd(
- backingLayerHost, ctx, gl3ShaderProgramName, pixelFormat, pbufferHandle, texID,
+ attachGLLayerCmd = new AttachGLLayerCmd(
+ backingLayerHost, ctx, gl3ShaderProgramName, pixelFormat, pbufferHandle, texID,
chosenCaps.isBackgroundOpaque(), lastWidth, lastHeight );
if(DEBUG) {
System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(true): "+attachGLLayerCmd);
- }
+ }
OSXUtil.RunOnMainThread(false, attachGLLayerCmd);
- } else { // -> null == backingLayerHost
+ } else { // -> null == backingLayerHost
lastWidth = drawable.getWidth();
- lastHeight = drawable.getHeight();
+ lastHeight = drawable.getHeight();
boolean[] isPBuffer = { false };
boolean[] isFBO = { false };
CGL.setContextView(contextHandle, getNSViewHandle(isPBuffer, isFBO));
@@ -882,7 +882,7 @@ public class MacOSXCGLContext extends GLContextImpl
final DetachGLLayerCmd dCmd = new DetachGLLayerCmd(cmd);
if(DEBUG) {
System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(false): "+dCmd);
- }
+ }
OSXUtil.RunOnMainThread(false, dCmd);
if( null != gl3ShaderProgram ) {
gl3ShaderProgram.destroy(MacOSXCGLContext.this.gl.getGL3());
@@ -903,11 +903,11 @@ public class MacOSXCGLContext extends GLContextImpl
needsSetContextPBuffer = false;
CGL.setContextPBuffer(ctx, drawableHandle);
if(DEBUG) {
- System.err.println("NS.validateDrawableConfig bind pbuffer "+toHexString(drawableHandle)+" -> ctx "+toHexString(ctx));
+ System.err.println("NS.validateDrawableConfig bind pbuffer "+toHexString(drawableHandle)+" -> ctx "+toHexString(ctx));
}
}
}
-
+
/** Returns true if size has been updated, otherwise false (same size). */
private final boolean validateDrawableSizeConfig(long ctx) {
final int width = drawable.getWidth();
@@ -916,13 +916,13 @@ public class MacOSXCGLContext extends GLContextImpl
lastWidth = drawable.getWidth();
lastHeight = drawable.getHeight();
if(DEBUG) {
- System.err.println("NS.validateDrawableConfig size changed");
+ System.err.println("NS.validateDrawableConfig size changed");
}
return true;
}
return false;
}
-
+
@Override
public boolean copyImpl(long src, int mask) {
CGL.copyContext(contextHandle, src, mask);
@@ -975,7 +975,7 @@ public class MacOSXCGLContext extends GLContextImpl
// CGL.setContextPBuffer(contextHandle, 0); // doesn't work, i.e. not taking nil
return true;
}
-
+
@Override
public boolean setSwapInterval(int interval) {
final AttachGLLayerCmd cmd = attachGLLayerCmd;
@@ -1004,7 +1004,7 @@ public class MacOSXCGLContext extends GLContextImpl
if(DEBUG) { System.err.println("CGL setSwapInterval: "+interval); }
CGL.setSwapInterval(contextHandle, interval);
}
-
+
private int skipSync=0;
/** TODO: Remove after discussion
private boolean perfIterReset = false;
@@ -1014,7 +1014,7 @@ public class MacOSXCGLContext extends GLContextImpl
private long frameXS = 0;
private long lastFrameStart = 0;
*/
-
+
@Override
public boolean swapBuffers() {
final AttachGLLayerCmd cmd = attachGLLayerCmd;
@@ -1026,7 +1026,7 @@ public class MacOSXCGLContext extends GLContextImpl
// allowing to update the texture IDs ASAP.
skipSync = 10;
}
-
+
final boolean res;
final int texID;
final boolean valid;
@@ -1054,19 +1054,19 @@ public class MacOSXCGLContext extends GLContextImpl
final long lastFramePeriod0 = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
gl.glFinish(); // Require to finish previous GL rendering to give CALayer proper result
final long lastFramePeriod1 = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
-
- // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
+
+ // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
// while still synchronizing w/ CALayer.
// If v-sync is enabled wait until next swap interval (v-sync).
CGL.waitUntilNSOpenGLLayerIsReady(cmd.nsOpenGLLayer, vsyncTimeout);
final long lastFramePeriodX = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
-
+
final long finishGL = lastFramePeriod1 - lastFramePeriod0;
final long waitGL = lastFramePeriodX - lastFramePeriod1;
finishGLS += finishGL;
waitGLS += waitGL;
frameXS += lastFramePeriodX;
-
+
System.err.println("XXX["+perfIter+"] TO "+vsyncTimeout/1000+" ms, "+
"lFrame0 "+lastFramePeriod0/1000+" ms, "+
"lFrameX "+lastFramePeriodX/1000+" / "+frameXS/1000+" ~"+(frameXS/perfIter)/1000.0+" ms, "+
@@ -1080,8 +1080,8 @@ public class MacOSXCGLContext extends GLContextImpl
// FIXME: IMHO this synchronization should be implicitly performed via 'CGL.flushBuffer(contextHandle)' above,
// in case this will be determined a driver bug - use a QUIRK entry in GLRendererQuirks!
gl.glFinish();
-
- // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
+
+ // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
// while still synchronizing w/ CALayer.
// If v-sync is enabled wait until next swap interval (v-sync).
CGL.waitUntilNSOpenGLLayerIsReady(cmd.nsOpenGLLayer, vsyncTimeout);
@@ -1093,7 +1093,7 @@ public class MacOSXCGLContext extends GLContextImpl
CGL.setNSOpenGLLayerNeedsDisplayFBO(cmd.nsOpenGLLayer, texID);
} else {
// trigger CALayer to update incl. possible surface change (new pbuffer handle)
- CGL.setNSOpenGLLayerNeedsDisplayPBuffer(cmd.nsOpenGLLayer, drawable.getHandle());
+ CGL.setNSOpenGLLayerNeedsDisplayPBuffer(cmd.nsOpenGLLayer, drawable.getHandle());
}
// lastFrameStart = TimeUnit.NANOSECONDS.toMicros(System.nanoTime());
}
@@ -1137,8 +1137,8 @@ public class MacOSXCGLContext extends GLContextImpl
if (0 != ctx) {
GLCapabilities fixedCaps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
fixedCaps = GLGraphicsConfigurationUtil.fixOpaqueGLCapabilities(fixedCaps, chosenCaps.isBackgroundOpaque());
- { // determine on-/offscreen caps, since pformat is ambiguous
- fixedCaps.setFBO( false ); // n/a for CGLImpl
+ { // determine on-/offscreen caps, since pformat is ambiguous
+ fixedCaps.setFBO( false ); // n/a for CGLImpl
fixedCaps.setPBuffer( fixedCaps.isPBuffer() && !chosenCaps.isOnscreen() );
fixedCaps.setBitmap( false ); // n/a in our OSX impl.
fixedCaps.setOnscreen( !fixedCaps.isPBuffer() );
@@ -1153,7 +1153,7 @@ public class MacOSXCGLContext extends GLContextImpl
if (res != CGL.kCGLNoError) {
throw new GLException("Error code " + res + " while attaching context to pbuffer");
}
- }
+ }
}
} finally {
CGL.CGLDestroyPixelFormat(pixelFormat);
@@ -1224,7 +1224,7 @@ public class MacOSXCGLContext extends GLContextImpl
} */
return true;
}
-
+
@Override
public boolean setSwapInterval(int interval) {
final IntBuffer lval = Buffers.newDirectIntBuffer(1);
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
index 4bd7bc994..bb36a7219 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
@@ -105,7 +105,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
@Override
protected void setRealizedImpl() {
}
-
+
@Override
protected void associateContext(GLContext ctx, boolean bound) {
// NOTE: we need to keep track of the created contexts in order to
@@ -123,14 +123,14 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
} else {
i++;
}
- }
+ }
}
- }
+ }
}
-
+
@Override
protected final void swapBuffersImpl(boolean doubleBuffered) {
- if(doubleBuffered) {
+ if(doubleBuffered) {
synchronized (createdContexts) {
for(int i=0; i libsGL = new ArrayList();
libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
libsGL.add("GL");
- libsList.add(libsGL);
+ libsList.add(libsGL);
return libsList;
}
-
+
@Override
public final List getToolGetProcAddressFuncNameList() {
- return null;
+ return null;
/** OSX manual says: NSImage use is discouraged
List res = new ArrayList();
res.add("GetProcAddress"); // dummy
@@ -59,7 +59,7 @@ public final class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLib
public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
return 0;
/** OSX manual says: NSImage use is discouraged
- return CGL.getProcAddress(glFuncName); // manual implementation
+ return CGL.getProcAddress(glFuncName); // manual implementation
*/
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 5eb11c6a4..535c4d2d3 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -54,7 +54,7 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
- MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
+ MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested) {
super(screen, capsChosen, capsRequested);
}
@@ -71,10 +71,10 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
// MacOSXGraphicsDevice osxDevice = sharedResource.getDevice();
return new ArrayList(0);
}
-
+
static final IntBuffer cglInternalAttributeToken = Buffers.newDirectIntBuffer(new int[] {
CGL.kCGLPFAOpenGLProfile, // >= lion
- CGL.NSOpenGLPFAAccelerated, // query only (prefer accelerated, but allow non accelerated), ignored for createPixelformat
+ CGL.NSOpenGLPFAAccelerated, // query only (prefer accelerated, but allow non accelerated), ignored for createPixelformat
CGL.NSOpenGLPFANoRecovery,
CGL.kCGLPFAColorFloat,
CGL.NSOpenGLPFAPixelBuffer,
@@ -96,13 +96,13 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
for (int idx = 0; idx < len; idx++) {
final int attr = attrToken.get(idx+off);
switch (attr) {
- case CGL.kCGLPFAOpenGLProfile:
+ case CGL.kCGLPFAOpenGLProfile:
ivalues.put(idx, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
break;
case CGL.NSOpenGLPFANoRecovery:
ivalues.put(idx, caps.getHardwareAccelerated() ? 1 : 0);
break;
-
+
case CGL.kCGLPFAColorFloat:
// ivalues.put(idx, ( !caps.isOnscreen() && caps.isPBuffer() && caps.getPbufferFloatingPointBuffers() ) ? 1 : 0);
ivalues.put(idx, 0);
@@ -160,7 +160,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
if ( !MacOSXCGLContext.isLionOrLater ) {
// no OpenGLProfile
attrToken.position(1);
- }
+ }
final IntBuffer ivalues = GLCapabilities2NSAttribList(attrToken, caps, ctp, major, minor);
return CGL.createPixelFormat(attrToken, attrToken.remaining(), ivalues);
}
@@ -174,7 +174,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
final IntBuffer attrs = Buffers.newDirectIntBuffer(256);
int i = 0;
if(MacOSXCGLContext.isLionOrLater) {
- attrs.put(i++, CGL.kCGLPFAOpenGLProfile);
+ attrs.put(i++, CGL.kCGLPFAOpenGLProfile);
attrs.put(i++, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
}
/**
@@ -222,8 +222,8 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
}
return fmt.get(0);
}
-
- static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {
+
+ static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {
return PixelFormat2GLCapabilities(null, pixelFormat, false);
}
@@ -235,7 +235,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
off = 1;
} else {
off = 0;
- }
+ }
attrToken.position(off);
final int len = attrToken.remaining();
final IntBuffer ivalues = Buffers.newDirectIntBuffer(len);
@@ -243,7 +243,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
// On this platform the pixel format is associated with the
// context and not the drawable. However it's a reasonable
// approximation to just store the chosen pixel format up in the
- // NativeSurface's AbstractGraphicsConfiguration,
+ // NativeSurface's AbstractGraphicsConfiguration,
// since the public API doesn't provide for a different GLCapabilities per context.
// Note: These restrictions of the platform's API might be considered as a bug anyways.
@@ -253,7 +253,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
} else {
CGL.CGLQueryPixelFormat(pixelFormat, attrToken, len, ivalues);
}
-
+
if(null == glp && MacOSXCGLContext.isLionOrLater) {
// pre-scan for OpenGL Profile
for (int i = 0; i < len; i++) {
@@ -265,11 +265,11 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
break;
case CGL.kCGLOGLPVersion_Legacy:
glp = GLProfile.get(GLProfile.GL2);
- break;
+ break;
default:
throw new RuntimeException("Unhandled OSX OpenGL Profile: 0x"+Integer.toHexString(ivalue));
}
- }
+ }
}
}
if(null == glp) {
@@ -284,7 +284,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
case CGL.NSOpenGLPFAAccelerated:
caps.setHardwareAccelerated(ivalue != 0);
break;
-
+
case CGL.kCGLPFAColorFloat:
// caps.setPbufferFloatingPointBuffers(ivalue != 0);
break;
@@ -346,7 +346,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
}
}
caps.setAlphaBits(alphaBits);
-
+
return caps;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index 3bbba2c52..e761be7b7 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -56,13 +56,13 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
static void registerFactory() {
GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice.class, GLCapabilitiesImmutable.class, new MacOSXCGLGraphicsConfigurationFactory());
}
- private MacOSXCGLGraphicsConfigurationFactory() {
+ private MacOSXCGLGraphicsConfigurationFactory() {
}
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
-
+
if (absScreen == null) {
throw new IllegalArgumentException("AbstractGraphicsScreen is null");
}
@@ -78,7 +78,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
}
-
+
return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, (GLCapabilitiesChooser)chooser, absScreen, false);
}
@@ -91,7 +91,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
}
final AbstractGraphicsDevice device = absScreen.getDevice();
capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, GLDrawableFactory.getDesktopFactory(), device);
-
+
return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index 4e791cb5f..f6e8b8fa3 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -90,7 +90,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
public GLContext createContext(GLContext shareWith) {
return new MacOSXCGLContext(this, shareWith);
}
-
+
protected int getTextureTarget() { return pBufferTexTarget; }
protected int getTextureWidth() { return pBufferTexWidth; }
protected int getTextureHeight() { return pBufferTexHeight; }
@@ -101,7 +101,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
if (0 != pBuffer) {
synchronized (createdContexts) {
for(int i=0; i ref = createdContexts.get(i);
+ final WeakReference ref = createdContexts.get(i);
final MacOSXCGLContext ctx = ref.get();
if (ctx != null) {
ctx.detachPBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
index edf9b7c84..c08259665 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -59,7 +59,7 @@ import jogamp.opengl.macosx.cgl.MacOSXCGLGraphicsConfiguration;
public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
public static void registerFactory() {
GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.awt.AWTGraphicsDevice.class, GLCapabilitiesImmutable.class, new MacOSXAWTCGLGraphicsConfigurationFactory());
- }
+ }
private MacOSXAWTCGLGraphicsConfigurationFactory() {
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
index 1a4ca345b..810a9286b 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
@@ -37,22 +37,22 @@ import javax.media.opengl.*;
*/
public interface GLArrayHandler {
-
+
/**
- * if bind
is true and the data uses VBO,
+ * if bind
is true and the data uses VBO,
* the latter will be bound and data written to the GPU if required.
*
* If bind
is false and the data uses VBO,
* the latter will be unbound.
*
- *
+ *
* @param gl current GL object
- * @param bind true if VBO shall be bound and data written,
+ * @param bind true if VBO shall be bound and data written,
* otherwise clear VBO binding.
- * @return true if data uses VBO and action was performed, otherwise false
+ * @return true if data uses VBO and action was performed, otherwise false
*/
public boolean bindBuffer(GL gl, boolean bind);
-
+
/**
* Implementation shall enable or disable the array state.
*
@@ -60,23 +60,23 @@ public interface GLArrayHandler {
* implementation shall synchronize the data with the GPU
* and associate the data with the array.
*
- *
+ *
* @param gl current GL object
* @param enable true if array shall be enabled, otherwise false.
- * @param ext extension object allowing passing of an implementation detail
+ * @param ext extension object allowing passing of an implementation detail
*/
public void enableState(GL gl, boolean enable, Object ext);
-
+
/**
- * Supporting interleaved arrays, where sub handlers may handle
+ * Supporting interleaved arrays, where sub handlers may handle
* the array state and the master handler the buffer consistency.
- *
+ *
* @param handler the sub handler
* @throws UnsupportedOperationException if this array handler does not support interleaved arrays
*/
public void addSubHandler(GLArrayHandlerFlat handler) throws UnsupportedOperationException;
public void setSubArrayVBOName(int vboName);
-
+
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
index 4a8f40608..179142fee 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
@@ -39,21 +39,21 @@ public interface GLArrayHandlerFlat {
/**
* Implementation shall associate the data with the array
- *
+ *
* @param gl current GL object
- * @param ext extension object allowing passing of an implementation detail
+ * @param ext extension object allowing passing of an implementation detail
*/
public void syncData(GL gl, Object ext);
-
+
/**
* Implementation shall enable or disable the array state.
- *
+ *
* @param gl current GL object
* @param enable true if array shall be enabled, otherwise false.
- * @param ext extension object allowing passing of an implementation detail
+ * @param ext extension object allowing passing of an implementation detail
*/
- public void enableState(GL gl, boolean enable, Object ext);
-
+ public void enableState(GL gl, boolean enable, Object ext);
+
public GLArrayDataWrapper getData();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 98f711b8e..5f9b25530 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -36,8 +36,8 @@ import javax.media.opengl.GL;
import com.jogamp.opengl.util.GLArrayDataEditable;
/**
- * Interleaved fixed function arrays, i.e. where this buffer data
- * represents many arrays.
+ * Interleaved fixed function arrays, i.e. where this buffer data
+ * represents many arrays.
*/
public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
private List subArrays = new ArrayList();
@@ -45,13 +45,13 @@ public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLAr
public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
super(ad);
}
-
+
public final void setSubArrayVBOName(int vboName) {
for(int i=0; i{@link #setTextureTarget(int)}
* - {@link EGLMediaPlayerImpl#setEGLTexImageAttribs(boolean, boolean)}.
*
* See {@link GLMediaPlayer}. *
@@ -75,21 +75,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { protected volatile State state; private Object stateLock = new Object(); - + protected int textureCount; protected int textureTarget; protected int textureFormat; - protected int textureInternalFormat; + protected int textureInternalFormat; protected int textureType; protected int texUnit; - - + + protected int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST }; protected int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE }; - + /** User requested URI stream location. */ protected URI streamLoc = null; - /** + /** * In case {@link #streamLoc} is a {@link GLMediaPlayer#CameraInputScheme}, * {@link #cameraPath} holds the URI's path portion * as parsed in {@link #initStream(URI, int, int, int)}. @@ -98,10 +98,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { protected String cameraPath = null; /** Optional camera properties, see {@link #cameraPath}. */ protected Maptexture2D
,
* if not overridden by specialization.
*/
@@ -247,31 +247,31 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
checkGLInit();
return "texture2D";
}
-
+
/**
* {@inheritDoc}
- *
- * This implementation simply returns an empty string since it's using
+ *
+ * This implementation simply returns an empty string since it's using
* the build-in function texture2D
,
* if not overridden by specialization.
*/
@Override
public String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
checkGLInit();
- return "";
+ return "";
}
-
+
@Override
public final int getDecodedFrameCount() { return decodedFrameCount; }
-
+
@Override
public final int getPresentedFrameCount() { return presentedFrameCount; }
-
+
@Override
public final int getVideoPTS() { return video_pts_last; }
-
+
@Override
- public final int getAudioPTS() {
+ public final int getAudioPTS() {
if( State.Uninitialized != state ) {
return getAudioPTSImpl();
}
@@ -285,10 +285,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return 0;
}
}
-
+
@Override
public final State getState() { return state; }
-
+
@Override
public final State play() {
synchronized( stateLock ) {
@@ -310,7 +310,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract boolean playImpl();
-
+
@Override
public final State pause(boolean flush) {
return pauseImpl(flush, 0);
@@ -337,7 +337,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract boolean pauseImpl();
-
+
@Override
public final State destroy(GL gl) {
return destroyImpl(gl, 0);
@@ -354,7 +354,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract void destroyImpl(GL gl);
-
+
@Override
public final int seek(int msec) {
synchronized( stateLock ) {
@@ -383,12 +383,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract int seekImpl(int msec);
-
+
@Override
public final float getPlaySpeed() {
return playSpeed;
}
-
+
@Override
public final boolean setPlaySpeed(float rate) {
synchronized( stateLock ) {
@@ -410,18 +410,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return res;
}
}
- /**
+ /**
* Override if not using AudioSink, or AudioSink's {@link AudioSink#setPlaySpeed(float)} is not sufficient!
*
- * AudioSink shall respect !audioSinkPlaySpeedSet
to determine data_size
+ * AudioSink shall respect !audioSinkPlaySpeedSet
to determine data_size
* at {@link AudioSink#enqueueData(com.jogamp.opengl.util.av.AudioSink.AudioFrame)}.
- *
* Shall also take care of {@link AudioSink} initialization if appropriate. @@ -593,8 +593,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { * @throws GLException */ protected abstract void initGLImpl(GL gl) throws IOException, GLException; - - /** + + /** * Returns the validated number of textures to be handled. *
* Default is {@link #TEXTURE_COUNT_MIN} minimum textures. @@ -606,7 +606,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { protected int validateTextureCount(int desiredTextureCount) { return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount; } - + protected TextureFrame[] createTexFrames(GL gl, final int count) { final int[] texNames = new int[count]; gl.glGenTextures(count, texNames, 0); @@ -621,7 +621,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { return texFrames; } protected abstract TextureFrame createTexImage(GL gl, int texName); - + protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight) { if( 0 > texName ) { throw new RuntimeException("TextureName "+toHexString(texName)+" invalid."); @@ -661,19 +661,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, texMinMagFilter[0]); - gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]); + gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]); gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, texWrapST[0]); gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, texWrapST[1]); - + return com.jogamp.opengl.util.texture.TextureIO.newTexture( texName, textureTarget, tWidth, tHeight, width, height, - !isInGLOrientation); + !isInGLOrientation); } - + protected void destroyTexFrame(GL gl, TextureFrame frame) { - frame.getTexture().destroy(gl); + frame.getTexture().destroy(gl); } @Override @@ -683,7 +683,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } return lastFrame; } - + private final void removeAllTextureFrames(GL gl) { final TextureFrame[] texFrames = videoFramesOrig; videoFramesOrig = null; @@ -699,14 +699,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } texFrames[i] = null; } - System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null"); - } + System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null"); + } } } - + protected TextureFrame cachedFrame = null; protected long lastTimeMillis = 0; - + @Override public final TextureFrame getNextTexture(GL gl) throws IllegalStateException { synchronized( stateLock ) { @@ -750,7 +750,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } else { d_apts = 0; } - + final int frame_period_last = video_pts - video_pts_last; // rendering loop interrupted ? if( videoSCR_reset || frame_period_last > frame_duration*10 ) { videoSCR_reset = false; @@ -782,7 +782,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { cachedFrame = nextFrame; nextFrame = null; } else if ( !droppedFrame && dt < -maxVideoDelay && videoFramesDecoded.size() > 0 ) { - // only drop if prev. frame has not been dropped and + // only drop if prev. frame has not been dropped and // frame is too late and one decoded frame is already available. dropFrame = true; } @@ -791,7 +791,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { System.err.println( "AV_: dT "+(currentTimeMillis-lastTimeMillis)+", "+ getPerfStringImpl( video_scr, video_pts, d_vpts, audio_scr, audio_pts, d_apts, - video_dpts_avg_diff ) + + video_dpts_avg_diff ) + ", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+_nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame); } } @@ -803,7 +803,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { lastFrame = nextFrame; videoFramesFree.putBlocking(_lastFrame); } - } else if( DEBUG ) { + } else if( DEBUG ) { final int video_pts = lastFrame.getPTS(); final int audio_pts = getAudioPTSImpl(); final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed ); @@ -835,25 +835,25 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { * Audio frames, i.e. {@link AudioSink.AudioFrame}, shall be handled in the process. *
* Video frames shall be ignored, if {@link #getVID()} is {@link #STREAM_ID_NONE}. - *
+ * ** Audio frames shall be ignored, if {@link #getAID()} is {@link #STREAM_ID_NONE}. *
** Method may be invoked on the StreamWorker decoding thread. - *
+ * ** Implementation shall care of OpenGL synchronization as required, e.g. glFinish()/glFlush()! *
- * @param gl valid and current GL instance, shall benull
for audio only.
+ * @param gl valid and current GL instance, shall be null
for audio only.
* @param nextFrame the {@link TextureFrame} to store the video PTS and texture data,
* shall be null
for audio only.
* @return the last processed video PTS value, maybe {@link TimeFrameI#INVALID_PTS} if video frame is invalid or n/a.
- * Will be {@link TimeFrameI#END_OF_STREAM_PTS} if end of stream reached.
+ * Will be {@link TimeFrameI#END_OF_STREAM_PTS} if end of stream reached.
*/
protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
-
- /**
+
+ /**
* {@inheritDoc}
* * Note: All {@link AudioSink} operations are performed from {@link GLMediaPlayerImpl}, @@ -866,8 +866,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { */ @Override public final AudioSink getAudioSink() { return audioSink; } - - /** + + /** * To be called from implementation at 1st PTS after start * w/ current pts value in milliseconds. * @param audio_scr_t0 @@ -908,10 +908,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { private final int getVideoDPTSAvg() { return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f ); } - + private final void newFrameAvailable(TextureFrame frame, long currentTimeMillis) { decodedFrameCount++; - if( 0 == frame.getDuration() ) { // patch frame duration if not set already + if( 0 == frame.getDuration() ) { // patch frame duration if not set already frame.setDuration( (int) frame_duration ); } synchronized(eventListenersLock) { @@ -920,38 +920,38 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } } - + class StreamWorker extends Thread { private volatile boolean isRunning = false; private volatile boolean isActive = false; private volatile boolean isBlocked = false; - + private volatile boolean shallPause = true; private volatile boolean shallStop = false; - + private volatile StreamException streamErr = null; private volatile GLContext sharedGLCtx = null; private boolean sharedGLCtxCurrent = false; private GLDrawable dummyDrawable = null; - - /** - * Starts this daemon thread, + + /** + * Starts this daemon thread, * which initializes the stream first via {@link GLMediaPlayerImpl#initStreamImpl(int, int)} first. *
* After stream initialization, this thread pauses! *
- **/ + **/ StreamWorker() { setDaemon(true); start(); } - + private void makeCurrent(GLContext ctx) { if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) { throw new GLException("Couldn't make ctx current: "+ctx); } } - + private void destroySharedGL() { if( null != sharedGLCtx ) { if( sharedGLCtx.isCreated() ) { @@ -963,16 +963,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { gle.printStackTrace(); } } - sharedGLCtx = null; + sharedGLCtx = null; } if( null != dummyDrawable ) { final AbstractGraphicsDevice device = dummyDrawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(); dummyDrawable.setRealized(false); dummyDrawable = null; device.close(); - } + } } - + public synchronized void initGL(GL gl) { final GLContext glCtx = gl.getContext(); final boolean glCtxCurrent = glCtx.isCurrent(); @@ -1013,7 +1013,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { while( !isActive ) { this.notify(); // wake-up pause-block try { - this.wait(); // wait until resumed + this.wait(); // wait until resumed } catch (InterruptedException e) { e.printStackTrace(); } @@ -1041,12 +1041,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } public boolean isRunning() { return isRunning; } public boolean isActive() { return isActive; } - public StreamException getStreamErr() { return streamErr; } - + public StreamException getStreamErr() { return streamErr; } + public void run() { setName(getName()+"-StreamWorker_"+StreamWorkerInstanceId); StreamWorkerInstanceId++; - + synchronized ( this ) { isRunning = true; try { @@ -1061,7 +1061,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { return; // end of thread! } // also initializes width, height, .. etc } - + while( !shallStop ){ if( shallPause ) { synchronized ( this ) { @@ -1100,7 +1100,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } } - + if( !shallStop ) { TextureFrame nextFrame = null; try { @@ -1121,7 +1121,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { Thread.sleep(STREAM_WORKER_DELAY); } if( !videoFramesDecoded.put(nextFrame) ) { - throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); + throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); } newFrameAvailable(nextFrame, Platform.currentTimeMillis()); nextFrame = null; @@ -1170,10 +1170,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { this.notify(); // wake-up doStop() } } - } - static int StreamWorkerInstanceId = 0; + } + static int StreamWorkerInstanceId = 0; private StreamWorker streamWorker = null; - + protected final int addStateEventMask(int event_mask, State newState) { if( state != newState ) { switch( newState ) { @@ -1193,7 +1193,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } return event_mask; } - + protected final void attributesUpdated(int event_mask) { if( 0 != event_mask ) { final long now = Platform.currentTimeMillis(); @@ -1204,7 +1204,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } } - + protected final void changeState(int event_mask, State newState) { event_mask = addStateEventMask(event_mask, newState); if( 0 != event_mask ) { @@ -1212,9 +1212,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { attributesUpdated( event_mask ); } } - - protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream, - int bps_video, int bps_audio, float fps, + + protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream, + int bps_video, int bps_audio, float fps, int videoFrames, int audioFrames, int duration, String vcodec, String acodec) { int event_mask = 0; if( state == State.Uninitialized ) { @@ -1227,19 +1227,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { if( this.vid != vid ) { event_mask |= GLMediaEventListener.EVENT_CHANGE_VID; this.vid = vid; - } + } if( STREAM_ID_AUTO == vid ) { vid = STREAM_ID_NONE; } if( this.aid != aid ) { event_mask |= GLMediaEventListener.EVENT_CHANGE_AID; this.aid = aid; - } + } if( this.width != width || this.height != height ) { event_mask |= GLMediaEventListener.EVENT_CHANGE_SIZE; this.width = width; this.height = height; - } + } if( this.fps != fps ) { event_mask |= GLMediaEventListener.EVENT_CHANGE_FPS; this.fps = fps; @@ -1257,7 +1257,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { this.audioFrames = audioFrames; this.duration = duration; } - if( (null!=acodec && acodec.length()>0 && !this.acodec.equals(acodec)) ) { + if( (null!=acodec && acodec.length()>0 && !this.acodec.equals(acodec)) ) { event_mask |= GLMediaEventListener.EVENT_CHANGE_CODEC; this.acodec = acodec; } @@ -1283,7 +1283,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { attributesUpdated(GLMediaEventListener.EVENT_CHANGE_SIZE); } } - + @Override public final URI getURI() { return streamLoc; @@ -1291,10 +1291,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { @Override public final int getVID() { return vid; } - + @Override public final int getAID() { return aid; } - + @Override public final String getVideoCodec() { return vcodec; @@ -1309,7 +1309,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { public final int getVideoFrames() { return videoFrames; } - + @Override public final int getAudioFrames() { return audioFrames; @@ -1319,7 +1319,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { public final int getDuration() { return duration; } - + @Override public final long getStreamBitrate() { return bps_stream; @@ -1329,12 +1329,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { public final int getVideoBitrate() { return bps_video; } - + @Override public final int getAudioBitrate() { return bps_audio; } - + @Override public final float getFramerate() { return fps; @@ -1344,7 +1344,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { public final boolean isGLOriented() { return isInGLOrientation; } - + @Override public final int getWidth() { return width; @@ -1369,11 +1369,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+ "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]"; } - + @Override public final String getPerfString() { final long currentTimeMillis = Platform.currentTimeMillis(); - final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed ); + final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed ); final int d_vpts = video_pts_last - video_scr; final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed ); final int audio_pts = getAudioPTSImpl(); @@ -1383,7 +1383,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { private final String getPerfStringImpl(final int video_scr, final int video_pts, final int d_vpts, final int audio_scr, final int audio_pts, final int d_apts, final int video_dpts_avg_diff) { - final float tt = getDuration() / 1000.0f; + final float tt = getDuration() / 1000.0f; final String audioSinkInfo; final AudioSink audioSink = getAudioSink(); if( null != audioSink ) { diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java index 85fab96a4..6e006d9c0 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java @@ -22,75 +22,75 @@ public class JavaSoundAudioSink implements AudioSink { public static final int BUFFER_SIZE = 1000; public static final int SAMPLES_PER_BUFFER = BUFFER_SIZE / 2; private static final boolean staticAvailable; - + // Sample time values // public static final double SAMPLE_TIME_IN_SECS = 1.0 / DEFAULT_SAMPLE_RATE; // public static final double BUFFER_TIME_IN_SECS = SAMPLE_TIME_IN_SECS * SAMPLES_PER_BUFFER; - + private javax.sound.sampled.AudioFormat format; private DataLine.Info info; private SourceDataLine auline; private int bufferCount; - private byte [] sampleData = new byte[BUFFER_SIZE]; + private byte [] sampleData = new byte[BUFFER_SIZE]; private boolean initialized = false; private AudioSink.AudioFormat chosenFormat = null; - + private volatile boolean playRequested = false; private float volume = 1.0f; - + static { boolean ok = false; try { AudioSystem.getAudioFileTypes(); ok = true; } catch (Throwable t) { - + } staticAvailable=ok; - } - + } + @Override public String toString() { return "JavaSoundSink[init "+initialized+", dataLine "+info+", source "+auline+", bufferCount "+bufferCount+ ", chosen "+chosenFormat+", jsFormat "+format; } - + @Override public final float getPlaySpeed() { return 1.0f; } // FIXME - + @Override - public final boolean setPlaySpeed(float rate) { - return false; // FIXME + public final boolean setPlaySpeed(float rate) { + return false; // FIXME } - + @Override public final float getVolume() { // FIXME - return volume; + return volume; } - + @Override public final boolean setVolume(float v) { // FIXME volume = v; return true; } - + @Override public AudioSink.AudioFormat getPreferredFormat() { return DefaultFormat; } - + @Override public final int getMaxSupportedChannels() { return 2; } - + @Override public final boolean isSupported(AudioSink.AudioFormat format) { return true; } - + @Override public boolean init(AudioSink.AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) { if( !staticAvailable ) { @@ -117,12 +117,12 @@ public class JavaSoundAudioSink implements AudioSink { } return true; } - + @Override public boolean isPlaying() { return playRequested && auline.isRunning(); } - + @Override public void play() { if( null != auline ) { @@ -135,7 +135,7 @@ public class JavaSoundAudioSink implements AudioSink { auline.start(); } } - + @Override public void pause() { if( null != auline ) { @@ -143,9 +143,9 @@ public class JavaSoundAudioSink implements AudioSink { auline.stop(); } } - + @Override - public void flush() { + public void flush() { if( null != auline ) { playRequested = false; auline.stop(); @@ -157,17 +157,17 @@ public class JavaSoundAudioSink implements AudioSink { public final int getEnqueuedFrameCount() { return 0; // FIXME } - + @Override public int getFrameCount() { return 1; } - + @Override public int getQueuedFrameCount() { return 0; } - + @Override public boolean isInitialized() { return initialized; @@ -179,7 +179,7 @@ public class JavaSoundAudioSink implements AudioSink { chosenFormat = null; // FIXEM: complete code! } - + @Override public AudioFrame enqueueData(AudioDataFrame audioDataFrame) { int byteSize = audioDataFrame.getByteSize(); @@ -188,7 +188,7 @@ public class JavaSoundAudioSink implements AudioSink { final int p = byteBuffer.position(); byteBuffer.get(bytes, 0, byteSize); byteBuffer.position(p); - + int written = 0; int len; while (byteSize > 0) { @@ -203,27 +203,27 @@ public class JavaSoundAudioSink implements AudioSink { @Override public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) { return enqueueData(new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), bytes, byteCount)); - } - + } + @Override public int getQueuedByteCount() { return auline.getBufferSize() - auline.available(); } - + @Override public int getFreeFrameCount() { return auline.available(); } - + @Override public int getQueuedTime() { return getQueuedTimeImpl( getQueuedByteCount() ); } private final int getQueuedTimeImpl(int byteCount) { final int bytesPerSample = chosenFormat.sampleSize >>> 3; // /8 - return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) ); + return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) ); } @Override - public final int getPTS() { return 0; } // FIXME + public final int getPTS() { return 0; } // FIXME } diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java index 723bb9dd1..8d3dbdf44 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java @@ -15,32 +15,32 @@ public class NullAudioSink implements AudioSink { private volatile float playSpeed = 1.0f; private volatile boolean playRequested = false; private float volume = 1.0f; - + @Override public final float getPlaySpeed() { return playSpeed; } - + @Override - public final boolean setPlaySpeed(float rate) { + public final boolean setPlaySpeed(float rate) { if( Math.abs(1.0f - rate) < 0.01f ) { rate = 1.0f; } - playSpeed = rate; + playSpeed = rate; return true; } - + @Override public final float getVolume() { // FIXME - return volume; + return volume; } - + @Override public final boolean setVolume(float v) { // FIXME - volume = v; + volume = v; return true; } - + @Override public AudioFormat getPreferredFormat() { return DefaultFormat; @@ -50,73 +50,73 @@ public class NullAudioSink implements AudioSink { public final int getMaxSupportedChannels() { return 8; } - + @Override public final boolean isSupported(AudioFormat format) { return true; } - + @Override public boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) { return true; } - + @Override public boolean isPlaying() { return playRequested; } - + @Override public void play() { playRequested = true; } - + @Override public void pause() { playRequested = false; } - + @Override - public void flush() { + public void flush() { } - + @Override public void destroy() { } - + @Override public final int getEnqueuedFrameCount() { return 0; } - + @Override public int getFrameCount() { return 0; } - + @Override public int getQueuedFrameCount() { return 0; } - + @Override public int getQueuedByteCount() { return 0; } - + @Override public int getQueuedTime() { return 0; } - + @Override public final int getPTS() { return 0; } - + @Override public int getFreeFrameCount() { - return 1; + return 1; } - + @Override public AudioFrame enqueueData(AudioDataFrame audioDataFrame) { return null; @@ -125,5 +125,5 @@ public class NullAudioSink implements AudioSink { @Override public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) { return null; - } + } } diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java index 1cddaa9cf..840149272 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -54,10 +54,10 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { private TextureData texData = null; private int pos_ms = 0; private long pos_start = 0; - + public NullGLMediaPlayer() { super(); - + } @Override @@ -82,16 +82,16 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { validatePos(); return pos_ms; } - + @Override protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) { final int pts = getAudioPTSImpl(); nextFrame.setPTS( pts ); return pts; } - + @Override - protected final int getAudioPTSImpl() { + protected final int getAudioPTSImpl() { pos_ms = (int) ( Platform.currentTimeMillis() - pos_start ); validatePos(); return pos_ms; @@ -102,9 +102,9 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { if(null != texData) { texData.destroy(); texData = null; - } + } } - + public final static TextureData createTestTextureData() { TextureData res = null; try { @@ -125,28 +125,28 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl { buffer.rewind(); res = new TextureData(GLProfile.getGL2ES2(), GL.GL_RGBA, w, h, 0, - GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false, + GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false, false, false, buffer, null); } return res; } - + @Override protected final void initStreamImpl(int vid, int aid) throws IOException { texData = createTestTextureData(); final float _fps = 24f; final int _duration = 10*60*1000; // msec final int _totalFrames = (int) ( (_duration/1000)*_fps ); - updateAttributes(0 /* fake */, GLMediaPlayer.STREAM_ID_NONE, - texData.getWidth(), texData.getHeight(), 0, - 0, 0, _fps, + updateAttributes(0 /* fake */, GLMediaPlayer.STREAM_ID_NONE, + texData.getWidth(), texData.getHeight(), 0, + 0, 0, _fps, _totalFrames, 0, _duration, "png-static", null); - } + } @Override protected final void initGLImpl(GL gl) throws IOException, GLException { isInGLOrientation = true; } - + /** * {@inheritDoc} *
@@ -157,21 +157,21 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
protected int validateTextureCount(int desiredTextureCount) {
return 2;
}
-
+
@Override
protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
final Texture texture = super.createTexImageImpl(gl, texName, width, height);
if(null != texData) {
texture.updateImage(gl, texData);
- }
+ }
return new TextureSequence.TextureFrame( texture );
}
-
+
@Override
protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
super.destroyTexFrame(gl, frame);
}
-
+
private void validatePos() {
boolean considerPausing = false;
if( 0 > pos_ms) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index 146a47ebc..390c20346 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.opengl.util.av.impl;
import java.security.AccessController;
@@ -48,9 +48,9 @@ import com.jogamp.common.util.VersionNumber;
*/
class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
private static final boolean DEBUG = FFMPEGMediaPlayer.DEBUG || DynamicLibraryBundleInfo.DEBUG;
-
+
private static final List
- * The decoded video frame is written directly into an OpenGL texture - * on the GPU in it's native format. A custom fragment shader converts - * the native pixelformat to a usable RGB format if required. - * Hence only 1 copy is required before bloating the picture + * The decoded video frame is written directly into an OpenGL texture + * on the GPU in it's native format. A custom fragment shader converts + * the native pixelformat to a usable RGB format if required. + * Hence only 1 copy is required before bloating the picture * from YUV* to RGB, for example. - *
+ * *- * Implements pixel format conversion to RGB via + * Implements pixel format conversion to RGB via * fragment shader texture-lookup functions: *
- *
+ *
* Libav Specifics
*
- * Utilizes a slim dynamic and native binding to the Lib_av + * Utilizes a slim dynamic and native binding to the Lib_av * libraries: *
* Currently we are binary compatible w/: @@ -115,25 +115,25 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat; *
* See http://upstream-tracker.org/versions/libav.html *
- *- * Check tag 'FIXME: Add more planar formats !' + *
+ * Check tag 'FIXME: Add more planar formats !'
* here and in the corresponding native code
* jogl/src/jogl/native/libav/ffmpeg_impl_template.c
*
*
*
ffmpegTexture2D
.
* Otherwise the call is delegated to it's super class.
@@ -646,15 +646,15 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
return texLookupFuncName;
}
- return super.getTextureLookupFunctionName(desiredFuncName);
+ return super.getTextureLookupFunctionName(desiredFuncName);
}
-
+
/**
* {@inheritDoc}
- *
+ *
* Depending on the pixelformat, a specific conversion shader is being created,
- * e.g. YUV420P to RGB. Otherwise the call is delegated to it's super class.
- */
+ * e.g. YUV420P to RGB. Otherwise the call is delegated to it's super class.
+ */
@Override
public final String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
if(State.Uninitialized == state) {
@@ -685,7 +685,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
" return vec4(r, g, b, 1);\n"+
"}\n"
;
-
+
case YUVJ422P:
case YUV422P: ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
return
@@ -706,7 +706,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
" return vec4(r, g, b, 1);\n"+
"}\n"
;
-
+
case YUYV422: // < packed YUV 4:2:2, 2 x 16bpp, [Y0 Cb] [Y1 Cr]
// Stuffed into RGBA half width texture
return
@@ -740,9 +740,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
default: // FIXME: Add more formats !
throw new InternalError("Add proper mapping of: vPixelFmt "+vPixelFmt+", usesTexLookupShader "+usesTexLookupShader);
- }
+ }
}
-
+
@Override
public final boolean playImpl() {
if(0==moviePtr) {
@@ -754,7 +754,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
return true;
}
-
+
@Override
public final boolean pauseImpl() {
if(0==moviePtr) {
@@ -780,12 +780,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
}
-
+
@Override
protected void postNextTextureImpl(GL gl) {
psm.restore(gl);
}
-
+
@Override
protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
if(0==moviePtr) {
@@ -806,14 +806,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
nextFrame.setPTS(vPTS);
}
return vPTS;
- }
-
+ }
+
final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
setFirstAudioPTS2SCR( audio_pts );
if( 1.0f == playSpeed || audioSinkPlaySpeedSet ) {
audioSink.enqueueData( audio_pts, sampleData, data_size);
}
}
-
+
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 8e08c23fa..bc0865aa9 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -30,21 +30,21 @@ package jogamp.opengl.util.av.impl;
import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
interface FFMPEGNatives {
-
+
boolean initSymbols0(long[] symbols, int count);
int getAvUtilMajorVersionCC0();
int getAvFormatMajorVersionCC0();
int getAvCodecMajorVersionCC0();
int getAvResampleMajorVersionCC0();
int getSwResampleMajorVersionCC0();
-
+
long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
void destroyInstance0(long moviePtr);
-
+
/**
* Issues {@link #updateAttributes(int, int, int, int, int, int, int, float, int, int, String, String)}
* and {@link #updateAttributes2(int, int, int, int, int, int, int, int, int, int)}.
- *
+ *
* @param moviePtr
* @param url
* @param vid
@@ -56,25 +56,25 @@ interface FFMPEGNatives {
* @param aPrefSampleRate
* @param aPrefChannelCount
*/
- void setStream0(long moviePtr, String url, boolean isCameraInput,
- int vid, String sizes, int vWidth, int vHeight,
+ void setStream0(long moviePtr, String url, boolean isCameraInput,
+ int vid, String sizes, int vWidth, int vHeight,
int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
-
+
void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
- int getVideoPTS0(long moviePtr);
-
+ int getVideoPTS0(long moviePtr);
+
int getAudioPTS0(long moviePtr);
-
+
/**
* @return resulting current video PTS, or {@link TextureFrame#INVALID_PTS}
*/
int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
-
+
int play0(long moviePtr);
int pause0(long moviePtr);
int seek0(long moviePtr, int position);
-
+
/** FFMPEG/libAV Audio Sample Format */
public static enum SampleFormat {
// NONE = -1,
@@ -89,10 +89,10 @@ interface FFMPEGNatives {
S32P, ///< signed 32 bits, planar
FLTP, ///< float, planar
DBLP, ///< double, planar
-
+
COUNT; ///< Number of sample formats.
-
- /**
+
+ /**
* Returns the matching SampleFormat value corresponding to the given SampleFormat's integer ordinal.
* * given: @@ -131,7 +131,7 @@ interface FFMPEGNatives { /** planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) */ YUV411P, /** Y, 8bpp */ - GRAY8, + GRAY8, /** Y, 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb */ MONOWHITE, /** Y, 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb */ @@ -151,57 +151,57 @@ interface FFMPEGNatives { /** packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 */ UYVY422, /** packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 */ - UYYVYY411, + UYYVYY411, /** packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) */ - BGR8, + BGR8, /** packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */ - BGR4, + BGR4, /** packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) */ - BGR4_BYTE, + BGR4_BYTE, /** packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) */ - RGB8, + RGB8, /** packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */ - RGB4, + RGB4, /** packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) */ - RGB4_BYTE, + RGB4_BYTE, /** planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) */ - NV12, + NV12, /** as above, but U and V bytes are swapped */ - NV21, + NV21, /** packed ARGB 8:8:8:8, 32bpp, ARGBARGB... */ - ARGB, + ARGB, /** packed RGBA 8:8:8:8, 32bpp, RGBARGBA... */ - RGBA, + RGBA, /** packed ABGR 8:8:8:8, 32bpp, ABGRABGR... */ - ABGR, + ABGR, /** packed BGRA 8:8:8:8, 32bpp, BGRABGRA... */ - BGRA, + BGRA, /** Y, 16bpp, big-endian */ - GRAY16BE, + GRAY16BE, /** Y , 16bpp, little-endian */ - GRAY16LE, + GRAY16LE, /** planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) */ - YUV440P, + YUV440P, /** planar YUV 4:4:0 full scale (JPEG), deprecated in favor of YUV440P and setting color_range */ - YUVJ440P, + YUVJ440P, /** planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) */ - YUVA420P, + YUVA420P, /** H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */ - VDPAU_H264, + VDPAU_H264, /** MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */ - VDPAU_MPEG1, + VDPAU_MPEG1, /** MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */ - VDPAU_MPEG2, + VDPAU_MPEG2, /** WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */ - VDPAU_WMV3, + VDPAU_WMV3, /** VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */ - VDPAU_VC1, + VDPAU_VC1, /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian */ - RGB48BE, + RGB48BE, /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian */ - RGB48LE, + RGB48LE, RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian @@ -255,7 +255,7 @@ interface FFMPEGNatives { GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian COUNT ///< number of pixel formats in this list ; - /** + /** * Returns the matching PixelFormat value corresponding to the given PixelFormat's integer ordinal. ** given: diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java index 01c249313..22a045825 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -29,7 +29,7 @@ package jogamp.opengl.util.av.impl; import com.jogamp.common.util.VersionNumber; -class FFMPEGStaticNatives { +class FFMPEGStaticNatives { static VersionNumber getAVVersion(int vers) { return new VersionNumber( ( vers >> 16 ) & 0xFF, ( vers >> 8 ) & 0xFF, diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java index 22694888d..4b013c1b3 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -45,7 +45,7 @@ class FFMPEGv08Natives implements FFMPEGNatives { @Override public native int getSwResampleMajorVersionCC0(); - + @Override public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose); diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java index 08e19d5e6..d69763287 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -45,7 +45,7 @@ class FFMPEGv09Natives implements FFMPEGNatives { @Override public native int getSwResampleMajorVersionCC0(); - + @Override public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose); diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java index 0081743fa..0b5f70d7c 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -45,7 +45,7 @@ class FFMPEGv10Natives implements FFMPEGNatives { @Override public native int getSwResampleMajorVersionCC0(); - + @Override public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose); diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java index a5a701a4f..24198703a 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -45,19 +45,19 @@ import jogamp.opengl.util.av.EGLMediaPlayerImpl; */ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { static final boolean available; - + static { available = false; /** FIXME! - // OMX binding is included in jogl_desktop and jogl_mobile + // OMX binding is included in jogl_desktop and jogl_mobile GLProfile.initSingleton(); available = initIDs0(); */ } - + public static final boolean isAvailable() { return available; } - + protected long moviePtr = 0; - + public OMXGLMediaPlayer() { super(TextureType.KHRImage, true); if(!available) { @@ -70,21 +70,21 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { moviePtr = _createInstance(); if(0==moviePtr) { throw new GLException("Couldn't create OMXInstance"); - } + } } - + @Override protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) { final EGLTextureFrame eglTex = (EGLTextureFrame) super.createTexImage(gl, texName); _setStreamEGLImageTexture2D(moviePtr, texName, eglTex.getImage(), eglTex.getSync()); return eglTex; } - + @Override protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) { - super.destroyTexFrame(gl, imgTex); + super.destroyTexFrame(gl, imgTex); } - + @Override protected void destroyImpl(GL gl) { if (moviePtr != 0) { @@ -94,20 +94,20 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { moviePtr = 0; } } - + @Override protected void initStreamImpl(int vid, int aid) throws IOException { if(0==moviePtr) { throw new GLException("OMX native instance null"); } if(!streamLoc.getScheme().equals("file")) { - throw new IOException("Only file schemes are allowed: "+streamLoc); + throw new IOException("Only file schemes are allowed: "+streamLoc); } final String path=streamLoc.getPath(); if(DEBUG) { System.out.println("initGLStream: clean path "+path); } - + if(DEBUG) { System.out.println("initGLStream: p1 "+this); } @@ -121,7 +121,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { // NOP isInGLOrientation = true; } - + @Override protected int getAudioPTSImpl() { return 0!=moviePtr ? _getCurrentPosition(moviePtr) : 0; @@ -172,8 +172,8 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { final int nextTex = _getNextTextureID(moviePtr, true); if(0 < nextTex) { // FIXME set pts ! - /* FIXME - final TextureSequence.TextureFrame eglImgTex = + /* FIXME + final TextureSequence.TextureFrame eglImgTex = texFrameMap.get(new Integer(_getNextTextureID(moviePtr, blocking))); if(null!=eglImgTex) { lastTex = eglImgTex; @@ -181,7 +181,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } return 0; // FIXME: return pts } - + private String replaceAll(String orig, String search, String repl) { String dest=null; // In case replaceAll / java.util.regex.* is not supported (-> CVM) @@ -203,14 +203,14 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } private static native boolean initIDs0(); - private native long _createInstance(); + private native long _createInstance(); private native void _destroyInstance(long moviePtr); - + private native void _detachVideoRenderer(long moviePtr); // stop before private native void _attachVideoRenderer(long moviePtr); // detach before private native void _setStream(long moviePtr, int textureNum, String path); private native void _activateStream(long moviePtr); - + private native void _setStreamEGLImageTexture2D(long moviePtr, int tex, long image, long sync); private native int _seek(long moviePtr, int position); private native void _setPlaySpeed(long moviePtr, float rate); diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java index 3c468f358..2d74fa532 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java @@ -41,23 +41,23 @@ import com.jogamp.opengl.util.GLArrayDataEditable; import com.jogamp.opengl.util.glsl.ShaderState; /** - * Used for 1:1 GLSL arrays, i.e. where the buffer data - * represents this array only. + * Used for 1:1 GLSL arrays, i.e. where the buffer data + * represents this array only. */ -public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandler { - +public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandler { + public GLSLArrayHandler(GLArrayDataEditable ad) { super(ad); } - + public final void setSubArrayVBOName(int vboName) { throw new UnsupportedOperationException(); } - + public final void addSubHandler(GLArrayHandlerFlat handler) { throw new UnsupportedOperationException(); } - + public final void enableState(GL gl, boolean enable, Object ext) { final GL2ES2 glsl = gl.getGL2ES2(); if( null != ext ) { @@ -66,12 +66,12 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle enableSimple(glsl, enable); } } - + private final void enableShaderState(GL2ES2 glsl, boolean enable, ShaderState st) { if(enable) { /* * This would be the non optimized code path: - * + * if(ad.isVBO()) { glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); if(!ad.isVBOWritten()) { @@ -108,13 +108,13 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle } else if(null!=buffer) { st.vertexAttribPointer(glsl, ad); } - + st.enableVertexAttribArray(glsl, ad); } else { st.disableVertexAttribArray(glsl, ad); } } - + private final void enableSimple(GL2ES2 glsl, boolean enable) { final int location = ad.getLocation(); if( 0 > location ) { @@ -123,7 +123,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle if(enable) { /* * This would be the non optimized code path: - * + * if(ad.isVBO()) { glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); if(!ad.isVBOWritten()) { diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java index 855406db3..a5f78b5d6 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java @@ -37,7 +37,7 @@ import com.jogamp.opengl.util.GLArrayDataWrapper; import com.jogamp.opengl.util.glsl.ShaderState; /** - * Used for interleaved GLSL arrays, i.e. where the buffer data itself is handled + * Used for interleaved GLSL arrays, i.e. where the buffer data itself is handled * separately and interleaves many arrays. */ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat { @@ -50,7 +50,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat { public GLArrayDataWrapper getData() { return ad; } - + public final void syncData(GL gl, Object ext) { final GL2ES2 glsl = gl.getGL2ES2(); if( null != ext ) { @@ -62,7 +62,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat { } /** * Due to probable application VBO switching, this might not make any sense .. - * + * if(!written) { st.vertexAttribPointer(glsl, ad); } else if(st.getAttribLocation(glsl, ad) >= 0) { @@ -94,7 +94,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat { } else { glsl.glDisableVertexAttribArray(location); } - } + } } - } + } } diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java index c2048d652..bcc146d78 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java @@ -40,8 +40,8 @@ import jogamp.opengl.util.GLVBOArrayHandler; import com.jogamp.opengl.util.GLArrayDataEditable; /** - * Interleaved fixed function arrays, i.e. where this buffer data - * represents many arrays. + * Interleaved fixed function arrays, i.e. where this buffer data + * represents many arrays. */ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler { private ListsubArrays = new ArrayList (); @@ -49,13 +49,13 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL public GLSLArrayHandlerInterleaved(GLArrayDataEditable ad) { super(ad); } - + public final void setSubArrayVBOName(int vboName) { for(int i=0; i shaderRootClass, String shaderSrcRoot, String shaderBinRoot, String vertexColorFile, String vertexColorLightFile, String fragmentColorFile, String fragmentColorTextureFile) { @@ -90,14 +90,14 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun this.pmvMatrix = new PMVMatrix(); } - fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix, shaderRootClass, shaderSrcRoot, + fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix, shaderRootClass, shaderSrcRoot, shaderBinRoot, vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile); } public boolean verbose() { return fixedFunction.verbose(); } public void setVerbose(boolean v) { fixedFunction.setVerbose(v); } - + public void destroy() { fixedFunction.destroy(gl); fixedFunction = null; @@ -111,16 +111,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun public PMVMatrix getMatrix() { return pmvMatrix; } // - // FixedFuncHookIf - hooks + // FixedFuncHookIf - hooks // public void glDrawArrays(int mode, int first, int count) { fixedFunction.glDrawArrays(gl, mode, first, count); } public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) { - fixedFunction.glDrawElements(gl, mode, count, type, indices); + fixedFunction.glDrawElements(gl, mode, count, type, indices); } public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) { - fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset); + fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset); } public void glActiveTexture(int texture) { @@ -136,7 +136,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(fixedFunction.glEnable(cap, false)) { gl.glDisable(cap); } - } + } public void glGetFloatv(int pname, java.nio.FloatBuffer params) { if(PMVMatrix.isMatrixGetName(pname)) { pmvMatrix.glGetFloatv(pname, params); @@ -165,7 +165,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun } gl.glGetIntegerv(pname, params, params_offset); } - + public void glTexEnvi(int target, int pname, int value) { fixedFunction.glTexEnvi(target, pname, value); } @@ -179,7 +179,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun fixedFunction.glBindTexture(target, texture); gl.glBindTexture(target, texture); } - public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, + public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels) { // align internalformat w/ format, an ES2 requirement switch(internalformat) { @@ -212,8 +212,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun public void glPointParameterfv(int pname, java.nio.FloatBuffer params) { fixedFunction.glPointParameterfv(pname, params); } - - // + + // // MatrixIf // public int glGetMatrixMode() { @@ -253,29 +253,29 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun pmvMatrix.glScalef(x, y, z); } public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) { - glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val); + glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val); } public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar); } public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { - glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar); + glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar); } public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar); } - // + // // LightingIf // public void glColor4f(float red, float green, float blue, float alpha) { fixedFunction.glColor4f(gl, red, green, blue, alpha); } - + public void glColor4ub(byte red, byte green, byte blue, byte alpha) { - glColor4f(ValueConv.byte_to_float(red, false), - ValueConv.byte_to_float(green, false), - ValueConv.byte_to_float(blue, false), + glColor4f(ValueConv.byte_to_float(red, false), + ValueConv.byte_to_float(green, false), + ValueConv.byte_to_float(blue, false), ValueConv.byte_to_float(alpha, false) ); } public void glLightfv(int light, int pname, java.nio.FloatBuffer params) { @@ -299,17 +299,17 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun // public void glShadeModel(int mode) { fixedFunction.glShadeModel(gl, mode); - } + } public void glAlphaFunc(int func, float ref) { fixedFunction.glAlphaFunc(func, ref); } - - /** ES2 supports CullFace implicit + + /** ES2 supports CullFace implicit public void glCullFace(int faceName) { fixedFunction.glCullFace(faceName); gl.glCullFace(faceName); } */ - + // // PointerIf // @@ -340,7 +340,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun } public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) { - glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, + glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) { @@ -348,7 +348,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(vboName==0) { throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } - glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, + glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER)); } @@ -368,7 +368,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun fixedFunction.glColorPointer(gl, array); } public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) { - glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, + glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) { @@ -376,7 +376,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(vboName==0) { throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } - glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, + glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER)); } @@ -399,7 +399,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun fixedFunction.glNormalPointer(gl, array); } public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) { - glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride, + glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } public void glNormalPointer(int type, int stride, long pointer_buffer_offset) { @@ -407,7 +407,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(vboName==0) { throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } - glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride, + glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride, null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER)); } @@ -428,7 +428,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun } public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) { glTexCoordPointer( - GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, + GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) { @@ -437,7 +437,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } glTexCoordPointer( - GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, + GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER) ); } diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java index 5349745ea..187fdb309 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java @@ -59,25 +59,25 @@ import com.jogamp.opengl.util.glsl.ShaderState; import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode; /** - * + * * - * Note: Certain GL FFP state values (e.g.: alphaTestFunc and cullFace) - * are mapped to a lower number range so they can be stored in low precision storage, + * Note: Certain GL FFP state values (e.g.: alphaTestFunc and cullFace) + * are mapped to a lower number range so they can be stored in low precision storage, * i.e. in a 'lowp int' (GL ES2). *
*/ public class FixedFuncPipeline { protected static final boolean DEBUG; - + static { Debug.initSingleton(); DEBUG = Debug.isPropertyDefined("jogl.debug.FixedFuncPipeline", true); } - + /** The maximum texture units which could be used, depending on {@link ShaderSelectionMode}. */ public static final int MAX_TEXTURE_UNITS = 8; public static final int MAX_LIGHTS = 8; - + public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) { shaderRootClass = FixedFuncPipeline.class; shaderSrcRoot = shaderSrcRootDef; @@ -88,8 +88,8 @@ public class FixedFuncPipeline { fragmentColorTextureFile = fragmentColorTextureFileDef; init(gl, mode, pmvMatrix); } - public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, - Class> shaderRootClass, String shaderSrcRoot, + public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, + Class> shaderRootClass, String shaderSrcRoot, String shaderBinRoot, String vertexColorFile, String vertexColorLightFile, String fragmentColorFile, String fragmentColorTextureFile) { @@ -100,9 +100,9 @@ public class FixedFuncPipeline { this.vertexColorLightFile = vertexColorLightFile; this.fragmentColorFile = fragmentColorFile; this.fragmentColorTextureFile = fragmentColorTextureFile; - init(gl, mode, pmvMatrix); + init(gl, mode, pmvMatrix); } - + public ShaderSelectionMode getShaderSelectionMode() { return requestedShaderSelectionMode; } public void setShaderSelectionMode(ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; } public ShaderSelectionMode getCurrentShaderSelectionMode() { return currentShaderSelectionMode; } @@ -153,21 +153,21 @@ public class FixedFuncPipeline { colorStatic.put(1, green); colorStatic.put(2, blue); colorStatic.put(3, alpha); - + shaderState.useProgram(gl, true); - final GLUniformData ud = shaderState.getUniform(mgl_ColorStatic); + final GLUniformData ud = shaderState.getUniform(mgl_ColorStatic); if(null!=ud) { // same data object .. shaderState.uniform(gl, ud); } else { throw new GLException("Failed to update: mgl_ColorStatic"); - } + } } - + // // Arrays / States // - + public void glEnableClientState(GL2ES2 gl, int glArrayIndex) { glToggleClientState(gl, glArrayIndex, true); } @@ -202,7 +202,7 @@ public class FixedFuncPipeline { break; } } - + public void glVertexPointer(GL2ES2 gl, GLArrayData data) { shaderState.useProgram(gl, true); shaderState.vertexAttribPointer(gl, data); @@ -217,14 +217,14 @@ public class FixedFuncPipeline { shaderState.useProgram(gl, true); shaderState.vertexAttribPointer(gl, data); } - + // // MULTI-TEXTURE // /** Enables/Disables the named texture unit (if changed), returns previous state */ private boolean glEnableTexture(boolean enable, int unit) { - final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) ); + final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) ); if( isEnabled != enable ) { if(enable) { textureEnabledBits |= ( 1 << unit ); @@ -237,7 +237,7 @@ public class FixedFuncPipeline { } return isEnabled; } - + public void glClientActiveTexture(int textureUnit) { textureUnit -= GL.GL_TEXTURE0; if(0 <= textureUnit && textureUnit"+toHexString(ifmt)); } } else { - System.err.println("FixedFuncPipeline: Unimplemented glTexImage2D: target "+toHexString(target)+", internalformat "+toHexString(internalformat)); + System.err.println("FixedFuncPipeline: Unimplemented glTexImage2D: target "+toHexString(target)+", internalformat "+toHexString(internalformat)); } } /* public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, - int format, int type, long pixels_buffer_offset) { + int format, int type, long pixels_buffer_offset) { textureFormat.put(activeTextureUnit, internalformat); textureFormatDirty = true; }*/ - + public void glTexEnvi(int target, int pname, int value) { if(GL2ES1.GL_TEXTURE_ENV == target && GL2ES1.GL_TEXTURE_ENV_MODE == pname) { final int mode; @@ -351,7 +351,7 @@ public class FixedFuncPipeline { if( value != textureEnvMode.get(activeTextureUnit) ) { textureEnvMode.put(activeTextureUnit, value); textureEnvModeDirty = true; - } + } } public void glGetTexEnviv(int target, int pname, IntBuffer params) { // FIXME System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname)); @@ -359,13 +359,13 @@ public class FixedFuncPipeline { public void glGetTexEnviv(int target, int pname, int[] params, int params_offset) { // FIXME System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname)); } - + // // Point Sprites // public void glPointSize(float size) { pointParams.put(0, size); - pointParamsDirty = true; + pointParamsDirty = true; } public void glPointParameterf(int pname, float param) { switch(pname) { @@ -379,7 +379,7 @@ public class FixedFuncPipeline { pointParams.put(4+3, param); break; } - pointParamsDirty = true; + pointParamsDirty = true; } public void glPointParameterfv(int pname, float[] params, int params_offset) { switch(pname) { @@ -389,7 +389,7 @@ public class FixedFuncPipeline { pointParams.put(4+2, params[params_offset + 2]); break; } - pointParamsDirty = true; + pointParamsDirty = true; } public void glPointParameterfv(int pname, java.nio.FloatBuffer params) { final int o = params.position(); @@ -400,24 +400,24 @@ public class FixedFuncPipeline { pointParams.put(4+2, params.get(o + 2)); break; } - pointParamsDirty = true; + pointParamsDirty = true; } // private int[] pointTexObj = new int[] { 0 }; - + private void glDrawPoints(GL2ES2 gl, GLRunnable2