#include <imageutils.h>
Static Public Member Functions | ||||
| static void | ImageStats (const osg::Image *image, std::string *imagename) | |||
| Logs information about the given image. | ||||
| static void | LoadGeospecificLCCImage (ImageUtils::GeospecificImage &gslcc) | |||
| static dtCore::RefPtr< osg::Image > | CreateDetailMap (unsigned int width, unsigned int height) | |||
| ||||
| static unsigned short | CalculateDetailNoise (int x, int y) | |||
| Calculates a noise value for a given x,y pair. | ||||
| static dtCore::RefPtr< osg::Image > | CreateBaseGradientMap (const HeightField &hf, float scale) | |||
| Generates a gradient map based on the given heightfield. | ||||
| static dtCore::RefPtr< osg::Image > | CreateDetailGradientMap (unsigned int width, unsigned int height, float scale) | |||
| Generates a gradient map based on perlin noise. | ||||
| static unsigned short | CalculateScaleMapNoise (int x, int y) | |||
| static dtCore::RefPtr< osg::Image > | CreateDetailScaleMap (unsigned int width, unsigned int height) | |||
| Creates a perlin noise map which is useful for adding perturbing existing noise values in a random fashion. | ||||
| static dtCore::RefPtr< osg::Image > | MakeFilteredImage (const osg::Image &src_image, const osg::Vec3 &rgb_selected) | |||
| Create smoothed grayscale map of the terrain by LCC type Uses weighted next nearest neighbor to "fuzzy"-up the LCCImage data. | ||||
| static dtCore::RefPtr< osg::Image > | ApplyMask (const osg::Image &src_image, const osg::Image &mask_image) | |||
| Use an image to mask-out vegetation probability (set probability to 0%) Useful for masking-out bodies of water or user-created urban models. | ||||
| static dtCore::RefPtr< osg::Image > | MakeSlopeAspectImage (const HeightField &hf) | |||
| Create a slope map. | ||||
| static dtCore::RefPtr< osg::Image > | MakeRelativeElevationImage (const HeightField &hf, float scale) | |||
| Creates a relative elevation map. | ||||
| static dtCore::RefPtr< osg::Image > | MakeBaseColor (const HeightField &hf, const ImageUtils::HeightColorMap &upperHeightColorMap, const ImageUtils::HeightColorMap &lowerHeightColorMap, float gamma=1.0f) | |||
| Generates an image which maps the height value in the heightfield to a color value given by one of the two color maps. | ||||
| static dtCore::RefPtr< osg::Image > | EnsurePow2Image (const osg::Image *srcImage) | |||
| Nearest neighbor geometric image manipulation. | ||||
Classes | ||||
| struct | GeospecificImage | |||
| struct | HeightColorMap | |||
| Maps height values to colors with interpolation/extrapolation. More... | ||||
| void dtTerrain::ImageUtils::ImageStats | ( | const osg::Image * | image, | |
| std::string * | imagename | |||
| ) | [static] |
Logs information about the given image.
(LogLevel is INFO).
| image | the handle to the image you want to examine | |
| imagename | a descriptive name to call this image |
| void dtTerrain::ImageUtils::LoadGeospecificLCCImage | ( | ImageUtils::GeospecificImage & | gslcc | ) | [static] |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::CreateDetailMap | ( | unsigned int | width, | |
| unsigned int | height | |||
| ) | [static] |
| width | The target width of the created image. |
| eight | The target height of the created image. |
| unsigned short dtTerrain::ImageUtils::CalculateDetailNoise | ( | int | x, | |
| int | y | |||
| ) | [static] |
Calculates a noise value for a given x,y pair.
| x | The x value. | |
| y | The y value. |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::CreateBaseGradientMap | ( | const HeightField & | hf, | |
| float | scale | |||
| ) | [static] |
Generates a gradient map based on the given heightfield.
| hf | The source heightfield. | |
| scale | The scale value to apply to the resulting gradient calculations. |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::CreateDetailGradientMap | ( | unsigned int | width, | |
| unsigned int | height, | |||
| float | scale | |||
| ) | [static] |
Generates a gradient map based on perlin noise.
This can be used to procedurally add lighting detail to surfaces.
| width | The width of the image. | |
| height | The height of the image. | |
| float | Scale value with with to scale the resulting gradient values. |
| unsigned short dtTerrain::ImageUtils::CalculateScaleMapNoise | ( | int | x, | |
| int | y | |||
| ) | [static] |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::CreateDetailScaleMap | ( | unsigned int | width, | |
| unsigned int | height | |||
| ) | [static] |
Creates a perlin noise map which is useful for adding perturbing existing noise values in a random fashion.
| width | Width of the image. | |
| height | Height of the image. |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::MakeFilteredImage | ( | const osg::Image & | src_image, | |
| const osg::Vec3 & | rgb_selected | |||
| ) | [static] |
Create smoothed grayscale map of the terrain by LCC type Uses weighted next nearest neighbor to "fuzzy"-up the LCCImage data.
| src_image | the black/white LCC Image by LCC type | |
| rgb_selected | the RGB color of the points to smooth (always 0,0,0 - black) |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::ApplyMask | ( | const osg::Image & | src_image, | |
| const osg::Image & | mask_image | |||
| ) | [static] |
Use an image to mask-out vegetation probability (set probability to 0%) Useful for masking-out bodies of water or user-created urban models.
| src_image | the black/white LCC Image by LCC type | |
| mask_image | the black/white - using LCC type 11 as default |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::MakeSlopeAspectImage | ( | const HeightField & | hf | ) | [static] |
Create a slope map.
| hf | The heightfield heightfield |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::MakeRelativeElevationImage | ( | const HeightField & | hf, | |
| float | scale | |||
| ) | [static] |
Creates a relative elevation map.
| hf | The heightfield with which to build the elevation map. | |
| scale | The amount to scale the resulting values by. |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::MakeBaseColor | ( | const HeightField & | hf, | |
| const ImageUtils::HeightColorMap & | upperHeightColorMap, | |||
| const ImageUtils::HeightColorMap & | lowerHeightColorMap, | |||
| float | gamma = 1.0f | |||
| ) | [static] |
Generates an image which maps the height value in the heightfield to a color value given by one of the two color maps.
| hf | The heightfield with which to map colors. | |
| upperHeightColorMap | The color values to map the height values which are above 0 (sea-level). | |
| lowerHeightColorMap | The color values to map the height values which are are below or equal to zero. | |
| gamma | Gamma correction value. Greater than 1.0 to brighten, less than 1.0 to darken. |
| dtCore::RefPtr< osg::Image > dtTerrain::ImageUtils::EnsurePow2Image | ( | const osg::Image * | srcImage | ) | [static] |
Nearest neighbor geometric image manipulation.
This assumes that the original image is nxn square.
| srcImage | The image to scale. |