bool buildRenderers(const ossimKeywordlist& specFile, ossimConnectableObject::ConnectableObjectList& imageSources, ossimMapProjection* productProjection) { ossim_int32 index = 0; // add the renderer to each chain. First, look for // the ossimImageHandler and get the image // geometry for this chain. The add the ossimImageRenderer // to each chain and then connect it up // for(index = 0; index < (ossim_int32)imageSources.size(); ++index) { ossimImageChain* imageChain = PTR_CAST(ossimImageChain, imageSources[index].get()); if(imageChain) { ossimConnectableObject* source = imageChain->findFirstObjectOfType(STATIC_TYPE_INFO(ossimImageHandler)); if(source) { ossimImageHandler* imageHandler = PTR_CAST(ossimImageHandler, source); ossimRefPtr<ossimImageGeometry> geom = imageHandler->getImageGeometry(); // now add the image/view transform to the // renderer. // if(geom.valid()) { ossimImageSource* last = imageChain->getFirstSource(); ossimImageRenderer* renderer = new ossimImageRenderer; renderer->connectMyInputTo(0, PTR_CAST(ossimConnectableObject, last)); imageChain->add(renderer); ossimImageViewProjectionTransform* transform = new ossimImageViewProjectionTransform; transform->setImageGeometry(geom.get()); ossimRefPtr<ossimImageGeometry> viewGeom = new ossimImageGeometry(); viewGeom->setProjection(productProjection); // Make a copy of the view projection for // each chain by passing in the object and not // the pointer. transform->setViewGeometry(viewGeom.get()); renderer->setImageViewTransform(transform); imageChain->initialize(); } else { return false; } } } } return true; }
ossimImageCombiner::ossimImageCombiner(ossimConnectableObject::ConnectableObjectList& inputSources) :ossimImageSource(NULL, (ossim_uint32)inputSources.size(), 0, false, false), theLargestNumberOfInputBands(0), theInputToPassThrough(0), theHasDifferentInputs(false), theNormTile(NULL), theCurrentIndex(0) { theComputeFullResBoundsFlag = true; for(ossim_uint32 index = 0; index < inputSources.size(); ++index) { connectMyInputTo(index, inputSources[index].get()); } addListener((ossimConnectableObjectListener*)this); initialize(); }