Crate lapix

source ·
Expand description

Backend library for Tarsila. This crate is the core of an image editor focused on pixel art and spritesheets, whereas tarsila is the GUI frontend of this editor. Other GUIs can be created reusing this crate for all the actual image manipulation. Note that the focus of this crate is not to be an image manipulation library (for that we leverage other crates such as image), but a fully-functional editor core that keeps track of things like layers, canvasses, and is capable of processing events of an image editor, such as creating or changing a layer, drawing a line, etc.

Re-exports§

Modules§

  • Basic types for colors
  • Functions to calculate graphics like lines, rectangles, etc. in a discrete 2D space
  • Basic types for numbers, points, rectangles, etc.

Structs§

  • The canvas is the area where drawing can take place. Each layer has a canvas, and the canvas in turn holds an image internally to represent the drawing on it.
  • Represents an image that is not in any Canvas, but floats freely on the screen until it is anchored back into the canvas. Typical uses of this are imported images and selections – they can be moved around and manipulated before being integrated into the canvas (by anchoring).
  • Represents a layer of the canvas. Layers are stacked on top of each other to make a final image, blending colors with transparency. Layers can be moved up or down relative to each other, can be made invisible or have a level of transparency (opacity).
  • An ordered collection of Layers. There is always one active layer.
  • Holds a function that takes a path as input and outputs the bytes of the project file found at that path.
  • Holds a function that takes a path and a set of bytes as input as saves those bytes as a project file at that path
  • The state of the image editor’s core. Most importantly, this contains all the layers and images that are being drawn. This state can be modified externally mainly by sending Events via the execute method.

Enums§

  • Effects that certain actions can have on the canvas
  • Represents an event. This is one of the key types of this crate. The main way the State of the drawing project can be modified is by sending events to it.
  • Represents a selection
  • Drawing and manipulation tools available in the image editor

Traits§

  • Represents a 2D matrix of pixels (an image)

Type Aliases§