MpImageWindow::MpImageWindow (MpWindow &parent, const MpImage *source, int w, int h, int x, int y, bool hold) : MpCanvas(parent,w,h,x,y), hold(hold), image(source), theXImage(NULL) { // no frame as default SetFrameWidth(0); SetFrameMidWidth(0); // convert if contents are holded if (hold) ConvertToXImage(image); }
/////////////////////////////////////////////// // CONSTRUCTOR / DECONSTRUCT / OP OVERLOADS /////////////////////////////////////////////// CAnimation::CAnimation(int nImageID,int nImageWidth,int nImageHeight, int nFrameWidth, int nFrameHeight,int nFrames,int nCurrent,float fTimePerFrame,bool bLooping,bool bStatic) { SetImageID(nImageID); SetImageWidth(nImageWidth); SetImageHeight(nImageHeight); SetFrameWidth(nFrameWidth); SetFrameHeight(nFrameHeight); // Because framecount starts at 0 SetFrameCount(nFrames - 1); SetCurrentFrame(nCurrent); SetLooping(bLooping); SetStatic(bStatic); SetTimePerFrame(fTimePerFrame); SetTimeWaited(0.0f); }
bool PS3EyeCapture::Init(const int deviceNum){ //printf("PS3 Eye cameras connected: %i\n", PS3EyeDriver::GetInstance().GetNumCameras()); SetDeviceIndex(deviceNum); //The requested FPS will be changed to the next-lowest valid framerate if an invalid framerate is requested. bool success = PS3EyeDriver::GetInstance().InitCamera(deviceNum, PS3EyeDriver::RESOLUTION_SETTING::FULL_640_480, 60); if(success){ SetFrameWidth(PS3EyeDriver::GetInstance().GetHeight(deviceNum)); SetFrameHeight(PS3EyeDriver::GetInstance().GetWidth(deviceNum)); rawData = (unsigned char*)malloc(GetFrameWidth()*GetFrameHeight()*3*sizeof(unsigned char)); //cv::Mat frame(cv::Mat(cv::Size(GetFrameWidth(), GetFrameHeight()), CV_8U)); if(useThreadedUpdate) PS3EyeDriver::GetInstance().StartThreadUpdate(); } else{ //printf("Unsuccessful\n"); } return success; }