您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CheckInput函数代码示例

51自学网 2021-06-01 20:10:27
  C++
这篇教程C++ CheckInput函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CheckInput函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckInput函数的具体用法?C++ CheckInput怎么用?C++ CheckInput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CheckInput函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DoCCallBack_LPSTR_OutByRef

extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_OutByRef(CCallBackOutByRef callback){	int len = 10;	LPSTR pStr = (LPSTR)CoTaskMemAlloc(len);	if(!CheckInput(callback(&pStr)))	{		ReportFailure("DoCCallBack_LPSTR_OutByRef:NativeSide,the first Check");	}	if(!CheckInput(pStr))	{		ReportFailure("DoCCallBack_LPSTR_OutByRef:NativeSide,the Second Check");	}	CoTaskMemFree(pStr);}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:15,


示例2: DoSCallBack_LPSTR_OutByRef

extern "C" DLL_EXPORT void __cdecl DoSCallBack_LPSTR_OutByRef(SCallBackOutByRef callback){    size_t len = 10;    LPSTR pStr = (LPSTR)CoreClrAlloc(len);    if (!CheckInput(callback(&pStr)))    {        ReportFailure("DoSCallBack_LPSTR_OutByRef:NativeSide,the first check");    }    if (!CheckInput(pStr))    {        ReportFailure("DoSCallBack_LPSTR_OutByRef:NativeSide,the second Check");    }    CoreClrFree(pStr);}
开发者ID:vcsjones,项目名称:coreclr,代码行数:15,


示例3: main

intmain(void){    int h;    // initialize a flag    bool flag = false;    // keep asking for input until it's vaild    do    {        // ask for the height        printf("height: ");        // record users' input        h = GetInt();        // check the input        flag = CheckInput(h);    }    while (flag == false);    // draw the chart    DrawChart(h);    return 0;}
开发者ID:yzzjohn,项目名称:CS50x-for-2015,代码行数:27,


示例4: Convert

int IdConverter::Convert(std::string & id_in, std::string & id_out){    // sanity check    if(int rc = CheckInput(id_in))    {        return rc;    }    // convert    id_out = "";    for(size_t ipos = 0; ipos < id_in.size(); )    {        if(id_in[ipos + 2] != delimr)        {            // one-token group            if(id_in.compare(ipos, 2, "Z9") == 0)            {                id_out += "A1-A1";            }            else            {                // increment token                char token[8];                IncrementToken(id_in, ipos, token);                id_out += token;            }            ipos += 2;        }        else        {            // two-token group            if(id_in.compare(ipos, 5, "Z9-Z9") == 0)            {                // can not be incremented more                return 3;            }            if(id_in.compare(ipos + 3, 2, "Z9") == 0)            {                // first token should be incremented                char token[8];                IncrementToken(id_in, ipos, token);                id_out += token;                // second token will be "A1"                id_out += "-A1";            }            else            {                // increment second token only                char token[8];                IncrementToken(id_in, ipos + 3, token);                id_out += id_in.substr(ipos, 3);                id_out += token;            }            ipos += 5;        }    }    return 0;}
开发者ID:kukthevery,项目名称:idconverter,代码行数:60,


示例5: if

void CMainMenu::Update(const SUIInput& a_rInput){    if (m_GoingIntoGame)    {        float half = CPostEffects::GameStartTime / 2.0f;        m_CurrentTime += twTime->GetDeltaTime();        float value = m_CurrentTime / half;        ((triebWerk::CUIDrawable*)(m_pBackground->GetDrawable()))->m_Material.m_ConstantBuffer.SetValueInBuffer(4, &value);        if (m_CurrentTime >= half)        {            twSceneManager->SetActiveScene("Game");            m_GoingIntoGame = false;            m_CurrentTime = 0.0f;        }        return;    }    else if (m_LerpToExtras) LerpToExtras();    else if (m_LerpFromExtras) LerpFromExtras();    if (CGameInfo::Instance().m_Menu == EMenus::Main)    {        ((triebWerk::CFontDrawable*)m_pTextExtras->GetDrawable())->m_pText->SetText("Extras");        CheckInput(a_rInput);    }    UpdateGraphics();}
开发者ID:Chylix,项目名称:triebWerk,代码行数:31,


示例6: CheckInput

void Example::prepare(float dt){	CheckInput();	DeltaTime = dt;	ModelSky->m_RotateY+=(SPEED*DeltaTime);	const float ROTSPEED = 50.0f;	if(rotate)		m_rotationAngle += ROTSPEED * dt;	if (m_rotationAngle > 360.0f)		m_rotationAngle -= 360.0f;	m_angle += 2.0f * dt;	if (m_angle > 360.0f) 		m_angle -= 360.0f;	const float LIGHT_SPEED = 0.0005f;		m_lightPosZ += LIGHT_SPEED;		m_GLSLProgram->sendUniform("time", timer);}
开发者ID:drsoxen,项目名称:Heavy-Machine,代码行数:25,


示例7: onStart

void auto_smzdm::onStart(){  if (!CheckInput())  {    return;  }  UpdateData();  control_status = true;  ui.lineEdit_msg->setText(QStringLiteral("运行中"));  QString msg = QStringLiteral("运行中");  int count = 0;  while( control_status )  {    QString temp = msg;    smzdm_run();    count ++;     QString temp2;    temp2.setNum(count);    ui.lineEdit_msg->setText(temp + temp2);    QElapsedTimer t;    t.start();    while(t.elapsed()<1000)        QCoreApplication::processEvents();  }}
开发者ID:blacksjt,项目名称:autobots,代码行数:35,


示例8: OpenShop

// Open the ShopNamedScript KeyBind void OpenShop(bool OpenLocker){    // If you're dead, return    if (GetActorProperty(0, APROP_Health) <= 0) return;    // If you're in an Outpost menu, return    if (Player.OutpostMenu > 0) return;    // If you're in any minigames, return    if (Player.InMinigame) return;    // If you're looking inside a crate, return    if (Player.CrateOpen) return;    // Close the main menu if it's open    Player.InMenu = false;    // Sanity check for pressing use while the shop is open in front of the counter in the Outpost    if (Player.InShop && CheckInput(BT_USE, KEY_HELD, false, PlayerNumber())) return;    if (Player.InShop)    {        ActivatorSound("menu/leave", 127);        SetPlayerProperty(0, 0, PROP_TOTALLYFROZEN);        Player.InShop = false;    }    else    {        ActivatorSound("menu/shop", 127);        Player.InShop = true;        if (OpenLocker)            Player.LockerMode = true;    }}
开发者ID:Silentdarkness12,项目名称:DoomRPG,代码行数:35,


示例9: mexFunction

void mexFunction(int nlhs, mxArray *plhs[], int nrhs,const mxArray *prhs[]){  double tau, rownorm;  double *W, *W_thresh, *nz;  long p, K, ik, ip, pK;          CheckInput(nlhs, plhs, nrhs, prhs);    p=mxGetM(prhs[0]); /* # row */  K=mxGetN(prhs[0]); /* # col */  W=mxGetPr(prhs[0]); /* pointer to the input array */  tau=mxGetScalar(prhs[1]);    plhs[0]=mxCreateDoubleMatrix(p,K,mxREAL); /* output p x K array */  W_thresh=mxGetPr(plhs[0]); /* pointer to the data W_thresh*/  pK=p*K;     for (ip=0; ip<p; ip++) {      /* compute the 2-norm of the ip-th row */      for (ik=0, rownorm=0.0; ik<K; ik++)         rownorm+=W[ip+p*ik]*W[ip+p*ik]; /* W(ip+1,ik+1)=W[ip + p*ik], ip=0,...,p, ik=0,...,K */      rownorm=sqrt(rownorm);            /* perform row-wise group-thresholding */     if (rownorm > tau){         for (ik=0; ik<K; ik++)            W_thresh[ip+p*ik]=W[ip+p*ik]*(1-tau/rownorm); /* W(ip+1,ik+1)=W[ip + p*ik], ip=0,...,p, ik=0,...,K */     }     else {         for (ik=0; ik<K; ik++)            W_thresh[ip+p*ik]=0; /* W(ip+1,ik+1)=W[ip + p*ik], ip=0,...,p, ik=0,...,K */     }  }}
开发者ID:wtak23,项目名称:Schiz_multi,代码行数:35,


示例10: CheckUp

// This is called every 4096 nodes to check if we have run out of time// or if we have been interrupted by the GUIstatic void CheckUp(searchinfo_t *sinfo){	if(sinfo->infinite == false && GetTime() >= sinfo->stopTime){		sinfo->stop = true;	}	CheckInput(sinfo);}
开发者ID:Cubitect,项目名称:cep,代码行数:9,


示例11: CheckInput

void BiasAdderNet::Execute() {  CheckInput();  const Blob* const input = this->input_blobs(0);  const Blob* const bias = this->params(0);  Blob* const output = this->output_blobs(0);  int channels = bias->channels();  CHECK_EQ(channels, input->channels());  int height = input->height();  int width = input->width();  int num = input->num();    LOG(DEBUG) << "input blob: (" << num << "," << input->channels() << ","     << height << "," << width << ")";  LOG(DEBUG) << "bias blob: (" << bias->num() << "," << bias->channels()     << "," << bias->height() << "," << bias->width() << ")";    float* const dst_head = new float[num*channels*height*width];  int size = height * width;  for (int n = 0, offset = 0; n < num; ++n) {    for (int ichannel = 0; ichannel < channels; ++ichannel) {      for(int i = 0; i < size; ++i, ++offset) {        dst_head[offset] = (*input)[offset] + (*bias)[ichannel];      }    }  }  output->CopyData(num, channels, height, width, dst_head);  delete []dst_head;  CheckOutput();}
开发者ID:Johnny-Martin,项目名称:toys,代码行数:34,


示例12: DoCCallBack_LPSTR_Out

extern "C" DLL_EXPORT void __cdecl DoCCallBack_LPSTR_Out(CCallBackOut callback){    size_t len = 10;    LPSTR pStr = (LPSTR)CoreClrAlloc(len);    //Check the return value    if (!CheckInput(callback(pStr)))    {        ReportFailure("DoCCallBack_LPSTR_Out:NativeSide,the first check");    }    if (!CheckInput(pStr))    {        ReportFailure("DoCCallBack_LPSTR_Out:NativeSide,the Second Check");    }    CoreClrFree(pStr);}
开发者ID:vcsjones,项目名称:coreclr,代码行数:16,


示例13: main

/**** Main function of this program.**/int main(){    float input;    float input_cents;    do    {        // Get the user input        printf("O hai! How much change is owed?/n");        input = GetFloat();                // Validate the user input        if(CheckInput(input) == FALSE)        {            continue;        }            }while(input < 0.0);    // Convert to cents    input_cents = (float)round(input * 100);        // Lets Start        int number_of_coins = 0;        while(input_cents > 0.0)    {        //printf("input_cents=%f/n",input_cents);        if(input_cents >= QUATAR)        {            // This means the input is can be subtracted by a QUATAR            input_cents = input_cents - QUATAR;            number_of_coins++;          }        else if(input_cents < QUATAR && input_cents >= DIME)        {            // This means the input is can be subtracted by a DIME            input_cents = input_cents - DIME;            number_of_coins++;         }        else if(input_cents < DIME && input_cents >= NICKEL)        {            // This means the input is can be subtracted by a NICKEL            input_cents = input_cents - NICKEL;            number_of_coins++;         }        else        {            // This means remaining are PENNIES. So just add as many number of pennies.            number_of_coins = number_of_coins + input_cents;            input_cents = 0;        }    }    printf("%d/n", number_of_coins);        // Good Bye    return 0;}
开发者ID:prasannabe2004,项目名称:Harvard,代码行数:64,


示例14: on_btnOK_clicked

void InputDialog::on_btnOK_clicked(){    if(CheckInput())    {        strResult = ui->lnInput->text();        done(QDialog::Accepted);    }}
开发者ID:sweng2013team4,项目名称:shredder,代码行数:8,


示例15: DoSCallBack_LPSTR_InOut

extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoSCallBack_LPSTR_InOut(SCallBackInOut callback){	const char* pTemp = "AAAA";	int len = strlen(pTemp)+1;	LPSTR pStr = (LPSTR)CoTaskMemAlloc(len);	strncpy(pStr,pTemp,len);	if(!CheckInput(callback(pStr)))	{		ReportFailure("DoSCallBack_LPSTR_InOut:NativeSide,the first check");	}	if(!CheckInput(pStr))	{		ReportFailure("DoSCallBack_LPSTR_InOut:NativeSide,the second Check");	}	CoTaskMemFree(pStr);}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:17,


示例16: DoSCallBack_LPSTR_InOutByRef

extern "C" DLL_EXPORT void __cdecl DoSCallBack_LPSTR_InOutByRef(SCallBackInOutByRef callback){    const char* pTemp = "AAAA";    size_t len = strlen(pTemp) + 1;    LPSTR pStr = (LPSTR)CoreClrAlloc(len);    strncpy(pStr, pTemp, len);    if (!CheckInput(callback(&pStr)))    {        ReportFailure("DoSCallBack_LPSTR_InOutByRef:NativeSide,the first check");    }    if (!CheckInput(pStr))    {        ReportFailure("DoSCallBack_LPSTR_InOutByRef:NativeSide,the second Check");    }    CoreClrFree(pStr);}
开发者ID:vcsjones,项目名称:coreclr,代码行数:17,


示例17: CheckInput

void MaxPoolingNet::Execute() {  // *** Argument *** //  const float MIN_THRESHOLD = 0.0f;  // *** //    CheckInput();  const Blob* const input = this->input_blobs(0);  Blob* const output = this->output_blobs(0);    int src_h = input->height();  int src_w = input->width();  int num = input->num();  int channels = input->channels();  int dst_h = static_cast<int>(ceil(static_cast<float>(    src_h - kernel_h_) / stride_h_)) + 1;  int dst_w = static_cast<int>(ceil(static_cast<float>(    src_w - kernel_w_) / stride_w_)) + 1;  int dst_count = num * channels * dst_h * dst_w;  float* const dst_head = new float[dst_count];  const float* src_data = input->data().get();  float* dst_data = dst_head;  int src_channel_off = src_h * src_w;  int dst_channel_off = dst_h * dst_w;  for (int n = 0; n < num; ++n) {    for (int c = 0; c < channels; ++c) {      for (int dh = 0, hstart = 0; dh < dst_h;            ++dh, hstart += stride_h_) {        int hend = std::min(hstart + kernel_h_, src_h);        for (int dw = 0, wstart = 0; dw < dst_w;            ++dw, wstart += stride_w_) {          int wend = std::min(wstart + kernel_w_, src_w);          int didx = dh * dst_w + dw;          float max_val = MIN_THRESHOLD;          for (int sh = hstart; sh < hend; ++sh) {            for (int sw = wstart; sw < wend; ++sw) {              int sidx = sh * src_w + sw;              if (src_data[sidx] > max_val) {                max_val = src_data[sidx];              }            } // for sw          } // for sh          dst_data[didx] = max_val;        } // for dw      } // for dh      src_data += src_channel_off;      dst_data += dst_channel_off;    } // for c  } // for n  output->CopyData(num, channels, dst_h, dst_w, dst_head);  delete[] dst_head;  CheckOutput();}
开发者ID:Johnny-Martin,项目名称:toys,代码行数:58,


示例18: PushCallStack

inline voidLocalTrrkKernel( UpperOrLower uplo,  Orientation orientationOfA,  Orientation orientationOfB,  T alpha, const DistMatrix<T,STAR,MC  >& A,           const DistMatrix<T,MR,  STAR>& B,  T beta,        DistMatrix<T,MC,  MR  >& C ){#ifndef RELEASE    PushCallStack("LocalTrrkKernel");    CheckInput( orientationOfA, orientationOfB, A, B, C );#endif    const Grid& g = C.Grid();    DistMatrix<T,STAR,MC> AL(g), AR(g);    DistMatrix<T,MR,STAR> BT(g),                           BB(g);    DistMatrix<T,MC,MR> CTL(g), CTR(g),                        CBL(g), CBR(g);    DistMatrix<T,MC,MR> DTL(g), DBR(g);    const int half = C.Height()/2;    ScaleTrapezoid( beta, LEFT, uplo, 0, C );    LockedPartitionRight( A, AL, AR, half );    LockedPartitionDown    ( B, BT,          BB, half );    PartitionDownDiagonal    ( C, CTL, CTR,         CBL, CBR, half );    DTL.AlignWith( CTL );    DBR.AlignWith( CBR );    DTL.ResizeTo( CTL.Height(), CTL.Width() );    DBR.ResizeTo( CBR.Height(), CBR.Width() );    //------------------------------------------------------------------------//    if( uplo == LOWER )        internal::LocalGemm        ( orientationOfA, orientationOfB, alpha, AR, BT, T(1), CBL );    else        internal::LocalGemm        ( orientationOfA, orientationOfB, alpha, AL, BB, T(1), CTR );    internal::LocalGemm    ( orientationOfA, orientationOfB, alpha, AL, BT, T(0), DTL );    AxpyTriangle( uplo, T(1), DTL, CTL );    internal::LocalGemm    ( orientationOfA, orientationOfB, alpha, AR, BB, T(0), DBR );    AxpyTriangle( uplo, T(1), DBR, CBR );    //------------------------------------------------------------------------//#ifndef RELEASE    PopCallStack();#endif}
开发者ID:certik,项目名称:Elemental,代码行数:56,


示例19: GetWindowText

void CHSNumEdit::OnChar (UINT nChar, UINT nRepCnt, UINT nFlags){	if( !isdigit(nChar) && nChar != 8 && nChar != '.' && nChar != '-' && nChar != '+' )		return;	CString strWin;	GetWindowText(strWin);	CEdit::OnChar(nChar,nRepCnt,nFlags);	CString strCurText;	GetWindowText(strCurText);	if( !CheckInput(strCurText) )	{		SetWindowText(strWin);	}		/*	if( isdigit(nChar) && CheckInput(nChar) )		CEdit::OnChar(nChar,nRepCnt,nFlags);	else	{		CString txt;		GetWindowText(txt);		switch (nChar) 		{		case '+' : // set to absolute value			{				double x = (double) atof(txt);				if (x > 0)					break; // only break if we already >0, else do "case -"			}		case '-' : // change sign.			{				double x = (double) atof(txt);//				if(x == 0)//				{//					::MessageBeep(MB_ICONQUESTION);//					break;//				}				x = -x;				SetValue(x);				break;			}		case '.' :	 				if ( txt.Find('.') == -1 && CheckInput(nChar))					CEdit::OnChar(nChar, nRepCnt, nFlags);				break; 		case VK_BACK:			CEdit::OnChar(nChar, nRepCnt, nFlags);			break;		}	}	*/}
开发者ID:hefen1,项目名称:XCaimi,代码行数:55,


示例20: CheckInput

void DialogInputFileNameForm::ApplyButtonPressed(){    //Check the input    bool inputOk = CheckInput();    //If the input is ok cloase the dialog with accedpted    if(inputOk)    {        QDialog::accept();    }}
开发者ID:Mauxx91,项目名称:XML-Editor,代码行数:11,


示例21: CHARLS_IMEXPORT

CHARLS_IMEXPORT(JLS_ERROR) JpegLsEncodeStream(ByteStreamInfo compressedStreamInfo, size_t* pcbyteWritten, ByteStreamInfo rawStreamInfo, struct JlsParameters* pparams){	if (pcbyteWritten == NULL)		return InvalidJlsParameters;	JLS_ERROR parameterError = CheckInput(rawStreamInfo, pparams);	if (parameterError != OK)		return parameterError;	try	{		JlsParameters info = *pparams;		if (info.bytesperline == 0)		{			info.bytesperline = info.width * ((info.bitspersample + 7)/8);			if (info.ilv != ILV_NONE)			{				info.bytesperline *= info.components;			}		}		Size size = Size(info.width, info.height);		JpegMarkerWriter writer(info.jfif, size, info.bitspersample, info.components);		if (info.colorTransform != 0)		{			writer.AddColorTransform(info.colorTransform);		}		if (info.ilv == ILV_NONE)		{			LONG cbyteComp = size.cx*size.cy*((info.bitspersample +7)/8);			for (LONG component = 0; component < info.components; ++component)			{				writer.AddScan(rawStreamInfo, &info);				SkipBytes(&rawStreamInfo, cbyteComp);			}		}		else		{			writer.AddScan(rawStreamInfo, &info);		}			writer.Write(compressedStreamInfo);		*pcbyteWritten = writer.GetBytesWritten();		return OK;	}	catch (const JlsException& e)	{		return e._error;	}}
开发者ID:Who8MyLunch,项目名称:CharPyLS,代码行数:53,


示例22: Move

bool PlayerObject::Update() {		if (m_moving)		Move();	else		CheckInput();	m_animManager->Update(m_position);	UpdateViewPosition();		return false;}
开发者ID:Sephia,项目名称:bugfree-nemesis,代码行数:12,


示例23: DoCCallBack_LPSTR_InByRef

extern "C" DLL_EXPORT DLL_EXPORT void _cdecl DoCCallBack_LPSTR_InByRef(CallBackInByRef callback){	const char* pTemp = "AAAA";	int len = strlen(pTemp)+1;	LPSTR pStr = (LPSTR)CoTaskMemAlloc(len);	strncpy(pStr,pTemp,len);	if(!CheckInput(callback(&pStr)))	{		ReportFailure("DoCCallBack_LPSTR_InByRef:NativeSide");	}	CoTaskMemFree(pStr);}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:13,


示例24: DoCCallBack_LPSTR_In

extern "C" DLL_EXPORT void __cdecl DoCCallBack_LPSTR_In(CCallBackIn callback){  const char* pTemp = "AAAA";  size_t len = strlen(pTemp)+1;  LPSTR pStr = (LPSTR)CoreClrAlloc(len);  strncpy(pStr,pTemp,len);  if(!CheckInput(callback(pStr)))  {  	ReportFailure("DoCCallBack_LPSTR_In:NativeSide");  }  CoreClrFree(pStr);}
开发者ID:vcsjones,项目名称:coreclr,代码行数:13,


示例25: SLPStr_InByRef

extern "C" DLL_EXPORT LPSTR STDMETHODCALLTYPE SLPStr_InByRef(LPSTR* ppStr){    //Check the Input    if (!CheckInput(*ppStr))    {        ReportFailure("SLPStr_InByRef:NativeSide");    }    //alloc,copy, since we cannot depend the Marshaler's activity.    size_t len = strlen(*ppStr) + 1; //+1, Include the NULL Character.    LPSTR pBack = (LPSTR)CoreClrAlloc(len);    strncpy(pBack, *ppStr, len);    return pBack;}
开发者ID:vcsjones,项目名称:coreclr,代码行数:13,


示例26: main

// ----------------------------------------------------------------int main(int argc, char* argv[]){	Start();	while(CheckInput())	{		MoveStuff();		Draw();	}	Finish();	return(EXIT_SUCCESS);}
开发者ID:Yulna,项目名称:Intro_to_SDL_handout,代码行数:14,


示例27: JpegLsEncode

CHARLS_IMEXPORT JLS_ERROR JpegLsEncode(void* pdataCompressed, size_t cbyteBuffer, size_t* pcbyteWritten, const void* pdataUncompressed, size_t cbyteUncompressed, const JlsParamaters* pparams){	JlsParamaters info = *pparams;	if(info.bytesperline == 0)	{		info.bytesperline = info.width * ((info.bitspersample + 7)/8);		if (info.ilv != ILV_NONE)		{			info.bytesperline *= info.components;		}	}		JLS_ERROR parameterError = CheckInput(pdataCompressed, cbyteBuffer, pdataUncompressed, cbyteUncompressed, &info);	if (parameterError != OK)		return parameterError;	if (pcbyteWritten == NULL)		return InvalidJlsParameters;	Size size = Size(info.width, info.height);	LONG cbit = info.bitspersample;	JLSOutputStream stream;		stream.Init(size, info.bitspersample, info.components);		if (info.colorTransform != 0)	{		stream.AddColorTransform(info.colorTransform);	}	if (info.ilv == ILV_NONE)	{		LONG cbyteComp = size.cx*size.cy*((cbit +7)/8);		for (LONG icomp = 0; icomp < info.components; ++icomp)		{			const BYTE* pbyteComp = static_cast<const BYTE*>(pdataUncompressed) + icomp*cbyteComp;			stream.AddScan(pbyteComp, &info);		}	}	else 	{		stream.AddScan(pdataUncompressed, &info);	}		stream.Write((BYTE*)pdataCompressed, cbyteBuffer);		*pcbyteWritten = stream.GetBytesWritten();		return OK;}
开发者ID:catid,项目名称:Splane,代码行数:51,


示例28: SLPStr_InOutByRef

extern "C" DLL_EXPORT LPSTR __stdcall SLPStr_InOutByRef(LPSTR* ppStr){	//Check the Input	if(!CheckInput(*ppStr))	{		ReportFailure("SLPStr_InOutByRef:NativeSide");	}	//alloc,copy, since we cannot depend the Marshaler's activity.	int len = strlen(*ppStr)+ 1 ; //+1, Include the NULL Character.	LPSTR pBack = (LPSTR)CoTaskMemAlloc(len);	strncpy(pBack,*ppStr,len);	return pBack;}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:14,


示例29: CHARLS_IMEXPORT

CHARLS_IMEXPORT(JLS_ERROR) JpegLsEncode(void* compressedData, size_t compressedLength, size_t* pcbyteWritten, const void* uncompressedData, size_t uncompressedLength, struct JlsParameters* pparams){	JlsParameters info = *pparams;	if(info.bytesperline == 0)	{		info.bytesperline = info.width * ((info.bitspersample + 7)/8);		if (info.ilv != ILV_NONE)		{			info.bytesperline *= info.components;		}	}		JLS_ERROR parameterError = CheckInput(compressedData, compressedLength, uncompressedData, uncompressedLength, &info);	if (parameterError != OK)		return parameterError;	if (pcbyteWritten == NULL)		return InvalidJlsParameters;	Size size = Size(info.width, info.height);	JLSOutputStream stream;		stream.Init(size, info.bitspersample, info.components);		if (info.colorTransform != 0)	{		stream.AddColorTransform(info.colorTransform);	}	if (info.ilv == ILV_NONE)	{		LONG cbyteComp = size.cx*size.cy*((info.bitspersample +7)/8);		for (LONG component = 0; component < info.components; ++component)		{			const BYTE* compareData = static_cast<const BYTE*>(uncompressedData) + component*cbyteComp;			stream.AddScan(compareData, &info);		}	}	else 	{		stream.AddScan(uncompressedData, &info);	}		stream.Write((BYTE*)compressedData, compressedLength);		*pcbyteWritten = stream.GetBytesWritten();		return OK;}
开发者ID:png85,项目名称:CharLS,代码行数:50,


示例30: OnStartRegistration

void QmitkAICPRegistrationView::OnStartRegistration(){  d->m_Threshold = m_Controls.m_ThresholdSpinbox->value();  d->m_MaxIterations = m_Controls.m_MaxIterationsSpinbox->value();  d->m_SearchRadius = m_Controls.m_SearchRadius->value();  d->m_TrimmFactor = 0.0;  if ( m_Controls.m_EnableTrimming->isChecked() )  {    d->m_TrimmFactor = m_Controls.m_TrimmFactorSpinbox->value();  }  if (! CheckInput() )    return;  d->m_MovingSurface = dynamic_cast<mitk::Surface*>(            m_Controls.m_MovingSurfaceComboBox->GetSelectedNode()->GetData() );  d->m_FixedSurface = dynamic_cast<mitk::Surface*>(            m_Controls.m_FixedSurfaceComboBox->GetSelectedNode()->GetData() );  // sanity check  if ( d->m_FixedSurface.IsNull() || d->m_MovingSurface.IsNull() )  {    const char* message = "Input surfaces are NULL.";    QMessageBox msg;    msg.setIcon(QMessageBox::Critical);    msg.setText(message);    MITK_ERROR << message;    return;  }  // enable trimming  if ( m_Controls.m_EnableTrimming->isChecked() )  {    d->m_TrimmFactor = m_Controls.m_TrimmFactorSpinbox->value();  }  // set data into the UI thread  d->m_Worker->SetRegistrationData(d);  // start thread  d->m_RegistrationThread->start();  // disable registration button  m_Controls.m_RegisterSurfaceButton->setEnabled(false);  mitk::RenderingManager::GetInstance()->RequestUpdateAll();}
开发者ID:151706061,项目名称:MITK,代码行数:49,



注:本文中的CheckInput函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CheckInterrupted函数代码示例
C++ CheckInit函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。