![]() |
Colors and geometric helpers | ![]() |
Several low level libraries in
src/src/Graphics/
are shared by the typesetter, the renderers, the picture effects and the graphics editor:
the color library (
Graphics/Colors/
), which packs colors into 32 bit words, resolves color names from several dictionaries, implements the reverse (dark) display mode and provides floating point colors for image processing;
the geometric types (Graphics/Types/): points, frames (coordinate transformations), curves and grids, together with the numerical routines for splines, closest points and intersections;
a small generic algebra library (
Graphics/Mathematics/
) with matrices, vectors, polynomials and a few experimental classes;
the experimental three dimensional objects (
Graphics/Spacial/
) behind the object-3d family of tags.
This chapter describes the data structures and their numerical conventions. How the graphics editor and the typesetter of graphics use frames and grids is explained in the graphics editor: typesetting; how colors end up on the screen or in a PDF file is explained in the renderer interface; and the picture effects, which use the floating point colors of this chapter, are described in raster pictures and effects.
markup converted by result used by
"red", "#ff000080" named_color color pencils, renderers
(implicit) true_color effects, 3D light
(point "1" "2") as_point point curves, frames
gr-frame update_frame frame curve images
(spline …) typeset_spline curve curve_box, snapping
gr-grid as_grid grid grid_box, snapping
(object-3d …) as_spacial spacial spacial_box |
All these types follow the usual TeXmacs conventions (see basic data types): point is a plain array<double>, matrix and polynomial are concrete reference counted structures, and frame, curve, grid and spacial are abstract handles whose concrete classes are hidden in the .cpp files and created by constructor functions such as scaling, spline or cartesian.
Graphics/Colors/colors.hpp,
colors.cpp
The color word: rgb_color, get_rgb_color, cmyk_color, xpm_color, named_color, get_hex_color, blend_colors, reverse, the global flags true_colors and reverse_colors.
tm_colors.hpp,
x11_colors.hpp,
svg_colors.hpp,
xc_colors.hpp,
dvips_colors.hpp
The five color dictionaries, as static tables included only by
colors.cpp
.
Graphics/Colors/true_color.hpp,
true_color.cpp
Floating point RGBA colors with arithmetic, alpha composition and color transformations.
Graphics/Types/point.hpp,
point.cpp
Points, axes and elementary plane geometry.
Graphics/Types/frame.hpp,
frame.cpp
Frames: invertible coordinate transformations.
Graphics/Types/curve.hpp,
curve.cpp,
curve_extras.cpp
Parameterized curves, rectification, closest points and intersections; polyline simplification, Bezier fitting and calligraphic strokes.
Graphics/Types/equations.hpp,
equations.cpp
Tridiagonal solvers used for interpolating splines.
Graphics/Types/grid.hpp,
grid.cpp
Grids (cartesian, polar, logarithmic).
Graphics/Types/math_util.hpp
Numerical constants and helpers (tm_infinity, tm_PI, square, fnull, …).
Graphics/Mathematics/
Generic templates:
matrix.hpp
,
vector.hpp
,
polynomial.hpp
,
ball.hpp
,
function.hpp
,
function_extra.hpp
, the operator and property traits
operators.hpp
and
properties.hpp
, symbolic trees
math_tree.hpp
, and the self test
test_math.cpp
.
Graphics/Spacial/
Triangulated three dimensional objects, their transformations and lighting.