move arith_dispatch to deprecated
This commit is contained in:
parent
713ecf8252
commit
97d1431abe
@ -1,7 +1,6 @@
|
|||||||
noinst_LTLIBRARIES = libarithmetic.la
|
noinst_LTLIBRARIES = libarithmetic.la
|
||||||
|
|
||||||
libarithmetic_la_SOURCES = \
|
libarithmetic_la_SOURCES = \
|
||||||
arith_dispatch.c \
|
|
||||||
abs.c \
|
abs.c \
|
||||||
complex.c \
|
complex.c \
|
||||||
im_cross_phase.c \
|
im_cross_phase.c \
|
||||||
|
@ -53,6 +53,200 @@
|
|||||||
|
|
||||||
#include "arithmetic.h"
|
#include "arithmetic.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION: arithmetic
|
||||||
|
* @short_description: operations which perform pixel arithmetic, trig, log, statistics
|
||||||
|
* @see_also: <link linkend="libvips-boolean">boolean</link>
|
||||||
|
* @stability: Stable
|
||||||
|
* @include: vips/vips.h
|
||||||
|
*
|
||||||
|
* These operations perform pixel arithmetic, that is, they perform an
|
||||||
|
* arithmetic operation, such as addition, on every pixel in an image or a
|
||||||
|
* pair of images. All (except in a few cases noted below) will work with
|
||||||
|
* images of any type or any mixture of types, of any size and of any number
|
||||||
|
* of bands.
|
||||||
|
*
|
||||||
|
* For binary operations, if the number of bands differs, one of the images
|
||||||
|
* must have one band. In this case, an n-band image is formed from the
|
||||||
|
* one-band image by joining n copies of the one-band image together, and then
|
||||||
|
* the two n-band images are operated upon.
|
||||||
|
*
|
||||||
|
* In the same way, for operations that take an array constant, such as
|
||||||
|
* vips_remainder_const(), you can mix single-element arrays or single-band
|
||||||
|
* images freely.
|
||||||
|
*
|
||||||
|
* Arithmetic operations try to preserve precision by increasing the number of
|
||||||
|
* bits in the output image when necessary. Generally, this follows the ANSI C
|
||||||
|
* conventions for type promotion, so multiplying two
|
||||||
|
* #VIPS_FORMAT_UCHAR images together, for example, produces a
|
||||||
|
* #VIPS_FORMAT_USHORT image, and taking the im_costra() of a
|
||||||
|
* #VIPS_FORMAT_USHORT image produces #VIPS_FORMAT_FLOAT image.
|
||||||
|
*
|
||||||
|
* For binary arithmetic operations, type promotion occurs in two stages.
|
||||||
|
* First, the two input images are cast up to the smallest common format,
|
||||||
|
* that is, the type with the smallest range that can represent the full
|
||||||
|
* range of both inputs. This conversion can be represented as a table:
|
||||||
|
*
|
||||||
|
* <table>
|
||||||
|
* <title>Smallest common format</title>
|
||||||
|
* <tgroup cols='10' align='left' colsep='1' rowsep='1'>
|
||||||
|
* <thead>
|
||||||
|
* <row>
|
||||||
|
* <entry>@in2/@in1</entry>
|
||||||
|
* <entry>uchar</entry>
|
||||||
|
* <entry>char</entry>
|
||||||
|
* <entry>ushort</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>uint</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* </thead>
|
||||||
|
* <tbody>
|
||||||
|
* <row>
|
||||||
|
* <entry>uchar</entry>
|
||||||
|
* <entry>ushort</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>ushort</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>uint</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>char</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>ushort</entry>
|
||||||
|
* <entry>ushort</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>ushort</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>uint</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>short</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>uint</entry>
|
||||||
|
* <entry>uint</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>uint</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>uint</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>int</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>float</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* <row>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* <entry>double complex</entry>
|
||||||
|
* </row>
|
||||||
|
* </tbody>
|
||||||
|
* </tgroup>
|
||||||
|
* </table>
|
||||||
|
*
|
||||||
|
* In the second stage, the operation is performed between the two identical
|
||||||
|
* types to form the output. The details vary between operations, but
|
||||||
|
* generally the principle is that the output type should be large enough to
|
||||||
|
* represent the whole range of possible values, except that int never becomes
|
||||||
|
* float.
|
||||||
|
*/
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE( VipsArithmetic, vips_arithmetic, VIPS_TYPE_OPERATION );
|
G_DEFINE_ABSTRACT_TYPE( VipsArithmetic, vips_arithmetic, VIPS_TYPE_OPERATION );
|
||||||
|
|
||||||
/* Save a bit of typing.
|
/* Save a bit of typing.
|
||||||
|
@ -5,6 +5,7 @@ libdeprecated_la_SOURCES = \
|
|||||||
im_lab_morph.c \
|
im_lab_morph.c \
|
||||||
deprecated_dispatch.c \
|
deprecated_dispatch.c \
|
||||||
colour_dispatch.c \
|
colour_dispatch.c \
|
||||||
|
arith_dispatch.c \
|
||||||
wrapvips7.c \
|
wrapvips7.c \
|
||||||
lazy.c \
|
lazy.c \
|
||||||
im_dif_std.c \
|
im_dif_std.c \
|
||||||
|
@ -38,200 +38,6 @@
|
|||||||
|
|
||||||
#include <vips/vips.h>
|
#include <vips/vips.h>
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION: arithmetic
|
|
||||||
* @short_description: operations which perform pixel arithmetic, trig, log, statistics
|
|
||||||
* @see_also: <link linkend="libvips-boolean">boolean</link>
|
|
||||||
* @stability: Stable
|
|
||||||
* @include: vips/vips.h
|
|
||||||
*
|
|
||||||
* These operations perform pixel arithmetic, that is, they perform an
|
|
||||||
* arithmetic operation, such as addition, on every pixel in an image or a
|
|
||||||
* pair of images. All (except in a few cases noted below) will work with
|
|
||||||
* images of any type or any mixture of types, of any size and of any number
|
|
||||||
* of bands.
|
|
||||||
*
|
|
||||||
* For binary operations, if the number of bands differs, one of the images
|
|
||||||
* must have one band. In this case, an n-band image is formed from the
|
|
||||||
* one-band image by joining n copies of the one-band image together, and then
|
|
||||||
* the two n-band images are operated upon.
|
|
||||||
*
|
|
||||||
* In the same way, for operations that take an array constant, such as
|
|
||||||
* im_remainder_vec(), you can mix single-element arrays or single-band
|
|
||||||
* images freely.
|
|
||||||
*
|
|
||||||
* Arithmetic operations try to preserve precision by increasing the number of
|
|
||||||
* bits in the output image when necessary. Generally, this follows the ANSI C
|
|
||||||
* conventions for type promotion, so multiplying two
|
|
||||||
* %IM_BANDFMT_UCHAR images together, for example, produces a
|
|
||||||
* %IM_BANDFMT_USHORT image, and taking the im_costra() of a
|
|
||||||
* %IM_BANDFMT_USHORT image produces %IM_BANDFMT_FLOAT image.
|
|
||||||
*
|
|
||||||
* For binary arithmetic operations, type promotion occurs in two stages.
|
|
||||||
* First, the two input images are cast up to the smallest common format,
|
|
||||||
* that is, the type with the smallest range that can represent the full
|
|
||||||
* range of both inputs. This conversion can be represented as a table:
|
|
||||||
*
|
|
||||||
* <table>
|
|
||||||
* <title>Smallest common format</title>
|
|
||||||
* <tgroup cols='10' align='left' colsep='1' rowsep='1'>
|
|
||||||
* <thead>
|
|
||||||
* <row>
|
|
||||||
* <entry>@in2/@in1</entry>
|
|
||||||
* <entry>uchar</entry>
|
|
||||||
* <entry>char</entry>
|
|
||||||
* <entry>ushort</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>uint</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* </thead>
|
|
||||||
* <tbody>
|
|
||||||
* <row>
|
|
||||||
* <entry>uchar</entry>
|
|
||||||
* <entry>ushort</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>ushort</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>uint</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>char</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>ushort</entry>
|
|
||||||
* <entry>ushort</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>ushort</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>uint</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>short</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>uint</entry>
|
|
||||||
* <entry>uint</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>uint</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>uint</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>int</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>float</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* <entry>double complex</entry>
|
|
||||||
* </row>
|
|
||||||
* </tbody>
|
|
||||||
* </tgroup>
|
|
||||||
* </table>
|
|
||||||
*
|
|
||||||
* In the second stage, the operation is performed between the two identical
|
|
||||||
* types to form the output. The details vary between operations, but
|
|
||||||
* generally the principle is that the output type should be large enough to
|
|
||||||
* represent the whole rage of possible values, except that int never becomes
|
|
||||||
* float.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* One image in, one out.
|
/* One image in, one out.
|
||||||
*/
|
*/
|
||||||
static im_arg_desc one_in_one_out[] = {
|
static im_arg_desc one_in_one_out[] = {
|
Loading…
x
Reference in New Issue
Block a user