$darkmode
Generation and processing of per-vertex and per-face colors according to various strategy. More...
#include <vcg/complex/algorithms/update/color.h>
Classes | |
class | ColorAvgInfo |
Static Public Member Functions | |
static int | PerVertexConstant (MeshType &m, Color4b vs=Color4b::White, bool selected=false) |
This function colors all (or the selected) the vertices of a mesh. | |
static int | PerFaceConstant (MeshType &m, Color4b vs=Color4b::White, bool selected=false) |
This function colors all (or the selected) faces of a mesh. | |
static int | PerTetraConstant (MeshType &m, Color4b vs=Color4b::White, bool selected=false) |
This function colors all (or the selected) tetras of a mesh. | |
static void | PerVertexFromTetra (MeshType &m) |
Transfer tetra color onto vertex color. More... | |
static void | PerVertexFromFace (MeshType &m) |
Transfer face color onto vertex color. More... | |
static void | PerFaceFromVertex (MeshType &m) |
Transfer vertex color onto face color Plain average of the color of the vertexes on a given face. | |
static void | PerVertexQualityRamp (MeshType &m, ScalarType minq=0., ScalarType maxq=0., vcg::ColorMap cmap=vcg::ColorMap::RGB) |
This function colores all the faces of a mesh with a hue color shade dependent on the quality. More... | |
static void | PerVertexQualityRampParula (MeshType &m, ScalarType minq=0., ScalarType maxq=0.) |
This function colores all the faces of a mesh with a hue color shade dependent on the quality. More... | |
static void | PerTetraQualityRamp (MeshType &m, ScalarType minq=0., ScalarType maxq=0., bool selected=false, vcg::ColorMap cmap=vcg::ColorMap::RGB) |
This function colores all the faces of a mesh with a hue color shade dependent on the quality. More... | |
static void | PerFaceQualityRamp (MeshType &m, ScalarType minq=0, ScalarType maxq=0, bool selected=false, vcg::ColorMap cmap=vcg::ColorMap::RGB) |
This function colores all the faces of a mesh with a hue color shade dependent on the quality. More... | |
static void | PerEdgeQualityRamp (MeshType &m, ScalarType minq=0, ScalarType maxq=0, bool selected=false, vcg::ColorMap cmap=vcg::ColorMap::RGB) |
This function colores all the edges of a mesh with a hue color shade dependent on the quality. More... | |
static void | PerVertexQualityGray (MeshType &m, ScalarType minq=0, ScalarType maxq=0) |
This function colores all the vertices of a mesh with a gray shade dependent on the quality. More... | |
static void | PerFaceQualityGray (MeshType &m, ScalarType minq=0, ScalarType maxq=0) |
This function colores all the faces of a mesh with a gray shade dependent on the quality. More... | |
static void | PerVertexBorderFlag (MeshType &m, Color4b BorderColor=Color4b::Blue, Color4b InternalColor=Color4b::White, Color4b MixColor=Color4b::Cyan) |
Color the vertexes of the mesh that are on the border. More... | |
static void | PerFaceRandomConnectedComponent (MeshType &m) |
This function colores the faces of connected components of a mesh randomly. More... | |
static void | PerFaceRandom (MeshType &m) |
This function colores the face of a mesh randomly. More... | |
static void | PerVertexPerlinNoise (MeshType &m, CoordType period, CoordType offset=CoordType(0, 0, 0), bool onSelected=false) |
Perlin Noise. More... | |
static void | PerVertexPerlinColoring (MeshType &m, ScalarType period, CoordType offset=CoordType(0, 0, 0), Color4b color1=Color4b::Black, Color4b color2=Color4b::White, bool onSelected=false) |
Perlin Color mixing. More... | |
static void | PerVertexAddNoise (MeshType &m, int noiseBits, bool onSelected=false) |
Simple Noise adding function. It simply add signed noise to the color of the mesh. The noise has uniform distribution and the amplitude is +/-2^(noisebits-1). | |
static int | PerVertexThresholding (MeshType &m, float threshold, const Color4b c1=Color4< unsigned char >::Black, const Color4b c2=Color4< unsigned char >::White, const bool ProcessSelected=false) |
Reduces vertex color the mesh to two colors according to a threshold. | |
static float | ComputeLightness (Color4b c) |
static int | PerVertexBrightness (MeshType &m, float amount, const bool ProcessSelected=false) |
Apply the brightness filter, with the given amount, to the mesh. | |
static int | PerVertexContrast (MeshType &m, float factor, const bool ProcessSelected=false) |
Apply Contrast filter to the mesh with the given contrast factor. | |
static Color4b | ColorMul (Color4b c, float factor) |
static int | ValueMul (int value, float factor) |
static int | PerVertexBrightnessContrast (MeshType &m, float brightness, float contrast, const bool ProcessSelected=false) |
Apply Brightness and Contrast filter to the mesh, with the given contrast factor and brightness amount. More... | |
static Color4b | ColorBrightnessContrast (Color4b c, float brightness, float contrast) |
static int | ValueBrightnessContrast (unsigned char ivalue, float brightness, float contrast) |
static int | PerVertexInvert (MeshType &m, const bool ProcessSelected=false) |
Invert the colors of the mesh. More... | |
static int | PerVertexGamma (MeshType &m, float gamma, const bool ProcessSelected=false) |
Apply the gamma correction filter, with the given gamma exponet, to the mesh. More... | |
static Color4b | ColorPow (Color4b c, float exponent) |
static float | ValuePow (float value, float exponent) |
static int | PerVertexLevels (MeshType &m, float gamma, float in_min, float in_max, float out_min, float out_max, unsigned char rgbMask, const bool ProcessSelected=false) |
Adjusts color levels of the mesh. More... | |
static Color4b | ColorLevels (Color4b c, float gamma, float in_min, float in_max, float out_min, float out_max, unsigned char rgbMask) |
static int | ValueLevels (int value, float gamma, float in_min, float in_max, float out_min, float out_max) |
static int | PerVertexColourisation (MeshType &m, Color4b c, float intensity, const bool ProcessSelected=false) |
Colorize the mesh toward a given color. More... | |
static Color4b | ColorApplyDiff (Color4b old_color, Color4b new_color, float intensity) |
static int | ValueApplyDiff (int old_value, int new_value, float intensity) |
static int | PerVertexDesaturation (MeshType &m, int method, const bool ProcessSelected=false) |
Desaturates the mesh according the a chosen desaturation method. More... | |
static Color4b | ColorDesaturate (Color4b c, int method) |
static float | ComputeAvgLightness (Color4b c) |
static float | ComputeLuminosity (Color4b c) |
static int | PerVertexEqualize (MeshType &m, unsigned int rgbMask, const bool ProcessSelected=false) |
Histogram Color Equalization. More... | |
static Color4b | ColorEqualize (Color4b c, int cdf_l[256], int cdf_r[256], int cdf_g[256], int cdf_b[256], unsigned int rgbMask) |
static int | ValueEqualize (int cdfValue, int cdfMin, int cdfMax) |
static int | PerVertexWhiteBalance (MeshType &m, Color4b userColor, const bool ProcessSelected=false) |
Simple white balancing filter. More... | |
static Color4b | ColorWhiteBalance (Color4b c, Color4b unbalancedWhite) |
Generation and processing of per-vertex and per-face colors according to various strategy.
This class is used to compute per face or per vertex color with respect to a number of algorithms. There is a wide range of algorithms for processing vertex color in a \i photoshop-like mode (changing for example contrast, white balance, gamma) Basic Tools for mapping quality into a color according to standard color ramps are here.
|
inlinestatic |
This function colores all the edges of a mesh with a hue color shade dependent on the quality.
If no range of quality is passed it is automatically computed.
|
inlinestatic |
This function colores all the faces of a mesh with a gray shade dependent on the quality.
If no range of quality is passed it is automatically computed.
|
inlinestatic |
This function colores all the faces of a mesh with a hue color shade dependent on the quality.
If no range of quality is passed it is automatically computed.
|
inlinestatic |
This function colores the face of a mesh randomly.
Note: The faux bit is used to color polygonal faces uniformly
|
inlinestatic |
This function colores the faces of connected components of a mesh randomly.
It require FaceFace Adjacency becouse it relies on the output of the ConnecteComponents();
|
inlinestatic |
This function colores all the faces of a mesh with a hue color shade dependent on the quality.
If no range of quality is passed it is automatically computed.
|
inlinestatic |
Color the vertexes of the mesh that are on the border.
It uses the information in the Vertex flags, and not necessarily any topology. So it just require that you have correctly computed the flags; one way could be the following one:
|
inlinestatic |
Apply Brightness and Contrast filter to the mesh, with the given contrast factor and brightness amount.
Performs contrast and brightness operations on color, i.e NewValue = (OldValue - 128) * contrast + 128 + amount The result is clamped just one time after all computations; this get a more accurate result.
The formula used here is the one of GIMP.
|
inlinestatic |
Colorize the mesh toward a given color.
Colors the mesh. Color is blended to the mesh with the given intensity (0..1 ranged).
|
inlinestatic |
Desaturates the mesh according the a chosen desaturation method.
There are three possibilities
M_LIGHTNESS
where lightness = 0.5*(Max(R,G,B)+Min(R,G,B))M_LUMINOSITY
where luminosity = 0.21*R+0.71*G+0.7*BM_AVERAGE
Plain Average
|
inlinestatic |
Histogram Color Equalization.
Equalize the histogram of colors. It can equalize any combination of rgb channels or it can work on lightness.
|
inlinestatic |
Transfer face color onto vertex color.
Plain average of the color of the faces incident on a given vertex. No adjacency required.
|
inlinestatic |
Transfer tetra color onto vertex color.
Plain average of the color of the tetras incident on a given vertex. No adjacency required.
|
inlinestatic |
Apply the gamma correction filter, with the given gamma exponet, to the mesh.
|
inlinestatic |
Invert the colors of the mesh.
|
inlinestatic |
Adjusts color levels of the mesh.
Adjusts color levels of the mesh. Filter can be applied to all RGB channels or to each channel separately. in_min, gamma and in_max are respectively the black point, the gray point and the white point. out_min and out_max are the output level for black and white respectively.
|
inlinestatic |
Perlin Color mixing.
Simple Perlin color mixing. Color 1 and 2 are mixed according the perlin noise function, with period and offset.
|
inlinestatic |
Perlin Noise.
Simple Perlin noise. To make things weirder each color band can have its own offset and frequency. Period is expressed in absolute terms. So as period it is meaningful could be to use something in the range of 1/10 of the bbox diag.
|
inlinestatic |
This function colores all the vertices of a mesh with a gray shade dependent on the quality.
If no range of quality is passed it is automatically computed.
|
inlinestatic |
This function colores all the faces of a mesh with a hue color shade dependent on the quality.
If no range of quality is passed it is automatically computed.
|
inlinestatic |
This function colores all the faces of a mesh with a hue color shade dependent on the quality.
If no range of quality is passed it is automatically computed.
|
inlinestatic |
Simple white balancing filter.
It applies a simple white balancing filter. It may works on a provided user color that is supposed to be white.