Add pixman-combine-float.c
authorSøren Sandmann Pedersen <ssp@redhat.com>
Fri, 14 May 2010 04:42:04 +0000 (00:42 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Mon, 1 Oct 2012 16:56:09 +0000 (12:56 -0400)
commita5b459114e35c7a946362f1e5857e8a87a403ec3
tree7383baa408cb4cc420351f4468785a772935a60d
parent7a9c2d586b2349b5e17966a96d7fe8c390abb75a
Add pixman-combine-float.c

This file contains floating point implementations of combiners for all
pixman operators. These combiners operate on buffers containing single
precision floating point pixels stored in (a, r, g, b) order.

The combiners are added to the pixman_implementation_t struct, but
nothing uses them yet.

This commit incorporates a number of bug fixes contributed by Andrea
Canciani.

Some notes:

- The combiners are making sure to never divide by zero regardless of
  input, so an application could enable divide-by-zero exceptions and
  pixman wouldn't generate any.

- The operators are implemented according to the Render spec. Ie.,

    - If the input pixels are between 0 and 1, then so is the output.

    - The source and destination coefficients for the conjoint and
      disjoint operators are clamped to [0, 1].

- The PDF operators are not described in the render spec, and the
  implementation here doesn't do any clamping except in the final
  conversion from floating point to destination format.

All of the above will need to be rethought if we add support for pixel
formats that can support negative and greater-than-one pixels. It is
in fact already the case in principle that convolution filters can
produce pixels with negative values, but since these go through the
broken "wide" path that narrows everything to 32 bits, these negative
values don't currently survive to the combiners.
pixman/Makefile.sources
pixman/pixman-combine-float.c [new file with mode: 0644]
pixman/pixman-general.c
pixman/pixman-private.h