本文整理汇总了C++中IParamBlock2::GetBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock2::GetBitmap方法的具体用法?C++ IParamBlock2::GetBitmap怎么用?C++ IParamBlock2::GetBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParamBlock2
的用法示例。
在下文中一共展示了IParamBlock2::GetBitmap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
/// Called to update the controls of the dialog
virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map )
{
ICustButton *bmSelectBtn;
IParamBlock2 *pblock;
int i;
long buttons[ 6 ] = { IDC_FRONT_NAME, IDC_BACK_NAME, IDC_LEFT_NAME, IDC_RIGHT_NAME, IDC_TOP_NAME, IDC_BOTTOM_NAME };
BitmapInfo bi;
ParamMap2UserDlgProc::Update( t, valid, map );
pblock = map->GetParamBlock();
for( i = plStaticEnvLayer::kBmpFrontBitmap; i <= plStaticEnvLayer::kBmpBottomBitmap; i++ )
{
bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), buttons[ i ] ) );
PBBitmap *pbbm = pblock->GetBitmap( i, t );
if( pbbm )
bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() );
else
bmSelectBtn->SetText( _T( "None" ) );
ReleaseICustButton( bmSelectBtn );
}
plStaticEnvLayer *layer = (plStaticEnvLayer *)map->GetParamBlock()->GetOwner();
bi.SetName( layer->GetBaseFilename( t ) );
SetDlgItemText( map->GetHWnd(), IDC_BASE_FILENAME, bi.Filename() );
map->Enable( plStaticEnvLayer::kBmpGenerateFaces, ( bi.Name() == NULL || bi.Name()[ 0 ] == 0 ) ? FALSE : TRUE );
bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_GENERATE_FACES ) );
bmSelectBtn->SetText( _T( "Generate From Node" ) );
ReleaseICustButton( bmSelectBtn );
i = pblock->GetInt( plStaticEnvLayer::kBmpTextureSize, t );
pblock->SetValue( plStaticEnvLayer::kBmpLastTextureSize, t, i );
}
示例2: frameBegin
// Called at the start of each frame
void VRayCamera::frameBegin(VR::VRayRenderer *vray) {
const VR::VRayFrameData &fdata = vray->getFrameData();
TimeValue t = fdata.t;
stereo_camera=pblock->GetInt(pb_camera, t);
// angles in paramblock are automatically converted to radians, so no need to convert here
fov_vert_angle = pblock->GetFloat(pb_fov_vert_angle, t);
zenith_fov = pblock->GetInt(pb_zenithfov, t);
fov_horiz_angle = pblock->GetFloat(pb_fov_horiz_angle, t);
parallax_distance = pblock->GetFloat(pb_parallax_distance, t);
separation = pblock->GetFloat(pb_separation, t);
neck_offset = pblock->GetFloat(pb_neck_offset, t);
zenith_mode = pblock->GetInt(pb_zenith_mode, t);
separation_map = pblock->GetBitmap(pb_separation_map, t);
if (separation_map != NULL) {
separation_map->Load();
if (separation_map->bm != NULL) {
separation_map->bm->SetFilter(BMM_FILTER_PYRAMID);
}
}
flip_x = pblock->GetInt(pb_flip_x, t);
flip_y = pblock->GetInt(pb_flip_y, t);
horiz_neck = pblock->GetInt(pb_horiz_neck, t);;
poles_corr = pblock->GetInt(pb_poles_corr, t);;
poles_corr_start = pblock->GetFloat(pb_poles_corr_start, t);
poles_corr_end = pblock->GetFloat(pb_poles_corr_end, t);
parallel_cams = pblock->GetInt(pb_parall_cams, t);
// check poles corr angles
if (poles_corr_end < poles_corr_start)
poles_corr_end = poles_corr_start;
//zenith_fov = (fov_vert_angle < 0.0f) ? TRUE : FALSE;
//fov_vert_angle = abs(fov_vert_angle);
//fov=pblock->GetFloat(pb_fov, fdata.t);
fov = 1.0; // fov_vert_angle / 2.0f; // [rz] testing only. Need better approximation formula.
targetDist = GetTDist((TimeValue) fdata.t);
aperture = 0.0f;
camera.SetPos(fdata.camToWorld.offs, -fdata.camToWorld.m[2], fdata.camToWorld.m[1], fdata.camToWorld.m[0]);
camera.Init(fdata.imgWidth, fdata.imgHeight, fov, 1.0f, aperture, targetDist);
this->vray = vray;
}
示例3: if
plLayerInterface *plLayerConverter::IConvertStaticEnvLayer( plPlasmaMAXLayer *layer,
plMaxNode *maxNode, uint32_t blendFlags,
bool preserveUVOffset, bool upperLayer )
{
hsGuardBegin( "plLayerConverter::IConvertStaticEnvLayer" );
IParamBlock2 *bitmapPB;
plLocation loc;
loc = maxNode->GetLocation();
bitmapPB = layer->GetParamBlockByID( plStaticEnvLayer::kBlkBitmap );
if( !bitmapPB )
{
fErrorMsg->Set( !bitmapPB, "Plasma Layer Error", "Bitmap paramblock for Plasma Layer not found" ).Show();
fErrorMsg->Set();
return nil;
}
// Get a new layer to play with
plLayer *plasmaLayer = ICreateLayer( plString::FromUtf8( layer->GetName() ), upperLayer, loc );
// Get the texture info
PBBitmap *pbbm = bitmapPB->GetBitmap( plStaticEnvLayer::kBmpFrontBitmap + 0 );
BitmapInfo *bi = nil;
if( pbbm )
bi = &pbbm->bi;
// If the texture had bad info, assert and return the empty layer
if (!bi || !bi->Name() || !strcmp(bi->Name(), ""))
{
// Or don't assert since it can get annoying when you are using someone
// elses file and don't have all the textures.
return (plLayerInterface *)plasmaLayer;
}
// Setup the texture creation parameters
plBitmapData bd;
bd.fileName = bi->Name();
// Create texture and add it to list if unique
int32_t texFlags = 0;
// Texture Alpha/Color
if( bitmapPB->GetInt( plStaticEnvLayer::kBmpInvertColor ) )
plasmaLayer->SetBlendFlags( plasmaLayer->GetBlendFlags() | hsGMatState::kBlendInvertColor );
if( bitmapPB->GetInt( plStaticEnvLayer::kBmpDiscardColor ) )
plasmaLayer->SetBlendFlags( plasmaLayer->GetBlendFlags() | hsGMatState::kBlendNoTexColor );
if( bitmapPB->GetInt( kBmpDiscardAlpha ) )
plasmaLayer->SetBlendFlags( plasmaLayer->GetBlendFlags() | hsGMatState::kBlendNoTexAlpha );
if( bitmapPB->GetInt( plStaticEnvLayer::kBmpInvertAlpha ) )
bd.invertAlpha = true;
// Texture quality
if( bitmapPB->GetInt( plStaticEnvLayer::kBmpNonCompressed ) )
texFlags |= plBitmap::kForceNonCompressed;
switch( bitmapPB->GetInt( plStaticEnvLayer::kBmpScaling ) )
{
case plStaticEnvLayer::kScalingHalf: texFlags |= plBitmap::kHalfSize; break;
case plStaticEnvLayer::kScalingNone: texFlags |= plBitmap::kNoMaxSize; break;
}
bd.texFlags = texFlags;
bd.isStaticCubicEnvMap = true;
for( int i = 0; i < 6; i++ )
{
PBBitmap *face = bitmapPB->GetBitmap( plStaticEnvLayer::kBmpFrontBitmap + i );
if( !face )
return (plLayerInterface *)plasmaLayer;
bd.faceNames[ i ] = face->bi.Name();
}
// Get detail parameters
if( bitmapPB->GetInt( plStaticEnvLayer::kBmpUseDetail ) )
{ // TODO: be smarter
if( blendFlags & hsGMatState::kBlendAdd )
bd.createFlags = plMipmap::kCreateDetailAdd;
else if( blendFlags & hsGMatState::kBlendMult )
bd.createFlags = plMipmap::kCreateDetailMult;
else
bd.createFlags = plMipmap::kCreateDetailAlpha;
bd.detailDropoffStart = float( bitmapPB->GetInt( plStaticEnvLayer::kBmpDetailStartSize ) ) / 100.f;
bd.detailDropoffStop = float( bitmapPB->GetInt( plStaticEnvLayer::kBmpDetailStopSize ) ) / 100.f;
bd.detailMax = float( bitmapPB->GetInt( plStaticEnvLayer::kBmpDetailStartOpac ) ) / 100.f;
bd.detailMin = float( bitmapPB->GetInt( plStaticEnvLayer::kBmpDetailStopOpac ) ) / 100.f;
}
/// Since we're a cubic environMap, we don't care about the UV transform nor the uvwSrc
plasmaLayer->SetUVWSrc( 0 );
plasmaLayer->SetUVWSrc( plasmaLayer->GetUVWSrc() | plLayerInterface::kUVWReflect );
// Create the texture. If it works, assign it to the layer
if( ( plasmaLayer = IAssignTexture( &bd, maxNode, plasmaLayer, upperLayer ) ) == nil )
return nil;
// Tag this layer as reflective cubic environmentmapping
if( bitmapPB->GetInt(plStaticEnvLayer::kBmpRefract) )
plasmaLayer->SetMiscFlags( plasmaLayer->GetMiscFlags() | hsGMatState::kMiscUseRefractionXform );
//.........这里部分代码省略.........
示例4: exportEffectParameters
//.........这里部分代码省略.........
case TYPE_RGBA:
case TYPE_FRGBA:
{
COLLADASW::NewParam<> newParam ( streamWriter );
newParam.setParamType ( COLLADASW::ValueType::FLOAT4 );
int numOfValues = 4;
AColor paramPoint3Value = pblock->GetAColor( parameterID );
float* paramValue = (float*)paramPoint3Value;
exportParam ( paramName, &newParam, paramValue, numOfValues );
break;
}
case TYPE_POINT3:
{
COLLADASW::NewParam<> newParam ( streamWriter );
newParam.setParamType ( COLLADASW::ValueType::FLOAT3 );
int numOfValues = 3;
Point3 paramPoint3Value = pblock->GetPoint3( parameterID );
float* paramValue = (float*)paramPoint3Value;
exportParam ( paramName, &newParam, paramValue, numOfValues );
break;
}
case TYPE_BOOL:
{
COLLADASW::NewParam<> newParam ( streamWriter );
newParam.setParamType ( COLLADASW::ValueType::BOOL );
int numOfValues = 1;
/*bool*/ int paramValue = pblock->GetInt( parameterID );
exportParam ( paramName, &newParam, ¶mValue, numOfValues );
break;
}
//TYPE_ANGLE
//TYPE_PCNT_FRAC
//TYPE_WORLD
case TYPE_STRING:
{
COLLADASW::NewParam<> newParam ( streamWriter );
const MCHAR * paramValue = pblock->GetStr( parameterID );
exportParam ( paramName, &newParam, paramValue );
break;
}
//TYPE_FILENAME
//TYPE_HSV
//TYPE_COLOR_CHANNEL
//TYPE_TIMEVALUE
//TYPE_RADIOBTN_INDEX
//TYPE_MTL
//TYPE_TEXMAP
case TYPE_BITMAP:
{
PBBitmap * bitmap = pblock->GetBitmap( parameterID );
exportSampler ( paramName, bitmap );
break;
}
//TYPE_INODE
//TYPE_REFTARG
//TYPE_INDEX
//TYPE_MATRIX3
//TYPE_PBLOCK2
case TYPE_POINT4:
{
COLLADASW::NewParam<> newParam ( streamWriter );
newParam.setParamType ( COLLADASW::ValueType::FLOAT4 );
int numOfValues = 4;
Point4 paramPoint3Value = pblock->GetPoint4( parameterID );
float* paramValue = (float*)paramPoint3Value;
exportParam ( paramName, &newParam, paramValue, numOfValues );
break;
}
default:
{
//:TODO: warning (file and/or popup)
GetCOREInterface()->Log()->LogEntry( SYSLOG_WARN, DISPLAY_DIALOG, _M( "Parameter export problem" ),_M( "Unsupported parameter type (%i) for parameter %s\n" ), parameterType, paramName );
}
}
}
}