void RImGrid::ExtDef() { Neighbourhood V4 = Neighbourhood::v4(); Neighbourhood V8 = Neighbourhood::v8(); Liste_Pts_INT2 anOldL(2); bool First = true; while(First || (!anOldL.empty())) { Flux_Pts aFlx = First ? select(mGrid.all_pts(), mGrid.in()!=mDef): anOldL.all_pts(); Liste_Pts_INT2 aNewL(2); ELISE_COPY ( dilate(aFlx,sel_func(V4,mGrid.in(mDef/2)==mDef)), 2*mDef, mGrid.out() | aNewL ); Neigh_Rel aROK = sel_func(V8,mGrid.in(mDef)!= mDef); ELISE_COPY ( aNewL.all_pts(), aROK.red_sum( mGrid.in()) / aROK.red_sum(1), mGrid.out() ); anOldL = aNewL; First = false; } }
void cImage_LumRas::CalculShadeByDiff() { mImShade.Resize(mAppli.mImGr.sz()); std::string aNameOut = mDir+ "LumRas_"+StdPrefix(mName) + ".tif"; Tiff_Im TifTest ( aNameOut.c_str(), mIm.sz(), // GenIm::u_int1, GenIm::real4, Tiff_Im::No_Compr, Tiff_Im::BlackIsZero ); Fonc_Num aFRas = FLoc(6,50,mIm); Fonc_Num aFStd = FLoc(6,50,mAppli.mImGr); Tiff_Im::Create8BFromFonc("Test-Ras.tif",mIm.sz(),aFRas*100); Tiff_Im::Create8BFromFonc("Test-Std.tif",mIm.sz(),aFStd*100); // Fonc_Num cImage_LumRas::FLoc(int aNbIter,int aSzW,Fonc_Num aF) ELISE_COPY(mImShade.all_pts(),(aFRas-aFStd),mImShade.out()); ELISE_COPY ( TifTest.all_pts(), // Max(0,Min(255,128 * (1 + 2*mImShade.in()))), mImShade.in(), TifTest.out() ); }
void bench_im_reech ( Fonc_Num Fonc, Pt2di SzIm, Fonc_Num reechantX, Fonc_Num reechantY, INT sz_grid, REAL aMaxDif ) { Im2D_U_INT1 AnIm(SzIm.x,SzIm.y); ELISE_COPY(AnIm.all_pts(),Fonc,AnIm.out()); REAL dif; ELISE_COPY ( AnIm.interior(3), Abs ( AnIm.ImGridReech (reechantX,reechantY,sz_grid,-100) - Fonc[Virgule(reechantX,reechantY)] ), VMax(dif) ); BENCH_ASSERT(dif<aMaxDif); }
void cMMTP::MaskProgDyn(const cParamFiltreDepthByPrgDyn & aParam) { std::cout << "BEGIN MASK PRGD\n"; mImMasqFinal = FiltrageDepthByProgDyn(mContBT,mImLabel,aParam); std::cout << "END MASK PRGD\n"; #ifdef ELISE_X11 if(TheWTiePCor) { ELISE_COPY(mImLabel.all_pts(),mImLabel.in(),TheWTiePCor->odisc()); ELISE_COPY ( select(mImLabel.all_pts(),mImMasqFinal.in() && (mImLabel.in()==1)), P8COL::green, TheWTiePCor->odisc() ); ELISE_COPY ( select(mImLabel.all_pts(),mImMasqFinal.in() && (mImLabel.in()==2)), P8COL::blue, TheWTiePCor->odisc() ); TheWTiePCor->clik_in(); } #endif }
void TestKL() { Pt2di aSZ(200,200); Im2D_Bits<1> aImMasqF(aSZ.x,aSZ.y,1); Im2D_Bits<1> aImMasqDef(aSZ.x,aSZ.y,1); ELISE_COPY(rectangle(Pt2di(70,0),Pt2di(130,200)),0,aImMasqDef.out()); Im2D<U_INT2,INT> aImVal(aSZ.x,aSZ.y); ELISE_COPY(aImVal.all_pts(),FX,aImVal.out()); Video_Win aW=Video_Win::WStd(aSZ,3.0); ELISE_COPY(aW.all_pts(),aImVal.in(),aW.ogray()); ELISE_COPY(aW.all_pts(),aImMasqDef.in(),aW.odisc()); getchar(); aImVal = ImpaintL2(aImMasqDef,aImMasqF,aImVal); // NComplKLipsParLBas(aImMasqDef,aImMasqF,aImVal,1.0); ELISE_COPY(aW.all_pts(),aImVal.in(),aW.ogray()); Tiff_Im::Create8BFromFonc("toto.tif",aSZ,aImVal.in()); getchar(); }
template <class Type,class TBase> cElNuage3DMaille_FromImProf<Type,TBase>::cElNuage3DMaille_FromImProf ( const std::string & aDir, const cXML_ParamNuage3DMaille & aNuage, Fonc_Num aFMasq, Fonc_Num aFProf, bool WithEmpyData, bool aDequant ) : cElNuage3DMaille(aDir,aNuage,aFMasq,WithEmpyData), mIm (mSzData.x,mSzData.y), mTIm (mIm), mProf0 (aNuage.Image_Profondeur().Val().OrigineAlti()), mResolProf (aNuage.Image_Profondeur().Val().ResolutionAlti()), mDequant (aDequant) { if (mDequant && (!WithEmpyData)) { ElImplemDequantifier aDeq(mSzData); aDeq.DoDequantif(mSzData,aFProf); ELISE_COPY(mIm.all_pts(),aDeq.ImDeqReelle(),mIm.out()); } else { ELISE_COPY ( mIm.all_pts(), aFProf, mIm.out()); } }
void bench_Proj32() { Pt2di aSz(200,300); Pt2di aC = aSz/2; double aR = 50; Fonc_Num aF = Square(FX-aC.x)+Square(FY-aC.y) < ElSquare(aR); // aF = 0; Im2D_INT2 aI1(aSz.x,aSz.y); ELISE_COPY ( aI1.all_pts(), aF * Polar_Def_Opun::polar(Virgule(FX-aC.x,FY-aC.y),0).v1()*(255.0/(2.0*PI)) + (1-aF) * (frandr() * 255), aI1.out() ); Video_Win aW= Video_Win::WStd(aSz,1.0); ELISE_COPY(aI1.all_pts(),aI1.in(),aW.ocirc()); getchar(); cResProj32 aR32 = Projection32(aF,aSz); ELISE_COPY ( aI1.all_pts(), aI1.in()[Virgule(aR32.PX().in(),aR32.PY().in())], aW.ocirc() ); getchar(); }
void ElImplemDequantifier::Test() { INT Z=2; Pt2di aSZ = mSzReel - Pt2di(2,2); Video_Win aW = Video_Win::WStd(aSZ,Z); aW.set_title("Image Quant"); Video_Win aW2 = Video_Win::WStd(aSZ,Z); Video_Win aW3 = Video_Win::WStd(aSZ,Z); Video_Win aW4 = Video_Win::WStd(aSZ,Z); aW2.set_title("Deq"); aW3.set_title("Deq+Cuv"); aW4.set_title("FRELLE"); Fonc_Num aFR = sin(FX/20.0) * sin(FY/20.0) * 3 + FX/70.0; // aFR = 5 * (1- (Square(FX-aSZ.x/2)+Square(FY-aSZ.y/2))/square_euclid(aSZ/2)); Fonc_Num aFonc = round_ni (aFR); Fonc_Num aBase = 0;// aFonc; REAL Ampl = 90.0; ELISE_COPY(aW.all_pts(),(aFonc -aBase)*Ampl,aW.ocirc()); DoDequantif(aSZ,aFonc,true); ELISE_COPY ( aW2.all_pts(), (ImDeqReelle()-aBase)*Ampl, aW2.ocirc()); SetTraitSpecialCuv(true); DoDequantif(aSZ,aFonc,true); ELISE_COPY ( aW3.all_pts(), (ImDeqReelle()-aBase)*Ampl, aW3.ocirc()); ELISE_COPY ( aW4.all_pts(), (aFR-aBase)*Ampl, aW4.ocirc()); /* Video_Win aW4 = Video_Win::WStd(aSZ,Z); ELISE_COPY ( aW3.all_pts(), Moy(Moy( aF.in(0),3),3) *Ampl, aW3.ocirc() ); ELISE_COPY ( aW3.all_pts(), Moy(Moy( ImDeqReelle(),3),3) *Ampl, aW4.ocirc() ); */ while(1) getchar(); }
void bench_dist_chamfrain() { bench_env_klip(Pt2di(200,300)); { Im2D<U_INT1,INT> I(300,300,0); //ELISE_COPY(disc(Pt2di(150,150),120),1,I.out()); ELISE_COPY(disc(Pt2dr(150,150),120),1,I.out()); // __NEW dist_chamfer_cabl(I,35); } { Im2D<U_INT1,INT> I(600,600,0); //ELISE_COPY(disc(Pt2di(300,300),290),1,I.out()); //ELISE_COPY(disc(Pt2di(300,300),5),0,I.out()); ELISE_COPY(disc(Pt2dr(300,300),290),1,I.out()); // __NEW ELISE_COPY(disc(Pt2dr(300,300),5),0,I.out()); // __NEW dist_chamfer_cabl(I,144); } cout << "OK chamfer TEST \n"; }
void PartitionRenato(int argc,char** argv) { std::string aName; double aPropSzW=0.1,aSeuil=75; double aPropExag = 0.1; int aNbIter = 3; ElInitArgMain ( argc,argv, LArgMain() << EAMC(aName,"Name Input"), LArgMain() << EAM(aPropSzW,"PropSzW",true,"Prop Size of W, def =0.1") << EAM(aSeuil,"Seuil",true,"Threshold beetween Black & White, Def=75") ); Tiff_Im aTIn = Tiff_Im::UnivConvStd(aName); Pt2di aSz = aTIn.sz(); int aSzW = round_ni((euclid(aSz)*aPropSzW) / sqrt(aNbIter)); Im2D_REAL4 anIm0(aSz.x,aSz.y); Im2D_REAL4 anIm1(aSz.x,aSz.y); Im2D_U_INT1 aImInside(aSz.x,aSz.y,1); ELISE_COPY(anIm0.all_pts(),255-aTIn.in(),anIm0.out()); int aNbF = 3; for (int aKF=0 ; aKF<aNbF ; aKF++) { Im2D_REAL4 anImFond(aSz.x,aSz.y); Fonc_Num aFIn = anIm0.in(0); for (int aK=0 ; aK<aNbIter ; aK++) aFIn = (rect_som(aFIn,aSzW)*aImInside.in(0)) / Max(1.0,rect_som(aImInside.in(0),aSzW)); ELISE_COPY(anImFond.all_pts(),aFIn,anImFond.out()); if (aKF == (aNbF-1)) { Fonc_Num aF = anIm0.in()-anImFond.in(); aF = aF / aSeuil; aF = (aF -0.1) / (1-2*aPropExag); aF = Max(0.0,Min(1.0,aF)); ELISE_COPY(anIm1.all_pts(),255.0 *(1-aF),anIm1.out()); } else { ELISE_COPY ( aImInside.all_pts(), anIm0.in() < anImFond.in()+aSeuil, aImInside.out() ); } } Tiff_Im::Create8BFromFonc(std::string("Bin-")+StdPrefix(aName)+".tif",aTIn.sz(),anIm1.in()); }
void ElImplemDequantifier::DoDequantif(Pt2di aSzIm,Fonc_Num f2Deq,bool aVerifI) { SetSize(aSzIm); SetChamfer(Chamfer::d32); Symb_FNum aFC = Max(trans(Rconv(f2Deq),Pt2di(-1,-1)),eValOut+2); Symb_FNum aIFC = round_ni(aFC); double aDifI; ELISE_COPY ( mImQuant.interior(1), Virgule(aIFC,Abs(aFC-aIFC)), // Max(trans(f2Deq,Pt2di(-1,-1)),eValOut+2), Virgule(mImQuant.out(),VMax(aDifI)) ); if (aVerifI) { ELISE_ASSERT(aDifI<1e-6,"Non int in ElImplemDequantifier::DoDequantif"); } ELISE_COPY(mImQuant.border(1),eValOut, mImQuant.out()); QuickSetDist(1); Symb_FNum sM (mDistMoins.in()); Symb_FNum sP (mDistPlus.in()); /* Pt2di P128(1565+2,1100+2); Pt2di P126(1475+2,1085+2); std::cout << "P128 : " << int(mDistMoins.data()[P128.y][P128.x]) << " " << int(mDistPlus.data()[P128.y][P128.x]) << "\n" ; std::cout << "P126 : " << int(mDistMoins.data()[P126.y][P126.x]) << " " << int(mDistPlus.data()[P126.y][P126.x]) << "\n" ; std::cout << "SZ IM " << aSzIm << "\n"; getchar(); */ ELISE_COPY ( mImDeq.all_pts(), trans(mImQuant.in()+(sM/Rconv(sM+sP)-0.5),Pt2di(1,1)), mImDeq.out() ); }
void ElImplemDequantifier::QuickSetDist(INT aNbStep) { ELISE_COPY(mDistPlus.all_pts(),eMaxDist,mDistPlus.out()); ELISE_COPY(mDistMoins.all_pts(),eMaxDist,mDistMoins.out()); for (INT aP0=0; aP0<mNbPts ; aP0++) { INT aQuant0 = lDQ[aP0]; if (aQuant0 != eValOut) { for (INT aKV=0; aKV<mNbVYm ; aKV++) { INT aPV = aP0 + mVYm[aKV]; INT aQuantV = lDQ[aPV]; if (aQuantV != eValOut) { INT aPds = mPdsYm[aKV]; if (aQuantV<aQuant0) { ElSetMin(mDPL[aPV],aPds-1); ElSetMin(mDM[aP0],aPds-1); } else if (aQuantV>aQuant0) { ElSetMin(mDPL[aP0],aPds-1); ElSetMin(mDM[aPV],aPds-1); } else { ElSetMin(mDPL[aP0],mDPL[aPV]+aPds); ElSetMin(mDM[aP0],mDM[aPV]+aPds); } } } } } OnePasseInverseVideo(); for (INT aK=0; aK<aNbStep ; aK++) { OnePasseVideo(); OnePasseInverseVideo(); } if (mTraitCuv) { TraitCuv(mDPL,mDM); TraitCuv(mDM ,mDPL); } }
void dist_chamfer_cabl(Im2D<U_INT1,INT> I,INT v_max) { Im2D<U_INT1,INT> I0(I.tx(),I.ty(),0); ELISE_COPY(I0.all_pts(),I.in(),I0.out()); Chamfer::d32.im_dist(I); INT nb_dif; ELISE_COPY ( I.all_pts(), I0.in()!=(I.in()!=0), sigma(nb_dif) ); BENCH_ASSERT(nb_dif == 0); INT tx = I.tx(); INT ty = I.ty(); U_INT1 ** d = I.data(); INT vmax = I.vmax()-1; for (int x=1; x<tx-1 ; x++) for (int y=1; y<ty-1 ; y++) { INT v; if (d[y][x]) v = std::min3 ( std::min3(d[y+1][x-1]+3,d[y+1][x]+2,d[y+1][x+1]+3), std::min3(d[y][x-1]+2,vmax,d[y][x+1]+2), std::min3(d[y-1][x-1]+3,d[y-1][x]+2,d[y-1][x+1]+3) ); else v = 0; BENCH_ASSERT(v == d[y][x]); } INT dif; ELISE_COPY ( I.all_pts(), Abs ( Min(I.in(),v_max) - extinc_32(I0.in(0),v_max) ), VMax(dif) ); BENCH_ASSERT(dif == 0); }
void MakeFoncRepart(Im1D_REAL8 aH,int * aVMax=0) { double aNbP; ELISE_COPY(aH.all_pts(),aH.in(),sigma(aNbP)); REAL8 * aDH = aH.data(); for (int aK=1 ; aK<aNbH ; aK++) { if (aDH[aK] && aVMax) *aVMax = aK; aDH[aK] += aDH[aK-1]; } ELISE_COPY(aH.all_pts(),aH.in() * (255.0/aNbP),aH.out()); }
void VisuParalx(Video_Win aW,Fonc_Num f,REAL & aV0,REAL & aV1,bool CalcV) { if (CalcV) ELISE_COPY ( aW.all_pts(),Rconv(f),VMin(aV0) | VMax(aV1)); ELISE_COPY ( aW.all_pts(), AUC(round_ni((f-aV0) * (255.0/(aV1-aV0)))), aW.ogray() ); }
cBenchCorrSub::cBenchCorrSub(Pt2di aSz,REAL anAmpl,REAL EchR,REAL TrR) : mAmpl (anAmpl), mSz (aSz), mDistX(aSz.x,aSz.y), mDistY(aSz.x,aSz.y), mIm1(aSz), mIm2(aSz), mW1 (Video_Win::WStd(aSz,1.0)), mW2 (Video_Win::WStd(aSz,1.0)) { static const INT NbV = 6; INT SzV[NbV] = {1,2,4,8,16,32}; REAL PdsV[NbV] = {1,2,3,4,5,6}; ELISE_COPY ( mIm1.mIm.all_pts(), 10.0+ unif_noise_4(PdsV,SzV,NbV) * 235.0, mIm1.mIm.out() | mW1.ogray() ); ELISE_COPY ( mIm2.mIm.all_pts(), Virgule ( FX + mAmpl * sin(FY/50.0), FY + mAmpl * sin(FX/50.0) ), Virgule(mDistX.out(),mDistY.out()) ); Fonc_Num EchDistRad = (1+cos(6+FX/60.0)) * (1+cos(FY/77.0)) / 4.0; Fonc_Num TrDistRad = 64.0 * ((1+cos(6+FX/72.0)) * (1+cos(FY/55.0))); Fonc_Num DistGeom = Virgule(mDistX.in(),mDistY.in()); REAL CsteR =1-EchR-TrR; ELISE_COPY ( mIm2.mIm.all_pts(), mIm1.mIm.in(0)[DistGeom]*(CsteR+EchR*EchDistRad) + TrR*TrDistRad, mIm2.mIm.out() | mW2.ogray() ); }
template <class Type,class TypeB> void bench_r2d_assoc ( const OperAssocMixte & op, Type *, TypeB *, Pt2di sz, INT x0, INT x1 ) { Im2D<Type,TypeB> I(sz.x,sz.y,(Type)0); Im2D_REAL8 R1(sz.x,sz.y,0.0); Im2D_REAL8 R2(sz.x,sz.y,0.0); Im2D_REAL8 R3(sz.x,sz.y,0.0); ELISE_COPY(I.all_pts(),255*frandr(),I.out()); ELISE_COPY ( I.all_pts(), linear_red(op,I.in(),x0,x1), R1.out() ); TypeB vdef; op.set_neutre(vdef); ELISE_COPY ( I.all_pts(), rect_red(op,I.in(vdef),Box2di(Pt2di(x0,0),Pt2di(x1,0))), R2.out() ); ELISE_COPY ( I.lmr_all_pts(Pt2di(1,0)), linear_red(op,I.in(),x0,x1), R3.out() ); REAL d12,d23; ELISE_COPY ( R1.all_pts(), Virgule( Abs(R1.in()-R2.in()), Abs(R2.in()-R3.in()) ), Virgule(VMax(d12),VMax(d23)) ); BENCH_ASSERT((d12<epsilon)&&(d23<epsilon)); }
void bench_env_klip(Pt2di sz) { Im2D_U_INT1 I1(sz.x,sz.y); Im2D_U_INT1 I2(sz.x,sz.y); INT vmax = 30; ELISE_COPY ( I1.all_pts(), Min ( vmax, 1 + frandr()*5 + unif_noise_4(3) * 30 ), I1.out() ); ELISE_COPY ( I1.border(1), 0, I1.out() ); ELISE_COPY ( I1.all_pts(), EnvKLipshcitz_32(I1.in(0),vmax), I2.out() ); U_INT1 ** i1 = I1.data(); U_INT1 ** i2 = I2.data(); for (INT x=0; x<sz.x ; x++) for (INT y=0; y<sz.y ; y++) if (i1[y][x]) { INT v = std::min3 ( std::min3(i2[y+1][x-1]+3,i2[y+1][x]+2,i2[y+1][x+1]+3), std::min3(i2[y][x-1]+2,(INT)i1[y][x],i2[y][x+1]+2), std::min3(i2[y-1][x-1]+3,i2[y-1][x]+2,i2[y-1][x+1]+3) ); BENCH_ASSERT(v==i2[y][x]); } }
void ShowIm2(Im2D_INT2 aZ,Video_Win aW) { INT zMax,zMin; ELISE_COPY(aZ.all_pts(),aZ.in(),VMax(zMax)|VMin(zMin)); cout << "Z = [" << zMin << " , " << zMax << "]\n"; ELISE_COPY ( aZ.all_pts(), Max(0,Min(255,aZ.in())), // (aZ.in()-zMin) * (255.0/(zMax-zMin)), aW.ogray() ); }
void Write_Vignette(string aDir, string aNameOut,vector<double> aParam,string aDirOut, Pt2di aSz){ //Bulding the output file system ELISE_fp::MkDirRec(aDir + aDirOut); //Reading the image and creating the objects to be manipulated aNameOut=aDir + aDirOut + aNameOut; Tiff_Im aTF=Tiff_Im(aNameOut.c_str(), aSz, GenIm::real4, Tiff_Im::No_Compr, Tiff_Im::BlackIsZero); Im2D_REAL4 aIm(aSz.x,aSz.y); ELISE_COPY ( aTF.all_pts(), aTF.in(), aIm.out() ); REAL4 ** aData = aIm.data(); for (int aY=0 ; aY<aSz.y ; aY++) { for (int aX=0 ; aX<aSz.x ; aX++) { double x0=aSz.x/2; double y0=aSz.y/2; double D=pow(aX-x0,2)+pow(aY-y0,2); double aCor=1+aParam[0]*D+aParam[1]*pow(D,2)+aParam[2]*pow(D,3); if(aCor<1){aData[aY][aX]=1;}else{aData[aY][aX]=aCor;} } } Tiff_Im aTOut ( aNameOut.c_str(), aSz, GenIm::real4, Tiff_Im::No_Compr, Tiff_Im::BlackIsZero ); ELISE_COPY ( aTOut.all_pts(), aIm.in(), aTOut.out() ); }
void cIncEnsembleCamera::SetLambda(REAL aLambda) { Im1D_REAL8 anIm(NbVal()); ELISE_COPY(anIm.all_pts(),mImState0.in()+mImDir.in()*aLambda,anIm.out()); SetPtCur(anIm.data()); }
void cASAMG::TestDifProf(const cASAMG & aNE) const { Im2D_REAL4 aImDif(mSz.x,mSz.y,1000); TIm2D<REAL4,REAL8> aTDif(aImDif); Pt2di anIndex; for (anIndex.x=0 ; anIndex.x <mSz.x ; anIndex.x++) { for (anIndex.y=0 ; anIndex.y <mSz.y ; anIndex.y++) { if (mTMasqN.get(anIndex)) { Pt3dr aPE = mStdN->PtOfIndex(anIndex); aTDif.oset(anIndex,aNE.SignedDifProf(aPE)); } } } Video_Win * aW = TheWinIm(); if (aW) { ELISE_COPY ( aImDif.all_pts(), Min(255,Abs(aImDif.in()*300)), aW->ogray() ); aW->clik_in(); } }
void MoyByCC(bool V4,TypeEtiq aTIm,int aValExclu,TypeImIn aImIn,TypeImOut aImOut) { Pt2di aSz = aTIm.sz(); Im2D_Bits<1> aMasq1 = ImMarqueurCC(aSz); TIm2DBits<1> aTMasq1(aMasq1); Im2D_Bits<1> aMasq2(aSz.x,aSz.y,1); TIm2DBits<1> aTMasq2(aMasq2); ELISE_COPY(aMasq2.border(1),0,aMasq2.out()); Pt2di aP; for(aP.x=0 ; aP.x<aSz.x ; aP.x++) { for(aP.y=0 ; aP.y<aSz.y ; aP.y++) { int aValIm = aTIm.get(aP); if ((aValIm!=aValExclu) && (aTMasq1.get(aP)==1)) { cSomValCC<TypeImIn> aCumSom(aImIn); int aNb = OneZC(aP,V4,aTMasq1,1,0,aTIm,aValIm,aCumSom); cMarqImCC<TypeImOut> aMarqIm(aImOut,aCumSom.mSom/aNb); OneZC(aP,V4,aTMasq2,1,0,aTIm,aValIm,aMarqIm); } } } }
cVisuCaracDigeo::cVisuCaracDigeo ( cAppliDigeo & anAppli, Pt2di aSz, int aZ, Fonc_Num aF, const cParamVisuCarac & aParam ) : mAppli (anAppli), mSz1 (aSz), mZ (aZ), mSzZ (mSz1*aZ), mIm (mSzZ.x,mSzZ.y), mTIm (mIm), mParam (aParam), mDynG (aParam.DynGray().Val()) { ELISE_COPY ( mIm.all_pts(), Max(0,Min(mDynG-1,(aF[Virgule(FX/aZ,FY/aZ)]*double(mDynG))/255)), mIm.out() ); }
Im2D_REAL4 Conv2Float(Im2DGen anI) { Pt2di aSz = anI.sz(); Im2D_REAL4 aRes(aSz.x,aSz.y); ELISE_COPY(anI.all_pts(),anI.in(),aRes.out()); return aRes; }
void MakeFCol() { Tiff_Im Tif("../TMP/f3Reduc4.tif"); Tiff_Im NewTif ( "../TMP/Col.tif", Tif.sz(), GenIm::u_int1, Tiff_Im::No_Compr, Tiff_Im::RGB, ElList<Arg_Tiff> () + Arg_Tiff(Tiff_Im::ATiles(Pt2di(1024,1024))) + Arg_Tiff(Tiff_Im::APlanConf(Tiff_Im::Chunky_conf)) ); ELISE_COPY ( Tif.all_pts(), its_to_rgb (Virgule( Tif.in(0), FX, Abs((FY%512)-256) )), NewTif.out() ); }
Liste_Pts_INT2 cAppli_Ortho::CompConx ( Pt2di aGerm, int aValSet ) { Liste_Pts_INT2 cc(2); Neighbourhood V4 = Neighbourhood::v4(); ELISE_COPY ( conc ( aGerm, mImEtiqTmp.neigh_test_and_set ( V4, mTImEtiqTmp.get(aGerm), aValSet, 100 ) ), 0, cc ); return cc; }
Box2di cWindowXmlEditor::TopDraw() { ELISE_COPY(mW.all_pts(),mGrayFond,mW.ogray()); int aTx = mW.sz().x; // int aXMil = aTx/2; if (mFirstDraw) { mCaseQuit = cCaseX11Xml::Alloc(mW,Box2di(Pt2di(10,10),Pt2di(200,40)),P8COL::magenta); mCaseWarn = cCaseX11Xml::Alloc(mW,Box2di(Pt2di(10,2),Pt2di(aTx-2,48)),P8COL::red); mVCase.push_back(mCaseQuit); mVInfoCase.push_back(cWXXInfoCase(0,0)); } Box2di aRes = Draw(Pt2di(50,50),mTreeGlob,0,mFilterGlob); mFirstDraw = false; for (int aKC=0 ; aKC<int(mVCase.size()) ; aKC++) { cCaseX11Xml * aCX = mVCase[aKC]; aCX->Efface(); cWXXInfoCase & anIC = mVInfoCase[aKC]; cElXMLTree * aTree = anIC.mTree; if (aTree) aCX->string(-10,anIC.mTree->GetUniqueVal()); } ShowQuit(); return aRes; }
std::pair<int,std::string> cX11_Interface::IdNewPts(cCaseNamePoint * aCNP) { int aCptMax = mAppli->GetCptMax() + 1; std::string aName = aCNP->mName; if (aCNP->mTCP == eCaseAutoNum) { aName = nameFromAutoNum(aCNP, aCptMax); } if (aCNP->mTCP == eCaseSaisie) { mWEnter->raise(); ELISE_COPY(mWEnter->all_pts(),P8COL::yellow,mWEnter->odisc()); // std::cin >> aName ; aName = mWEnter->GetString(Pt2dr(5,15),mWEnter->pdisc()(P8COL::black),mWEnter->pdisc()(P8COL::yellow)); mWEnter->lower(); } mMenuNamePoint->W().lower(); // std::cout << "cAppli_SaisiePts::IdNewPts " << aCptMax << " " << aName << "\n"; return std::pair<int,std::string>(aCptMax,aName); }
int main(int,char **) { Pt2di sz(10,10); Im2D_U_INT2 Ifl(sz.x,sz.y,255); cout << "bench_vecto AAAA\n"; // cout << Ifl.ptr() << "\n"; INT aBid; ELISE_COPY ( rectangle(Pt2di(0,0),sz), // Ifl.all_pts(), TOTO ( Fonc_Num(11), BugAV (Ifl) ), sigma(aBid) ); cout << "bench_vecto BBBBB\n"; exit(-1); return 0; }