/** \file
* \brief Image Processing - Pontual Operations
*
* See Copyright Notice in im_lib.h
*/
#ifndef __IM_PROCESS_PON_H
#define __IM_PROCESS_PON_H
#include "im_image.h"
#if defined(__cplusplus)
extern "C" {
#endif
/** \defgroup arithm Arithmetic Operations
* \par
* Simple math operations for images.
* \par
* See \ref im_process_pon.h
* \ingroup process */
/** Unary Arithmetic Operations. \n
* Inverse and log may lead to math exceptions.
* \ingroup arithm */
enum imUnaryOp {
IM_UN_EQL, /**< equal = a */
IM_UN_ABS, /**< abssolute = |a| */
IM_UN_LESS, /**< less = -a */
IM_UN_INV, /**< invert = 1/a (#) */
IM_UN_SQR, /**< square = a*a */
IM_UN_SQRT, /**< square root = a^(1/2) */
IM_UN_LOG, /**< natural logarithm = ln(a) (#) */
IM_UN_EXP, /**< exponential = exp(a) */
IM_UN_SIN, /**< sine = sin(a) */
IM_UN_COS, /**< cosine = cos(a) */
IM_UN_CONJ, /**< complex conjugate = ar - ai*i */
IM_UN_CPXNORM /**< complex normalization by magnitude = a / cpxmag(a) */
};
/** Apply an arithmetic unary operation. \n
* Can be done in place, images must match size. \n
* Destiny image can be several types depending on source: \n
* \li byte -> byte, ushort, int, float
* \li ushort -> byte, ushort, int, float
* \li int -> byte, ushort, int, float
* \li float -> float
* \li complex -> complex
* If destiny is byte, then the result is cropped to 0-255.
*
* \verbatim im.ProcessUnArithmeticOp(src_image: imImage, dst_image: imImage, op: number) [in Lua 5] \endverbatim
* \verbatim im.ProcessUnArithmeticOpNew(image: imImage, op: number) -> new_image: imImage [in Lua 5] \endverbatim
* \ingroup arithm */
void imProcessUnArithmeticOp(const imImage* src_image, imImage* dst_image, int op);
/** Binary Arithmetic Operations. \n
* Divide may lead to math exceptions.
* \ingroup arithm */
enum imBinaryOp {
IM_BIN_ADD, /**< add = a+b */
IM_BIN_SUB, /**< subtract = a-b */
IM_BIN_MUL, /**< multiply = a*b */
IM_BIN_DIV, /**< divide = a/b (#) */
IM_BIN_DIFF, /**< difference = |a-b| */
IM_BIN_POW, /**< power = a^b */
IM_BIN_MIN, /**< minimum = (a < b)? a: b */
IM_BIN_MAX /**< maximum = (a > b)? a: b */
};
/** Apply a binary arithmetic operation. \n
* Can be done in place, images must match size. \n
* Source images must match type, destiny image can be several types depending on source: \n
* \li byte -> byte, ushort, int, float
* \li ushort -> ushort, int, float
* \li int -> int, float
* \li float -> float
* \li complex -> complex
* One exception is that you can combine complex with float resulting complex.
* If destiny is byte, then the result is cropped to 0-255.
*
* \verbatim im.ProcessArithmeticOp(src_image1: imImage, src_image2: imImage, dst_image: imImage, op: number) [in Lua 5] \endverbatim
* \verbatim im.ProcessArithmeticOpNew(image1: imImage, image2: imImage, op: number) -> new_image: imImage [in Lua 5] \endverbatim
* The New function will create a new image of the same type of the source images.
* \ingroup arithm */
void imProcessArithmeticOp(const imImage* src_image1, const imImage* src_image2, imImage* dst_image, int op);
/** Apply a binary arithmetic operation with a constant value. \n
* Can be done in place, images must match size. \n
* Destiny image can be several types depending on source: \n
* \li byte -> byte, ushort, int, float
* \li ushort -> byte, ushort, int, float
* \li int -> byte, ushort, int, float
* \li float -> float
* \li complex -> complex
* The constant value is type casted to an apropriate type before the operation.
* If destiny is byte, then the result is cropped to 0-255.
*
* \verbatim im.ProcessArithmeticConstOp(src_image: imImage, src_const: number, dst_image: imImage, op: number) [in Lua 5] \endverbatim
* \verbatim im.ProcessArithmeticConstOpNew(image: imImage, src_const: number, op: number) -> new_image: imImage [in Lua 5] \endverbatim
* \ingroup arithm */
void imProcessArithmeticConstOp(const imImage* src_image, float src_const, imImage* dst_image, int op);
/** Blend two images using an alpha value = [a * alpha + b * (1 - alpha)]. \n
* Can be done in place, images must match size and type. \n
* alpha value must be in the interval [0.0 - 1.0].
*
* \verbatim im.ProcessBlendConst(src_image1: imImage, src_image2: imImage, dst_image: imImage, alpha: number) [in Lua 5] \endverbatim
* \verbatim im.ProcessBlendConstNew(image1: imImage, image2: imImage, alpha: number) -> new_image: imImage [in Lua 5] \endverbatim
* \ingroup arithm */
void imProcessBlendConst(const imImage* src_image1, const imImage* src_image2, imImage* dst_image, float alpha);
/** Blend two images using an alpha channel = [a * alpha + b * (1 - alpha)]. \n
* Can be done in place, images must match size and type. \n
* alpha_image must have the same data type except for complex images that must be float, and color_space must be IM_GRAY.
* integer alpha values must be:
\verbatim
0 - 255 IM_BYTE
0 - 65535 IM_USHORT
0 - 2147483647 IM_INT
\endverbatim
* that will be normalized to 0 - 1.
* \verbatim im.ProcessBlend(src_image1: imImage, src_image2: imImage, alpha_image: imImage, dst_image: imImage) [in Lua 5] \endverbatim
* \verbatim im.ProcessBlendNew(image1: imImage, image2: imImage, alpha_image: imImage) -> new_image: imImage [in Lua 5] \endverbatim
* \ingroup arithm */
void imProcessBlend(const imImage* src_image1, const imImage* src_image2, const imImage* alpha_image, imImage* dst_image);
/** Compose two images that have an alpha channel using the OVER operator. \n
* Can be done in place, images must match size and type. \n
* Integer alpha values must be:
\verbatim
0 - 255 IM_BYTE
0 - 65535 IM_USHORT
0 - 2147483647 IM_INT
\endverbatim
* that will be normalized to 0 - 1.
* \verbatim im.ProcessCompose(src_image1: imImage, src_image2: imImage, dst_image: imImage) [in Lua 5] \endverbatim
* \verbatim im.ProcessComposeNew(image1: imImage, image2: imImage) -> new_image: imImage [in Lua 5] \endverbatim
* \ingroup arithm */
void imProcessCompose(const imImage* src_image1, const imImage* src_image2, imImage* dst_image);
/** Split a complex image into two images with real and imaginary parts \n
* or magnitude and phase parts (polar). \n
* Source image must be IM_CFLOAT, destiny images must be IM_FLOAT.
*
* \verbatim im.ProcessSplitComplex(src_image: imImage, dst_image1: imImage, dst_image2: imImage, polar: boolean) [in Lua 5] \endverbatim
* \verbatim im.ProcessSplitComplexNew(image: imImage, polar: boolean) -> dst_image1: imImage, dst_image2: imImage [in Lua 5] \endverbatim
* \ingroup arithm */
void imProcessSplitComplex(const imImage* src_image, imImage* dst_image1, imImage* dst_image2, int polar);
/** Merges two images as the real and imaginary parts of a complex image, \n
* or as magnitude and phase parts (polar = 1). \n
* Source images must be IM_FLOAT, destiny image must be IM_CFLOAT.
*
* \verbatim im.ProcessMergeComplex(src_image1: imImage, src_image2: imImage, dst_image: imImage, polar: boolean) [in Lua 5] \endverbatim
* \verbatim im.ProcessMergeComplexNew(image1: imImage, image2: imImage, polar: boolean) -> new_image: imImage [in Lua 5] \endverbatim
* \ingroup arithm */
void imProcessMergeComplex(const imImage* src_image1, const imImage* src_image2, imImage* dst_image, int polar);
/** Calculates the mean of multiple images. \n
* Images must match size and type.
*
* \verbatim im.ProcessMultipleMean(src_image_list: table of imImage, dst_image: imImage) [in Lua 5] \endverbatim
* \verbatim im.ProcessMultipleMeanNew(src_image_list: table of imImage) -> new_image: imImage [in Lua
很不错的开源图像处理库IM tools
需积分: 13 158 浏览量
2010-06-24
10:45:36
上传
评论
收藏 871KB ZIP 举报
lclhurricane
- 粉丝: 13
- 资源: 12
最新资源
- 1040g0cg310ravpiu6ibg5pg00tsipsln3ju2d0g 2
- 基于Python的SAR图像去噪CNN-NLM设计源码
- redhat6升级到redhat7,过程redhat6.x-> redhat6.10->rehat7.9 主版本最高版本
- 基于Django的流程引擎设计源码
- 基于Node.js的Express框架与MySQL的后台管理系统设计源码
- 基于Java的Flink流批一体数据处理快速集成开发框架设计源码
- FirstFilterOrderCompare
- Screenshot_2024-03-28-19-17-25-020_com.ss.android.lark.jpg
- 基于Java的车辆违章信息查询系统设计源码
- wqeAFSDADWDAESD
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈