[script] Implement invert

Flesh out matrix inversion.
This commit is contained in:
Chris Wilson 2009-08-29 09:59:36 +01:00
parent 06ca0b1475
commit c60280782d

View file

@ -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 },