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











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord 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.

 


 

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 *, const RGBA *, int), bool co = false)

Copies Rect srect of Image src into Point p of ImageBuffer dest using copying function op. If co is true, uses multithreading.

 


 

void Copy(ImageBuffer& dest, Point p, const Image& src, const Rect& srect, bool co = false)

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

 


 

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, bool co = false)

Copies Rect srect of Image src into Point p of Image dest. If co is true, uses multithreading.

 


 

void Over(ImageBuffer& dest, Point p, const Image& src, const Rect& srect, bool co = false)

Paints over (using alpha channel) Rect srect of Image src into Point p of ImageBuffer dest. If co is true, uses multithreading.

 


 

void Over(Image& dest, Point p, const Image& _src, const Rect& srect, bool co = false)

Paints over (using alpha channel) Rect srect of Image src into Point p of Image dest. If co is true, uses multithreading.

 


 

void Over(Image& dest, const Image& _src, bool co = false)

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

 


 

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.

 


 

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 Rescale(const Image& src, Size sz, Gate<int, int> progress = Null)

Image Rescale(const Image& src, int cx, int cy, Gate<int, int> progress = Null)

Returns src rescaled to requested size.

 


 

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 GaussianBlur(const Image& img, int radius, bool co = false)

An implementation of well known fast box and gaussian blur approximation algorithms by Wojciech Jarosz and Peter Kovesi. co activates parallel processing.

 


 

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).

 

 

Do you want to contribute?