本文整理汇总了C++中Bitmap::HasFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ Bitmap::HasFilter方法的具体用法?C++ Bitmap::HasFilter怎么用?C++ Bitmap::HasFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitmap
的用法示例。
在下文中一共展示了Bitmap::HasFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IFailsProbBitmap
bool plDistributor::IFailsProbBitmap(int iFace, const Point3& bary) const
{
// If we don't have a probability map, or we don't have
// valid coordinates into it, just return false. That is,
// with no valid probability map, everything goes.
int uvwChan = 1;
Matrix3 uvtrans(true);
Bitmap* bm = nil;
UINT filtType = BMM_FILTER_PYRAMID;
if( fProbBitmapTex )
{
uvwChan = fProbBitmapTex->GetMapChannel();
fProbBitmapTex->GetUVTransform(uvtrans);
bm = fProbBitmapTex->GetBitmap(TimeValue(0));
if( bm && !bm->HasFilter() )
{
switch( fProbBitmapTex->GetFilterType() )
{
default:
case FILTER_PYR:
filtType = BMM_FILTER_PYRAMID;
break;
case FILTER_SAT:
filtType = BMM_FILTER_SUM;
break;
case FILTER_NADA:
filtType = BMM_FILTER_NONE;
break;
}
}
}
else if( fProbLayerTex )
{
uvwChan = fProbLayerTex->GetMapChannel();
fProbLayerTex->GetUVTransform(uvtrans);
bm = fProbLayerTex->GetBitmap(TimeValue(0));
}
if( !bm )
return false;
if( !bm->HasFilter() )
bm->SetFilter(filtType);
bm->PrepareGChannels(&bm->Storage()->bi);
if( !fSurfMesh->mapSupport(uvwChan) )
return false;
if( !fSurfMesh->mapFaces(uvwChan) || !fSurfMesh->mapVerts(uvwChan) )
return false;
// Lookup the appropriate texel value
Point3 uvw;
uvw = fSurfMesh->mapVerts(uvwChan)[fSurfMesh->mapFaces(uvwChan)[iFace].getTVert(0)] * bary[0];
uvw += fSurfMesh->mapVerts(uvwChan)[fSurfMesh->mapFaces(uvwChan)[iFace].getTVert(1)] * bary[1];
uvw += fSurfMesh->mapVerts(uvwChan)[fSurfMesh->mapFaces(uvwChan)[iFace].getTVert(2)] * bary[2];
uvw = uvw * uvtrans;
float fu = uvw.x - int(uvw.x);
if( fu < 0 )
fu += 1.f;
float fv = 1.0f - (uvw.y - int(uvw.y));
if( fv < 0 )
fv += 1.f;
float du = 1.f / bm->Width();
float dv = 1.f / bm->Height();
BMM_Color_fl evCol;
bm->GetFiltered(fu, fv, du, dv, &evCol);
float frac;
switch( fProbColorChan )
{
case kRed:
frac = evCol.r;
break;
case kGreen:
frac = evCol.g;
break;
case kBlue:
frac = evCol.b;
break;
case kAlpha:
frac = evCol.a;
break;
case kAverageRedGreen:
frac = (evCol.r + evCol.g) / 2.f;
break;
case kAverageRedGreenTimesAlpha:
frac = (evCol.r + evCol.g) / 2.f * evCol.a;
break;
case kAverage:
frac = (evCol.r + evCol.g + evCol.b ) / 3.f;
break;
//.........这里部分代码省略.........