#include "Util/Types.H"
#include "Image/SimpleFont.H"
#include "Image/Pixels.H"
#include <string>
#include <vector>
Go to the source code of this file.
Classes | |
struct | MeterInfo |
Simple struct to define a bargraph meter. More... | |
Enumerations | |
enum | TextAnchor { ANCHOR_TOP_LEFT, ANCHOR_TOP_RIGHT, ANCHOR_BOTTOM_LEFT, ANCHOR_BOTTOM_RIGHT } |
Functions | |
void | drawTraj (Image< PixRGB< byte > > &img, const Point2D< int > *foas_begin, const Point2D< int > *foas_end) |
draw the trajectory for the points in foas onto img | |
Image< PixRGB< byte > > | colGreyCombo (const Image< PixRGB< byte > > &colimg, const Image< float > &bwimg, const bool xcombo, const bool interp=true) |
build a combo between a color and greyscale image | |
Image< PixRGB< byte > > | colColCombo (const Image< PixRGB< byte > > &colimg1, const Image< PixRGB< byte > > &colimg2, const bool xcombo, const bool interp=true) |
build a combo between a color and color image | |
Image< PixRGB< byte > > | highlightRegions (const Image< PixRGB< byte > > &img, const Image< byte > &mask, const int maxval=320) |
highlight an image in the regions given by a mask | |
Image< PixRGB< byte > > | warp3Dmap (const Image< PixRGB< byte > > &img, const Image< float > &hmap, const float pitch, const float yaw, Dims &imdims) |
warp image onto height map | |
void | inplaceSetValMask (Image< float > &dest, const Image< byte > &mask, const float val) |
Set values at all locations where mask is non-zero. | |
template<class T_or_RGB > | |
void | drawDisk (Image< T_or_RGB > &dst, const Point2D< int > ¢er, const int radius, const T_or_RGB value) |
Draws a disk with color "value" in image. | |
template<class T_or_RGB > | |
void | drawLine (Image< T_or_RGB > &dst, const Point2D< int > &p1, const Point2D< int > &p2, const T_or_RGB col, const int rad=1) |
Draw a line from p1 to p2 of color col and pixel radius rad. | |
template<class T_or_RGB > | |
void | drawLine (Image< T_or_RGB > &dst, const Point2D< int > &pos, float ori, float len, const T_or_RGB col, const int rad=1) |
Draw a line at pos angle ori(rad) and length len. | |
template<class T_or_RGB > | |
void | drawCorner (Image< T_or_RGB > &dst, const Point2D< int > &pos, float ori, float ang, float len, const T_or_RGB col, const int rad=1) |
Draw a corner at pos and ori with an ang. | |
template<class T_or_RGB > | |
void | drawRect (Image< T_or_RGB > &dst, const Rectangle &rect, const T_or_RGB col, const int rad=1) |
Draw a rectangle of color col and line width of rad*2, with rounded corners. | |
template<class T_or_RGB > | |
void | drawRectSquareCorners (Image< T_or_RGB > &dst, const Rectangle &r, const T_or_RGB color, const int linewidth) |
Draw a rectangle of the given color and line width, with square corners. | |
template<class T_or_RGB > | |
void | drawRectOR (Image< T_or_RGB > &dst, const Rectangle &rect, const T_or_RGB col, const int rad=1, const float ori=0.0F) |
Draw a rectangle of color col and pixel radius rad, rotate by ori. | |
template<class T_or_RGB > | |
void | drawRectEZ (Image< T_or_RGB > &dst, const Rectangle &rect, const T_or_RGB col, const int rad=1) |
Draw a rectangle of color col and pixel radius rad, no size assertions. | |
template<class T_or_RGB > | |
void | drawFilledRect (Image< T_or_RGB > &dst, const Rectangle &rect, const T_or_RGB fillVal) |
Draw a filled rectangle with the given fill value. | |
template<class T_or_RGB > | |
void | drawCross (Image< T_or_RGB > &dst, const Point2D< int > &p, const T_or_RGB col, const int siz=3, const int rad=1) |
Draw a cross of color col, half-size siz and pixel radius rad. | |
template<class T_or_RGB > | |
void | drawCrossOR (Image< T_or_RGB > &dst, const Point2D< int > &p, const T_or_RGB col, const int siz=3, const int rad=1, const float ori=0.0F) |
Draw a cross of color col, half-size siz and pixel radius rad. | |
template<class T_or_RGB > | |
void | drawPatch (Image< T_or_RGB > &dst, const Point2D< int > &p, const int siz, const T_or_RGB col) |
Draw a square patch of color col and size siz. | |
template<class T_or_RGB > | |
void | drawPatchBB (Image< T_or_RGB > &dst, const Point2D< int > &p, const int siz, const T_or_RGB col, const T_or_RGB bgcol=T_or_RGB()) |
Draw a square patch of color col and size siz, with a black border. | |
template<class T_or_RGB > | |
void | drawCircle (Image< T_or_RGB > &dst, const Point2D< int > &p, const int radius, const T_or_RGB col, const int rad=1) |
Draw a circle of color col and radius radius, with pixel radius rad. | |
template<class T_or_RGB > | |
void | drawEllipse (Image< T_or_RGB > &dst, const Point2D< int > &p, const int radiusx, const int radiusy, const T_or_RGB col, const int rad=1) |
Draw a ellipse of color col and radius radiusx, radiusy, with pixel radius rad. | |
template<class T_or_RGB > | |
void | drawArrow (Image< T_or_RGB > &dst, const Point2D< int > &p1, const Point2D< int > &p2, const T_or_RGB col, const int rad=1) |
Draw an arrow from p1 to p2 with pixel radius rad. | |
template<class T_or_RGB > | |
void | drawGrid (Image< T_or_RGB > &dst, const int spacingX, const int spacingY, const int thickX, const int thickY, const T_or_RGB col) |
Draw a grid. | |
template<class T_or_RGB > | |
void | drawGrid (Image< T_or_RGB > &dst, const uint nx, const uint ny, const int thick, const T_or_RGB col) |
Draw an nx * ny grid that exactly partitions the given image. | |
template<class T_or_RGB > | |
void | drawSuperquadric (Image< T_or_RGB > &dst, const Point2D< int > &p, const float a, const float b, const float e, const T_or_RGB col, const float rot=0, const float k1=0, const float k2=0, const float thetai=-M_PI, const float thetaf=M_PI, const int rad=1, const int nSeg=40) |
Draw a superquadric shape. nSeg defines the quality of the shape. ie. how many line to draw. | |
template<class T , class T_or_RGB > | |
void | drawContour2D (const Image< T > &src, Image< T_or_RGB > &dst, const T_or_RGB &col, const byte rad) |
Draw a 2D contour. | |
template<class T_or_RGB > | |
void | writeText (Image< T_or_RGB > &dst, const Point2D< int > &pt, const char *text, const T_or_RGB col=T_or_RGB(), const T_or_RGB bgcol=T_or_RGB(255), const SimpleFont &f=SimpleFont::FIXED(10), const bool transparent_bg=false, const TextAnchor anchor=ANCHOR_TOP_LEFT) |
Write some text in normal font; only ASCII chars 32 .. 126 are supported. | |
template<class T_or_RGB > | |
Image< T_or_RGB > | makeMultilineTextBox (const int w, const std::string *lines, const size_t nlines, const T_or_RGB col, const T_or_RGB bg=T_or_RGB(), const size_t max_chars_per_line=0, const int fontwidth=0) |
Make an image containing one or more lines of text. | |
template<class T_or_RGB > | |
void | drawPoint (Image< T_or_RGB > &dst, int X, int Y, T_or_RGB pix) |
draw a dot which is a point with 4 connected points | |
template<class T > | |
int | drawDiskCheckTarget (Image< T > &dst, Image< T > &mask, const Point2D< int > ¢er, const int radius, const T value, const T targetval, const T floodval) |
Draws a disk in image and check if it hits a target. | |
template<class T > | |
Image< PixRGB< T > > | warp3D (const Image< PixRGB< T > > &ima, const Image< float > &zmap, const float pitch, const float yaw, const float zMax, Dims &dims) |
Warp image in 3D onto z-map. | |
Image< PixRGB< byte > > | formatMapForDisplay (const Image< float > &img, const float factor, const Dims &newdims, const bool useInterp, const ColorMap &cmap, const bool showColorScale, const char *label) |
Format a feature map for display. | |
template<typename T , class U > | |
Image< PixRGB< byte > > | linePlot (const U &points, const int w, const int h, const T &minVal=T(), const T &maxVal=T(), const char *title="", const char *yLabel="", const char *xLabel="", const PixRGB< byte > &linecol=PixRGB< byte >(0, 0, 0), const PixRGB< byte > &bckcol=PixRGB< byte >(255, 255, 255), const int numticks=4, const bool axisonright=false) |
template<typename T > | |
Image< PixRGB< byte > > | multilinePlot (const std::vector< std::vector< T > > &lines, const int w, const int h, T minVal=T(), T maxVal=T(), const char *title="", const char *xLabel="", const char *yLabel="", const std::vector< PixRGB< byte > > &linescolor=std::vector< PixRGB< byte > >(0), const PixRGB< byte > &gridcolor=PixRGB< byte >(255, 0, 0), const PixRGB< byte > &bckcolor=PixRGB< byte >(255, 255, 255)) |
Generate multiline plot from a vector of lines. | |
template<class T_or_RGB > | |
void | drawOutlinedPolygon (Image< T_or_RGB > &img, const std::vector< Point2D< int > > &polygon, const T_or_RGB col, const Point2D< int > trans=Point2D< int >(0, 0), const float rot=0.0, const float scale=1.0, const float k1=0, const float k2=0, const int rad=1) |
Draw a polygon with outlined polygon, no change outside. | |
template<class T_or_RGB > | |
void | drawFilledPolygon (Image< T_or_RGB > &img, const std::vector< Point2D< int > > &polygon, const T_or_RGB col) |
Draw a filled polygon with color col inside the polygon, no change outside. | |
Image< PixRGB< byte > > | drawMeters (const MeterInfo *infos, const size_t ninfo, const size_t nx, const Dims &meterdims) |
Draw some bargraph meters. | |
template<class T > | |
Image< T > | drawHistogram (std::vector< float > hist, int width, int height, T lineVal, T fillVal) |
functions for drawing on images
Definition in file DrawOps.H.
Image< PixRGB<byte> > colColCombo | ( | const Image< PixRGB< byte > > & | colimg1, | |
const Image< PixRGB< byte > > & | colimg2, | |||
const bool | xcombo, | |||
const bool | interp = true | |||
) |
build a combo between a color and color image
colimg1 | the color image (e.g., trajectory + saliency map) | |
colimg2 | the second color image (e.g., the scene highlighted by TRM) | |
xcombo | will combine horizontally if true, otherwise vertically | |
interp | use bilinear interpolation for any image rescaling |
Definition at line 95 of file DrawOps.C.
References ASSERT, concatX(), and concatY().
Referenced by SimulationViewerStd::getTraj().
Image< PixRGB<byte> > colGreyCombo | ( | const Image< PixRGB< byte > > & | colimg, | |
const Image< float > & | bwimg, | |||
const bool | xcombo, | |||
const bool | interp = true | |||
) |
build a combo between a color and greyscale image
colimg | the color image (e.g., trajectory) | |
bwimg | the greyscale image (e.g., saliency map) | |
xcombo | will combine horizontally if true, otherwise vertically | |
interp | use bilinear interpolation for any image rescaling |
Definition at line 74 of file DrawOps.C.
References ASSERT, concatX(), concatY(), Image< T >::getDims(), Image< T >::initialized(), makeRGB(), and ZEROS.
Referenced by SimulationViewerStd::getTraj(), SimulationViewerCompress::getTraj(), main(), and SimulationViewerStats::save1().
void drawArrow | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p1, | |||
const Point2D< int > & | p2, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw an arrow from p1 to p2 with pixel radius rad.
Referenced by drawTraj(), TopologicalMap::getMapImage(), SimulationViewerNerdCam::linkFOAs(), SimulationViewerStd::linkFOAs(), CINNICstatsRun::pointAndFlood(), and StimMaker::SM_drawSingleTarget().
void drawCircle | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p, | |||
const int | radius, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw a circle of color col and radius radius, with pixel radius rad.
Referenced by HippocampusI::displayMap(), VisualEventSet::drawTokens(), drawTraj(), BeoLRF::evolve(), InferotemporalCortexI::evolve(), GSlocalizer::getBeliefImage(), Beobot2_GistSalLocalizerMasterI::getBeliefImage(), Ganglion::getDebugImage(), GeometricHashing::getHashTableImage(), VisualObject::getKeypointImage2(), main(), segmentImageMerge::mergeImages(), VectorField::plotGridField(), CINNICstatsRun::pointAndFlood(), BeoSubBin::pruneLines(), HeliPose::run_cameraPose(), segmentImageMerge2::SIMmergeImages(), segmentImageTrackMC::SITdrawBlobTrack(), segmentImageTrackMC::SITdrawBlobTrackMerged(), and StimMaker::SM_drawSingleTarget().
void drawContour2D | ( | const Image< T > & | src, | |
Image< T_or_RGB > & | dst, | |||
const T_or_RGB & | col, | |||
const byte | rad | |||
) | [inline] |
Draw a 2D contour.
Will draw a disk of color col and radius rad in dst at every point where src is on a contour. dst should be initialized ahd have same dims as src. Nothing is drawn for point off contours.
void drawCorner | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | pos, | |||
float | ori, | |||
float | ang, | |||
float | len, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw a corner at pos and ori with an ang.
void drawCross | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p, | |||
const T_or_RGB | col, | |||
const int | siz = 3 , |
|||
const int | rad = 1 | |||
) | [inline] |
Draw a cross of color col, half-size siz and pixel radius rad.
Referenced by HippocampusI::displayMap(), ImageSpring< T >::getClusteredImage(), and main().
void drawCrossOR | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p, | |||
const T_or_RGB | col, | |||
const int | siz = 3 , |
|||
const int | rad = 1 , |
|||
const float | ori = 0.0F | |||
) | [inline] |
Draw a cross of color col, half-size siz and pixel radius rad.
Referenced by main(), and StimMaker::SM_drawSingleTarget().
void drawDisk | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | center, | |||
const int | radius, | |||
const T_or_RGB | value | |||
) | [inline] |
Draws a disk with color "value" in image.
Referenced by BeobotBrainMT::BeobotBrainMT(), LandmarkDB::display(), HippocampusI::displayMap(), dispResults(), SimulationViewerNerdCam::drawMaskOutline(), SimulationViewerStd::drawMaskOutline(), VisualEventSet::drawTokens(), Landmark::getActiveKeypoints(), GSlocalizer::getBeliefImage(), Beobot2_GistSalLocalizerMasterI::getBeliefImage(), ShapeModel::getDistVal(), FeatureVector::getFeatureVectorImage(), VisualObject::getKeypointImage(), ScaleSpace::getKeypointImage(), VisualObject::getKeypointImage2(), TopologicalMap::getMapImage(), VisualObjectMatch::getMatchImage(), RetinaAdapter::getOutput(), Landmark::getPosition(), ImageSpring< T >::getPositions(), VisualObject::getSalAndKeypointImage(), getSalImage(), SimulationViewerCompress::getTraj(), VisualBufferStd::inhibit(), VisualBufferStd::input(), main(), Stimulus2D::next(), VectorField::plotField(), VectorField::plotGridField(), CINNICstatsRun::pointAndFlood(), BeoSubSaliency::run(), BeoSubCanny::setupCanny(), StimMaker::SM_drawGroundTruth(), and StimMaker::SM_drawSingleTarget().
int drawDiskCheckTarget | ( | Image< T > & | dst, | |
Image< T > & | mask, | |||
const Point2D< int > & | center, | |||
const int | radius, | |||
const T | value, | |||
const T | targetval, | |||
const T | floodval | |||
) | [inline] |
Draws a disk in image and check if it hits a target.
mask | input binary target mask to draw into | |
center | coordinates of disk center | |
radius | radisu of disk, in pixels | |
value | pixel value used to draw the disk | |
targetval | value with which the targets are represented | |
floodval | value to flood target with if target hit |
Definition at line 888 of file DrawOps.C.
References ASSERT, Image< T >::coordsOk(), flood(), Image< T >::getVal(), Point2D< T >::i, Image< T >::initialized(), Image< T >::setVal(), sqrt(), and squareOf().
void drawEllipse | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p, | |||
const int | radiusx, | |||
const int | radiusy, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw a ellipse of color col and radius radiusx, radiusy, with pixel radius rad.
void drawFilledPolygon | ( | Image< T_or_RGB > & | img, | |
const std::vector< Point2D< int > > & | polygon, | |||
const T_or_RGB | col | |||
) | [inline] |
Draw a filled polygon with color col inside the polygon, no change outside.
Referenced by TestImages::getObjMask(), and TaskRelevanceMapSocial::inputFrame().
void drawFilledRect | ( | Image< T_or_RGB > & | dst, | |
const Rectangle & | rect, | |||
const T_or_RGB | fillVal | |||
) | [inline] |
Draw a filled rectangle with the given fill value.
Referenced by ArrayCreator::draw(), SDLdisplay::makeBlittableSurface(), POMDP::makeObservation(), and submain().
void drawGrid | ( | Image< T_or_RGB > & | dst, | |
const uint | nx, | |||
const uint | ny, | |||
const int | thick, | |||
const T_or_RGB | col | |||
) | [inline] |
Draw an nx * ny grid that exactly partitions the given image.
void drawGrid | ( | Image< T_or_RGB > & | dst, | |
const int | spacingX, | |||
const int | spacingY, | |||
const int | thickX, | |||
const int | thickY, | |||
const T_or_RGB | col | |||
) | [inline] |
Draw a grid.
void drawLine | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | pos, | |||
float | ori, | |||
float | len, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw a line at pos angle ori(rad) and length len.
void drawLine | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p1, | |||
const Point2D< int > & | p2, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw a line from p1 to p2 of color col and pixel radius rad.
Image<PixRGB<byte> > drawMeters | ( | const MeterInfo * | infos, | |
const size_t | ninfo, | |||
const size_t | nx, | |||
const Dims & | meterdims | |||
) |
Draw some bargraph meters.
Definition at line 1570 of file DrawOps.C.
References ASSERT, clampValue(), SimpleFont::fixedMaxHeight(), Dims::h(), sformat(), SimpleFont::w(), Dims::w(), writeText(), and ZEROS.
void drawOutlinedPolygon | ( | Image< T_or_RGB > & | img, | |
const std::vector< Point2D< int > > & | polygon, | |||
const T_or_RGB | col, | |||
const Point2D< int > | trans = Point2D< int >(0, 0) , |
|||
const float | rot = 0.0 , |
|||
const float | scale = 1.0 , |
|||
const float | k1 = 0 , |
|||
const float | k2 = 0 , |
|||
const int | rad = 1 | |||
) | [inline] |
Draw a polygon with outlined polygon, no change outside.
void drawPatch | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p, | |||
const int | siz, | |||
const T_or_RGB | col | |||
) | [inline] |
Draw a square patch of color col and size siz.
Referenced by SimulationViewerNerdCam::drawFOA(), SimulationViewerStd::drawFOA(), RawGistEstimatorStd::getGistImage(), GistEstimatorGen::getGistImage(), getPcaIcaFeatImage(), SimulationViewerStats::save1(), and StimMaker::SM_drawSingleTarget().
void drawPatchBB | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p, | |||
const int | siz, | |||
const T_or_RGB | col, | |||
const T_or_RGB | bgcol = T_or_RGB() | |||
) | [inline] |
Draw a square patch of color col and size siz, with a black border.
Referenced by SimulationViewerEyeHand::drawHand(), SimulationViewerHand::drawHand(), and SimulationViewerCompress::getTraj().
void drawPoint | ( | Image< T_or_RGB > & | dst, | |
int | X, | |||
int | Y, | |||
T_or_RGB | pix | |||
) | [inline] |
draw a dot which is a point with 4 connected points
this is between the setVal method and drawCircle method for illustrating points
Referenced by vizDist().
void drawRect | ( | Image< T_or_RGB > & | dst, | |
const Rectangle & | rect, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw a rectangle of color col and line width of rad*2, with rounded corners.
Referenced by dispResults(), SimulationViewerStd::drawEye(), SimulationViewerStd::drawHead(), SimulationViewerStd::drawMegaCombo(), TemplateMatchChannel::drawResults(), InferotemporalCortexI::evolve(), formatMapForDisplay(), TopologicalMap::getMapImage(), DPM::getModelImage(), getSalImage(), SimulationViewerStd::getTraj(), main(), SimulationViewerStd::prepMapForDisplay(), and SimulationViewerNerdCam::saveResults().
void drawRectEZ | ( | Image< T_or_RGB > & | dst, | |
const Rectangle & | rect, | |||
const T_or_RGB | col, | |||
const int | rad = 1 | |||
) | [inline] |
Draw a rectangle of color col and pixel radius rad, no size assertions.
Referenced by main(), segmentImageTrackMC::SITdrawBlobBox(), segmentImageTrackMC::SITdrawBlobTrack(), segmentImageTrackMC::SITdrawBlobTrackMerged(), and segmentImageTrackMC::SITdrawHistoValues().
void drawRectOR | ( | Image< T_or_RGB > & | dst, | |
const Rectangle & | rect, | |||
const T_or_RGB | col, | |||
const int | rad = 1 , |
|||
const float | ori = 0.0F | |||
) | [inline] |
Draw a rectangle of color col and pixel radius rad, rotate by ori.
Referenced by StimMaker::SM_drawSingleTarget().
void drawRectSquareCorners | ( | Image< T_or_RGB > & | dst, | |
const Rectangle & | r, | |||
const T_or_RGB | color, | |||
const int | linewidth | |||
) | [inline] |
Draw a rectangle of the given color and line width, with square corners.
void drawSuperquadric | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | p, | |||
const float | a, | |||
const float | b, | |||
const float | e, | |||
const T_or_RGB | col, | |||
const float | rot = 0 , |
|||
const float | k1 = 0 , |
|||
const float | k2 = 0 , |
|||
const float | thetai = -M_PI , |
|||
const float | thetaf = M_PI , |
|||
const int | rad = 1 , |
|||
const int | nSeg = 40 | |||
) | [inline] |
Draw a superquadric shape. nSeg defines the quality of the shape. ie. how many line to draw.
Definition at line 643 of file DrawOps.C.
References Point2D< T >::i.
void drawTraj | ( | Image< PixRGB< byte > > & | img, | |
const Point2D< int > * | foas_begin, | |||
const Point2D< int > * | foas_end | |||
) |
draw the trajectory for the points in foas onto img
Yellow circles and red arrows are drawn, connecting the points in foas.
foas | a vector with the foci of attention ised for drawing |
Definition at line 59 of file DrawOps.C.
References drawArrow(), and drawCircle().
Image< PixRGB<byte> > formatMapForDisplay | ( | const Image< float > & | img, | |
const float | factor, | |||
const Dims & | newdims, | |||
const bool | useInterp, | |||
const ColorMap & | cmap, | |||
const bool | showColorScale, | |||
const char * | label | |||
) |
Format a feature map for display.
Take an Image<float> feature map as input and convert it to PixRGB<byte> by either multiplying the values by a factor or by normalizing them to 0 .. 255 (if factor is 0.0), and then using a given color map (which will also be displayed if showColorScale is true). Then rescale to the specified dims, using interpolation if desired. Then write a descriptor label in the top-left corner using a large font, and finally show the original range of values in the bottom-right corner uing a tiny font.
Definition at line 1056 of file DrawOps.C.
References colorize(), drawRect(), SimpleFont::FIXED(), Image< T >::getHeight(), getMinMax(), Image< T >::getVal(), Image< T >::getWidth(), SimpleFont::h(), Image< T >::initialized(), inplaceNormalize(), Image< T >::resize(), sformat(), Rectangle::tlbrI(), SimpleFont::w(), and writeText().
Image< PixRGB<byte> > highlightRegions | ( | const Image< PixRGB< byte > > & | img, | |
const Image< byte > & | mask, | |||
const int | maxval = 320 | |||
) |
highlight an image in the regions given by a mask
Definition at line 124 of file DrawOps.C.
References binaryReverse(), chamfer34(), inplaceNormalize(), and Image< T >::setVal().
Referenced by SimulationViewerStd::getTraj().
Set values at all locations where mask is non-zero.
Definition at line 152 of file DrawOps.C.
References ASSERT, Image< T >::begin(), Image< T >::beginw(), Image< T >::endw(), and Image< T >::isSameSize().
Image< PixRGB<byte> > linePlot | ( | const U & | points, | |
const int | w, | |||
const int | h, | |||
const T & | minVal = T() , |
|||
const T & | maxVal = T() , |
|||
const char * | title = "" , |
|||
const char * | yLabel = "" , |
|||
const char * | xLabel = "" , |
|||
const PixRGB< byte > & | linecol = PixRGB< byte >(0, 0, 0) , |
|||
const PixRGB< byte > & | bckcol = PixRGB< byte >(255, 255, 255) , |
|||
const int | numticks = 4 , |
|||
const bool | axisonright = false | |||
) | [inline] |
Generate a plot from a vector of points. Choose numticks < 0 to disable x and y axes tick marks. class U should be a deque or vector
Definition at line 1132 of file DrawOps.C.
References SimpleFont::fixedMaxHeight(), flipVertic(), SimpleFont::h(), Point2D< T >::i, sformat(), Image< T >::size(), transpose(), SimpleFont::w(), writeText(), and ZEROS.
Referenced by SVEMNPlot::PlotBuf::draw(), and PlotBuffer::draw().
Image<T_or_RGB> makeMultilineTextBox | ( | const int | w, | |
const std::string * | lines, | |||
const size_t | nlines, | |||
const T_or_RGB | col, | |||
const T_or_RGB | bg = T_or_RGB() , |
|||
const size_t | max_chars_per_line = 0 , |
|||
const int | fontwidth = 0 | |||
) | [inline] |
Make an image containing one or more lines of text.
The function will choose a font width that fits the desired image size.
w | the desired width (in pixels) of the resulting image | |
lines | an array of strings to be written in the result, one line per string | |
nlines | the number of strings in the string array | |
col | the foreground color for the written text | |
bg | the background color for the written text | |
max_chars_per_line | if non-zero, then each line of text will be truncated at this many characters | |
fontwidth | the max font width unless it is zero, in which case it will be determined automatically to fit the text in the box. |
Image< PixRGB<byte> > multilinePlot | ( | const std::vector< std::vector< T > > & | lines, | |
const int | w, | |||
const int | h, | |||
T | minVal = T() , |
|||
T | maxVal = T() , |
|||
const char * | title = "" , |
|||
const char * | xLabel = "" , |
|||
const char * | yLabel = "" , |
|||
const std::vector< PixRGB< byte > > & | linescolor = std::vector< PixRGB< byte > >(0) , |
|||
const PixRGB< byte > & | gridcolor = PixRGB< byte >(255, 0, 0) , |
|||
const PixRGB< byte > & | bckcolor = PixRGB< byte >(255, 255, 255) | |||
) | [inline] |
Generate multiline plot from a vector of lines.
Definition at line 1299 of file DrawOps.C.
References SimpleFont::fixedMaxHeight(), flipVertic(), SimpleFont::h(), Point2D< T >::i, min(), sformat(), transpose(), SimpleFont::w(), writeText(), and ZEROS.
Image<PixRGB<T> > warp3D | ( | const Image< PixRGB< T > > & | ima, | |
const Image< float > & | zmap, | |||
const float | pitch, | |||
const float | yaw, | |||
const float | zMax, | |||
Dims & | dims | |||
) | [inline] |
Warp image in 3D onto z-map.
ima | Input image | |
zmap | Height map of same size as ima | |
pitch | 3D pitch angle, in degrees | |
yaw | 3D yaw angle, in degrees | |
dims | The result will have these dimensions, unless the dimensions are empty (i.e. 0-by-0), in which case the result will be the best size computed from ima's size and the pitch and yaw angles. |
Definition at line 922 of file DrawOps.C.
References ASSERT, clampValue(), Image< T >::getHeight(), Image< T >::getVal(), Image< T >::getWidth(), Dims::h(), Dims::isEmpty(), Image< T >::isSameSize(), max(), min(), Image< T >::setVal(), Dims::w(), and ZEROS.
Referenced by warp3Dmap().
Image< PixRGB<byte> > warp3Dmap | ( | const Image< PixRGB< byte > > & | img, | |
const Image< float > & | hmap, | |||
const float | pitch, | |||
const float | yaw, | |||
Dims & | imdims | |||
) |
warp image onto height map
Definition at line 137 of file DrawOps.C.
References Image< T >::getWidth(), inplaceClamp(), lowPass9(), rescale(), and warp3D().
Referenced by SimulationViewerStd::getTraj(), and SimulationViewerNerdCam::saveResults().
void writeText | ( | Image< T_or_RGB > & | dst, | |
const Point2D< int > & | pt, | |||
const char * | text, | |||
const T_or_RGB | col = T_or_RGB() , |
|||
const T_or_RGB | bgcol = T_or_RGB(255) , |
|||
const SimpleFont & | f = SimpleFont::FIXED(10) , |
|||
const bool | transparent_bg = false , |
|||
const TextAnchor | anchor = ANCHOR_TOP_LEFT | |||
) | [inline] |
Write some text in normal font; only ASCII chars 32 .. 126 are supported.
See Image/SimpleFont.H for font choices.
Referenced by ColorbarsInput::ColorbarsInput(), HippocampusI::displayMap(), PsychoDisplay::displayNumbers(), SDLdisplay::displayText(), dispResults(), SimulationViewerNerdCam::drawDateTime(), SimulationViewerStd::drawFOA(), SimulationViewerEyeHand::drawHand(), SimulationViewerHand::drawHand(), SimulationViewerNerdCam::drawMegaCombo(), SimulationViewerStd::drawMegaCombo(), drawMeters(), SimulationViewerStd::drawTime(), SimulationViewerSurpCont::drawTime(), SimulationViewerNerdCam::drawTime(), VisualEventSet::drawTokens(), InferotemporalCortexI::evolve(), formatMapForDisplay(), getSalImage(), TestImages::labelScene(), linePlot(), main(), multilinePlot(), normalizeFloat(), normalizeFloatRgb(), plotData(), SimulationViewerStd::prepMapForDisplay(), XMLInput::readFrame(), ColorbarsInput::readFrame(), AgentManagerB::setCurrentImage(), AgentManagerA::setCurrentImage(), CudaFramework::setText(), submain(), and vizDist().