From 3b994439acd0c001b64e96634636026f11af619c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 3 Oct 2023 04:12:23 +0200 Subject: TextureSequence.setTexCoordBBox(): Add 'verbose' parameter for debug output instead hard coded branch --- .../classes/com/jogamp/opengl/util/texture/TextureSequence.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/util') diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java index 7c924864a..2951eec90 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java @@ -311,9 +311,9 @@ public interface TextureSequence { * @param box the {@Link AABBpx} of the destination * @param letterBox true to produce letter-box space to match aspect-ratio, otherwise will zoom in * @param colorTexBBox destination float[6] array for the following three texture-coordinate tuples: minX/minY, maxX/maxY, texW/texH + * @param verbose TODO */ - @SuppressWarnings("unused") - public static void setTexCoordBBox(final Texture tex, final AABBox box, final boolean letterBox, final float[] colorTexBBox) { + public static void setTexCoordBBox(final Texture tex, final AABBox box, final boolean letterBox, final float[] colorTexBBox, final boolean verbose) { final TextureCoords tc = tex.getImageTexCoords(); final float boxRatio = box.getWidth() / box.getHeight(); final float imgRatio = tex.getAspectRatio(); @@ -398,14 +398,14 @@ public interface TextureSequence { } colorTexBBox[4] = tcW; colorTexBBox[5] = tcH; - if( false ) { + if( verbose ) { final float texWidthRatio = (float)tex.getImageWidth() / (float)tex.getWidth(); final float texHeightRatio = (float)tex.getImageHeight() / (float)tex.getHeight(); final float texRatio = ( tc.right() - tc.left() ) / ( tc.bottom() - tc.top() ); final float box2TexRatio = boxRatio / texRatio; final float colorTexBBoxW = colorTexBBox[2] - colorTexBBox[0]; final float colorTexBBoxH = colorTexBBox[3] - colorTexBBox[1]; - System.err.println("XXX"); + System.err.println("XXX setTexCoordBBox:"); System.err.println("XXX ColorTex imgRatio "+imgRatio+", texRatio "+texRatio+", texPixelRatio[w "+texWidthRatio+", h "+texHeightRatio+"], "+tex); System.err.println("XXX ColorTexBBox lbox "+letterBox+", cut "+boxWidthCut+"/"+boxHeightCut+", ext "+boxWidthExt+"/"+boxHeightExt); System.err.println("XXX ColorTexBBox min "+colorTexBBox[0]+"/"+colorTexBBox[1]+", max "+colorTexBBox[2]+" x "+colorTexBBox[3]+ -- cgit v1.2.3