I have a bunch of sid files that are of the same coordinate space and resolution.
What I want to do is pass that to the LTIMosaicFilter to created a single mosaicked image.
To do that, LTIMosaicFIlter requires a LTIImageStageManager of the set of sid files, and I have a hard time figuring out how to initialize the MrSIDImageStageManager with more than one sid file.
MrSIDImageStageManager help
Moderator: jskiffington
7 posts
• Page 1 of 1
You will want to try something like this.
SimpleImageStageManager manager = new ...
MrSIDImageReader src1 = new ...
src1->initialize(...)
manager->addImageStage(src1)));
MrSIDImageReader src2 = new ...
src2->initialize(...)
manager->addImageStage(src2)));
LTIMosaicFilter> mosaic = new ...
mosaic->initialize(manager, NULL, false, false);
SimpleImageStageManager manager = new ...
MrSIDImageReader src1 = new ...
src1->initialize(...)
manager->addImageStage(src1)));
MrSIDImageReader src2 = new ...
src2->initialize(...)
manager->addImageStage(src2)));
LTIMosaicFilter> mosaic = new ...
mosaic->initialize(manager, NULL, false, false);
- gat
- Posts: 28
- Joined: Mon Jan 12, 2009 12:41 pm
Ah, I'm sorry about that. You will need to implement SimpleImageStageManager. Here is an example on how you could do that. This code comes from some inhouse validation code and is not public but shows how to do it.
/* $Id$ */
/* //////////////////////////////////////////////////////////////////////////
// //
// This code is Copyright (c) 2003 LizardTech, Inc, 1008 Western Avenue, //
// Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
// prohibited. Access to and use of this code is permitted only under //
// license from LizardTech, Inc. Portions of the code are protected by //
// US and foreign patents and other filings. All Rights Reserved. //
// //
////////////////////////////////////////////////////////////////////////// */
#ifndef _SimpleImageStageManager_h
#define _SimpleImageStageManager_h
// lt_lib_utils
#include "lt_new.h"
// lt_lib_mrsid_imageFilters
#include "lti_imageStageManager.h"
LT_USE_NAMESPACE(LizardTech);
/**
* This LTIImageStageManager implementation holds an array of previously-
* instantiated LTIImageStage pointers and does not destroy them until the
* destructor. The createImageStage() a method is essentially accessor.
*
* Such a strategy for managing image stages should not be used in production,
* but it is useful for validation code.
*/
class SimpleImageStageManager : public LTIImageStageManager
{
LT_DISALLOW_COPY_CONSTRUCTOR(SimpleImageStageManager);
protected:
SimpleImageStageManager(void) :
m_images(NULL)
{
}
~SimpleImageStageManager(void)
{
if(m_images)
{
for(lt_uint32 i = 0; i < getNumImages(); i++)
LTI_RELEASE(m_images[i]);
::free(m_images);
}
}
public:
static SimpleImageStageManager *create(void)
{
LT_USE_MEMMGR;
return LT_NEW(SimpleImageStageManager, LT_NOP);
}
LT_STATUS addImageStage(LTIImageStage *imageStage)
{
lt_uint32 numImages = getNumImages();
lt_uint32 oldLen = (numImages + 0x1F) & ~0x1F;
lt_uint32 newLen = (numImages + 1 + 0x1F) & ~0x1F;
if(oldLen != newLen)
m_images = (LTIImageStage **)::realloc(m_images, newLen * sizeof(LTIImageStage *));
if(!m_images)
return LT_STS_OutOfMemory;
m_images[numImages] = LTI_RETAIN(imageStage);
setNumImages(numImages + 1);
return LT_STS_Success;
}
LT_STATUS createImageStage(lt_uint32 imageNumber,
LTIImageStage *&imageStage)
{
imageStage = LTI_RETAIN(m_images[imageNumber]);
return LT_STS_Success;
}
private:
LTIImageStage** m_images;
};
#endif // _SimpleImageStageManager_h
/* $Id$ */
/* //////////////////////////////////////////////////////////////////////////
// //
// This code is Copyright (c) 2003 LizardTech, Inc, 1008 Western Avenue, //
// Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
// prohibited. Access to and use of this code is permitted only under //
// license from LizardTech, Inc. Portions of the code are protected by //
// US and foreign patents and other filings. All Rights Reserved. //
// //
////////////////////////////////////////////////////////////////////////// */
#ifndef _SimpleImageStageManager_h
#define _SimpleImageStageManager_h
// lt_lib_utils
#include "lt_new.h"
// lt_lib_mrsid_imageFilters
#include "lti_imageStageManager.h"
LT_USE_NAMESPACE(LizardTech);
/**
* This LTIImageStageManager implementation holds an array of previously-
* instantiated LTIImageStage pointers and does not destroy them until the
* destructor. The createImageStage() a method is essentially accessor.
*
* Such a strategy for managing image stages should not be used in production,
* but it is useful for validation code.
*/
class SimpleImageStageManager : public LTIImageStageManager
{
LT_DISALLOW_COPY_CONSTRUCTOR(SimpleImageStageManager);
protected:
SimpleImageStageManager(void) :
m_images(NULL)
{
}
~SimpleImageStageManager(void)
{
if(m_images)
{
for(lt_uint32 i = 0; i < getNumImages(); i++)
LTI_RELEASE(m_images[i]);
::free(m_images);
}
}
public:
static SimpleImageStageManager *create(void)
{
LT_USE_MEMMGR;
return LT_NEW(SimpleImageStageManager, LT_NOP);
}
LT_STATUS addImageStage(LTIImageStage *imageStage)
{
lt_uint32 numImages = getNumImages();
lt_uint32 oldLen = (numImages + 0x1F) & ~0x1F;
lt_uint32 newLen = (numImages + 1 + 0x1F) & ~0x1F;
if(oldLen != newLen)
m_images = (LTIImageStage **)::realloc(m_images, newLen * sizeof(LTIImageStage *));
if(!m_images)
return LT_STS_OutOfMemory;
m_images[numImages] = LTI_RETAIN(imageStage);
setNumImages(numImages + 1);
return LT_STS_Success;
}
LT_STATUS createImageStage(lt_uint32 imageNumber,
LTIImageStage *&imageStage)
{
imageStage = LTI_RETAIN(m_images[imageNumber]);
return LT_STS_Success;
}
private:
LTIImageStage** m_images;
};
#endif // _SimpleImageStageManager_h
- gat
- Posts: 28
- Joined: Mon Jan 12, 2009 12:41 pm
[quote="gat"]
static SimpleImageStageManager *create(void)
{
LT_USE_MEMMGR;
return LT_NEW(SimpleImageStageManager, LT_NOP);
}
[/quote]
This was helpful, but I can't find these macros in the SDK (LT_USE_MEMMGR, LT_NEW, LT_NOP). Are they defined somewhere?
static SimpleImageStageManager *create(void)
{
LT_USE_MEMMGR;
return LT_NEW(SimpleImageStageManager, LT_NOP);
}
[/quote]
This was helpful, but I can't find these macros in the SDK (LT_USE_MEMMGR, LT_NEW, LT_NOP). Are they defined somewhere?
- rymc26
- Posts: 3
- Joined: Tue Jan 19, 2010 2:15 pm
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
- Forum index
- The team • Delete all board cookies • All times are UTC - 7 hours
