HRESULT ImageReaderSensor::processColor() { HRESULT hr = S_OK; if (m_CurrentFrameNumberColor >= m_NumFrames) { return S_FALSE; } bool readColor = false; if (readColor) { char frameNumber_c[10]; sprintf_s(frameNumber_c,"%06d", m_CurrentFrameNumberDepth+1); std::string frameNumber(frameNumber_c); std::string currFileName = m_BaseFilename; currFileName.append("color/").append(frameNumber).append(".png"); ColorImageRGB image; FreeImageWrapper::loadImage(currFileName, image); image.flipY(); for (UINT i = 0; i < getDepthWidth() * getDepthHeight(); i++) { vec3f c = image.getDataPointer()[i]; c = 255.0f*c; m_colorRGBX[4*i+0] = (BYTE)c.x; m_colorRGBX[4*i+1] = (BYTE)c.y; m_colorRGBX[4*i+2] = (BYTE)c.z; m_colorRGBX[4*i+3] = 255; } } m_CurrentFrameNumberColor++; return hr; }
// This function commits the CCLayerTreeHost to an impl tree. When modifying // this function, keep in mind that the function *runs* on the impl thread! Any // code that is logically a main thread operation, e.g. deletion of a LayerChromium, // should be delayed until the CCLayerTreeHost::commitComplete, which will run // after the commit, but on the main thread. void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl) { ASSERT(CCProxy::isImplThread()); hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->releaseRootLayer())); // We may have added an animation during the tree sync. This will cause both layer tree hosts // to visit their controllers. if (rootLayer()) { hostImpl->setNeedsAnimateLayers(); m_needsAnimateLayers = true; } hostImpl->setSourceFrameNumber(frameNumber()); hostImpl->setViewportSize(viewportSize()); hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor); hostImpl->setBackgroundColor(m_backgroundColor); m_frameNumber++; }
HRESULT ImageReaderSensor::processDepth() { HRESULT hr = S_OK; if (m_CurrentFrameNumberDepth >= m_NumFrames) { return S_FALSE; } std::cout << "Processing Depth Frame " << m_CurrentFrameNumberDepth << std::endl; char frameNumber_c[10]; sprintf_s(frameNumber_c,"%06d", m_CurrentFrameNumberDepth+1); std::string frameNumber(frameNumber_c); std::string currFileName = m_BaseFilename; currFileName.append("depth/").append(frameNumber).append(".png"); DepthImage image; FreeImageWrapper::loadImage(currFileName, image); image.flipY(); for (UINT i = 0; i < getDepthWidth() * getDepthHeight(); i++) { m_depthD16[i] = (USHORT)(image.getDataPointer()[i] * 1000); } m_CurrentFrameNumberDepth++; return hr; }
// This function commits the CCLayerTreeHost to an impl tree. When modifying // this function, keep in mind that the function *runs* on the impl thread! Any // code that is logically a main thread operation, e.g. deletion of a LayerChromium, // should be delayed until the CCLayerTreeHost::commitComplete, which will run // after the commit, but on the main thread. void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl) { ASSERT(CCProxy::isImplThread()); hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostImpl->detachLayerTree(), hostImpl)); // We may have added an animation during the tree sync. This will cause both layer tree hosts // to visit their controllers. if (rootLayer() && m_needsAnimateLayers) hostImpl->setNeedsAnimateLayers(); hostImpl->setSourceFrameNumber(frameNumber()); hostImpl->setViewportSize(viewportSize()); hostImpl->setDeviceScaleFactor(deviceScaleFactor()); hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor); hostImpl->setBackgroundColor(m_backgroundColor); hostImpl->setHasTransparentBackground(m_hasTransparentBackground); hostImpl->setVisible(m_visible); hostImpl->setSourceFrameCanBeDrawn(m_frameIsForDisplay); m_frameNumber++; }
ST_FUNC int ST_ID3v2_disc(const ST_ID3v2 *tag) { return frameNumber(tag, ST_FramePartOfSet, ST_Frame22PartOfSet); }
ST_FUNC int ST_ID3v2_track(const ST_ID3v2 *tag) { return frameNumber(tag, ST_FrameTrackNumber, ST_Frame22TrackNumber); }