Functions

Image Resize
[Image Processing]

Collaboration diagram for Image Resize:

Functions

int imProcessReduce (const imImage *src_image, imImage *dst_image, int order)
int imProcessResize (const imImage *src_image, imImage *dst_image, int order)
int imProcessReduceBy4 (const imImage *src_image, imImage *dst_image)
int imProcessCrop (const imImage *src_image, imImage *dst_image, int xmin, int ymin)
int imProcessInsert (const imImage *src_image, const imImage *region_image, imImage *dst_image, int xmin, int ymin)
int imProcessAddMargins (const imImage *src_image, imImage *dst_image, int xmin, int ymin)

Detailed Description

Operations to change the image size.
All size operations include the alpha channel if any.
See im_process_loc.h

Function Documentation

int imProcessReduce ( const imImage src_image,
imImage dst_image,
int  order 
)

Only reduze the image size using the given decimation order.
Supported decimation orders:

  • 0 - zero order (mean) [default in Lua for MAP and BINARY]
  • 1 - first order (bilinear decimation) [default in Lua] Images must be of the same type. If image type is IM_MAP or IM_BINARY, must use order=0.
    Returns zero if the counter aborted.
im.ProcessReduce(src_image: imImage, dst_image: imImage, order: number) -> counter: boolean [in Lua 5] 
im.ProcessReduceNew(image: imImage, width, height[, order]: number) -> counter: boolean, new_image: imImage [in Lua 5] 
int imProcessResize ( const imImage src_image,
imImage dst_image,
int  order 
)

Change the image size using the given interpolation order.
Supported interpolation orders:

  • 0 - zero order (near neighborhood) [default in Lua for MAP and BINARY]
  • 1 - first order (bilinear interpolation) [default in Lua]
  • 3 - third order (bicubic interpolation) Images must be of the same type. If image type is IM_MAP or IM_BINARY, must use order=0.
    Returns zero if the counter aborted.
im.ProcessResize(src_image: imImage, dst_image: imImage, order: number) -> counter: boolean [in Lua 5] 
im.ProcessResizeNew(image: imImage, width, height[, order]: number) -> counter: boolean, new_image: imImage [in Lua 5] 
int imProcessReduceBy4 ( const imImage src_image,
imImage dst_image 
)

Reduze the image area by 4 (w/2,h/2).
Uses a fast average of neighbors. Images must be of the same type. Target image size must be source image width/2, height/2. Can not operate on IM_MAP nor IM_BINARY images. Returns zero if the counter aborted.

im.ProcessReduceBy4(src_image: imImage, dst_image: imImage) -> counter: boolean [in Lua 5] 
im.ProcessReduceBy4New(image: imImage) -> counter: boolean, new_image: imImage [in Lua 5] 
int imProcessCrop ( const imImage src_image,
imImage dst_image,
int  xmin,
int  ymin 
)

Extract a rectangular region from an image.
Images must be of the same type. Target image size must be smaller than source image width-xmin, height-ymin.
ymin and xmin must be >0 and <size. Returns zero if the counter aborted.

im.ProcessCrop(src_image: imImage, dst_image: imImage, xmin: number, ymin: number) -> counter: boolean [in Lua 5] 
im.ProcessCropNew(image: imImage, xmin, xmax, ymin, ymax: number) -> counter: boolean, new_image: imImage [in Lua 5] 
int imProcessInsert ( const imImage src_image,
const imImage region_image,
imImage dst_image,
int  xmin,
int  ymin 
)

Insert a rectangular region in an image.
Images must be of the same type. Region image size can be larger than source image.
ymin and xmin must be >0 and <size.
Source and target must be of the same size. Can be done in-place. Returns zero if the counter aborted.

im.ProcessInsert(src_image: imImage, region_image: imImage, dst_image: imImage, xmin: number, ymin: number) -> counter: boolean [in Lua 5] 
im.ProcessInsertNew(image: imImage, region_image: imImage, xmin: number, ymin: number) -> counter: boolean, new_image: imImage [in Lua 5] 
int imProcessAddMargins ( const imImage src_image,
imImage dst_image,
int  xmin,
int  ymin 
)

Increase the image size by adding pixels with zero value.
Images must be of the same type. Target image size must be greatter or equal than source image width+xmin, height+ymin. Returns zero if the counter aborted.

im.ProcessAddMargins(src_image: imImage, dst_image: imImage, xmin: number, ymin: number) -> counter: boolean [in Lua 5] 
im.ProcessAddMarginsNew(image: imImage, xmin, xmax, ymin, ymax: number) -> counter: boolean, new_image: imImage [in Lua 5]