Hey,
I'm trying to load a bumpmap image and invert it by subtracting a byte's value from 255.
The image data is stored in a ByteBuffer. When I try to access the bytes I get some strange results. For example -103. I think there should only be values from 0 to 255 ?
Are they unsigned bytes? What am I doing wrong?
Thank you very much...
and sorry for my bad English {grin}
ByteBuffer imageData = null;
IntBuffer tmp = BufferUtils.createIntBuffer(1);
IL.ilGenImages(tmp);
IL.ilBindImage(tmp.get(0));
IL.ilLoadImage(path);
IL.ilConvertImage(IL.IL_RGB, IL.IL_BYTE);
imageData = IL.ilGetData();
System.out.println(imageData.get(0)); // Output: -103
/* create texture in opengl....*/
GL11.glGenTextures(tmp);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, tmp.get(0));
.....