---
name: "transform"
section: "3caca"
platform: "linux"
package: "libcucul-dev"
version: "0.99.beta11.debian-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/transform/3caca"
---

# transform(3caca)

## NAME

libcucul canvas transformation -

### Functions

int **cucul\_invert** (**cucul\_canvas\_t** \*)\
 *Invert a canvas' colours.*  int **cucul\_flip** (**cucul\_canvas\_t** \*)\
 *Flip a canvas horizontally.*  int **cucul\_flop** (**cucul\_canvas\_t** \*)\
 *Flip a canvas vertically.*  int **cucul\_rotate** (**cucul\_canvas\_t** \*)\
 *Rotate a canvas.*

## Detailed Description

These functions perform horizontal and vertical canvas flipping.

## Function Documentation

### int cucul\_invert (cucul\_canvas\_t \* cv)

Invert a canvas' colours (black becomes white, red becomes cyan, etc.) without changing the characters in it.

This function never fails.

**Parameters:**

*cv* The canvas to invert.

**Returns:**

This function always returns 0.

### int cucul\_flip (cucul\_canvas\_t \* cv)

Flip a canvas horizontally, choosing characters that look like the mirrored version wherever possible. Some characters will stay unchanged by the process, but the operation is guaranteed to be involutive: performing it again gives back the original canvas.

This function never fails.

**Parameters:**

*cv* The canvas to flip.

**Returns:**

This function always returns 0.

### int cucul\_flop (cucul\_canvas\_t \* cv)

Flip a canvas vertically, choosing characters that look like the mirrored version wherever possible. Some characters will stay unchanged by the process, but the operation is guaranteed to be involutive: performing it again gives back the original canvas.

This function never fails.

**Parameters:**

*cv* The canvas to flop.

**Returns:**

This function always returns 0.

### int cucul\_rotate (cucul\_canvas\_t \* cv)

Apply a 180-degree transformation to a canvas, choosing characters that look like the upside-down version wherever possible. Some characters will stay unchanged by the process, but the operation is guaranteed to be involutive: performing it again gives back the original canvas.

This function never fails.

**Parameters:**

*cv* The canvas to rotate.

**Returns:**

This function always returns 0.
