Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

Image Utility Functions

 

void SetHotSpots(Image& m, Point hotspot, Point hotspot2)

Sets hotspots in m to hotspot, hotspot2.

 


 

Image WithHotSpots(const Image& m, Point hotspot, Point hotspot2)

Image WithHotSpots(const Image& m, int x1, int y1, int x2, int y2)

Returns m with new hotspots.

 


 

Image WithHotSpot(const Image& m, int x1, int y1)

Returns m with hotspot x1, y1.

 


 

void SetResolution(Image& m, int res)

Sets the resolution of m to res.

 


 

Image WithResolution(const Image& m, int res)

Returns m with resolution res.

 


 

Image WithResolution(const Image& m, const Image& res)

Returns m with resolution equal to res.GetResolution().

 


 

Image CreateImage(Size sz, const RGBA& rgba)

Creates a new Image with Size sz filled with color rgba.

 


 

Image CreateImage(Size sz, Color color)

Creates a new Image with Size sz filled with color color.

 


 

Size DstSrc(ImageBuffer& dest, Point& p, const Image& src, Rect& sr)

Calculates the minimum Size of Rect sr of Image src when trying to copy it into Point p of ImageBuffer dest.

 


 

void DstSrcOp(ImageBuffer& dest, Point p, const Image& src, const Rect& srect, void (*op)(RGBA *t, const RGBA *s, int n))

Copies Rect srect of Image src into Point p of ImageBuffer dest using copying function op.

 


 

void Copy(ImageBuffer& dest, Point p, const Image& src, const Rect& srect)

Copies Rect srect of Image src into Point p of ImageBuffer dest.

 


 

void Fill(ImageBuffer& dest, const Rect& rect, RGBA color)

Fills rectangular are rect with color .

 


 

void Copy(Image& dest, Point p, const Image& src, const Rect& srect)

Copies Rect srect of Image src into Point p of Image dest.

 


 

void Over(ImageBuffer& dest, Point p, const Image& src, const Rect& srect)

Mixes using alpha information Rect srect of Image src into Point p of ImageBuffer dest.

 


 

void Over(Image& dest, Point p, const Image& src, const Rect& srect)

Mixes using alpha information Rect srect of Image src into Point p of Image dest.

 


 

void Over(Image& dest, const Image& src)

Same as Over(dest, Point(0, 0), src, src.GetSize()).

 


 

void Fill(Image& dest, const Rect& rect, RGBA color)

Fills rectangular are rect with color.

 


 

Image Copy(const Image& src, const Rect& srect)

Returns srect area of src.

 


 

void OverStraightOpaque(ImageBuffer& dest, Point p, const Image& src, const Rect& srect)

Mixes using alpha information Rect srect of Image src into Point p of ImageBuffer dest.

The alpha channel of dest is 255 (opaque).

 


 

void OverStraightOpaque(Image& dest, Point p, const Image& _src, const Rect& srect)

Mixes using alpha information Rect srect of Image src into Point p of Image dest.

The alpha channel of dest is 255 (opaque).

 


 

Image Crop(const Image& img, const Rect& rc)

Returns a subimage from img defined by Rect rc.

 


 

Image Crop(const Image& img, int x, int y, int cx, int cy)

Returns a subimage from img defined by origin x, y, width cx and height cy.

 


 

Rect FindBounds(const Image& m, RGBA bg = RGBAZero())

Detects rectangular margin with uniform color bg and returns the rectangle with the image with pixels inside this margin.

 


 

Image AutoCrop(const Image& m, RGBA bg = RGBAZero())

Detects rectangular margin with uniform color bg and then crops this margin out.

 


 

void AutoCrop(Image *m, int count, RGBA bg)

Finds the maximal rectangular margin with uniform color bg of all images and then crops this margin out. All images must have the same size and will have the same size after the operation.

 


 

void ClampHotSpots(Image& m)

Clamps the positions of hotspots so that they are inside m.

 


 

Image ColorMask(const Image& src, Color transparent)

Returns a new Image based on src replaced Color transparent with RGBAZero().

 


 

Image CanvasSize(const Image& img, int cx, int cy)

img cx cy.

 


 

Image AssignAlpha(const Image& img, const Image& new_alpha)

Returns a new Image based on img colors and new_alpha alpha.

Image size is the minimum of img and new_alpha.

 


 

Image Equalight(const Image& img, int thold = 10)

img thold.

 


 

Image Grayscale(const Image& img)

Returns a new Image including img converted to grayscale.

 


 

Image Grayscale(const Image& img, int amount)

img amount.

 


 

Image Colorize(const Image& img, Color color, int alpha = 100)

img color alpha.

 


 

Image Contrast(const Image& img, int amount = 256)

Returns a new Image with its contrast increased in amount based on img.

 


 

Image Rescale(const Image& src, Size sz, const Rect& src_rc, Gate2<int, intprogress = false)

Returns a new Image rescaled to Size sz based on Rect src_rc of Image src

 


 

Image Sharpen(const Image& img, int amount = 100)

Sharpens image using primitive convolution filter.

 


 

Image Dither(const Image& m, int dival = 394)

Provides primitive dithering with 8x8 matrix into black/white picture. Dival is sort of gamma control of output, lowering it from default value (to e.g. 350) can produce better results when dithering is using for printing on purely monochromatic (without half-toning support) printers.

 


 

Image Etched(const Image& img)

"Etching" effect.

 


 

Image SetColorKeepAlpha(const Image& img, Color c)

Returns a new Image based on img alpha and c Color.

 


 

Image RotateClockwise(const Image& img)

Returns a new Image rotated 90º (clockwise) that is based on img.

 


 

Image RotateAntiClockwise(const Image& img)

Returns a new Image rotated -90º (anticlockwise) that is based on img.

 


 

Image Rotate180(const Image& orig)

Returns a new Image rotated 180º that is based on img.

 


 

Image MirrorHorz(const Image& img)

Returns a new Image that is a mirror of img following horizontal axis.

 


 

Image MirrorVert(const Image& img)

Returns a new Image that is a mirror of img following vertical axis.

 


 

Image Rotate(const Image& m, int angle)

Returns a new Image based on Image m rotated angle by its center where the full rotation (2π) is 3600.

 


 

Image Transpose(const Image& img)

Result is the same as MirrorHorz(RotateClockwise(img)), but implemented effectively in single step.

 


 

Image Transverse(const Image& img)

Result is the same as MirrorHorz(RotateAntiClockwise(img)), but implemented effectively in single step.

 


 

Image FlipImage(const Image& m, int mode)

Transforms Image based on flip mode, which can be one of FLIP_NONE, FLIP_MIRROR_HORZ, FLIP_ROTATE_180, FLIP_MIRROR_VERT, FLIP_TRANSPOSE, FLIP_ROTATE_CLOCKWISE, FLIP_TRANSVERSE, FLIP_ROTATE_ANTICLOCKWISE. Flip mode values are compatible with Raster::GetOrientation and are equal to EXIF orientation - 1. This function is intended to flip Image to correct orientation (usually JPEG from digital camera).

 

 

Last edit by cxl on 10/12/2018. Do you want to contribute?. T++