void _wrap_appendLayer() { unsigned int *arg1 = (unsigned int *) 0 ; unsigned int *arg2 = (unsigned int *) 0 ; int arg3 ; int arg4 ; bool arg5 ; { AS3_GetScalarFromVar(arg1, pixels); } { AS3_GetScalarFromVar(arg2, colorPixels); } { AS3_GetScalarFromVar(arg3, width); } { AS3_GetScalarFromVar(arg4, height); } { AS3_GetScalarFromVar(arg5, flip); } appendLayer(arg1,arg2,arg3,arg4,arg5); { } { AS3_ReturnAS3Var(undefined); } }
MIPControl::MIPControl( presets::MIPStage& mip, QWidget* parent ) : VolumeRenderingControl( mip, parent ) , pimpl( new Details( *this ) ) , mip( mip ) { QVBoxLayout* const layout = new QVBoxLayout(); /* Add 'sample rate' configurator. */ QFormLayout* const general = new QFormLayout(); general->addRow( "Sample Rate:", sbSampleRate ); layout->addLayout( general ); /* Add layers list. */ QPushButton* const buAddChannel = new QPushButton( "&Add Layer" ); connect( buAddChannel, SIGNAL( clicked() ), this, SLOT( appendLayer() ) ); layout->addWidget( buAddChannel ); pimpl->layers->addStretch(); layout->addLayout( pimpl->layers ); layout->setContentsMargins( 0, 0, 0, 0 ); pimpl->layers->setContentsMargins( 0, 0, 0, 0 ); QHBoxLayout* const bottom_buttons = new QHBoxLayout(); QPushButton* const buSaveColorConfig = new QPushButton( "Save" ); QPushButton* const buLoadColorConfig = new QPushButton( "Load" ); bottom_buttons->addWidget( buSaveColorConfig ); bottom_buttons->addWidget( buLoadColorConfig ); bottom_buttons->addStretch( 1 ); QVBoxLayout* master = new QVBoxLayout(); master->addLayout( layout ); master->addLayout( bottom_buttons ); connect( buSaveColorConfig, SIGNAL( clicked() ), this, SLOT( saveColorConfig() ) ); connect( buLoadColorConfig, SIGNAL( clicked() ), this, SLOT( loadColorConfig() ) ); this->setLayout( master ); /* Initialize layers list. */ for( std::size_t layerIdx = 0; layerIdx < mip.layersCount(); ++layerIdx ) { presets::MIPLayer& layer = mip.layer( layerIdx ); pimpl->appendControl( layer ); } }
/** * Class constructor. */ TopologyWidget::TopologyWidget(QWidget *parent) : QWidget(parent), ui(new Ui::TopologyWidget), model(NULL){ ui->setupUi(this); //creates and adds newt param widget to layout npw = new NetParamWidget(this); ui->splitterH->addWidget(npw); //connects signal slots connect(ui->appendButton, SIGNAL(pressed()), this, SLOT(appendLayer())); connect(ui->removeButton, SIGNAL(pressed()), this, SLOT(removeSelected())); connect(ui->duplicateButton, SIGNAL(pressed()), this, SLOT(duplicateSelected())); connect(ui->closeButton, SIGNAL(pressed()), this, SLOT(closeBtnPressed())); //adds layout to layer editor layerEditLayout = new QVBoxLayout(ui->layerScrollAreaContent); ui->layerScrollAreaContent->setLayout(layerEditLayout); layerEditLayout->setMargin(0); layerEditLayout->setSpacing(0); layerEditLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); }
void MIPControl::appendLayer() { const base::Color color = pimpl->nextColor++; presets::MIPLayer* const newLayer = new presets::MIPLayer( -1024, 3071, color ); appendLayer( newLayer ); }
/////////////////////////////////////////////////////////////////////// // Function : appendPyramid // Description : Append an image pyramid into an image file // the reduction gives the amount of reduction in the image size at each step // Return Value : // Comments : template <class T> static void appendPyramid(TIFF *out,int &dstart,int numSamples,int bitsperpixel,int tileSize,int width,int height,T *data) { T *currentLevel; int currentWidth,currentHeight,nextWidth,nextHeight; float *fnextLevel; // Append the base layer appendLayer(out,dstart++,numSamples,bitsperpixel,tileSize,width,height,data); // Append the remaining layers currentWidth = width; currentHeight = height; currentLevel = data; fnextLevel = (float *) ralloc(width*height*numSamples*sizeof(float),CRenderer::globalMemory); int numLevels = tiffNumLevels(width,height); int i; for (i=1;i<numLevels;i++) { int x,y,yo; int s; nextWidth = currentWidth >> 1; nextHeight = currentHeight >> 1; for (y=0,yo=0;y<nextHeight;y++,yo+=2) { T *src = ¤tLevel[yo*currentWidth*numSamples]; float *dest = &fnextLevel[y*nextWidth*numSamples]; int n; for (x=0;x<nextWidth;x++) { for (n=0;n<numSamples;n++) { dest[n] = src[n]; dest[n] += src[numSamples+n]; } dest += numSamples; src += 2*numSamples; } src = ¤tLevel[(yo+1)*currentWidth*numSamples]; dest = &fnextLevel[y*nextWidth*numSamples]; for (x=0;x<nextWidth;x++) { for (n=0;n<numSamples;n++) { dest[n] += src[n]; dest[n] += src[numSamples+n]; } dest += numSamples; src += 2*numSamples; } dest = &fnextLevel[y*nextWidth*numSamples]; for (x=0;x<nextWidth*numSamples;x++) { *dest++ *= 1/(float) 4; } } for (s=0;s<nextWidth*nextHeight*numSamples;s++) { currentLevel[s] = (T) fnextLevel[s]; } currentWidth = nextWidth; currentHeight = nextHeight; appendLayer(out,dstart++,numSamples,bitsperpixel,tileSize,currentWidth,currentHeight,currentLevel); } }