soulfreezer wrote on Tuesday, August 10, 2010:
Hi,
I want to manipulate the Image-Data, which I got from the glfwReadImage-
Function. I loaded a tga-File with an alpha-channel.
Now I have two questions:
1. What means the Flag: GLFW_ORIGIN_UL_BIT ?? does it work correctly?
I had created an 256x256 TGA-File with GIMP and then saved it with “Origin in
the Upper Left”. If I read this file with glfwReadImage and then texture it on
a quad, it is painted reverse! If I REMOVE the flag GLFW_ORIGIN_UL_BIT
from the glfwReadImage and replace it with a 0, then it appears correct! If I
create in GIMP a TGA-File, which is NOT saveing the Origin in the upper left
and then I use glfwReadImage with the GLFW_ORIGIN_UL_BIT-Flag, it is ALSO
painted reverse!
Can someone explain me plz, how the usage of this flag is meant?
2. Whats the internal format of GLFWimage ?
I loaded a TGA with alphachannel and it is correct painted. The transparent is
correct set. That means, the data in GLFWImage
seems to be correct. But how can I manipulate the Data in the GLFWImage-
Struct?
I have read, that in GL_RGBA-Mode the Pixels are linear stored from the
bottom left to the upper right? Correct?
for example I want to draw a simple line into my loaded Image:
GLFWImage img;
//Read the Stuff ….
//Manipulate
for(int i=0; i< 100; i+=4)
{
img.date_ = 255;
img.date = 0;
img.date = 0;
img.date = 0;
}
I thougt, I would get a horizontal red line at the bottom of my image but that
is not the case. I can see one small line at the bottom (much to small) and
one synchron thin line at the top of the image! Does anybody know, what I do
wrong?
I have checked img.Format and it is correct -> GL_RGBA! The image is correct
painted, only my modification seems to be incorrect
Thanx so much for help!!
Grtz Soul
_