diff options
author | Kenneth Russel <[email protected]> | 2005-02-23 10:05:58 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-02-23 10:05:58 +0000 |
commit | 7119ba7179dd34665ec8185185adc3db0f9ce9ac (patch) | |
tree | 3686645ec572d1cdd15c23f75fecca7a4023ab72 /src | |
parent | c8dee7dfd025112ff11e6506f02060eacd4c90f2 (diff) |
Fixed Issue 140: glu.gluBuild2DMipmaps crash
Last portion of fix. Fixed typo in one loop in scale_internal_byte and
scale_internal_ubyte routines, correcting visual artifacts. Fixed
truncated comments.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@236 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/games/jogl/impl/mipmap/ScaleInternal.java | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/src/net/java/games/jogl/impl/mipmap/ScaleInternal.java b/src/net/java/games/jogl/impl/mipmap/ScaleInternal.java index 1c5321412..06c8e582f 100644 --- a/src/net/java/games/jogl/impl/mipmap/ScaleInternal.java +++ b/src/net/java/games/jogl/impl/mipmap/ScaleInternal.java @@ -84,7 +84,9 @@ public class ScaleInternal { highx = x + 0.5f; lowx = x - 0.5f; } - // Ok, now apply box filter to box that goes from + // 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; area = 0.0f; @@ -186,11 +188,14 @@ public class ScaleInternal { for( j = 0; j < widthout; j++ ) { - // Ok, now apply box filterto box that goes from + // 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; @@ -205,7 +210,7 @@ public class ScaleInternal { temp += group_size; for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) { datain.position( temp_index ); - totals[k] += ( 0x000000FF & datain.get() ) * percent; + totals[k] += ( 0x000000FF & datain.get() ) * y_percent; } } temp += group_size; @@ -301,7 +306,7 @@ public class ScaleInternal { totals[k] += ( 0x000000FF & 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++ ) { @@ -395,7 +400,9 @@ public class ScaleInternal { for( j = 0; j < widthout; j++ ) { - // Ok, now apply box filterto box that goes from + // 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 @@ -414,7 +421,7 @@ public class ScaleInternal { temp += group_size; for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) { datain.position( temp_index ); - totals[k] += datain.get() * percent; + totals[k] += datain.get() * y_percent; } } temp += group_size; @@ -604,7 +611,9 @@ public class ScaleInternal { for( j = 0; j < widthout; j++ ) { - // Ok, now apply box filterto box that goes from + // 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 @@ -878,7 +887,9 @@ public class ScaleInternal { for( j = 0; j < widthout; j++ ) { - // Ok, now apply box filterto box that goes from + // 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 @@ -1164,7 +1175,9 @@ public class ScaleInternal { for( j = 0; j < widthout; j++ ) { - // Ok, now apply box filterto box that goes from + // 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 @@ -1445,7 +1458,9 @@ public class ScaleInternal { for( j = 0; j < widthout; j++ ) { - // Ok, now apply box filterto box that goes from + // 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 @@ -1733,7 +1748,9 @@ public class ScaleInternal { for( j = 0; j < widthout; j++ ) { - // Ok, now apply box filterto box that goes from + // 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 |