GNU TeXmacsUser manualReferenceAboutEnglish
Colors and geometric helpers

1.Introduction

Several low level libraries in

src/src/Graphics/

are shared by the typesetter, the renderers, the picture effects and the graphics editor:

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.

2.Overview

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.

3.Source files

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.

4.Contents of this chapter

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".