10#ifndef __PropertyMaps_H__
11#define __PropertyMaps_H__
13#include <OgrePrerequisites.h>
14#include <OgrePixelFormat.h>
15#include <OgreColourValue.h>
17#include <OgreRenderSystem.h>
96 Ogre::Real
getDensityAt(Ogre::Real
x, Ogre::Real
z,
const Ogre::TRect<Ogre::Real> &mapBounds)
111 static std::map<Ogre::String, DensityMap*>
selfList;
185 static Ogre::VertexElementType format = Ogre::Root::getSingleton().getRenderSystem()->getColourVertexElementType();
186 if (format == Ogre::VET_COLOUR_ARGB)
189 b = ((c) & 0xFF) * 0.0039215686f;
190 g = ((c >> 8) & 0xFF) * 0.0039215686f;
191 r = ((c >> 16) & 0xFF) * 0.0039215686f;
192 a = ((c >> 24) & 0xFF) * 0.0039215686f;
196 r = ((c) & 0xFF) * 0.0039215686f;
197 g = ((c >> 8) & 0xFF) * 0.0039215686f;
198 b = ((c >> 16) & 0xFF) * 0.0039215686f;
199 a = ((c >> 24) & 0xFF) * 0.0039215686f;
202 return Ogre::ColourValue(r, g, b, a);
214 Ogre::uint32
_interpolateColor(Ogre::uint32 color1, Ogre::uint32 color2, Ogre::Real ratio, Ogre::Real ratioInv);
A 2D greyscale image that is assigned to a certain region of your world to represent color levels.
static ColorMap * load(const Ogre::String &fileName, MapChannel channel=CHANNEL_COLOR)
Ogre::uint32 _getColorAt_Bilinear(Ogre::Real x, Ogre::Real z, const Ogre::TRect< Ogre::Real > &mapBounds)
Ogre::uint32 _getColorAt(Ogre::Real x, Ogre::Real z, const Ogre::TRect< Ogre::Real > &mapBounds)
Ogre::PixelBox getPixelBox()
Gets a pointer to the pixel data of the color map.
void setFilter(MapFilter filter)
Sets the filtering mode used for this color map.
Ogre::uint32 getColorAt(Ogre::Real x, Ogre::Real z, const Ogre::TRect< Ogre::Real > &mapBounds)
Gets the color value at the specified position.
Ogre::TRect< Ogre::Real > mapBounds
static std::map< Ogre::String, ColorMap * > selfList
Ogre::uint32 _interpolateColor(Ogre::uint32 color1, Ogre::uint32 color2, Ogre::Real ratio, Ogre::Real ratioInv)
static ColorMap * load(Ogre::TexturePtr texture, MapChannel channel=CHANNEL_COLOR)
MapFilter getFilter()
Returns the filtering mode being used for this color map.
Ogre::ColourValue getColorAt_Unpacked(Ogre::Real x, Ogre::Real z, const Ogre::TRect< Ogre::Real > &mapBounds)
Gets the color value at the specified position.
A 2D greyscale image that is assigned to a certain region of your world to represent density levels.
Ogre::Real _getDensityAt_Bilinear(Ogre::Real x, Ogre::Real z, const Ogre::TRect< Ogre::Real > &mapBounds)
static std::map< Ogre::String, DensityMap * > selfList
Ogre::PixelBox getPixelBox()
Gets a pointer to the pixel data of the density map.
MapFilter getFilter()
Returns the filtering mode being used for this density map.
static DensityMap * load(Ogre::TexturePtr texture, MapChannel channel=CHANNEL_COLOR)
static DensityMap * load(const Ogre::String &fileName, MapChannel channel=CHANNEL_COLOR)
void setFilter(MapFilter filter)
Sets the filtering mode used for this density map.
Ogre::Real _getDensityAt_Unfiltered(Ogre::Real x, Ogre::Real z, const Ogre::TRect< Ogre::Real > &mapBounds)
Ogre::Real getDensityAt(Ogre::Real x, Ogre::Real z, const Ogre::TRect< Ogre::Real > &mapBounds)
Gets the density level at the specified position.
MapFilter
Specifies the filtering method used to interpret property maps.
@ MAPFILTER_NONE
Use no filtering - fast, but may appear blocky.
@ MAPFILTER_BILINEAR
Use bilinear filtering - slower, but will appear less blocky.
MapChannel
Specifies which color channel(s) to extract from an image.
@ CHANNEL_GREEN
Use only the image's green color channel.
@ CHANNEL_BLUE
Use only the image's blue color channel.
@ CHANNEL_ALPHA
Use only the image's alpha channel.
@ CHANNEL_RED
Use only the image's red color channel.
@ CHANNEL_COLOR
Use the image's full RGB color information.