FaceGen 3 SDKs Reference
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Fg::Scm3 Struct Reference

FaceGen 3 Statistical Color Model for a UV map: More...

#include <Fg3Scm.hpp>

Public Member Functions

 Scm3 (String8 const &dirBase, String8 const &overlayColor="")
 Loads a SCM from all applicable file types starting with 'dirBase':
 
 Scm3 (String8 const &imgFile, String8 const &egtFile, String8 const &fimFile)
 
 Scm3 (ImgRgba8 const &meanClr, String8 const &egtFile, String8 const &fimFile)
 "
 
bool empty () const
 "
 
ImgRgba8 calcScmColorMap (Sam3Coord const &faceCoord, bool multithread=true) const
 Compute the SCM color map without any detail texture, custom base or overlay:
 
ImgRgba8 applyFace (Face3 const &face, float detailModulation=1.0f, bool multithread=true) const
 Returns the final color map image for the given face:
 
ImgRgba8 transformDetail (Bytes const &detailJpegBlob, bool multithread=true) const
 
ImgRgba8 applyFaceCoord (Floats const &ColorCoordS, ImgRgba8 const &transformedDetail, float detailModulation=1.0f, bool multithread=true) const
 Returns the final color map for the given face coordinate and optional transformed detail texture:
 

Static Public Member Functions

static float gammaDefault ()
 

Public Attributes

ImgRgba8 mean
 
Scm3Modes modes
 SCM modes (symmetric only) encoded with gamma=1/2.6. Size is power of 2. Can be empty.
 
Img2F detailXfm
 
float gamma = gammaDefault()
 Desired inverse gamma value for output color maps:
 
ImgRgba8 overlay
 
ImgUC fadeMap
 

Detailed Description

FaceGen 3 Statistical Color Model for a UV map:

Definition at line 73 of file Fg3Scm.hpp.

Constructor & Destructor Documentation

◆ Scm3() [1/4]

Fg::Scm3::Scm3 ( )
inline

Definition at line 97 of file Fg3Scm.hpp.

◆ Scm3() [2/4]

Fg::Scm3::Scm3 ( String8 const &  dirBase,
String8 const &  overlayColor = "" 
)

Loads a SCM from all applicable file types starting with 'dirBase':

Definition at line 215 of file Fg3Scm.cpp.

◆ Scm3() [3/4]

Fg::Scm3::Scm3 ( String8 const &  imgFile,
String8 const &  egtFile,
String8 const &  fimFile 
)
Parameters
fimFile"

Definition at line 256 of file Fg3Scm.cpp.

◆ Scm3() [4/4]

Fg::Scm3::Scm3 ( ImgRgba8 const &  meanClr,
String8 const &  egtFile,
String8 const &  fimFile 
)

"

Parameters
fimFileCan be empty

Definition at line 241 of file Fg3Scm.cpp.

Member Function Documentation

◆ applyFace()

ImgRgba8 Fg::Scm3::applyFace ( Face3 const &  face,
float  detailModulation = 1.0f,
bool  multithread = true 
) const
inline

Returns the final color map image for the given face:

Parameters
detailModulationOPTIONAL: The amount of detail texture modulation. Defaults to 1.0. Use 0.5 for little, 1.5 for lots.
multithreadSelect false if calling within multithreaded context.

Definition at line 126 of file Fg3Scm.hpp.

◆ applyFaceCoord()

ImgRgba8 Fg::Scm3::applyFaceCoord ( Floats const &  ColorCoordS,
ImgRgba8 const &  transformedDetail,
float  detailModulation = 1.0f,
bool  multithread = true 
) const

Returns the final color map for the given face coordinate and optional transformed detail texture:

Parameters
ColorCoordSThe face color coordinate (symmetric only, there is no asymmetric):
transformedDetailThe transformed texture detail image from above. Can be empty:
detailModulationOPTIONAL: The amount of detail texture modulation. Defaults to 1.0. Use 0.5 for little, 1.5 for lots.

Definition at line 417 of file Fg3Scm.cpp.

◆ calcScmColorMap()

ImgRgba8 Fg::Scm3::calcScmColorMap ( Sam3Coord const &  faceCoord,
bool  multithread = true 
) const
inline

Compute the SCM color map without any detail texture, custom base or overlay:

Parameters
multithreadSelect false if calling within multithreaded context.

Definition at line 113 of file Fg3Scm.hpp.

◆ empty()

bool Fg::Scm3::empty ( ) const
inline

"

No valid data currently loaded:

Definition at line 110 of file Fg3Scm.hpp.

◆ gammaDefault()

static float Fg::Scm3::gammaDefault ( )
inlinestatic

Definition at line 95 of file Fg3Scm.hpp.

◆ transformDetail()

ImgRgba8 Fg::Scm3::transformDetail ( Bytes const &  detailJpegBlob,
bool  multithread = true 
) const

Separates the detail transformation from the rest of the texture update computatation in order to more quickly update the texture image when the detail texture remains the same. Returns an empty image if argument is empty, or if this SCM has no detail transform map:

Definition at line 380 of file Fg3Scm.cpp.

Member Data Documentation

◆ detailXfm

Img2F Fg::Scm3::detailXfm

Resampling map from SCM UV layout (ie. in SCM UV layout) to FG internal UV layout. Pixel values are OTCS coordinates for FG internal UV layout, with (-1,-1) as invalid (ie. outside face area). Size is power of 2. Can be empty.

Definition at line 83 of file Fg3Scm.hpp.

◆ fadeMap

ImgUC Fg::Scm3::fadeMap

Transition map from FaceGen face area (0) to non face area (255) allows SCM to be color-matched and composited onto a generic head/body map in this UV layout. Same dimensions as 'modes'.

Definition at line 93 of file Fg3Scm.hpp.

◆ gamma

float Fg::Scm3::gamma = gammaDefault()

Desired inverse gamma value for output color maps:

Definition at line 85 of file Fg3Scm.hpp.

◆ mean

ImgRgba8 Fg::Scm3::mean

SCM mean color map encoded with gamma=1/2.6. Size must be power of 2. Can be empty if 'modes' is empty and 'overlay' is non-empty.

Definition at line 77 of file Fg3Scm.hpp.

◆ modes

Scm3Modes Fg::Scm3::modes

SCM modes (symmetric only) encoded with gamma=1/2.6. Size is power of 2. Can be empty.

Definition at line 79 of file Fg3Scm.hpp.

◆ overlay

ImgRgba8 Fg::Scm3::overlay

Not technically part of an SCM but here for convenience. Size must be power of 2. Overlay image with transparency in alpha channel. Appled after all the above. Useful for in-texture clothing or hair. Ignored if empty. DEPRECATED.

Definition at line 90 of file Fg3Scm.hpp.


The documentation for this struct was generated from the following files: