本文整理汇总了C++中FColor::ReinterpretAsLinear方法的典型用法代码示例。如果您正苦于以下问题:C++ FColor::ReinterpretAsLinear方法的具体用法?C++ FColor::ReinterpretAsLinear怎么用?C++ FColor::ReinterpretAsLinear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FColor
的用法示例。
在下文中一共展示了FColor::ReinterpretAsLinear方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PostLoad
void UPaperTerrainComponent::PostLoad()
{
Super::PostLoad();
const int32 PaperVer = GetLinkerCustomVersion(FPaperCustomVersion::GUID);
if (PaperVer < FPaperCustomVersion::FixVertexColorSpace)
{
const FColor SRGBColor = TerrainColor.ToFColor(/*bSRGB=*/ true);
TerrainColor = SRGBColor.ReinterpretAsLinear();
}
}
示例2: DrawDebugPoint
void DrawDebugPoint(const UWorld* InWorld, FVector const& Position, float Size, FColor const& Color, bool bPersistentLines, float LifeTime, uint8 DepthPriority)
{
// no debug line drawing on dedicated server
if (GEngine->GetNetMode(InWorld) != NM_DedicatedServer)
{
// this means foreground lines can't be persistent
ULineBatchComponent* const LineBatcher = GetDebugLineBatcher( InWorld, bPersistentLines, LifeTime, (DepthPriority == SDPG_Foreground) );
if(LineBatcher != NULL)
{
LineBatcher->DrawPoint(Position, Color.ReinterpretAsLinear(), Size, DepthPriority, LifeTime);
}
}
}
示例3: SetFolderColor
void FSequencerFolderNode::SetFolderColor()
{
InitialFolderColor = MovieSceneFolder.GetFolderColor();
bFolderPickerWasCancelled = false;
FColorPickerArgs PickerArgs;
PickerArgs.bUseAlpha = false;
PickerArgs.DisplayGamma = TAttribute<float>::Create( TAttribute<float>::FGetter::CreateUObject(GEngine, &UEngine::GetDisplayGamma) );
PickerArgs.InitialColorOverride = InitialFolderColor.ReinterpretAsLinear();
PickerArgs.OnColorCommitted = FOnLinearColorValueChanged::CreateSP( this, &FSequencerFolderNode::OnColorPickerPicked);
PickerArgs.OnColorPickerWindowClosed = FOnWindowClosed::CreateSP( this, &FSequencerFolderNode::OnColorPickerClosed);
PickerArgs.OnColorPickerCancelled = FOnColorPickerCancelled::CreateSP( this, &FSequencerFolderNode::OnColorPickerCancelled );
OpenColorPicker(PickerArgs);
}
示例4: CreateColorPicker
void FColorStructCustomization::CreateColorPicker( bool bUseAlpha, bool bOnlyRefreshOnOk )
{
int32 NumObjects = StructPropertyHandle->GetNumOuterObjects();
SavedPreColorPickerColors.Empty();
TArray<FString> PerObjectValues;
StructPropertyHandle->GetPerObjectValues( PerObjectValues );
for( int32 ObjectIndex = 0; ObjectIndex < NumObjects; ++ObjectIndex )
{
if( bIsLinearColor )
{
FLinearColor Color;
Color.InitFromString( PerObjectValues[ObjectIndex] );
SavedPreColorPickerColors.Add( Color );
}
else
{
FColor Color;
Color.InitFromString( PerObjectValues[ObjectIndex] );
SavedPreColorPickerColors.Add( Color.ReinterpretAsLinear() );
}
}
FLinearColor InitialColor;
GetColorAsLinear(InitialColor);
// This needs to be meta data. Other colors could benefit from this
const bool bRefreshOnlyOnOk = StructPropertyHandle->GetProperty()->GetOwnerClass()->IsChildOf(UMaterialExpressionConstant3Vector::StaticClass());
FColorPickerArgs PickerArgs;
PickerArgs.bUseAlpha = !bIgnoreAlpha;
PickerArgs.bOnlyRefreshOnMouseUp = false;
PickerArgs.bOnlyRefreshOnOk = bRefreshOnlyOnOk;
PickerArgs.DisplayGamma = TAttribute<float>::Create( TAttribute<float>::FGetter::CreateUObject(GEngine, &UEngine::GetDisplayGamma) );
PickerArgs.OnColorCommitted = FOnLinearColorValueChanged::CreateSP( this, &FColorStructCustomization::OnSetColorFromColorPicker );
PickerArgs.OnColorPickerCancelled = FOnColorPickerCancelled::CreateSP( this, &FColorStructCustomization::OnColorPickerCancelled );
PickerArgs.OnInteractivePickBegin = FSimpleDelegate::CreateSP( this, &FColorStructCustomization::OnColorPickerInteractiveBegin );
PickerArgs.OnInteractivePickEnd = FSimpleDelegate::CreateSP( this, &FColorStructCustomization::OnColorPickerInteractiveEnd );
PickerArgs.InitialColorOverride = InitialColor;
PickerArgs.ParentWidget = ColorPickerParentWidget;
OpenColorPicker(PickerArgs);
}
示例5: SNew
TSharedRef<SColorPicker> FColorStructCustomization::CreateInlineColorPicker()
{
int32 NumObjects = StructPropertyHandle->GetNumOuterObjects();
SavedPreColorPickerColors.Empty();
TArray<FString> PerObjectValues;
StructPropertyHandle->GetPerObjectValues( PerObjectValues );
for( int32 ObjectIndex = 0; ObjectIndex < NumObjects; ++ObjectIndex )
{
if( bIsLinearColor )
{
FLinearColor Color;
Color.InitFromString( PerObjectValues[ObjectIndex] );
SavedPreColorPickerColors.Add( Color );
}
else
{
FColor Color;
Color.InitFromString( PerObjectValues[ObjectIndex] );
SavedPreColorPickerColors.Add( Color.ReinterpretAsLinear() );
}
}
FLinearColor InitialColor;
GetColorAsLinear(InitialColor);
// This needs to be meta data. Other colors could benefit from this
const bool bRefreshOnlyOnOk = StructPropertyHandle->GetProperty()->GetOwnerClass()->IsChildOf(UMaterialExpressionConstant3Vector::StaticClass());
return SNew(SColorPicker)
.Visibility(this, &FColorStructCustomization::GetInlineColorPickerVisibility)
.DisplayInlineVersion(true)
.OnlyRefreshOnMouseUp(false)
.OnlyRefreshOnOk(bRefreshOnlyOnOk)
.DisplayGamma(TAttribute<float>::Create( TAttribute<float>::FGetter::CreateUObject(GEngine, &UEngine::GetDisplayGamma) ))
.OnColorCommitted(FOnLinearColorValueChanged::CreateSP( this, &FColorStructCustomization::OnSetColorFromColorPicker ))
.OnColorPickerCancelled(FOnColorPickerCancelled::CreateSP( this, &FColorStructCustomization::OnColorPickerCancelled ))
.OnInteractivePickBegin(FSimpleDelegate::CreateSP( this, &FColorStructCustomization::OnColorPickerInteractiveBegin ))
.OnInteractivePickEnd(FSimpleDelegate::CreateSP( this, &FColorStructCustomization::OnColorPickerInteractiveEnd ))
.TargetColorAttribute(InitialColor);
}
示例6: PostLoad
void UPaperSpriteComponent::PostLoad()
{
Super::PostLoad();
const int32 PaperVer = GetLinkerCustomVersion(FPaperCustomVersion::GUID);
if (PaperVer < FPaperCustomVersion::ConvertPaperSpriteComponentToBeMeshComponent)
{
if (MaterialOverride_DEPRECATED != nullptr)
{
SetMaterial(0, MaterialOverride_DEPRECATED);
}
}
if (PaperVer < FPaperCustomVersion::FixVertexColorSpace)
{
const FColor SRGBColor = SpriteColor.ToFColor(/*bSRGB=*/ true);
SpriteColor = SRGBColor.ReinterpretAsLinear();
}
}
示例7: atlasSampleTL
//.........这里部分代码省略.........
check(sliceU >= -(0.5f + KINDA_SMALL_NUMBER) &&
sliceU <= (0.5f + KINDA_SMALL_NUMBER));
check(sliceV >= -(0.5f + KINDA_SMALL_NUMBER) &&
sliceV <= (0.5f + KINDA_SMALL_NUMBER));
//TODO: ikrimae: Supersample/bilinear filter
const int32 slicePixelX = FMath::TruncToInt(dbgMatchCaptureSliceFovToAtlasSliceFov ? sliceU * StripWidth : sliceU * CaptureWidth);
const int32 slicePixelY = FMath::TruncToInt(dbgMatchCaptureSliceFovToAtlasSliceFov ? sliceV * StripHeight : sliceV * CaptureHeight);
FLinearColor slicePixelSample;
if (bEnableBilerp)
{
//TODO: ikrimae: Clean up later; too tired now
const int32 sliceCenterPixelX = (sliceXIndex + 0.5f) * StripWidth;
const int32 sliceCenterPixelY = (sliceYIndex + 0.5f) * StripHeight;
const FIntPoint atlasSampleTL(sliceCenterPixelX + FMath::Clamp(slicePixelX , -StripWidth/2, StripWidth/2), sliceCenterPixelY + FMath::Clamp(slicePixelY , -StripHeight/2, StripHeight/2));
const FIntPoint atlasSampleTR(sliceCenterPixelX + FMath::Clamp(slicePixelX + 1, -StripWidth/2, StripWidth/2), sliceCenterPixelY + FMath::Clamp(slicePixelY , -StripHeight/2, StripHeight/2));
const FIntPoint atlasSampleBL(sliceCenterPixelX + FMath::Clamp(slicePixelX , -StripWidth/2, StripWidth/2), sliceCenterPixelY + FMath::Clamp(slicePixelY + 1, -StripHeight/2, StripHeight/2));
const FIntPoint atlasSampleBR(sliceCenterPixelX + FMath::Clamp(slicePixelX + 1, -StripWidth/2, StripWidth/2), sliceCenterPixelY + FMath::Clamp(slicePixelY + 1, -StripHeight/2, StripHeight/2));
const FColor pixelColorTL = SurfaceData[atlasSampleTL.Y * UnprojectedAtlasWidth + atlasSampleTL.X];
const FColor pixelColorTR = SurfaceData[atlasSampleTR.Y * UnprojectedAtlasWidth + atlasSampleTR.X];
const FColor pixelColorBL = SurfaceData[atlasSampleBL.Y * UnprojectedAtlasWidth + atlasSampleBL.X];
const FColor pixelColorBR = SurfaceData[atlasSampleBR.Y * UnprojectedAtlasWidth + atlasSampleBR.X];
const float fracX = FMath::Frac(dbgMatchCaptureSliceFovToAtlasSliceFov ? sliceU * StripWidth : sliceU * CaptureWidth);
const float fracY = FMath::Frac(dbgMatchCaptureSliceFovToAtlasSliceFov ? sliceV * StripHeight : sliceV * CaptureHeight);
//Reinterpret as linear (a.k.a dont apply srgb inversion)
slicePixelSample = FMath::BiLerp(
pixelColorTL.ReinterpretAsLinear(), pixelColorTR.ReinterpretAsLinear(),
pixelColorBL.ReinterpretAsLinear(), pixelColorBR.ReinterpretAsLinear(),
fracX, fracY);
}
else
{
const int32 sliceCenterPixelX = (sliceXIndex + 0.5f) * StripWidth;
const int32 sliceCenterPixelY = (sliceYIndex + 0.5f) * StripHeight;
const int32 atlasSampleX = sliceCenterPixelX + slicePixelX;
const int32 atlasSampleY = sliceCenterPixelY + slicePixelY;
slicePixelSample = SurfaceData[atlasSampleY * UnprojectedAtlasWidth + atlasSampleX].ReinterpretAsLinear();
}
samplePixelAccum += slicePixelSample;
////Output color map of projections
//const FColor debugEquiColors[12] = {
// FColor(205, 180, 76),
// FColor(190, 88, 202),
// FColor(127, 185, 194),
// FColor(90, 54, 47),
// FColor(197, 88, 53),
// FColor(197, 75, 124),
// FColor(130, 208, 72),
// FColor(136, 211, 153),
// FColor(126, 130, 207),
// FColor(83, 107, 59),
// FColor(200, 160, 157),
// FColor(80, 66, 106)
//};