本文整理汇总了C++中Tiff_Im::type_el方法的典型用法代码示例。如果您正苦于以下问题:C++ Tiff_Im::type_el方法的具体用法?C++ Tiff_Im::type_el怎么用?C++ Tiff_Im::type_el使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tiff_Im
的用法示例。
在下文中一共展示了Tiff_Im::type_el方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool MultiChannel<tData>::read_tiff( Tiff_Im &i_tiff ) // Tiff_Im is not const because of ReadVecOfIm
{
if ( i_tiff.type_el()!=typeEl() ) return false;
vector<Im2DGen *> tiffChannels = i_tiff.ReadVecOfIm();
resize( i_tiff.sz().x, i_tiff.sz().y, i_tiff.nb_chan() );
for ( size_t i=0; i<mChannels.size(); i++ )
set( i, *(Im2D<tData,tBase>*)tiffChannels[i] );
return true;
}
示例2: aSzBrd
cTmpReechEpip::cTmpReechEpip
(
bool aConsChan,
const std::string & aNameOri,
Box2dr aBoxImIn,
ElDistortion22_Gen * anEpi,
Box2dr aBox,
double aStep,
const std::string & aNameOut,
const std::string & aPostMasq,
int aNumKer ,
bool Debug
) :
mBoxImIn(aBoxImIn),
mEpi (anEpi),
mStep (aStep),
mP0 (aBox._p0),
mSzEpi (aBox.sz()),
mSzRed (round_up (aBox.sz() / aStep) + Pt2di(1,1)),
mRedIMasq (mSzRed.x,mSzRed.y,0),
mRedTMasq (mRedIMasq),
mRedImX (mSzRed.x,mSzRed.y),
mRedTImX (mRedImX),
mRedImY (mSzRed.x,mSzRed.y),
mRedTImY (mRedImY)
{
cInterpolateurIm2D<REAL4> * aPtrSCI = 0;
if (aNumKer==0)
{
aPtrSCI = new cInterpolBilineaire<REAL4>;
}
else
{
cKernelInterpol1D * aKer = 0;
if (aNumKer==1)
aKer = new cCubicInterpKernel(-0.5);
else
aKer = new cSinCardApodInterpol1D(cSinCardApodInterpol1D::eTukeyApod,aNumKer,aNumKer/2,1e-4,false);
aPtrSCI = new cTabIM2D_FromIm2D<REAL4> (aKer,1000,false);
// cTabIM2D_FromIm2D<REAL4> aSSCI (&aKer,1000,false);
}
cInterpolateurIm2D<REAL4> & aSCI = *aPtrSCI;
Pt2di aPInd;
for (aPInd.x=0 ; aPInd.x<mSzRed.x ; aPInd.x++)
{
for (aPInd.y=0 ; aPInd.y<mSzRed.y ; aPInd.y++)
{
bool Ok= false;
Pt2dr aPEpi = ToFullEpiCoord(aPInd);
Pt2dr aPIm = anEpi->Inverse(aPEpi);
if ((aPIm.x>mBoxImIn._p0.x) && (aPIm.y>mBoxImIn._p0.y) && (aPIm.x<mBoxImIn._p1.x) && (aPIm.y<mBoxImIn._p1.y))
{
Pt2dr aPEpi2 = anEpi->Direct(aPIm);
if (euclid(aPEpi-aPEpi2) < 1e-2)
{
Ok= true;
mRedTMasq.oset(aPInd,Ok);
}
}
mRedTImX.oset(aPInd,aPIm.x);
mRedTImY.oset(aPInd,aPIm.y);
}
}
ELISE_COPY(mRedIMasq.all_pts(),dilat_d8(mRedIMasq.in(0),4),mRedIMasq.out());
Tiff_Im aTifOri = Tiff_Im::StdConvGen(aNameOri.c_str(),aConsChan ? -1 :1 ,true);
Tiff_Im aTifEpi = Debug ?
Tiff_Im(aNameOut.c_str()) :
Tiff_Im
(
aNameOut.c_str(),
mSzEpi,
aTifOri.type_el(),
Tiff_Im::No_Compr,
aTifOri.phot_interp()
) ;
Tiff_Im aTifMasq = aTifEpi;
bool ExportMasq = (aPostMasq!="NONE");
// std::cout << "POSTMAS " << aPostMasq << "\n";
if (ExportMasq)
{
std::string aNameMasq = StdPrefix(aNameOut)+ aPostMasq +".tif";
aTifMasq = Debug ?
Tiff_Im(aNameMasq.c_str()) :
//.........这里部分代码省略.........
示例3: ConvertIm_main
int ConvertIm_main(int argc,char ** argv)
{
MMD_InitArgcArgv(argc,argv);
Tiff_Im::SetDefTileFile(1000000);
std::string aNameIn ;
INT aReducX=0;
INT aReducY=0;
INT aReducXY=0;
INT aVisu=0;
GenIm::type_el aTypeOut ;
std::string aNameTypeOut ="";
Tiff_Im::PH_INTER_TYPE aPhInterpOut ;
std::string aNamePITOut ="";
std::string PITOut[] = {"RGB","BW"};
std::list<std::string> lOut(PITOut, PITOut + sizeof(PITOut) / sizeof(std::string) );
std::string aNameOut;
std::string anExt;
Pt2di aP0(0,0);
Pt2di aSzOut ;
Pt2di aSzTF(-1,-1);
REAL aDyn=1.0;
Pt2di aSzTileInterne(-1,-1);
int aKCh = -1;
std::vector<int> aVPermut;
int aNoTile = 0;
std::string aF2 ="";
ElInitArgMain
(
argc,argv,
LArgMain() << EAMC(aNameIn, "Image", eSAM_IsExistFile),
LArgMain() << EAM(aNameOut,"Out",true)
<< EAM(anExt,"Ext",true)
<< EAM(aSzOut,"SzOut",true, "Size out", eSAM_NoInit)
<< EAM(aP0,"P0",true)
<< EAM(aNameTypeOut,"Type",true, "TypeMNT", eSAM_None, ListOfVal(GenIm::bits1_msbf, ""))
<< EAM(aNamePITOut,"Col",true, "Col", eSAM_None,lOut)
<< EAM(aReducXY,"ReducXY",true)
<< EAM(aReducX,"ReducX",true)
<< EAM(aReducY,"ReducY",true)
<< EAM(aVisu,"Visu",true)
<< EAM(aSzTF,"SzTifTile",true)
<< EAM(aSzTileInterne,"SzTileInterne",true)
<< EAM(aDyn,"Dyn",true)
<< EAM(aKCh,"KCh",true)
<< EAM(aNoTile,"NoTile",true)
<< EAM(aVPermut,"Permut",true, "Permut", eSAM_NoInit)
<< EAM(aF2,"F2",true)
);
if (!MMVisualMode)
{
// Tiff_Im aTifIn = Tiff_Im::BasicConvStd(aNameIn);
Tiff_Im aTifIn = Tiff_Im::UnivConvStd(aNameIn);
INT aNbChIn = aTifIn.nb_chan();
if (! EAMIsInit(&aTypeOut)) aTypeOut =aTifIn.type_el();
if (! EAMIsInit(&aPhInterpOut)) aPhInterpOut = aTifIn.phot_interp();
if (! EAMIsInit(&aSzOut)) aSzOut = aTifIn.sz();
if (aReducXY)
{
aReducX = 1;
aReducY = 1;
}
if (aNameOut=="")
{
if (anExt=="")
{
if (aReducX && aReducY)
anExt = "_RXY";
else if (aReducX)
anExt = "_RX";
else if (aReducY)
anExt = "_RY";
else
anExt= "_Out";
}
if (IsPostfixed(aNameIn))
aNameOut = StdPrefix(aNameIn) + anExt +"." + StdPostfix(aNameIn);
else
aNameOut = aNameIn + anExt + "tif";
}
Pt2di aCoefReduc(aReducX != 0 ? 2 : 1, aReducY != 0 ? 2 : 1);
aSzOut = aSzOut.dcbyc(aCoefReduc);
if (aNameTypeOut != "")
//.........这里部分代码省略.........
示例4: aBox
cElNuage3DMaille * cElNuage3DMaille::FromParam
(
const cXML_ParamNuage3DMaille & aParamOri,
const std::string & aDir,
const std::string & aMasqSpec,
double ExagZ,
const cParamModifGeomMTDNuage * aPMG,
bool WithEmptyData
)
{
cXML_ParamNuage3DMaille aParam = aParamOri;
Box2di aBox(Pt2di(0,0),aParam.NbPixel());
bool Dequant = false;
if (aPMG)
{
double aScale = aPMG->mScale;
if (aScale != 1.0)
{
std::string aMes = "Scale=" + ToString(aScale);
cElWarning::ScaleInNuageFromP.AddWarn(aMes,__LINE__,__FILE__);
}
Pt2di aP0 = round_down(aPMG->mBox._p0/aScale);
Pt2di aP1 = round_up(aPMG->mBox._p1/aScale);
aBox = Inf(aBox,Box2di(aP0,aP1));
aParam.NbPixel() = aBox.sz();
ElAffin2D aAfM2C = Xml2EL(aParam.Orientation().OrIntImaM2C());
aAfM2C = ElAffin2D::trans(-Pt2dr(aBox._p0)) * aAfM2C;
aParam.Orientation().OrIntImaM2C().SetVal(El2Xml(aAfM2C));
Dequant = aPMG->mDequant;
}
std::string aMasq = aDir+aParam.Image_Profondeur().Val().Masq();
if (aMasqSpec!="")
aMasq = aMasqSpec;
GenIm::type_el aTypeEl = GenIm::real4;
Fonc_Num aFMasq = 0;
Fonc_Num aFProf = 1;
if (! WithEmptyData)
{
aFMasq = trans(Tiff_Im::BasicConvStd(aMasq).in(0),aBox._p0);
Tiff_Im aTP = Tiff_Im::BasicConvStd(aDir+aParam.Image_Profondeur().Val().Image());
aFProf = trans(aTP.in_proj()*ExagZ,aBox._p0);
aTypeEl = aTP.type_el();
}
if (aParam.Image_Profondeur().IsInit())
{
bool aFaiscClassik = ( (aParam.Image_Profondeur().Val().GeomRestit()==eGeomMNTFaisceauIm1PrCh_Px1D)
|| (aParam.Image_Profondeur().Val().GeomRestit()==eGeomMNTFaisceauIm1PrCh_Px2D)
|| (aParam.Image_Profondeur().Val().GeomRestit()==eGeomMNTEuclid)
|| (aParam.Image_Profondeur().Val().GeomRestit()==eGeomMNTFaisceauPrChSpherik)
);
bool aProfIsZ = ( (aParam.Image_Profondeur().Val().GeomRestit()==eGeomMNTFaisceauIm1ZTerrain_Px1D)
|| (aParam.Image_Profondeur().Val().GeomRestit()==eGeomMNTFaisceauIm1ZTerrain_Px2D)
);
if (aFaiscClassik || aProfIsZ)
{
switch (aTypeEl)
{
case GenIm::int2 :
if (Dequant)
return new cElN3D_EpipGen<float,double>(aDir,aParam,aFMasq,aFProf,aProfIsZ,WithEmptyData,true);
else
return new cElN3D_EpipGen<INT2,INT>(aDir,aParam,aFMasq,aFProf,aProfIsZ,WithEmptyData,false);
break;
case GenIm::real4 :
return new cElN3D_EpipGen<float,double>(aDir,aParam,aFMasq,aFProf,aProfIsZ,WithEmptyData,false);
break;
default :
std::cout << "NAME " << aDir+aParam.Image_Profondeur().Val().Image() << "\n";
ELISE_ASSERT(false,"Type Image non gere dans cElNuage3DMaille::FromParam");
break;
}
}
}
ELISE_ASSERT(false,"cElNuage3DMaille::FromParam");
return 0;
}