aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-03 04:55:14 +0100
committerSven Göthel <[email protected]>2024-02-03 04:55:14 +0100
commit5acc02aee010d0bae0186bf906bd0c5e8abfb948 (patch)
treeea68fbe05969555931e08231cbda18a502339648 /src/jogl/classes/jogamp/graph
parent7cc0bf0d58a3e3f672ce2e4f179de21f1f67dc93 (diff)
Typecast: Cleanup: final
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/TTGlyph.java23
2 files changed, 19 insertions, 18 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
index 2d9d4e4b7..7a29cdee8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
@@ -809,7 +809,7 @@ public class Fixed {
* @param num Input
* @return Output
*/
- public static int arctan( int num ) {
+ public static int arctan( final int num ) {
return 0;
}
@@ -819,7 +819,7 @@ public class Fixed {
* @param num The 26.6 fixed number in question
* @return The resulting square root
*/
- public static int squareRoot(int num) {
+ public static int squareRoot(final int num) {
int n = num;
int divisor = num;
int nSquared;
@@ -837,16 +837,16 @@ public class Fixed {
}
return n;
}
-
+
/**
* Converts a 32-bit signed fixed-point number (16.16) to <code>float</code>.
*/
- public static float floatValue(long fixed) {
+ public static float floatValue(final long fixed) {
return (fixed >> 16) + (float)(fixed & 0xffff) / 0x10000;
}
-
- public static float roundedFloatValue(long fixed, int decimalPlaces) {
- int factor = 10 * decimalPlaces;
+
+ public static float roundedFloatValue(final long fixed, final int decimalPlaces) {
+ final int factor = 10 * decimalPlaces;
return (float)((int)(floatValue(fixed) * factor)) / factor;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/TTGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/TTGlyph.java
index 880625520..89e1a5570 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/TTGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/TTGlyph.java
@@ -31,7 +31,7 @@ public class TTGlyph extends Glyph {
private short _leftSideBearing;
private int _advanceWidth;
private Point[] _points;
-
+
/**
* Construct a Glyph from a TrueType outline described by
* a GlyphDescription.
@@ -39,17 +39,18 @@ public class TTGlyph extends Glyph {
* @param lsb The Left Side Bearing.
* @param advance The advance width.
*/
- public TTGlyph(GlyphDescription gd, short lsb, int advance) {
+ public TTGlyph(final GlyphDescription gd, final short lsb, final int advance) {
super( gd.getGlyphIndex() );
_leftSideBearing = lsb;
_advanceWidth = advance;
describe(gd);
}
+ @Override
public final void clearPointData() {
_points = null;
}
-
+
@Override
public int getAdvanceWidth() {
return _advanceWidth;
@@ -61,7 +62,7 @@ public class TTGlyph extends Glyph {
}
@Override
- public Point getPoint(int i) {
+ public Point getPoint(final int i) {
return _points[i];
}
@@ -79,8 +80,8 @@ public class TTGlyph extends Glyph {
/**
* @param factor a 16.16 fixed value
*/
- public void scale(int factor) {
- for (Point _point : _points) {
+ public void scale(final int factor) {
+ for (final Point _point : _points) {
//points[i].x = ( points[i].x * factor ) >> 6;
//points[i].y = ( points[i].y * factor ) >> 6;
_point.x = ((_point.x << 10) * factor) >> 26;
@@ -93,12 +94,12 @@ public class TTGlyph extends Glyph {
/**
* Set the points of a glyph from the GlyphDescription
*/
- private void describe(GlyphDescription gd) {
+ private void describe(final GlyphDescription gd) {
int endPtIndex = 0;
- int pointCount = gd != null ? gd.getPointCount() : 0;
+ final int pointCount = gd != null ? gd.getPointCount() : 0;
_points = new Point[pointCount /* + 2 */];
for (int i = 0; i < pointCount; i++) {
- boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
+ final boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
if (endPt) {
endPtIndex++;
}
@@ -112,10 +113,10 @@ public class TTGlyph extends Glyph {
// Append the origin and advanceWidth points (n & n+1)
// _points[pointCount] = new Point(0, 0, true, true);
// _points[pointCount+1] = new Point(_advanceWidth, 0, true, true);
-
+
_bbox = new AABBox(gd.getXMinimum(), gd.getYMinimum(), 0, gd.getXMaximum(), gd.getYMaximum(), 0);
}
-
+
@Override
public String toString() {
return new StringBuilder()