rigImage 0.1.0
RigKit pack API - rigImage
Loading...
Searching...
No Matches
RasterPaint.h File Reference

CPU brush dabs into a Raster - the pixel half of an editor Brush tool. More...

#include <glm/glm.hpp>
#include "Raster.h"
Include dependency graph for RasterPaint.h:

Functions

int rig::image::paintDab (pixel::Raster &raster, const glm::vec2 &center, float radiusPx, const glm::vec4 &rgba)
 Stamp one soft round dab, alpha-blended over the pixels.
int rig::image::paintStroke (pixel::Raster &raster, const glm::vec2 &from, const glm::vec2 &to, float radiusPx, const glm::vec4 &rgba)
 Stamp dabs along a segment so a drag reads as one stroke.

Detailed Description

CPU brush dabs into a Raster - the pixel half of an editor Brush tool.

Pure pixel writes, no GL and no UI. The caller owns the raster, re-uploads the texture, and persists the file.

Function Documentation

◆ paintDab()

int rig::image::paintDab ( pixel::Raster & raster,
const glm::vec2 & center,
float radiusPx,
const glm::vec4 & rgba )

Stamp one soft round dab, alpha-blended over the pixels.

Parameters
centerDab centre in raster pixels.
radiusPxDab radius in pixels (>= 0.5 to mark anything).
rgbaBrush colour; a scales dab opacity.
Returns
Pixels touched. 0 when the dab misses the raster.

◆ paintStroke()

int rig::image::paintStroke ( pixel::Raster & raster,
const glm::vec2 & from,
const glm::vec2 & to,
float radiusPx,
const glm::vec4 & rgba )

Stamp dabs along a segment so a drag reads as one stroke.

Dab spacing is a quarter radius - close enough that round caps fuse into a band. Endpoints included.

Returns
Pixels touched over all dabs.