-
class
GrayRaster
: public OverlayRaster
(Return to index)
-
gray-level image with arbitary numeric values.
Type:
Base Classes:
Derived Classes
Include file:
OverlayUnidraw/grayraster.h
Public:
-
GrayRaster (const GrayRaster& raster)
-
GrayRaster (unsigned long width, unsigned long height, AttributeValue::ValueType type = AttributeValue::UCharType, void* data = nil)
construct a GrayRaster of 'width','height' and 'type', with an optional
copy of 'data', a linear array of 'width'*'height' values of 'type'.
- virtual OverlayRaster*
addgrayramp ( CopyString& cmd, IntCoord x, IntCoord y )
embed gray-level ramp in raster at 'x', 'y', and return 'cmd' string
to reproduce this effect after save/restore.
- virtual OverlayRaster*
addgrayramp ( CopyString& cmd, RampAlignment = R_LT )
embed gray-level ramp in raster at given alignment, and return 'cmd'
string to reproduce this effect after save/restore.
- virtual OverlayRaster*
copy () const
- virtual void
flush () const
scale pixel values to onscreen graylevels and flush to display.
- virtual boolean
gray_flag ()
- virtual void
graypeek (unsigned long x, unsigned long y, AttributeValue& v)
- virtual void
graypeek (unsigned long x, unsigned long y, double& v)
convert value of value_type() at 'x','y' to a double.
- virtual void
graypeek (unsigned long x, unsigned long y, float& v)
convert value of value_type() at 'x','y' to a float.
- virtual void
graypeek (unsigned long x, unsigned long y, unsigned int& v)
convert value of value_type() at 'x','y' to an unsigned int.
- virtual void
graypeek (unsigned long x, unsigned long y, unsigned long& v)
convert value of value_type() at 'x','y' to an unsigned long.
- virtual void
graypoke (unsigned long x, unsigned long y, AttributeValue v)
- virtual void
graypoke (unsigned long x, unsigned long y, double v)
convert double to value_type(), then poke at 'x','y'.
- virtual void
graypoke (unsigned long x, unsigned long y, float v)
convert unsigned float to value_type(), then poke at 'x','y'.
- virtual void
graypoke (unsigned long x, unsigned long y, unsigned int v)
convert unsigned int to value_type(), then poke at 'x','y'.
- virtual void
graypoke (unsigned long x, unsigned long y, unsigned long v)
convert unsigned long to value_type(), then poke at 'x','y'.
- virtual void
highlight (unsigned long x, unsigned long y)
highlight pixel at 'x','y' by setting red value to 1.0.
- virtual OverlayRaster*
logscale ( ColorIntensity mingray, ColorIntensity maxgray, CopyString& cmd )
create new raster logarithmically scaled between 'mingray' and 'maxgray',
and return command string to reproduce this effect after save/restore.
- virtual void
poke ( unsigned long x, unsigned long y, ColorIntensity red, ColorIntensity green, ColorIntensity blue, float alpha )
Convert 'red','green','blue' to graylevel value using
this equation: 0.299 r + 0.587 g + 0.114 b, then poke at 'x','y'.
- virtual OverlayRaster*
pseudocolor ( ColorIntensity mingray, ColorIntensity maxgray, CopyString& cmd )
create new raster pseudo-colored between 'mingray' and 'maxgray',
and return command string to reproduce this effect after save/restore.
- virtual boolean
read (istream& in, boolean gray=false)
read raster from istream.
- virtual OverlayRaster*
scale ( ColorIntensity mingray, ColorIntensity maxgray, CopyString& cmd )
create new raster scaled between 'mingray' and 'maxgray', and return
command string to reproduce this effect after save/restore.
- void
set_minmax (double minval, double maxval, boolean fixminmax = false)
set 'minval' and 'maxval' used for flush().
- virtual int
status () const
- boolean
top2bottom () const
orientation of pixel rows. Default is true.
- void
top2bottom (boolean t2b)
set orientation of pixel rows.
- virtual void
unhighlight ()
clear pixel highlighting by restoring red value.
- virtual AttributeValue::ValueType
value_type () const
- virtual boolean
write (ostream& out, boolean gray=false)
- virtual
~GrayRaster ()
Protected:
- void*
_data
- double
_maxval
cached maximum pixel value
- int
_minmax_set
true when _minval,_maxval computed
- double
_minval
cached minimum pixel value
- unsigned char*
_pixel_map
map from intensity-byte to colormap-byte
- boolean
_t2b
- AttributeValue::ValueType
_type
- void
gainbias_minmax (double& gain, double& bias, double& dmin, double& dmax) const
determine 'dmin' and 'dmax', then compute 'gain' and 'bias' for
mapping to 0 to 255.
- virtual boolean
grayraster ()
- void
init (AttributeValue::ValueType type =AttributeValue::UCharType, void* data=nil)
initialize raster of 'type' with optional 'data'.
- unsigned char
ipeek (unsigned long x, unsigned long y)
- void
ipoke (unsigned long x, unsigned long y, int byte)
- virtual void
logscale ( ColorIntensity mingray, ColorIntensity maxgray )
immediate-mode logarithmic scaling.
- virtual void
paintgrayramp ( IntCoord left, IntCoord bottom, unsigned width, unsigned height, boolean horiz )
immediate-mode grayramp embedding.
- virtual OverlayRaster*
pseudocolor ( ColorIntensity mingray, ColorIntensity maxgray )
immediate-mode pseudocoloring.
- virtual void
scale ( ColorIntensity mingray, ColorIntensity maxgray )
immediate-mode linear scaling.
- void
vpeek (unsigned long x, unsigned long y, AttributeValue&)
- void
vpoke (unsigned long x, unsigned long y, AttributeValue&)
(more documentation)