本文整理汇总了C++中ProcessData函数的典型用法代码示例。如果您正苦于以下问题:C++ ProcessData函数的具体用法?C++ ProcessData怎么用?C++ ProcessData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ProcessData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CRYPTOPP_ASSERT
void StreamTransformation::ProcessLastBlock(byte *outString, const byte *inString, size_t length)
{
CRYPTOPP_ASSERT(MinLastBlockSize() == 0); // this function should be overridden otherwise
if (length == MandatoryBlockSize())
ProcessData(outString, inString, length);
else if (length != 0)
throw NotImplemented(AlgorithmName() + ": this object doesn't support a special last block");
}
示例2: assert
void StreamTransformation::ProcessLastBlock(byte *outString, const byte *inString, unsigned int length)
{
assert(MinLastBlockSize() == 0); // this function should be overriden otherwise
if (length == MandatoryBlockSize())
ProcessData(outString, inString, length);
else if (length != 0)
throw NotImplemented("StreamTransformation: this object does't support a special last block");
}
示例3: lock
void IsuCalcLink::ReadyRead()
{
QMutexLocker lock(&m);
QTcpSocket::SocketState connState = Socket->state();
if (connState == QAbstractSocket::ConnectedState)
{
ProcessData(Socket->readAll());
}
}
示例4: DSTACK
bool Client::Receive()
{
DSTACK(__FUNCTION_NAME);
NetworkPacket pkt;
if (!m_con.Receive(&pkt))
return false;
ProcessData(&pkt);
return true;
}
示例5: ProcessData
NS_IMETHODIMP
nsDirIndexParser::OnStopRequest(nsIRequest *aRequest, nsISupports *aCtxt,
nsresult aStatusCode) {
// Finish up
if (mBuf.Length() > (PRUint32) mLineStart) {
ProcessData(aRequest, aCtxt);
}
return NS_OK;
}
示例6: ProcessData
void CDataView::ProcessData(
const std::shared_ptr<SourceSetting>& pSrcSetting,
std::shared_ptr<IDataSetting>& pDataSetting)
{
m_pSrcSetting = pSrcSetting;
m_pDataSetting = pDataSetting;
ProcessData();
Invalidate();
UpdateWindow();
}
示例7: while
void SerialComm::ReadData() {
while (Serial.available()) {
data_input.AppendToBuffer(Serial.read());
if (!data_input.IsDone())
continue;
ProcessData();
}
}
示例8: ProcessData
void UdpServer::handle_receive(const system::error_code& error, size_t bytes_transferred)
{
if(!error && bytes_transferred > 0)
{
ProcessData(DataToPacket(bytes_transferred));
socket_.async_send_to(asio::buffer(send_data, send_data.size()), remote_endpoint_,
boost::bind(&UdpServer::handle_send, this, asio::placeholders::error, asio::placeholders::bytes_transferred));
start_receive();
}
}
示例9: UE_LOG
bool FVoiceCaptureWindows::Tick(float DeltaTime)
{
if (VoiceCaptureState != EVoiceCaptureState::UnInitialized &&
VoiceCaptureState != EVoiceCaptureState::NotCapturing)
{
#if 1
uint32 NextEvent = (LastEventTriggered + 1) % (NUM_EVENTS - 1);
if (WaitForSingleObject(Events[NextEvent], 0) == WAIT_OBJECT_0)
{
UE_LOG(LogVoice, VeryVerbose, TEXT("Event %d Signalled"), NextEvent);
ProcessData();
LastEventTriggered = NextEvent;
ResetEvent(Events[NextEvent]);
}
#else
// All "non stop" events
for (int32 EventIdx = 0; EventIdx < STOP_EVENT; EventIdx++)
{
if (WaitForSingleObject(Events[EventIdx], 0) == WAIT_OBJECT_0)
{
UE_LOG(LogVoice, VeryVerbose, TEXT("Event %d Signalled"), EventIdx);
if (LastEventTriggered != EventIdx)
{
ProcessData();
}
LastEventTriggered = EventIdx;
ResetEvent(Events[EventIdx]);
}
}
#endif
if (Events[STOP_EVENT] != INVALID_HANDLE_VALUE && WaitForSingleObject(Events[STOP_EVENT], 0) == WAIT_OBJECT_0)
{
UE_LOG(LogVoice, Verbose, TEXT("Voice capture stopped"));
ResetEvent(Events[STOP_EVENT]);
VoiceCaptureState = EVoiceCaptureState::NotCapturing;
}
}
return true;
}
示例10: YUV2Jpg
/////////////////////////////////////////////////////////////////////////////
// Convert YUV411 to JPEG photo file
static int YUV2Jpg(PBYTE in_Y,PBYTE in_U,PBYTE in_V,int width,int height,int quality,int nStride,PBYTE pOut,DWORD *pnOutSize)
{
PBYTE pYBuf,pUBuf,pVBuf;
int nYLen = nStride * height;
int nUVLen = nStride * height / 4;
int nDataLen;
JPEGINFO JpgInfo;
memset(&JpgInfo, 0, sizeof(JPEGINFO));
JpgInfo.bytenew = 0;
JpgInfo.bytepos = 7;
pYBuf = (PBYTE)malloc(nYLen);
memcpy(pYBuf,in_Y,nYLen);
pUBuf = (PBYTE)malloc(nYLen);
pVBuf = (PBYTE)malloc(nYLen);
ProcessUV(pUBuf,in_U,width,height,nStride);
ProcessUV(pVBuf,in_V,width,height,nStride);
// GetDataFromSource(pYBuf,pUBuf,pVBuf,in_Y,in_U,in_V,width);
DivBuff(pYBuf,width,height,nStride,DCTSIZE,DCTSIZE);
DivBuff(pUBuf,width,height,nStride,DCTSIZE,DCTSIZE);
DivBuff(pVBuf,width,height,nStride,DCTSIZE,DCTSIZE);
quality = QualityScaling(quality);
SetQuantTable(std_Y_QT,JpgInfo.YQT, quality); // 设置Y量化表
SetQuantTable(std_UV_QT,JpgInfo.UVQT,quality); // 设置UV量化表
InitQTForAANDCT(&JpgInfo); // 初始化AA&N需要的量化表
JpgInfo.pVLITAB=JpgInfo.VLI_TAB + 2048; // 设置VLI_TAB的别名
BuildVLITable(&JpgInfo); // 计算VLI表
nDataLen = 0;
// 写入各段
nDataLen = WriteSOI(pOut,nDataLen);
nDataLen = WriteAPP0(pOut,nDataLen);
nDataLen = WriteDQT(&JpgInfo,pOut,nDataLen);
nDataLen = WriteSOF(pOut,nDataLen,width,height);
nDataLen = WriteDHT(pOut,nDataLen);
nDataLen = WriteSOS(pOut,nDataLen);
// 计算Y/UV信号的交直分量的huffman表,这里使用标准的huffman表,并不是计算得出,缺点是文件略长,但是速度快
BuildSTDHuffTab(STD_DC_Y_NRCODES,STD_DC_Y_VALUES,JpgInfo.STD_DC_Y_HT);
BuildSTDHuffTab(STD_AC_Y_NRCODES,STD_AC_Y_VALUES,JpgInfo.STD_AC_Y_HT);
BuildSTDHuffTab(STD_DC_UV_NRCODES,STD_DC_UV_VALUES,JpgInfo.STD_DC_UV_HT);
BuildSTDHuffTab(STD_AC_UV_NRCODES,STD_AC_UV_VALUES,JpgInfo.STD_AC_UV_HT);
// 处理单元数据
nDataLen = ProcessData(&JpgInfo,pYBuf,pUBuf,pVBuf,width,height,pOut,nDataLen);
nDataLen = WriteEOI(pOut,nDataLen);
free(pYBuf);
free(pUBuf);
free(pVBuf);
*pnOutSize = nDataLen;
return 0;
}
示例11: ExplorationRun
void ExplorationRun(void) {
int i;
if (pSegment.cnt != 0) {
switch (DispDotMatrixWait("There are recorded data. Continue?")) {
case SW_PRESS: return;
default: break;
}
}
// clear rSegment.
clrSegStruct = (char *) &rSegment;
for (i = 0; i < sizeof(rSegment); i++)
*clrSegStruct++ = 0;
// clear pSegment before recording data.
clrSegStruct = (char *) &pSegment;
for (i = 0; i < sizeof(pSegment); i++)
*clrSegStruct++ = 0;
StartBeep();
DispDotMatrix("GOGO");
DelaymSec(1500);
StartRun();
bExplorationFlag = TRUE;
// constant speed & acceleration
// SetRobotSpeedX(EXPLORATION_SPEED);
// SetRobotAccX(ACCELERATION);
SetMoveCommand(XSPEED, 100000, 0, EXPLORATION_SPEED, 0, ACCELERATION);
while (1) {
PrintRunStatus();
// prematurely terminate the run with switch press
if (bSWFlag) {
bExplorationFlag = FALSE;
bSWFlag = FALSE;
StopRun();
break;
}
if (bStopFlag) {
rSegment.totalDisp = curPos[XSPEED] / DIST_mm_oc(1);
StopRun();
ProcessData();
DispExplorationStats();
break;
}
}
}
示例12: Terminal_Process
///////////////////////////////////////////////////////////////////////////////
/// \brief process the buffer data and extract the commands
///
/// \return TRUE success. FALSE no error
///
/// \todo update the document return state value. need to implement
///////////////////////////////////////////////////////////////////////////////
int_fast8_t Terminal_Process(void)
{
uint8_t SerialTempData = 0; // hold the new byte from the serial fifo
int_fast8_t Result = FALSE;
Result = SerialPort2.GetByte(&SerialTempData);
if ( TRUE != Result )
{
return Result;
}
// echo the user command
SerialPort2.SendByte(SerialTempData);
if ('\r' == SerialTempData)
{
if (NumberOfByteReceived)
{
/// \todo call the process data
if ( TRUE == ProcessData(&Buffer[0], NumberOfByteReceived, &ParameterList) )
{
if( TRUE == RunCommand() )
{
Result = TRUE;
}
}
}
else
{
Result = FALSE;
}
}
else if ( (SerialTempData >= '0' && SerialTempData <= '9') ||
(SerialTempData >= 'A' && SerialTempData <= 'Z') ||
(SerialTempData >= 'a' && SerialTempData <= 'z') || ' ' == SerialTempData || '.' == SerialTempData)
{
if ( NumberOfByteReceived < TERMINAL_BUFFER_SIZE )
{
Buffer[NumberOfByteReceived] = SerialTempData;
NumberOfByteReceived++;
return FALSE;
}
}
// reset buffer by reseting the counter
NumberOfByteReceived = 0;
return Result;
}
示例13: sender
void CNetwork::DataMayRead( )
{
QByteArray byData;
QUdpSocket* udpServer = qobject_cast< QUdpSocket* > ( sender( ) );
while ( udpServer->hasPendingDatagrams( ) ) {
byData.resize( udpServer->pendingDatagramSize( ) );
udpServer->readDatagram( byData.data( ), byData.size( ) );
ProcessData( byData );
}
}
示例14: while
//ProcessOne() takes a track, transforms it to bunch of buffer-blocks,
//and executes ProcessData, on it...
// uses mMult and mOffset to normalize a track. Needs to have them set before being called
bool EffectNormalize::ProcessOne(WaveTrack * track, wxString msg)
{
bool rc = true;
sampleCount s;
//Transform the marker timepoints to samples
sampleCount start = track->TimeToLongSamples(mCurT0);
sampleCount end = track->TimeToLongSamples(mCurT1);
//Get the length of the buffer (as double). len is
//used simply to calculate a progress meter, so it is easier
//to make it a double now than it is to do it later
double len = (double)(end - start);
//Initiate a processing buffer. This buffer will (most likely)
//be shorter than the length of the track being processed.
float *buffer = new float[track->GetMaxBlockSize()];
//Go through the track one buffer at a time. s counts which
//sample the current buffer starts at.
s = start;
while (s < end) {
//Get a block of samples (smaller than the size of the buffer)
sampleCount block = track->GetBestBlockSize(s);
//Adjust the block size if it is the final block in the track
if (s + block > end)
block = end - s;
//Get the samples from the track and put them in the buffer
track->Get((samplePtr) buffer, floatSample, s, block);
//Process the buffer.
ProcessData(buffer, block);
//Copy the newly-changed samples back onto the track.
track->Set((samplePtr) buffer, floatSample, s, block);
//Increment s one blockfull of samples
s += block;
//Update the Progress meter
if (TrackProgress(mCurTrackNum,
0.5+((double)(s - start) / len)/2.0, msg)) {
rc = false; //lda .. break, not return, so that buffer is deleted
break;
}
}
//Clean up the buffer
delete[] buffer;
//Return true because the effect processing succeeded ... unless cancelled
return rc;
}
示例15: RETURN_IF_ERROR
OP_STATUS MIME_DecodeCache_Storage::Construct(URL_Rep *url_rep, Cache_Storage *src)
{
RETURN_IF_ERROR(DecodedMIME_Storage::Construct(url_rep));
source = src;
#ifdef MHTML_ARCHIVE_REDIRECT_SUPPORT
BOOL prev_decode_only = GetDecodeOnly();
SetDecodeOnly(TRUE);
ProcessData(); // Process data early to make the redirect while we have a MessageHandler
SetDecodeOnly(prev_decode_only);
#endif
return OpStatus::OK;
}