mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-23 15:40:46 +02:00
[script] Implement invert
Flesh out matrix inversion.
This commit is contained in:
parent
06ca0b1475
commit
c60280782d
1 changed files with 25 additions and 1 deletions
|
|
@ -3121,6 +3121,30 @@ _integer (csi_t *ctx)
|
|||
return CSI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static csi_status_t
|
||||
_invert (csi_t *ctx)
|
||||
{
|
||||
csi_object_t obj;
|
||||
csi_status_t status;
|
||||
cairo_matrix_t m;
|
||||
|
||||
check (1);
|
||||
|
||||
status = _csi_ostack_get_matrix (ctx, 0, &m);
|
||||
if (_csi_unlikely (status))
|
||||
return status;
|
||||
|
||||
cairo_matrix_invert (&m);
|
||||
|
||||
status = csi_matrix_new_from_matrix (ctx, &obj, &m);
|
||||
if (_csi_unlikely (status))
|
||||
return status;
|
||||
|
||||
pop (1);
|
||||
|
||||
return push (&obj);
|
||||
}
|
||||
|
||||
static csi_status_t
|
||||
_le (csi_t *ctx)
|
||||
{
|
||||
|
|
@ -5768,7 +5792,7 @@ _defs[] = {
|
|||
{ "image", _image },
|
||||
{ "index", _index },
|
||||
{ "integer", _integer },
|
||||
{ "invert", NULL },
|
||||
{ "invert", _invert },
|
||||
{ "in-stroke", NULL },
|
||||
{ "in-fill", NULL },
|
||||
{ "known", NULL },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue