[jogl~jogl-git:07684c8f] imageSizeInBytes .. leaving out the dirt/padding last line
- From: svengothel@kenai.com
- To: commits@jogl.kenai.com
- Subject: [jogl~jogl-git:07684c8f] imageSizeInBytes .. leaving out the dirt/padding last line
- Date: Mon, 19 Oct 2009 07:41:48 +0000
Project: jogl
Repository: jogl-git
Revision: 07684c8fe9534c235d0320ad693be24a8bdcada1
Author: svengothel
Date: 2009-10-19 07:41:09 UTC
Link:
Log Message:
------------
imageSizeInBytes .. leaving out the dirt/padding last line
Revisions:
----------
07684c8fe9534c235d0320ad693be24a8bdcada1
Modified Paths:
---------------
make/config/jogl/gl-impl-CustomJavaCode-desktop.java
make/config/jogl/gl-impl-CustomJavaCode-embedded.java
Diffs:
------
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
index fb06aa4..04ba39c 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
@@ -71,12 +71,9 @@ private int imageSizeInBytes(int bytesPerElement,
* rowlenght is the actual repeating offset
* to go from line n to line n+1 at the same x-axis position.
*/
- int imageSize = imageHeight * rowLengthInBytes;
-
- int skipOffset = skipImages * imageSize +
- skipRows * rowLengthInBytes +
- skipPixels * bytesPerElement;
-
- return skipOffset + imageSize * depth;
+ return
+ ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + //
whole images
+ ( skipRows + height - 1 ) * rowLengthInBytes + //
lines with padding
+ ( skipPixels + width ) * bytesPerElement; //
last line
}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-embedded.java
b/make/config/jogl/gl-impl-CustomJavaCode-embedded.java
index ae90a42..0408c21 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-embedded.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-embedded.java
@@ -34,7 +34,9 @@ private int imageSizeInBytes(int bytesPerElement,
* rowlenght is the actual repeating offset
* to go from line n to line n+1 at the same x-axis position.
*/
- int imageSize = imageHeight * rowLengthInBytes;
-
- return imageSize * depth;
+ return
+ ( depth - 1 ) * imageHeight * rowLengthInBytes + // whole
images
+ ( imageHeight - 1 ) * rowLengthInBytes + // lines with
padding
+ ( rowLength ) * bytesPerElement; // last line
}
+
|
[jogl~jogl-git:07684c8f] imageSizeInBytes .. leaving out the dirt/padding last line |
svengothel | 10/19/2009 |






