Enumerations | |
enum | CxImage::InterpolationMethod { CxImage::IM_NEAREST_NEIGHBOUR = 1, CxImage::IM_BILINEAR = 2, CxImage::IM_BSPLINE = 3, CxImage::IM_BICUBIC = 4, CxImage::IM_BICUBIC2 = 5, CxImage::IM_LANCZOS = 6, CxImage::IM_BOX = 7, CxImage::IM_HERMITE = 8, CxImage::IM_HAMMING = 9, CxImage::IM_SINC = 10, CxImage::IM_BLACKMAN = 11, CxImage::IM_BESSEL = 12, CxImage::IM_GAUSSIAN = 13, CxImage::IM_QUADRATIC = 14, CxImage::IM_MITCHELL = 15, CxImage::IM_CATROM = 16 } |
enum | CxImage::OverflowMethod { CxImage::OM_COLOR = 1, CxImage::OM_BACKGROUND = 2, CxImage::OM_TRANSPARENT = 3, CxImage::OM_WRAP = 4, CxImage::OM_REPEAT = 5, CxImage::OM_MIRROR = 6 } |
Functions | |
RGBQUAD | CxImage::GetAreaColorInterpolated (float const xc, float const yc, float const w, float const h, InterpolationMethod const inMethod, OverflowMethod const ofMethod=OM_BACKGROUND, RGBQUAD *const rplColor=0) |
RGBQUAD | CxImage::GetPixelColorInterpolated (float x, float y, InterpolationMethod const inMethod=IM_BILINEAR, OverflowMethod const ofMethod=OM_BACKGROUND, RGBQUAD *const rplColor=0) |
RGBQUAD | CxImage::GetPixelColorWithOverflow (long x, long y, OverflowMethod const ofMethod=OM_BACKGROUND, RGBQUAD *const rplColor=0) |
void | CxImage::OverflowCoordinates (long &x, long &y, OverflowMethod const ofMethod) |
void | CxImage::OverflowCoordinates (float &x, float &y, OverflowMethod const ofMethod) |
|
|
|
|
|
This method is similar to GetPixelColorInterpolated, but this method also properly handles subsampling. If you need to sample original image with interval of more than 1 pixel (as when shrinking an image), you should use this method instead of GetPixelColorInterpolated or aliasing will occur. When area width and height are both less than pixel, this method gets pixel color by interpolating color of frame center with selected (inMethod) interpolation by calling GetPixelColorInterpolated. If width and height are more than 1, method calculates color by averaging color of pixels within area. Interpolation method is not used in this case. Pixel color is interpolated by averaging instead. If only one of both is more than 1, method uses combination of interpolation and averaging. Chosen interpolation method is used, but since it is averaged later on, there is little difference between IM_BILINEAR (perhaps best for this case) and better methods. IM_NEAREST_NEIGHBOUR again leads to aliasing artifacts. This method is a bit slower than GetPixelColorInterpolated and when aliasing is not a problem, you should simply use the later.
|
|
This method reconstructs image according to chosen interpolation method and then returns pixel (x,y). (x,y) can lie between actual image pixels. If (x,y) lies outside of image, method returns value according to overflow method. This method is very useful for geometrical image transformations, where destination pixel can often assume color value lying between source pixels.
|
|
Method return pixel color. Different methods are implemented for out of bounds pixels. If an image has alpha channel, alpha value is returned in .RGBReserved.
|
|
Recalculates coordinates according to specified overflow method. If pixel (x,y) lies within image, nothing changes.
|
|
See OverflowCoordinates for integer version
|