Accessing a portion of an uploaded texture

Is there any way I can divide up a texture that has already been uploaded and my data deleted? What I mean is that if I have the integer texture name of a texture I want to divide up and I no longer have access to the image data (or pointer to the image data), is there a way that I can select portions of the texture in a manner similar to glTexSubImage2D?

The problem I have is that I have a texture manager that loads just about any type of image file but discards the image data once the texture is uploaded. I cannot get the pointer to the image data needed by glTexSubImage2D but I need to divy up an existing texture in the same manner.

Any thoughts?

Re-downloading the image with glGetTexImage then using the data in glTexSubImage2D is the only technique that comes to my mind. (Unless you want to render the texture to a p-buffer then do a sub-load from frame)

If you need access to the image data once you’ve uploaded the texture, surely the obvious solution is to change the texture manager to allow you to keep track of the image data.

Thx sqrt, i’ll give that a shot.

here’s another idea:
render the texture in a screen aligned quad to the frame buffer or to a pbuffer, then glCopyTexSubImage from the framebuffer into another texture.
Of course, the framebuffer approach is limited by the size of your viewport, and the pbuffer approach by the slight pain of setting up a pbuffer and the cost of context switching (which is still very high in my opinion)