Transformations


Functions

bool CxImage::Rotate (float angle, CxImage *iDst=NULL)
bool CxImage::Rotate2 (float angle, CxImage *iDst=NULL, InterpolationMethod inMethod=IM_BILINEAR, OverflowMethod ofMethod=OM_BACKGROUND, RGBQUAD *replColor=0, bool const optimizeRightAngles=true, bool const bKeepOriginalSize=false)
bool CxImage::Rotate180 (CxImage *iDst=NULL)
bool CxImage::Resample (long newx, long newy, int mode=1, CxImage *iDst=NULL)
bool CxImage::Resample2 (long newx, long newy, InterpolationMethod const inMethod=IM_BICUBIC2, OverflowMethod const ofMethod=OM_REPEAT, CxImage *const iDst=NULL, bool const disableAveraging=false)
bool CxImage::DecreaseBpp (DWORD nbit, bool errordiffusion, RGBQUAD *ppal=0, DWORD clrimportant=0)
bool CxImage::IncreaseBpp (DWORD nbit)
bool CxImage::Dither (long method=0)
bool CxImage::Crop (long left, long top, long right, long bottom, CxImage *iDst=NULL)
bool CxImage::Crop (const RECT &rect, CxImage *iDst=NULL)
bool CxImage::CropRotatedRectangle (long topx, long topy, long width, long height, float angle, CxImage *iDst=NULL)
bool CxImage::Skew (float xgain, float ygain, long xpivot=0, long ypivot=0, bool bEnableInterpolation=false)
bool CxImage::Expand (long left, long top, long right, long bottom, RGBQUAD canvascolor, CxImage *iDst=0)
bool CxImage::Expand (long newx, long newy, RGBQUAD canvascolor, CxImage *iDst=0)
bool CxImage::Thumbnail (long newx, long newy, RGBQUAD canvascolor, CxImage *iDst=0)
bool CxImage::CircleTransform (int type, long rmax=0, float Koeff=1.0f)
bool CxImage::RedEyeRemove (float strength=0.8f)
bool CxImage::QIShrink (long newx, long newy, CxImage *const iDst=NULL, bool bChangeBpp=false)

Detailed Description


Function Documentation

bool CxImage::CircleTransform ( int  type,
long  rmax = 0,
float  Koeff = 1.0f 
) [inherited]

Perform circle_based transformations.

Parameters:
type - for different transformations
  • 0 for normal (proturberant) FishEye
  • 1 for reverse (concave) FishEye
  • 2 for Swirle
  • 3 for Cilinder mirror
  • 4 for bathroom
rmax - effect radius. If 0, the whole image is processed
Koeff - only for swirle
Author:
Arkadiy Olovyannikov ark(at)msun(dot)ru

bool CxImage::Crop ( const RECT &  rect,
CxImage iDst = NULL 
) [inherited]

bool CxImage::Crop ( long  left,
long  top,
long  right,
long  bottom,
CxImage iDst = NULL 
) [inherited]

bool CxImage::CropRotatedRectangle ( long  topx,
long  topy,
long  width,
long  height,
float  angle,
CxImage iDst = NULL 
) [inherited]

CropRotatedRectangle

Parameters:
topx,topy : topmost and leftmost point of the rectangle (topmost, and if there are 2 topmost points, the left one)
width : size of the right hand side of rect, from (topx,topy) roundwalking clockwise
height : size of the left hand side of rect, from (topx,topy) roundwalking clockwise
angle : angle of the right hand side of rect, from (topx,topy)
iDst : pointer to destination image (if 0, this image is modified)
Author:
[VATI]

bool CxImage::DecreaseBpp ( DWORD  nbit,
bool  errordiffusion,
RGBQUAD *  ppal = 0,
DWORD  clrimportant = 0 
) [inherited]

Reduces the number of bits per pixel to nbit (1, 4 or 8). ppal points to a valid palette for the final image; if not supplied the function will use a standard palette. ppal is not necessary for reduction to 1 bpp.

bool CxImage::Dither ( long  method = 0  )  [inherited]

Converts the image to B&W using the desired method :

bool CxImage::Expand ( long  newx,
long  newy,
RGBQUAD  canvascolor,
CxImage iDst = 0 
) [inherited]

bool CxImage::Expand ( long  left,
long  top,
long  right,
long  bottom,
RGBQUAD  canvascolor,
CxImage iDst = 0 
) [inherited]

Expands the borders.

Parameters:
left,top,right,bottom = additional dimensions, should be greater than 0.
canvascolor = border color. canvascolor.rgbReserved will set the alpha channel (if any) in the border.
iDst = pointer to destination image (if it's 0, this image is modified)
Returns:
true if everything is ok
Author:
[Colin Urquhart]; changes [DP]

bool CxImage::IncreaseBpp ( DWORD  nbit  )  [inherited]

Increases the number of bits per pixel of the image.

Parameters:
nbit,: 4, 8, 24

bool CxImage::QIShrink ( long  newx,
long  newy,
CxImage *const   iDst = NULL,
bool  bChangeBpp = false 
) [inherited]

Faster way to almost properly shrink image. Algorithm produces results comparable with "high resoultion shrink" when resulting image is much smaller (that would be 3 times or more) than original. When resulting image is only slightly smaller, results are closer to nearest pixel. This algorithm works by averaging, but it does not calculate fractions of pixels. It adds whole source pixels to the best destionation. It is not geometrically "correct". It's main advantage over "high" resulution shrink is speed, so it's useful, when speed is most important (preview thumbnails, "map" view, ...). Method is optimized for RGB24 images.

Parameters:
newx,newy - size of destination image (must be smaller than original!)
iDst - pointer to destination image (if it's 0, this image is modified)
bChangeBpp - flag points to change result image bpp (if it's true, this result image bpp = 24 (useful for B/W image thumbnails))
Returns:
true if everything is ok
Author:
[bd], 9.2004; changes [Artiom Mirolubov], 1.2005

bool CxImage::RedEyeRemove ( float  strength = 0.8f  )  [inherited]

Use the RedEyeRemove function to remove the red-eye effect that frequently occurs in photographs of humans and animals. You must select the region where the function will filter the red channel.

Parameters:
strength,: range from 0.0f (no effect) to 1.0f (full effect). Default = 0.8
Returns:
true if everything is ok

bool CxImage::Resample ( long  newx,
long  newy,
int  mode = 1,
CxImage iDst = NULL 
) [inherited]

Resizes the image. mode can be 0 for slow (bilinear) method , 1 for fast (nearest pixel) method, or 2 for accurate (bicubic spline interpolation) method. The function is faster with 24 and 1 bpp images, slow for 4 bpp images and slowest for 8 bpp images.

bool CxImage::Resample2 ( long  newx,
long  newy,
InterpolationMethod const   inMethod = IM_BICUBIC2,
OverflowMethod const   ofMethod = OM_REPEAT,
CxImage *const   iDst = NULL,
bool const   disableAveraging = false 
) [inherited]

New simpler resample. Adds new interpolation methods and simplifies code (using GetPixelColorInterpolated and GetAreaColorInterpolated). It also (unlike old method) interpolates alpha layer.

Parameters:
newx,newy - size of resampled image
inMethod - interpolation method to use (see comments at GetPixelColorInterpolated) If image size is being reduced, averaging is used instead (or simultaneously with) inMethod.
ofMethod - what to replace outside pixels by (only significant for bordering pixels of enlarged image)
iDst - pointer to destination CxImage or NULL.
disableAveraging - force no averaging when shrinking images (Produces aliasing. You probably just want to leave this off...)
Author:
***bd*** 2.2004

bool CxImage::Rotate ( float  angle,
CxImage iDst = NULL 
) [inherited]

bool CxImage::Rotate180 ( CxImage iDst = NULL  )  [inherited]

bool CxImage::Rotate2 ( float  angle,
CxImage iDst = NULL,
InterpolationMethod  inMethod = IM_BILINEAR,
OverflowMethod  ofMethod = OM_BACKGROUND,
RGBQUAD *  replColor = 0,
bool const   optimizeRightAngles = true,
bool const   bKeepOriginalSize = false 
) [inherited]

Rotates image around it's center. Method can use interpolation with paletted images, but does not change pallete, so results vary. (If you have only four colours in a palette, there's not much room for interpolation.)

Parameters:
angle - angle in degrees (positive values rotate clockwise)
*iDst - destination image (if null, this image is changed)
inMethod - interpolation method used (IM_NEAREST_NEIGHBOUR produces aliasing (fast), IM_BILINEAR softens picture a bit (slower) IM_SHARPBICUBIC is slower and produces some halos...)
ofMethod - overflow method (how to choose colour of pixels that have no source)
replColor - replacement colour to use (OM_COLOR, OM_BACKGROUND with no background colour...)
optimizeRightAngles - call faster methods for 90, 180, and 270 degree rotations. Faster methods are called for angles, where error (in location of corner pixels) is less than 0.25 pixels.
bKeepOriginalSize - rotates the image without resizing.
Author:
***bd*** 2.2004

bool CxImage::Skew ( float  xgain,
float  ygain,
long  xpivot = 0,
long  ypivot = 0,
bool  bEnableInterpolation = false 
) [inherited]

Parameters:
xgain,ygain : can be from 0 to 1.
xpivot,ypivot : is the center of the transformation.
bEnableInterpolation : if true, enables bilinear interpolation.
Returns:
true if everything is ok

bool CxImage::Thumbnail ( long  newx,
long  newy,
RGBQUAD  canvascolor,
CxImage iDst = 0 
) [inherited]

Resamples the image with the correct aspect ratio, and fills the borders.

Parameters:
newx,newy = thumbnail size.
canvascolor = border color.
iDst = pointer to destination image (if it's 0, this image is modified).
Returns:
true if everything is ok.
Author:
[Colin Urquhart]


Generated on Thu Jan 31 20:11:32 2008 for CxImage by  doxygen 1.5.4