:: [Frei0r] 5 Cairo based plugins, Cai…
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Janne Liljeblad
Fecha:  
A: Minimalistic plugin API for video effects
Asunto: [Frei0r] 5 Cairo based plugins, Cairo/Frei0r compatibility and adding Cairo dependency
CAIRO - FREI0R COMPATIBILITY
Little endian:
These plugins use CAIRO_FORMAT_ARGB32 image surfaces and contexts
created from them. On Cairo documentation it says about these images:
"CAIRO_FORMAT_ARGB32 - each pixel is a 32-bit quantity, with alpha in
the upper 8 bits, then red, then green, then blue. The 32-bit
quantities are stored native-endian". The important part here is
"native-endian" which means that on LITTLE ENDIAN systems the byte
order is BGRA.

When using Cairo with Frei0r on little endian systems this is good news:
- We can draw vector images with Cairo if we simply switch values of
BLUE and RED channels when setting colors.
- When using Cairo to composite bitmap images everything works out of
the box correctly as ALPHA channel is in correct place and the
functions involved in compositing are all per channel or per pixel.

Big endian:
On big endian systems we would always need an additional full image
copy somewhere to switch channels to get Frei0r and Cairo to work
together properly. These plugins do NOT currently work correctly on
big endian systems. I believe this is acceptable as there are few / no
proven users of Frei0r on those systems.

I think for now we should:
- merge this patch series as is
- maybe make these plugins only build on little endian systems
- accept patches that make these work on big endian systems from users
of Frei0r that require such functionality


RATIONALE FOR INCLUSION OF CAIRO DEPENDENCY
Since building these plugins require adding Cairo as a build
dependency to Frei0r, I feel I should shortly justify its inclusion:
- Functionality provided by 'cairoaffineblend' is very much needed in
open video editing applications, and there is no indication of this
functionality being provided in any other fashion.
- Cairo is the 'standard' F/OSS 2D graphics library and is available everywhere.
- Cairo has close to a decade of development behind it. It is highly
optimized and stable. It's basically the best there is for this kind
of work.