WXP C++ Library Version 6.74.6
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
WXP::ImageMath Class Reference

This class manipulates images. More...

#include "../include/ImageMath.h"

Static Public Member Functions

static int clip (Image &image, GeomBox &box, Image &new_image)
 
static int clip (Image &image, EarthRange &range, Image &new_image)
 
static int clip (Image &image, EarthPoint &ept, int width, int height, Image &new_image)
 
static int scale (Image &image, float scale, Image &new_image)
 
static int remap (Image &image, Domain &domain, Image &new_image)
 
static int toIndex (Image &image, int rdepth, Image &new_image)
 
static int toIndex (Image &image, Image &new_image)
 
static int toIndex (Image &image, ColorMap &cmap, Image &new_image)
 
static int toGray (Image &image, Image &new_image)
 
static int toTrueColor (Image &image, int rdepth, Image &new_image)
 
static int toTrueColor (Image &image, Image &new_image)
 
static int compressColor (Image &image)
 
static int merge (Image &oimg, Image &img)
 
static int blank (Image &img, EarthPoint &ept1, EarthPoint &ept2)
 
static int blank (Image &img, float angle)
 
static int maskLesser (Image &oimg, Image &img, Grid &grid)
 
static int maskGreater (Image &oimg, Image &img, Grid &grid)
 

Detailed Description

This class manipulates images.

Author
Dan Vietor

Member Function Documentation

◆ blank() [1/2]

int ImageMath::blank ( Image img,
EarthPoint ept1,
EarthPoint ept2 
)
static

Blanks area of image outside of lat lon range

Parameters
imgBase image
ept1Upper left corner
ept2Lower right corner

References WXP::EarthPoint::lat, WXP::EarthPoint::lon, WXP::GridPoint::set(), WXP::Image::setPixel(), and WXP::Image::tran().

◆ blank() [2/2]

int ImageMath::blank ( Image img,
float  angle 
)
static

Blanks area of image outside of angle from projection centerpoint

Parameters
imgBase image
angleAngle from centerpoint

References WXP::Calc::earthAngle(), WXP::EarthPoint::lat, WXP::EarthPoint::lon, WXP::Const::MISS, WXP::GridPoint::set(), WXP::EarthPoint::set(), WXP::Image::setPixel(), and WXP::Image::tran().

◆ clip()

int ImageMath::clip ( Image image,
GeomBox box,
Image new_image 
)
static

◆ compressColor()

int ImageMath::compressColor ( Image image)
static

Compresses the color table in an image

Parameters
imageThe image to perform compression on

References WXP::RGB::blu, WXP::Image::getVal(), WXP::RGB::grn, WXP::RGB::red, and WXP::Image::setPixel().

◆ maskGreater()

int ImageMath::maskGreater ( Image oimg,
Image img,
Grid grid 
)
static

Masks the image if the values are greater than the values in the grid

Parameters
oimgOutput image
imgImage to change
gridGrid to use as a mask

References WXP::Grid::getValue(), WXP::Const::MISS, WXP::GridPoint::set(), WXP::Image::setPixel(), and WXP::Image::tran().

◆ maskLesser()

int ImageMath::maskLesser ( Image oimg,
Image img,
Grid grid 
)
static

Masks the image if the values are less than the values in the grid

Parameters
oimgOutput image
imgImage to change
gridGrid to use as a mask

References WXP::Grid::getValue(), WXP::Const::MISS, WXP::GridPoint::set(), WXP::Image::setPixel(), and WXP::Image::tran().

◆ merge()

int ImageMath::merge ( Image bimg,
Image img 
)
static

◆ remap()

int ImageMath::remap ( Image image,
Domain new_domain,
Image new_image 
)
static

◆ scale()

int ImageMath::scale ( Image image,
float  scale,
Image new_image 
)
static

Scales an image

Parameters
imageInput image to remap
scaleScale factor <1 = smaller image, >1 = larger image
Return values
new_imageOutput image

References WXP::Image::allocData(), WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::Image::getLimits(), WXP::Image::getPixel(), WXP::DomainVal::nx, WXP::DomainVal::ny, scale(), and WXP::Image::setPixel().

Referenced by scale().

◆ toGray()

int ImageMath::toGray ( Image image,
Image new_image 
)
static

Converts an image from direct color to gray scale

Parameters
imageInput direct color image
Return values
new_imageOutput image

References WXP::Image::allocColors(), WXP::Image::allocData(), WXP::ImageColor::b, WXP::RGB::blu, WXP::ImageColor::g, WXP::RGB::grn, WXP::Image::init(), WXP::ImageColor::r, WXP::RGB::red, and WXP::Image::setPixel().

◆ toIndex() [1/3]

int ImageMath::toIndex ( Image image,
ColorMap cmap,
Image new_image 
)
static

Converts an image from direct color to index color. Uses colormap in new image and maps colors in input image to nearest color in colormap.

Parameters
imageInput direct color image
cmapColormap to use in new image
Return values
new_imageOutput image

References WXP::Image::allocColors(), WXP::Image::allocData(), WXP::ImageColor::b, WXP::RGB::blu, WXP::ImageColor::g, WXP::ColorMap::get(), WXP::ColorMap::getNum(), WXP::RGB::grn, WXP::Image::init(), WXP::ImageColor::r, WXP::RGB::red, and WXP::Image::setPixel().

◆ toIndex() [2/3]

int ImageMath::toIndex ( Image image,
Image new_image 
)
static

Converts an image from direct color to index color (depth=8)

Parameters
imageInput direct color image
Return values
new_imageOutput image

References toIndex().

◆ toIndex() [3/3]

int ImageMath::toIndex ( Image image,
int  rdepth,
Image new_image 
)
static

Converts an image from direct color to index color

Parameters
imageInput direct color image
rdepthNew depth
Return values
new_imageOutput image

References WXP::Image::allocColors(), WXP::Image::allocData(), WXP::ImageColor::b, WXP::RGB::blu, WXP::ImageColor::g, WXP::RGB::grn, WXP::Image::init(), WXP::ImageColor::r, WXP::RGB::red, and WXP::Image::setPixel().

Referenced by toIndex(), WXP::GifFile::write(), WXP::LZWComp::write(), and WXP::PngFile::write().

◆ toTrueColor() [1/2]

int ImageMath::toTrueColor ( Image image,
Image new_image 
)
static

Converts an image from index color to direct color (depth=24)

Parameters
imageInput index color image
Return values
new_imageOutput image

References toTrueColor().

◆ toTrueColor() [2/2]

int ImageMath::toTrueColor ( Image image,
int  rdepth,
Image new_image 
)
static

Converts an image from index color to direct color

Parameters
imageInput index color image
rdepthNew depth
Return values
new_imageOutput image

References WXP::Image::allocData(), WXP::ImageColor::b, WXP::ImageColor::g, WXP::Image::getPixel(), WXP::Image::getVal(), WXP::Image::init(), WXP::ImageColor::r, and WXP::Image::setPixel().

Referenced by toTrueColor().


The documentation for this class was generated from the following files: