Exemplo n.º 1
0
void cData::clearAll()
{
    clearClouds();
    clearCameras();
    clearImages();
    clearObjects();
}
Exemplo n.º 2
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void Texture::setSize(uint width, uint height)
{
    CVF_ASSERT(m_image.isNull());
    CVF_ASSERT(m_cubeMapImages.size() == 0);

    forgetCurrentOglTexture();
    clearImages();

    m_width = width;
    m_height = height;
}
Exemplo n.º 3
0
/**
 * @brief Saves the shows data
 * @param mediaCenterInterface MediaCenterInterface to use
 * @return Saving was successful
 */
bool TvShow::saveData(MediaCenterInterface *mediaCenterInterface)
{
    qDebug() << "Entered";
    bool saved = mediaCenterInterface->saveTvShow(this);
    if (!m_infoLoaded)
        m_infoLoaded = saved;

    setChanged(false);
    setSyncNeeded(true);
    clearImages();
    clearExtraFanartData();
    return saved;
}
Exemplo n.º 4
0
/**
 * @brief Save data using a MediaCenterInterface
 * @param mediaCenterInterface MediaCenterInterface to use
 * @return Saving was successful
 */
bool TvShowEpisode::saveData(MediaCenterInterface *mediaCenterInterface)
{
    qDebug() << "Entered";
    if (!streamDetailsLoaded() && Settings::instance()->autoLoadStreamDetails())
        loadStreamDetailsFromFile();
    bool saved = mediaCenterInterface->saveTvShowEpisode(this);
    qDebug() << "Saved" << saved;
    if (!m_infoLoaded)
        m_infoLoaded = saved;
    setChanged(false);
    setSyncNeeded(true);
    clearImages();
    return saved;
}
Exemplo n.º 5
0
void TestingWidgetFacade::showTask(TestTask task) {
    emit showTaskText(task.getTaskContent());
    emit showTaskAnswers(task.getAnswerHtml());
    if(!(task.getImageLinks().isEmpty())) {
        QStringList links = task.getImageLinks();
        QString prefix = filepath;
        prefix.remove(prefix.lastIndexOf(QChar('/')) + 1, prefix.length());
        for(int i = 0; i < links.length(); i++) {
            links[i].prepend(prefix);
        }
        emit showTaskPicture(links);
    } else {
        emit clearImages();
    }
}
Exemplo n.º 6
0
void ofxGuiGrid::setXY( int x, int y ) {
	//! Just display mode can be set X/Y
	if ( mDisplayMode == kofxGui_Grid_Display ) {
		clearImages();

		mXGrid			= x;
		mYGrid			= y;

		calculateWH();
		setSelectedId( -1 );	// Clear the selected value

		createImages();

		removeControls();
		switchDblClickMode( false );
	}
}
Exemplo n.º 7
0
bool TestingWidgetFacade::connectToTestingTaskWidget(QObject* testingtaskwidget) {
    if(!QObject::connect(this, SIGNAL(showTaskText(QString)), testingtaskwidget, SLOT(displayTaskText(QString)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(this, SIGNAL(showTaskAnswers(QString)), testingtaskwidget, SLOT(displayTaskAnswers(QString)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(this, SIGNAL(showTaskPicture(QString)), testingtaskwidget, SLOT(displayPicture(QString)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(this, SIGNAL(showTaskPicture(QStringList)), testingtaskwidget, SLOT(displayPictures(QStringList)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(this, SIGNAL(clearImages()), testingtaskwidget, SLOT(clearPictures()), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(this, SIGNAL(clearTestTask()), testingtaskwidget, SLOT(clearAll()), Qt::AutoConnection)) {
        return 0;
    }
    return 1;
}
Exemplo n.º 8
0
  int mpiUser::doImgCalcs(void)
   {

      //
      // we hav these variables on each new image at our disposal
      //

      //public_double_image[0] integrating dark, [1] is the integrating std iamge.
       //num_dark_integrate is how many darks we must integrate total.
         //num_images_to_calc is total images to calc across all ranks
     // img_num_pixels is number if pixels in the iamge.
     //img_size_x, img_size_y is size of iamge in pixels
     // public_short_image are new image, [0] is new iamge

   // my_message is the gui settings, and all mpi iamges. specs from image from detector is there as well.
    //        detector image sopecs also appear at end of piblic_short_image[0], after pidxels. getImageSpecs gets this into
   //  image_specs    - the specs of the image from the detector. also copied into my_message in super class.
    //is_calc_image - if true that means we have an image to calc in this rank.

        printTrace("mpiUser::doImgCalcs================================================");


                //get img specs for public  iamge 0

        if (is_calc_image)
        {
            //get specs for pub img 0
            getImageSpecs(0);


            if (is_print_trace)
            {
                printf("Rank %d got Img num %d\n",rank,image_specs->inpt_img_cnt);
            }

            if (my_message.mpi_save_mem_file && is_calc_image)
            {
                writeImageRaw(public_short_image[0],pub_sh_img_size_bytes*sizeof(short) ,"PubImg",0);
            }


            image_specs->is_descrambled=false;

            //we normally uyse img 0,. if desc is on, we outptu to img 1, so we use that one...



            if (my_message.mpi_is_descramble)
            {
                //take pub image putput to private image
                //partialDescramble(imgx, imgy,0, count,rank,numprocs);

                //we have a bunch of public_image[], all mapped to one contiguous mem
                //starting at public_iamge[0][0]. hwere is the map
                // public_image[0] - raw iamge for all ranks
                // publc_image[1] -descramled image for ll ranks



                image_specs->is_descrambled=true;

                printTrace("doImgCalcs,mpi_b_image_desc2 ");

                if (is_made_desc_table)
                    this->tableDescramble2(1,0);
                else
                {
                    //make desc table and inverse desc table
                    //also desc the image to pub image 1. we will end up desc. again after
                    //making table, so the desc operation here is ONLTY for makin gtable.
                    // desc image is not used.
                    this->descramble_image_jtw1(public_short_image[1],
                                            public_short_image[0],
                                            img_size_x,
                                            img_size_y,
                                            img_num_pixels);

                    //alter desc table to remove overscan lines
                    //!!if (message&mpi_b_remove_overscan)
                    this->removeOverscan(public_short_image[1],
                                             public_short_image[1],
                                             img_size_x,
                                             img_size_y,
                                             img_num_pixels);

                    //we will calc new desc table as we desc image
                    is_made_desc_table=true;

                    //now clear the image and do a table descranble. this is needed if overscan
                    //removal is on, so extra puixels at end of images will be zero.
                    //extra pixels happen becasue we remove overscan pixels, and shift whole image\
                    // to top left corner. so we end up w/ extra pixels on right and bottom.
                    clearImages(1);

                    //now do the actual desc, amd rem overscan
                    this->tableDescramble2(1,0);


                }
                //do this calc
                memcpy(public_short_image[0],public_short_image[1],img_num_pixels*sizeof(short));

            }


            if (my_message.mpi_is_flip_endian)
            {
                flipEndian(0);
            }

            my_message.gui.is_acq_dark_RBV=is_acc_darks;

            if (is_acc_darks)
            {
                //accum pub img 0 into dark accum... of needed.
                // 1st 0 is input imate or puclc_sh_image 0.
                //2nd arg0 is puiblic double image 0.

                accumDarkStd(0,0);


                //
                // now we must make a square image, and accum into the 2nd pub image.
                //

                // make a sqire image
                double dval;
                for (int p=0; p<img_num_pixels;p++)
                {
                    dval =(double) public_short_image[0][p];
                    dval = dval*dval;
                    square_image[p] = dval;
                }

                //accum square intop public_double_iamge[1]
                accumDarkStd(square_image,1);

            }

            if (my_message.mpi_sub_dark && is_calc_image)
            {


                //0 is offset from top of image, 1 is publc_image[1]
                printTrace("doImgCalcs, mpi_b_sub_dark");
                subDark(0);


            }

            image_specs->dark_accum_tot=dark_integrate_counter;
            image_specs->rank_dark_accum_cnt=rank_dark_accum_cnt;

            if (my_message.mpi_is_makeraw_imm )
            {
                printTrace("mpiUser- making raw IMM\n");

                my_imm.rawToIMM(
                        (unsigned char*)public_short_image[0],
                        img_num_pixels*sizeof(short),
                        2,
                        img_size_x,
                        img_size_y,
                        0,
                        0,
                        image_specs->inpt_img_cnt,
                        temp_image,
                        &my_message.imm_bytes);

                    //imm_bytes is img siize plus imm header size
                image_specs->is_raw_imm=true;
                image_specs->is_raw=false;
                image_specs->imm_num_pixels=img_num_pixels;
                image_specs->is_compressed=false;
                image_specs->num_pixels=my_message.imm_bytes/2;

                immHeader *immh = (immHeader*)temp_image;
                immh->systick=image_specs->system_clock;
                immh->elapsed=(double)(immh->systick) / 1000.0;
                immh->corecotick=image_specs->inpt_img_cnt;
                memcpy(public_short_image[0],temp_image,my_message.imm_bytes);
            }

            if (my_message.mpi_is_makecomp_imm )
            {
                printTrace("mpiUser- making comp IMM\n");
                my_imm.rawToCompIMM(
                        (unsigned char*)public_short_image[0],
                        img_num_pixels*sizeof(short),
                        2,
                        img_size_x,
                        img_size_y,
                        0,
                        image_specs->img_len_shorts * 2,//max size of space for data
                        (unsigned char*)temp_image,
                        &my_message.imm_bytes);


                image_specs->is_raw_imm=false;
                image_specs->is_raw=false;
                immHeader *imh = (immHeader*)((unsigned char*)temp_image);
                image_specs->imm_num_pixels=imh->dlen;
                image_specs->is_compressed=true;
                image_specs->num_pixels=my_message.imm_bytes/2;

                immHeader *immh = (immHeader*)temp_image;
                immh->systick=image_specs->system_clock;
                immh->elapsed=(double)(immh->systick) / 1000.0;
                immh->corecotick=image_specs->inpt_img_cnt;


                memcpy(public_short_image[0],temp_image,my_message.imm_bytes);

            }


            if (my_message.gui.which_img_view==1)
            {
                //adrk img
                //std img
                image_specs->is_raw_imm=false;
                image_specs->is_raw=true;

                image_specs->imm_num_pixels=0;
                image_specs->is_compressed=false;
                image_specs->num_pixels=img_num_pixels;


                for (int k=0;k<img_num_pixels;k++)
                {
                    public_short_image[0][k]=(unsigned short)(public_double_image[0][k]);
                }

            }

            if (my_message.gui.which_img_view==2)
            {
                //std img
                image_specs->is_raw_imm=false;
                image_specs->is_raw=true;

                image_specs->imm_num_pixels=0;
                image_specs->is_compressed=false;
                image_specs->num_pixels=img_num_pixels;


                for (int k=0;k<img_num_pixels;k++)
                {
                    public_short_image[0][k]=(unsigned short)(public_double_image[1][k]);
                }

            }

            if (my_message.gui.which_img_view==3)
            {
                //thresh img:

                image_specs->is_raw_imm=false;
                image_specs->is_raw=true;

                image_specs->imm_num_pixels=0;
                image_specs->is_compressed=false;
                image_specs->num_pixels=img_num_pixels;

                memcpy(public_short_image[0],sthresh_image,img_num_pixels*sizeof(short));
            }

            image_specs->processed_by_rank=rank;
    }

        //must be outside of the if_calc_iamge
        // this must execute on every rank regardless if we have img.
        // has barriers and fences etc.

        //we get total average of all darks into pub dooub img 0.
        //is_finish_darks goes true when it is time to compute total sum,
        // that is, when accum is done. we must set to false ourselves.
        if (is_finish_darks)
        {
            combineDarkStd(0,1.0);
            // here we will get basic sum of all squared images into pub doub img 1.
            double noise_mult_factor =1.0;
            combineDarkStd(1,noise_mult_factor);

            //writeImageRaw(public_double_image[0],img_num_pixels*sizeof(double),"AA_DsumImage",0);
            //writeImageRaw(public_double_image[1],img_num_pixels*sizeof(double),"AA_DsumSqImage",0);
            // now calc the std image and thresh hold iamges
            calcThresh();
           // writeImageRaw(public_double_image[0],img_num_pixels*sizeof(double),"AA_DAveImage",0);
            //writeImageRaw(public_double_image[1],img_num_pixels*sizeof(double),"AA_DStdImage",0);

            //writeImageRaw(sdark_image,img_num_pixels*sizeof(short),"AA_UDarkImage",0);
            //writeImageRaw(sthresh_image,img_num_pixels*sizeof(short),"AA_UThreshImage",0);

            //writeImageRaw(square_image,img_num_pixels*sizeof(double),"AA_DVarianceImg",0);

            //is_finish_darks=false;
        }





        printTrace("mpiUser::doImgCalcs_______________________________________________");


return(1);
  }
Exemplo n.º 9
0
ImageManager::~ImageManager(void)
{
	clearImages();
}