Looking for a little advice. I have a collection of .sid and .jp2 images (both are the same, I have them in both formats). I was hoping to use the .sid images since they are lossless.
Anyway, in the end I need the images as a XImage so I can display them in my motif application. I was doing something like (this is kind of combination of v4 and v7 code, I haven't ported completely).
J2KImageReader *reader = J2KImageReader::create();
reader->initialize(fileSpec, false);
const LTIScene scene(x, y, w, h, 1.0);
LTISceneBuffer bufData(reader->getPixelProps(), w, h, bufs);
reader->read(scene, bufData);
Then convert the image to RGB pixel to pixel
red = static_cast<lt_uint8*>(bufs[0])[count];
green = static_cast<lt_uint8*>(bufs[1])[count];
blue = static_cast<lt_uint8*>(bufs[2])[count];
rgb[pixelX][pixelY] = adt::RGB((unsigned char)red, (unsigned char)green, (unsigned char)blue);
Then using XPutPixel() to create my XImage.
This is terribly slow (at least the v4 SDK was. I haven't finished the port to v7 yet). Especially in the size image files I am using.
I am just now starting to look at the v7 SDK. And it sounds like I might be able to do something with LTIViewerImageFilter but I am not completely sure.
Any random thoughts here for a good way to make the connection?
- Brian
.sid/.jp2 image to XImage
Moderator: jskiffington
2 posts
• Page 1 of 1
Our support for ximage is very limited(in fact we don't provide support for other products in general) but someone mentioned the following:
The key is to convert the BSQ sceneBuffer to BIP and then pass the BIP buffer the to the XCreateImage call.
I hope that helps. Pixel by pixel is certainly going to be slow.
Update - you can use:
LTISceneBuffer::exportDataBIP()
to do the BSQ->BIP
The key is to convert the BSQ sceneBuffer to BIP and then pass the BIP buffer the to the XCreateImage call.
I hope that helps. Pixel by pixel is certainly going to be slow.
Update - you can use:
LTISceneBuffer::exportDataBIP()
to do the BSQ->BIP
- gat
- Posts: 28
- Joined: Mon Jan 12, 2009 12:41 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests
- Forum index
- The team • Delete all board cookies • All times are UTC - 7 hours
