izzi
SVG SUBSET C++ API
|
Namespaces | |
namespace | constants |
Classes | |
struct | area |
struct | circle_element |
struct | collection_rstate |
Collection derived states. More... | |
struct | color_qf |
struct | color_qi |
Color quantified as integral RGB components in the range [0,255]. aka like Scalar in OpenCV. More... | |
struct | color_rstate |
Render settings for collections. More... | |
struct | defs_element |
struct | desc_element |
struct | element_base |
Abstract base class for all SVG Elements. More... | |
struct | filter_element |
struct | foreign_element |
struct | gradient_element |
struct | graph_rstate |
Per-graph constants, metadata, text. More... | |
struct | group_element |
struct | id_rstate |
Named render state. Datum to take id string and tie it to visual representation. More... | |
struct | iframe_element |
iframe HTML object embedded in SVG container. NB: HTML elements video/audio/iframe/canvas can be used w/o foreignElement. This approach uses HTML wrapped in foreign element. https://www.w3.org/TR/SVG2/embedded.html#HTMLElements https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe More... | |
struct | image_element |
struct | line_element |
struct | linear_gradient |
Linear gradients https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient. More... | |
struct | link_element |
struct | marker_element |
struct | object_element |
HTML object embedded in SVG container. Unlike image_elements, object_elements are not locked down for scripting. NB: HTML elements video/audio/object/canvas can be used w/o foreignElement. This approach uses HTML wrapped in foreign element. https://www.w3.org/TR/SVG2/embedded.html#HTMLElements https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object. More... | |
struct | path_element |
struct | polyline_element |
struct | radial_gradient |
Circular gradients https://developer.mozilla.org/en-US/docs/Web/SVG/Element/radialGradient. More... | |
struct | rect_element |
struct | render_state_base |
Settings for glyph, graphic, chart, and collection object render. More... | |
struct | script_element |
class | string |
STL class. More... | |
struct | stroke_style |
Additional path/line/polyline stroke styles. More... | |
struct | style |
Datum consolidating style preferences. More... | |
struct | svg_element |
struct | text_element |
struct | text_path_element |
struct | title_element |
struct | transform |
Datum consolidating transform possibilities. https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform. More... | |
struct | typography |
struct | video_element |
video HTML object embedded in SVG container. NB: HTML elements video/audio/iframe/canvas can be used w/o foreignElement. This approach uses HTML wrapped in foreign element. https://www.w3.org/TR/SVG2/embedded.html#HTMLElements https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video More... | |
Typedefs | |
using | color_qfs = std::vector<color_qf> |
using | color_qis = std::vector<color_qi> |
Types for Color iteration and combinatorics. | |
using | colorband = std::tuple<color, ushort> |
Specific regions of spectrum as bands of color. Each band has a starting hue and a number of known good samples. This is then used to seed a generator that computes more of similar hues. | |
using | id_rstate_umap = std::unordered_map<string, id_rstate> |
using | id_value_umap = std::unordered_map<string, value_type> |
Hash multimap of unique value to (perhaps multiple) unique ids. Use this form for sorting by value. | |
using | jsonstream = rj::PrettyWriter<rj::StringBuffer> |
Aliases/using. | |
template<typename T, std::size_t N> | |
using | palette = std::array<T, N> |
Palette, finite set of colors used. Must end with color::none. | |
template<std::size_t N> | |
using | palette_qf = palette<color_qf, N> |
template<std::size_t N> | |
using | palette_qi = palette<color_qi, N> |
using | point_2t = std::tuple<space_type, space_type> |
Point (x,y) in 2D space. | |
using | point_2tn = std::tuple<point_2t, ssize_type> |
Point (x,y) in 2D space with weight n. | |
using | space_type = double |
Base floating point type. | |
using | srange = std::set<point_2t> |
Latitude and Longitude Ranges. | |
using | ssize_type = int |
using | strings = std::vector<string> |
using | uint = unsigned int |
using | ulong = unsigned long |
using | ushort = unsigned short |
Base integer type: positive and negative, signed integral value. | |
using | value_id_ummap = std::unordered_multimap<value_type, string> |
using | value_set = std::set<value_type> |
using | value_type = long long |
Hash map of unique id to (not necessarily) unique value. Use this for sorting by id. | |
using | vrange = std::vector<point_2t> |
using | vspace = std::vector<double> |
Split range, so one dimension of (x,y) cartesian plane. | |
using | vstrings = strings |
using | vvranges = std::vector<vrange> |
using | vvstrings = std::vector<strings> |
Functions | |
auto & | active_spectrum (const bool sortbyhuep=false) |
Oklab https://bottosson.github.io/posts/oklab/. | |
void | add_to_id_rstate_cache (const string id, const style styl, const select vis) |
Add value to cache with base style of styl, colors klr, visibility vis. | |
double | adjust_angle_at_orbit_for_distance (double r, double dist, const double minadjust=0.25) |
double | adjust_angle_rotation (const double dorig, const k::rrotation rot) |
Adjust angle above to CW/CCW orientation. | |
void | append_ids_at (svg_element &obj, const typography &typo, const strings &ids, const double angled, const point_2t origin, double r) |
Concatenate ids onto one line. | |
color_qi | average_color_qi (const color_qi &a, const color_qi &b) |
Average two colors, return the result. | |
strings | blink_to_color_seq (const rect_element::data &dr, const color klr, size_t fps, double sec, double twhen, size_t nblinks, double blinksec) |
blink sequence of duration sec, given fps starts on background (backgf) at duration twhen blinks specific frame (blinkf) times (nblinks) for seconds (blinksec) can use with image behind | |
ulong | cell_size_3x3_matrix (const area<> a, const uint n, const double margin) |
Cell size 3x3 for n items with margin spacing on either size. | |
constexpr double | char_height_to_px (const uint sz) |
Approximate pixel height of type of point size @sz. | |
constexpr double | char_width_to_px (const uint sz) |
Approximate pixel height of type of point size @sz. | |
void | clear_select (select &a, const select &b) |
color_qf::ftype | color_qf_distance (const color_qf &k1, const color_qf &k2) |
bool | color_qf_lt (const color_qf &k1, const color_qf &k2) |
Forwarding function. | |
bool | color_qf_lt_hue_v1 (const color_qf &k1, const color_qf &k2) |
Less than compare for color_qf. | |
bool | color_qf_lt_hue_v2 (const color_qf &k1, const color_qf &k2) |
bool | color_qf_lt_v (const color_qf &k1, const color_qf &k2) |
Default compare distances from k1,k2 to black. | |
color_qi | combine_color_qi (const color_qi &a, const double ad, const color_qi &b, const double bd) |
void | composite_bleed_areas (svg_element &obj, const svg::select slxt, const double bleedin, const double bleedxoffset=0) |
Composite frame on bleed. For printed objects with a center gutter, some intra-page adjustments are necessary. | |
string | convert_8859_to_utf8 (string in) |
Convert from ISO-8859-1 encoding to UTF-8, required for XML. | |
string | convert_to_utf8 (string in) |
vrange | deserialize_json_array_object_field_n (const string jdata, const string afield, const string field1, const string field2, const bool verbosep=true) |
Deserialize json array, extract specific fields from array objects, return as vec of point_2t. | |
rj::Document | deserialize_json_string_to_dom (const string &json) |
Deserialize input string. | |
rj::Document | deserialize_json_to_dom (const string input_file) |
Deserialize input file. | |
rj::Document | deserialize_json_to_dom_array (const string input_file) |
Load JSON file to in-memory DOM array. | |
rj::Document | deserialize_json_to_dom_object (const string input_file) |
Load JSON file to in-memory DOM. | |
bool | detect_collision (const point_2t &p1, const int r1, const point_2t &p2, const int r2) |
void | direction_arc_at (svg_element &obj, const point_2t origin, const double rr, svg::style s, const double spacer=10) |
Arc + arrow glyph that traces path of start to finish trajectory. | |
void | direction_arc_title_at (svg_element &obj, const point_2t origin, const int radius, const typography typo, const string title, const uint pcnt=30) |
Title on same arc. | |
svg_element | display_color_qis (const auto &klrs, const area<> a, const typography &typobase) |
Make grid palette for display. NB. | |
space_type | distance_cartesian (const point_2t &p1, const point_2t &p2) |
Find cartesian distance between two 2D points. | |
string | dot_grid_seq (const rect_element::data &drin, const color klr, const rect_element::atype radius=80, const int maxwidth=8, const int maxheight=4, const rect_element::atype xstart=40, const rect_element::atype ystart=100) |
Randomly create grid of [maxwidth] x [maxheight] grid, and fill with dots. | |
string | element_to_svg_insert (const string isvgpre) |
Import svg file, convert it to svg_element for insertion. | |
double | extract_dom_value_to_double (const rj::Value &v) |
Extract from raw JSON value to double. | |
strings | fade_from_color_seq (const rect_element::data &dr, const color klr, size_t fps=30, double sec=1.0, double minopac=0) |
Start rectangle as transparent, fade to color. | |
strings | fade_to_color_seq (const rect_element::data &dr, const color klr, size_t fps=30, double sec=1.0, double maxopac=1.0) |
string | file_to_svg_insert (const string ifile) |
Import svg file, convert it to svg_element for insertion. ifile is a plain SVG file with a 1:1 aspect ratio. | |
vrange | find_vrange_change_points (const vrange &vr) |
Simplify sorted vrange by removing interior duplicates. | |
void | flip_select (select &a, const select &b) |
double | get_angle (ssize_type pvalue, ssize_type pmax) |
Transform a value on a range to an angle on the radial range. | |
point_2t | get_circumference_point_d (const double ad, const double r, const point_2t origin) |
Angle in degrees. | |
point_2t | get_circumference_point_r (const double angler, const double r, const point_2t origin) |
Angle in radians. | |
double & | get_dpi () |
Resolution of output display device. | |
const id_rstate | get_id_rstate (const string id) |
Given identifier/name/id, get corresponding id_rstate from cache. | |
id_rstate_umap & | get_id_rstate_cache () |
ssize_type & | get_label_spaces () |
Get the label space. Value -> Name, as a string where value has labelspaces of fill NB: Should be the number of significant digits in pmax plus separators. So, 10 == 2, 100 == 3, 10k == 5 + 1. | |
int & | get_min_ring_size () |
The smallest (sattelite) radius size allowed in a kusama orbit. | |
double & | get_min_satellite_distance () |
The minimum distance between satellites in high orbit. | |
point_2t & | get_radial_range () |
color_rstate & | get_render_state () |
Global state. | |
svg_element | insert_svg_at (svg_element &obj, const string isvg, const point_2t origin, const double origsize, const double isize, const double angled=0, const style &styl=k::no_style) |
Embed svg in group element. | |
void | kusama_collision_transforms (svg_element &obj, const point_2t origin, std::vector< ssize_type > &vuvalues, vvstrings &vids, const ssize_type value_max, const int radius, const int rspace, const int rstart, const typography &typo, const bool weighbyvaluep, const ssize_type threshold=1, const int startlenm=5) |
void | kusama_ids_at_uvalue (svg_element &obj, const point_2t origin, const strings &ids, const ssize_type v, const ssize_type value_max, const int radius, const int rspace, const int rstart, const int linelen, const typography &typo, const bool weighbyvaluep) |
Layer one value's glyphs and ids. | |
int | kusama_ids_orbit_high (svg_element &obj, const point_2t origin, const strings &ids, const ssize_type v, const ssize_type value_max, const int radius, const int rspace, const int rstart, const int linelen, const typography &typo, const bool wbyvaluep, const bool satellitep=false) |
void | kusama_ids_orbit_low (svg_element &obj, const point_2t origin, const strings &ids, const ssize_type v, const ssize_type value_max, const int radius, const int rspace, const int rstart, const int linelen, const typography &typo, const bool wbyvaluep) |
svg_element | kusama_ids_per_uvalue_on_arc (svg_element &obj, const point_2t origin, const typography &typo, const id_value_umap &ivm, const ssize_type value_max, const int radius, const int rspace, const bool weighbyvaluep=true, const bool collisionp=false, const bool sortstringsbysizep=false) |
void | make_1_channel_insert (svg_element &obj, string insert1) |
void | make_2_channel_insert (svg_element &obj, string insert1, string insert2) |
circle_element | make_circle (const point_2t origin, style s, const space_type r=4, const string xform="") |
Make circle element. | |
color_qis | make_color_band (const colorband &cb, const ushort neededh) |
Forwarding function. | |
color_qis | make_color_band_v1 (const colorband &cb, const ushort neededh, auto &spectrum) |
color_qis | make_color_band_v2 (const colorband &cb, const ushort neededh) |
Algorightm is HSV generation. | |
string | make_crossed_lines (const point_2t origin, const style s, const double radius, const double tiltd=0.0) |
Crossed lines, no fill. X marks the .... | |
string | make_label_for_value (string pname, ssize_type pvalue, const uint valuewidth=9) |
Make radial labels. | |
line_element | make_line (const point_2t origin, const point_2t end, style s, const string dasharray="") |
Line primitive. | |
svg_element | make_line_graph (const svg::area<> aplate, const vrange &points, const graph_rstate &gstate, const point_2t xrange, const point_2t yrange) |
Returns a svg_element with the chart and labels Assume: vgrange x axis is monotonically increasing. | |
svg_element | make_line_graph_annotations (const area<> aplate, const vrange &points, const graph_rstate &gstate, const double xscalein=1, const double yscalein=1, const typography typo=k::apercu_typo) |
Axis Labels Axis X/Y Ticmarks X line increments. | |
string | make_line_graph_markers_tips (const vrange &points, const vrange &cpoints, const graph_rstate &gstate, const double radius) |
Return set of paths corresponding to marker shapes with tooltips. | |
marker_element | make_marker_circle (const std::string id, const area<> ma, const point_2t mcp, const uint radius, const style styl) |
marker_element | make_marker_element (const std::string id, const area<> ma, const point_2t mcp, const std::string raw) |
Base function for generating SVG markers in a defs section. | |
marker_element | make_marker_rect (const std::string id, const area<> ma, const point_2t mcp, const style styl) |
string | make_marker_set_n (const double i) |
Create a set of markers bounded by a rectangle of size n. | |
marker_element | make_marker_triangle (const std::string id, const area<> ma, const point_2t mcp, const uint radius, const style styl) |
marker_element | make_marker_x (const std::string id, const area<> ma, const point_2t mcp, const uint radius, const style styl) |
void | make_markers (svg_element &obj) |
Make black/white/wcag markers with sizes 4x4 and 2x2. | |
path_element | make_path (const string &pathda, const style &styl, const string name="", const bool selfclosingtagp=true) |
Draw path given serialized path data. Assumes pinstripe, ie top and bottom line layers. top style defaults: fill opac(0), stroke opac(1), stroke sz 1 bottom style defaults: fill opac(0), stroke opac(1), stroke sz 1.25. | |
string | make_path_arc_circumference (const point_2t &start, const point_2t &end, const space_type r, const int arcflag=0, const int sweepflag=1) |
Make path segment between two points on a circumference of radius r. Points like: get_circumference_point_d(zero_angle_north_cw(0), r, origin) | |
string | make_path_arc_closed (const point_2t &origin, const double startd, const double endd, const space_type r, const int arcflag=0, const int sweepflag=0) |
Same but with degree range arguments instead of points. NB: Assumes appropriate zero_angle_north_cw/ccw adjustments on startd/endd. | |
string | make_path_arc_closed (const point_2t &origin, const point_2t &start, const point_2t &end, const space_type r, const int arcflag=0, const int sweepflag=0) |
Make closed path between two points and the center of a circle of radius r. Points like: get_circumference_point_d(zero_angle_north_cw(0), r, origin) | |
path_element | make_path_center_mark (const point_2t &origin, const style styl, const int len, const int width) |
Plus or x tilt mark as closed path that can be filled. | |
string | make_path_data_from_points (const vrange &lpoints) |
Make single path segment. | |
path_element | make_path_octogon (const point_2t origin, const style styl, const double r=4, const uint pointsn=8) |
Center an octogon at this point. radius 4 is pixels to draw out from center point. pointsn is number of points to draw (8 for octogon) | |
path_element | make_path_triangle (const point_2t origin, const style styl, const double r=4, const double angle=120, const bool selfclosingtagp=true) |
Center a triangle at this point. | |
polyline_element | make_polyline (const vrange &points, const style s, const stroke_style sstyle={ }) |
Polyline primitive. | |
rect_element | make_rect (const point_2t origin, const style s, const area<> a, const string filterstr="") |
Create rect_element at origin. | |
rect_element | make_rect_centered (const point_2t origin, const style s, const area<> a, const string filterstr="") |
Create rect_element centered at origin. | |
svg_element | make_svg_1_channel (const space_type deltax, const space_type deltay, const string &outbase) |
Take input size and make a one channel (single-image) SVG form. | |
svg_element | make_svg_2_channel (const space_type deltax, const space_type deltay, const string &outbase) |
Take input size and make a two channel (single-image) SVG form. | |
string | make_tspan_y_from_string_by_token (string s, uint xpos, const char token=' ') |
Make text span. | |
point_2t | max_vrange (const vrange &points, const uint pown, const double xscale=1, const double yscale=1) |
Just the range info, none of the temporary objects. | |
point_2t | max_vrange (vspace &xpoints, vspace &ypoints, const uint pown) |
For each dimension of vrnage, find min/max and return (xmax, ymax) NB: Assumes zero is min. | |
color_qf | mutate_color_qf (const color_qf &k) |
Return a variant on saturation/value only. | |
vspace | narrow_vspace (const vspace &points, uint pown) |
Truncate double to double with pown signifigant digits. | |
svg_element | nest_inner_svg_element_centered (const svg_element &obj, const point_2t &p) |
Take. | |
color_qi | next_color (const color_qi klr) |
Loop through color array starting at position c. Iff klr is not found, return color::none as the next color. | |
color_qi | next_in_color_band (const colorband &cb, const ushort bandn=400) |
Flip through color band colors. | |
constexpr select | operator& (select __a, select __b) |
const select & | operator&= (select &__a, select __b) |
bool | operator< (const color_qf &c1, const color_qf &c2) |
bool | operator== (const color_qf &c1, const color_qf &c2) |
bool | operator== (const color_qi &c1, const color_qi &c2) |
constexpr select | operator^ (select __a, select __b) |
const select & | operator^= (select &__a, select __b) |
constexpr select | operator| (select __a, select __b) |
const select & | operator|= (select &__a, select __b) |
constexpr select | operator~ (select __a) |
strings | optical_sound_dots_seq (const rect_element::data &drin, const color klr, size_t fps=30, double sec=1.0, const int radius=80, const int maxw=8, const int maxh=4, const int xstart=40, const int ystart=100) |
void | paint_edges_with_char_index (svg_element &obj, const area<> a, const char firstc, const svg::color klr=color::duboisgreen2, const double rlen=24.0) |
Paint the edges of a physical page. Assumes page is square. /. | |
void | place_ray_at_angle (svg_element &obj, const point_2t &origin, const point_2t &circump, const style &s, const string id="") |
void | point_2d_to_ray (svg_element &obj, double x, double y, style s, space_type r=4, const uint nrays=10) |
Lines radiating from center point (x,y). | |
void | point_to_circle (svg_element &obj, const point_2t origin, style s, const space_type r=4, const string xform="") |
Draws a circle around a point (x,y), of style (s), of radius (r). | |
void | point_to_crossed_lines (svg_element &obj, const point_2t origin, const style &styl, const int radius, const double tiltd=0.0) |
Point to center mark as crossed lines. Default is a plus sign at origin, but. | |
void | point_to_octogon (svg_element &obj, const point_2t origin, const style s, const double r=4) |
Center an octogon at this point. | |
void | point_to_rect (svg_element &obj, const point_2t origin, style s, double width=4, double height=4, const string filterstr="") |
Rectangle at this point. | |
void | point_to_rect_centered (svg_element &obj, const point_2t origin, style s, double width=4, double height=4, const string filterstr="") |
Center a rectangle at this point. | |
void | point_to_ring_halo (svg_element &obj, const point_2t origin, const space_type radius, const double blurspace, const svg::color klr, const svg::color fadeklr=color::none, const double opacity=1) |
Draws a ring centered at origin of radius r, with outer and inner radial gradient of blurspace in each direction. klr == fade from fadeklr == fade to. Background is transparent if none. | |
void | point_to_triangle (svg_element &obj, const point_2t origin, const style s, const double r=4, const double angle=120) |
Center a triangle at this point. | |
void | points_to_line (svg_element &obj, const style s, const point_2t origin, const point_2t end, const string dasharray="") |
Line between two points. | |
double | pt_to_px (const uint i=1) |
Conversion between point size to pixels given dpi density. | |
void | radial_text_ccw (svg_element &obj, string text, const typography &typo, const point_2t origin, const double deg) |
Text with typography, arranged ccw around points (x,y) on a circle. | |
void | radial_text_ccw (svg_element &obj, string text, const typography &typo, const point_2t origin, const double deg, const point_2t rorigin) |
Text with typography, arranged ccw around points (x,y) on a circle. | |
void | radial_text_cw (svg_element &obj, string text, const typography &typo, const point_2t origin, const double deg) |
Text with typography, arranged cw around points (x,y) on a circle. | |
void | radial_text_cw (svg_element &obj, string text, const typography &typo, const point_2t origin, const double deg, const point_2t rorigin) |
Text with typography, arranged cw around points (x,y) on a circle. | |
void | radial_text_r (svg_element &obj, string text, const typography &typo, const int r, const point_2t origin, const double deg, const bool roriginp=false) |
int | radiate_glyph (svg_element &obj, const point_2t origin, const double angled, const id_rstate idst, const int kr, const int rspace, const int rstart) |
int | radiate_glyph_and_id (svg_element &obj, const point_2t origin, const double angled, const double kr, const int rspace, const int rstart, const string id, const typography &typo) |
int | radiate_glyph_and_id (svg_element &obj, const point_2t origin, const ssize_type v, const ssize_type value_max, const int radius, const int rspace, const int rstart, const string id, const typography &typo) |
Convenience function for above. | |
void | radiate_id_at_value (svg_element &obj, const point_2t origin, const typography &typo, string pname, ssize_type pvalue, ssize_type pmax, double r, bool rotatep) |
void | radiate_ids_at_uvalue (svg_element &obj, const point_2t origin, const typography &typo, const strings &ids, ssize_type pvalue, ssize_type pmax, double r, double rspace) |
Map ids with one value to a point cluster radiating out from a center. | |
svg_element | radiate_ids_per_uvalue_on_arc (svg_element &obj, const point_2t origin, const typography &typo, const id_value_umap &ivm, const ssize_type value_max, const int radius, const int rspace) |
svg_element | radiate_ids_per_value_on_arc (svg_element &obj, const point_2t origin, const typography &typo, const id_value_umap &ivm, const ssize_type value_max, const int radius, bool rotatep) |
int | radiate_line_and_value (svg_element &obj, const point_2t origin, const double angled, const ssize_type v, const int rspace, const int rstart, const int linelen, const typography &typo, const style styl={color::black, 1, color::black,.25, 1}) |
template<typename _Spectrm> | |
color_qi | random_color (const _Spectrm &spectrm, const uint startoffset=0) |
color_qi | random_color (const uint startoffset=0) |
Random entry from array above. | |
id_value_umap | remove_matches_id_value_map (id_value_umap &ivm, const strings &matches) |
Remove all from map that match the input (matches) strings. Return found match entries. | |
double | scale_proportional_to_area (double radius, double weight) |
double | scale_proportional_to_weight (double radius, double weight) |
double | scale_value_on_range (const ssize_type value, const ssize_type min, const ssize_type max, const ssize_type nfloor, const ssize_type nceil) |
Scale value from min to max on range (nfloor, nceil). | |
int | search_dom_for_int_field (const rj::Document &dom, const string finds) |
Search DOM for integer values. | |
string | search_dom_for_string_field (const rj::Document &dom, const string finds) |
Search DOM for string literals. | |
void | serialize_id_types_json (jsonstream &writer, const auto &ids, const string tag) |
Serialize set of id_type. | |
void | set_label_spaces (ssize_type spaces) |
Set the number of label spaces. | |
int | set_min_ring_size (const int sz) |
By observation, type size 12pt = 5, 6pt = 2. | |
double | set_min_satellite_distance (const double kuse) |
By observation, 7pt = 5 minimum NB: Make sure distance is at least text height away for lowest values. | |
point_2t | set_radial_range (const space_type rmin, const space_type rmax) |
Convenience for setting radial range. | |
void | set_select (select &a, const select &b) |
Forwarding functions. | |
uint | significant_digits_in (ssize_type maxval) |
The number of significant digits in. | |
void | sized_text (svg_element &obj, svg::typography typo, const int sz, const string text, const int tx, const int ty) |
Text at size. | |
void | sized_text_r (svg_element &obj, svg::typography typo, const int sz, const string text, const int tx, const int ty, const double deg) |
Text at size, with a transformation=rotation. | |
void | sort_strings_by_size (strings &ids) |
Sort vectors of strings to largest length string first. (Or use set<>). | |
void | splay_ids_after (svg_element &obj, const typography &typo, const strings &ids, const double angledo, const point_2t origin, double r, double rspace) |
Spread ids past the origin point, along circumference path. | |
void | splay_ids_around (svg_element &obj, const typography &typo, const strings &ids, const double angled, const point_2t origin, double r, double rspace, const bool satellitep=false) |
Spread ids on either side of an origin point, along circumference path. | |
void | splay_ids_stagger (svg_element &obj, const typography &typo, const strings &ids, const double angled, const point_2t origin, double r, double rspace) |
Spread ids after in stepping pattern outward. | |
void | split_vrange (const vrange &cpoints, vspace &xpoints, vspace &ypoints, const double xscale=1, const double yscale=1) |
Decompose/split 2D ranges to 1D spaces, perhaps with scaling. | |
void | stack_ids_at (svg_element &obj, const typography &typoo, const strings &ids, const double angled, const point_2t origin, double r, const double rdelta=10) |
Rotate and stack ids at origin point, extending radius for each from point of origin. | |
color_qi | start_at_color (const color_qi klr) |
Start at specified color bar entry point. | |
void | string_replace (std::string &target, const std::string &match, const std::string &replace) |
text_element | style_text (const string text, const point_2t origin, const typography typo) |
Text elemetn at. | |
void | styled_text (svg_element &obj, const string text, const point_2t origin, const typography typo) |
Text at. | |
void | styled_text (svg_element &obj, const string text, const point_2t origin, const typography typo, const string xform) |
Text at. | |
void | styled_text_link (svg_element &obj, const string text, const point_2t origin, const typography typo, const string uri) |
XXX Text at. | |
void | styled_text_r (svg_element &obj, const string text, const point_2t origin, const typography typo, const double deg) |
Text at. | |
void | styled_text_r (svg_element &obj, const string text, const point_2t origin, const typography typo, const double deg, const point_2t rorigin) |
Text at. | |
strings | swipe_left_seq (const rect_element::data &drin, const string imgf, const color klr=color::white, size_t fps=30, double sec=9) |
1 channel start with image, background color is klr each "frame" == string in returned strings has an image and a background | |
uint | text_line_n (svg_element &obj, const point_2t origin, const string text, const svg::typography typo, const int sz, const uint maxlen) |
Text of maxlen length, overflow goes on line below. | |
uint | text_line_n_r (svg_element &obj, const point_2t origin, const string text, const svg::typography typo, const uint sz, const uint maxlen, const uint lettingsz=0) |
Text of maxlen length rotated, overflow goes on line below. | |
point_2t | to_point_in_1x8_matrix (const area<> a, const uint i, const double margin) |
For positioning a linear list of glyphs along a horizontal line. Assuming i is from find_id_index with tag, so is an offset starting at zero. | |
point_2t | to_point_in_1xn_matrix (const area<> a, const uint n, const uint i, const double margin, const double y, const bool centeredp=false) |
For positioning a linear list of glyphs along a horizontal line. | |
point_2t | to_point_in_2x4_matrix (const area<> a, const uint i, const double margin) |
point_2t | to_point_in_3x3_matrix (const area<> a, const uint i, const double margin, const matrix_variant vnt=matrix_variant::slim) |
point_2t | to_point_in_matrix (const area<> a, const uint i, const double margin) |
Default matrix position. | |
const std::string & | to_string (const color e) |
Convert color to RGB color value string. | |
const std::string | to_string (const color_qf klr) |
Convert color_qf to string. | |
const std::string | to_string (const color_qi klr) |
Convert color_qi to string. | |
string | to_string (const scale e) |
const string | to_string (const style &s) |
const string | to_string (const unit e) |
string | to_string (point_2t p) |
Convert point_2t to string. | |
value_id_ummap | to_value_id_mmap (const id_value_umap &ivm, value_set &uniquev) |
Convert id_value_umap to value_id_mmap + set of unique values. | |
const id_rstate | traverse_states (const strings &values) |
Roll through render states given in values squentially, index starts with zero. | |
vrange | union_vrange (const vrange &r1, const vrange &r2) |
Union two ranges. | |
strings | vertical_sync_roll_seq (const rect_element::data &drin, const color klr, size_t, double step=10, int blursz=200, int solidsz=133, double opac=0.6) |
Simulated vertical roll, with fades. r == frame size. | |
strings | wink_to_color_seq (const rect_element::data &dr, const color klr, size_t fps, double sec, double twhen, double maxclose, double winksec) |
wink sequence of duration sec, given fps to color klr starts on background transparent, so can use with an image behind. at duration twhen winks specific rectangle (r) this much (maxclose) for seconds (winksec) | |
double | zero_angle_north_ccw (double angled) |
Zero degrees is top, going clockwise (cw). | |
double | zero_angle_north_cw (double angled) |
Zero degrees is top, going clockwise (cw). | |
Variables | |
constexpr colorband | cband_b = std::make_tuple(color::blue, 34) |
constexpr colorband | cband_brown = std::make_tuple(color::duboisbrown5, 7) |
constexpr colorband | cband_bw = std::make_tuple(color::white, 2) |
Izzi palette-specific offsets for colorbands. | |
constexpr colorband | cband_g = std::make_tuple(color::green, 21) |
constexpr colorband | cband_gray = std::make_tuple(color::white, 16) |
constexpr colorband | cband_o = std::make_tuple(color::orange, 10) |
constexpr colorband | cband_p = std::make_tuple(color::purple, 33) |
constexpr colorband | cband_r = std::make_tuple(color::red, 17) |
constexpr colorband | cband_y = std::make_tuple(color::hellayellow, 10) |
static const palette_qi< 73 > | ciecam02_palette |
constexpr uint | color_max_size = static_cast<uint>(color::last) |
Total number of enumerated colors. | |
static const palette_qi< 19 > | colorbrewer2s3s_palette |
ColorBrewer 2.0 https://colorbrewer2.org. | |
static const palette_qi< 43 > | colorbrewer2s7s_palette |
Single hue 7-class sequential, low to high. | |
static const palette_qi< 55 > | colorbrewer2s9s_palette |
Single hue 9-class sequential, low to high. | |
static const palette_qi< color_max_size - 20 > | izzi_hue_palette |
Only color no black and white or gray. | |
static const palette_qi< color_max_size - 4 > | izzi_palette |
Default colors for izzi. | |
static const palette_qi< 118 > | jp_palette |
Japan colors (118) https://en.wikipedia.org/wiki/Traditional_colors_of_Japan. | |
constexpr uint | matrix_max_items = 8 |
Maximum number of individual items to be placed in grid cells. A 1x4 grid can contain up to 4 items. A 2x4 grid can contain up to 8 items. A 3x3 grid can contain up to 9 items. | |
Scalable Vector Graphics (SVG) namespace
using svg::color_qfs = std::vector<color_qf> |
Definition at line 817 of file a60-svg-color.h.
using svg::color_qis = std::vector<color_qi> |
Types for Color iteration and combinatorics.
Definition at line 816 of file a60-svg-color.h.
using svg::colorband = std::tuple<color, ushort> |
Specific regions of spectrum as bands of color. Each band has a starting hue and a number of known good samples. This is then used to seed a generator that computes more of similar hues.
Definition at line 32 of file a60-svg-color-band.h.
using svg::id_rstate_umap = std::unordered_map<string, id_rstate> |
Definition at line 311 of file a60-svg-render-state.h.
using svg::id_value_umap = std::unordered_map<string, value_type> |
Hash multimap of unique value to (perhaps multiple) unique ids. Use this form for sorting by value.
Definition at line 33 of file a60-svg-radial-arc.h.
using svg::jsonstream = rj::PrettyWriter<rj::StringBuffer> |
Aliases/using.
Definition at line 45 of file izzi-json-basics.h.
using svg::palette = std::array<T, N> |
Palette, finite set of colors used. Must end with color::none.
Definition at line 29 of file a60-svg-color-palette.h.
using svg::palette_qf = palette<color_qf, N> |
Definition at line 35 of file a60-svg-color-palette.h.
using svg::palette_qi = palette<color_qi, N> |
Definition at line 32 of file a60-svg-color-palette.h.
using svg::point_2t = std::tuple<space_type, space_type> |
using svg::point_2tn = std::tuple<point_2t, ssize_type> |
using svg::space_type = double |
using svg::srange = std::set<point_2t> |
using svg::ssize_type = int |
using svg::strings = std::vector<string> |
using svg::ulong = unsigned long |
using svg::ushort = unsigned short |
using svg::value_id_ummap = std::unordered_multimap<value_type, string> |
Definition at line 34 of file a60-svg-radial-arc.h.
using svg::value_set = std::set<value_type> |
Definition at line 28 of file a60-svg-radial-arc.h.
using svg::value_type = long long |
Hash map of unique id to (not necessarily) unique value. Use this for sorting by id.
Definition at line 27 of file a60-svg-radial-arc.h.
using svg::vrange = std::vector<point_2t> |
using svg::vspace = std::vector<double> |
using svg::vstrings = strings |
using svg::vvranges = std::vector<vrange> |
using svg::vvstrings = std::vector<strings> |
|
strong |
Color enumerated as types.
HUE
color = color enum (and name string conversion)
color_qi = color quantified as RGB integral values 0-255 (similar to Scalar in OpenCV).
color_qf = color quantified as Hue Saturation Value (HSV) decimal values 0-1
spectrum = color spectrum as finite array of color enum values
Definition at line 41 of file a60-svg-color.h.
|
strong |
Grid style mode.
Enumerator | |
---|---|
centerweight | |
centerweightsvg | |
veronica | |
slim |
Definition at line 29 of file a60-svg-grid-matrix-systems.h.
|
strong |
Some high-level nobs for rendering: scale tuning.
small == defense distributed == 70k-300k medium == westworld == 2-4M large == stranger things == 10M+
[1-5]xsmall == reduction from least to greatest 1x == baseline [1-5]xlarge == enlargement from least to greatest
Enumerator | |
---|---|
r5s | |
r4s | |
r3s | |
r2s | |
r1s | |
xxsmall | |
xsmall | |
small | |
medium | |
baseline | |
large | |
xlarge | |
xxlarge | |
e1s | |
e2s | |
e3s | |
e4s | |
e5s |
Definition at line 127 of file a60-svg-render-state.h.
|
strong |
Selected or Active in render area. Make discrete element or layer (visible, outline, etc) if true. Used as a (visibility, outline, etc.) bitmask
Definition at line 27 of file a60-svg-render-state.h.
|
strong |
Measurement abstraction for absolute (not relative) measurements.
Enumerator | |
---|---|
meter | |
m | Meter. |
centimeter | |
cm | Centimeter. |
millimeter | |
mm | Milliimeter. |
inch | |
in | Inch. |
pixel | |
px | Pixel where 1 pixel x 96 PPI = .26 mm. |
point | |
pt | Point where 1 pixel x 1/72 dpi x 96 PPI = .26 mm. |
Definition at line 30 of file a60-svg-base-types.h.
auto & svg::active_spectrum | ( | const bool | sortbyhuep = false | ) |
Oklab https://bottosson.github.io/posts/oklab/.
Set and Get working spectrum, aka default palette. NB: If colorbands are being used, palette has to be izzi or izzi_hue, and cannot be sorted (as color bands use colors arranged in a fixed order with offsets in hue.
Definition at line 370 of file a60-svg-color-palette.h.
Add value to cache with base style of styl, colors klr, visibility vis.
Definition at line 324 of file a60-svg-render-state.h.
|
inline |
Angle adjustment such that two points on the circumference path of radius
r | from origin are a minimum of |
dist | apart. |
NB: If it cannot be computed directly, returns
minadjust,a | minimum adjustment angle that defaults to 0.25 degrees. |
Definition at line 108 of file a60-svg-radial-base.h.
|
inline |
Adjust angle above to CW/CCW orientation.
Definition at line 89 of file a60-svg-radial-base.h.
void svg::append_ids_at | ( | svg_element & | obj, |
const typography & | typo, | ||
const strings & | ids, | ||
const double | angled, | ||
const point_2t | origin, | ||
double | r ) |
Concatenate ids onto one line.
Definition at line 403 of file a60-svg-radial-base.h.
Average two colors, return the result.
Definition at line 811 of file a60-svg-color.h.
strings svg::blink_to_color_seq | ( | const rect_element::data & | dr, |
const color | klr, | ||
size_t | fps, | ||
double | sec, | ||
double | twhen, | ||
size_t | nblinks, | ||
double | blinksec ) |
blink sequence of duration sec, given fps starts on background (backgf) at duration twhen blinks specific frame (blinkf) times (nblinks) for seconds (blinksec) can use with image behind
Definition at line 80 of file a60-svg-sequences.h.
Cell size 3x3 for n items with margin spacing on either size.
Definition at line 34 of file a60-svg-grid-matrix-systems.h.
|
constexpr |
|
constexpr |
Definition at line 108 of file a60-svg-render-state.h.
color_qf::ftype svg::color_qf_distance | ( | const color_qf & | k1, |
const color_qf & | k2 ) |
Definition at line 707 of file a60-svg-color.h.
Forwarding function.
Definition at line 743 of file a60-svg-color.h.
Less than compare for color_qf.
Definition at line 677 of file a60-svg-color.h.
Definition at line 690 of file a60-svg-color.h.
Default compare distances from k1,k2 to black.
Definition at line 727 of file a60-svg-color.h.
color_qi svg::combine_color_qi | ( | const color_qi & | a, |
const double | ad, | ||
const color_qi & | b, | ||
const double | bd ) |
Combine color a with color b in percentages ad and ab, respectively.
To average, constrain paramters ad and ab such that: ad + ab == 2.
Like so: ushort ur = (a.r + b.r) / 2; ushort ug = (a.g + b.g) / 2; ushort ub = (a.b + b.b) / 2;
Definition at line 794 of file a60-svg-color.h.
void svg::composite_bleed_areas | ( | svg_element & | obj, |
const svg::select | slxt, | ||
const double | bleedin, | ||
const double | bleedxoffset = 0 ) |
Composite frame on bleed. For printed objects with a center gutter, some intra-page adjustments are necessary.
slxt | is odd/even (left/right) |
bleedin | is bleed size for one edge in inches. (1/8) |
bleedxoffset | is distance from spine pushed outward. |
Definition at line 275 of file a60-svg-composite-and-layer-basics.h.
string svg::convert_8859_to_utf8 | ( | string | in | ) |
Convert from ISO-8859-1 encoding to UTF-8, required for XML.
Definition at line 29 of file a60-svg-codecvt.h.
string svg::convert_to_utf8 | ( | string | in | ) |
vrange svg::deserialize_json_array_object_field_n | ( | const string | jdata, |
const string | afield, | ||
const string | field1, | ||
const string | field2, | ||
const bool | verbosep = true ) |
Deserialize json array, extract specific fields from array objects, return as vec of point_2t.
jdata == input is path + filename of input JSON data file afield == pointer in json file dom to specific array's data field1 == x field to extract in array field2 == y field to extract in array
Definition at line 211 of file izzi-json-basics.h.
rj::Document svg::deserialize_json_string_to_dom | ( | const string & | json | ) |
Deserialize input string.
Definition at line 78 of file izzi-json-basics.h.
rj::Document svg::deserialize_json_to_dom | ( | const string | input_file | ) |
Deserialize input file.
Definition at line 95 of file izzi-json-basics.h.
rj::Document svg::deserialize_json_to_dom_array | ( | const string | input_file | ) |
Load JSON file to in-memory DOM array.
Definition at line 133 of file izzi-json-basics.h.
rj::Document svg::deserialize_json_to_dom_object | ( | const string | input_file | ) |
Load JSON file to in-memory DOM.
Definition at line 117 of file izzi-json-basics.h.
void svg::direction_arc_at | ( | svg_element & | obj, |
const point_2t | origin, | ||
const double | rr, | ||
svg::style | s, | ||
const double | spacer = 10 ) |
Arc + arrow glyph that traces path of start to finish trajectory.
Definition at line 28 of file a60-svg-radial-direction-arc-glyph.h.
void svg::direction_arc_title_at | ( | svg_element & | obj, |
const point_2t | origin, | ||
const int | radius, | ||
const typography | typo, | ||
const string | title, | ||
const uint | pcnt = 30 ) |
Title on same arc.
Definition at line 94 of file a60-svg-radial-direction-arc-glyph.h.
svg_element svg::display_color_qis | ( | const auto & | klrs, |
const area<> | a, | ||
const typography & | typobase ) |
Make grid palette for display. NB.
klrs | can be color_qis or array/palette. |
Definition at line 843 of file a60-svg-render-basics.h.
space_type svg::distance_cartesian | ( | const point_2t & | p1, |
const point_2t & | p2 ) |
string svg::dot_grid_seq | ( | const rect_element::data & | drin, |
const color | klr, | ||
const rect_element::atype | radius = 80, | ||
const int | maxwidth = 8, | ||
const int | maxheight = 4, | ||
const rect_element::atype | xstart = 40, | ||
const rect_element::atype | ystart = 100 ) |
Randomly create grid of [maxwidth] x [maxheight] grid, and fill with dots.
Definition at line 358 of file a60-svg-sequences.h.
string svg::element_to_svg_insert | ( | const string | isvgpre | ) |
Import svg file, convert it to svg_element for insertion.
Definition at line 154 of file a60-svg-composite-and-layer-basics.h.
double svg::extract_dom_value_to_double | ( | const rj::Value & | v | ) |
Extract from raw JSON value to double.
Definition at line 179 of file izzi-json-basics.h.
strings svg::fade_from_color_seq | ( | const rect_element::data & | dr, |
const color | klr, | ||
size_t | fps = 30, | ||
double | sec = 1.0, | ||
double | minopac = 0 ) |
Start rectangle as transparent, fade to color.
Definition at line 65 of file a60-svg-sequences.h.
strings svg::fade_to_color_seq | ( | const rect_element::data & | dr, |
const color | klr, | ||
size_t | fps = 30, | ||
double | sec = 1.0, | ||
double | maxopac = 1.0 ) |
Fade rectangle fill from transparent to color, of duration sec, given fps starts on white (klr), fades to klr color in sec can use with image behind
Definition at line 34 of file a60-svg-sequences.h.
string svg::file_to_svg_insert | ( | const string | ifile | ) |
Import svg file, convert it to svg_element for insertion. ifile is a plain SVG file with a 1:1 aspect ratio.
Definition at line 122 of file a60-svg-composite-and-layer-basics.h.
Definition at line 112 of file a60-svg-render-state.h.
|
inline |
Transform a value on a range to an angle on the radial range.
Definition at line 78 of file a60-svg-radial-base.h.
Angle in degrees.
Definition at line 541 of file a60-svg-render-basics.h.
point_2t svg::get_circumference_point_r | ( | const double | angler, |
const double | r, | ||
const point_2t | origin ) |
Angle in radians.
Definition at line 529 of file a60-svg-render-basics.h.
double & svg::get_dpi | ( | ) |
const id_rstate svg::get_id_rstate | ( | const string | id | ) |
Given identifier/name/id, get corresponding id_rstate from cache.
Definition at line 337 of file a60-svg-render-state.h.
id_rstate_umap & svg::get_id_rstate_cache | ( | ) |
Definition at line 315 of file a60-svg-render-state.h.
ssize_type & svg::get_label_spaces | ( | ) |
Get the label space. Value -> Name, as a string where value has labelspaces of fill NB: Should be the number of significant digits in pmax plus separators. So, 10 == 2, 100 == 3, 10k == 5 + 1.
Definition at line 161 of file a60-svg-radial-base.h.
int & svg::get_min_ring_size | ( | ) |
The smallest (sattelite) radius size allowed in a kusama orbit.
Definition at line 27 of file a60-svg-radial-kusama.h.
double & svg::get_min_satellite_distance | ( | ) |
The minimum distance between satellites in high orbit.
Definition at line 46 of file a60-svg-radial-kusama.h.
point_2t & svg::get_radial_range | ( | ) |
Max number of non-overlapping degrees in radial form, as a tuple of (min, max).
Total degrees in a circle are 360, but then the beginning and the end of the radial display are in the same place, which may confusing. So, shave a bit off both ends for the optics, so that there is a gap between the beginning and end of the generated radial viz. The default is such that the beginning and the end have a discernable gap.
Definition at line 56 of file a60-svg-radial-base.h.
color_rstate & svg::get_render_state | ( | ) |
Global state.
Definition at line 282 of file a60-svg-render-state.h.
svg_element svg::insert_svg_at | ( | svg_element & | obj, |
const string | isvg, | ||
const point_2t | origin, | ||
const double | origsize, | ||
const double | isize, | ||
const double | angled = 0, | ||
const style & | styl = k::no_style ) |
Embed svg in group element.
obj | is containing svg |
origin | is where glyph placement is inside containing svg element. |
origsize | is original file width/height constant |
isize | is final width/height |
isvg | is the raw svg string to insert, assumes _M_lifetime == false. |
styl | is overide style information: defaults to no_style. |
NB This only works is the file has no styles set in svg, group, or individual element definitions (like circle, path, rectangle, etc.).
See: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg
Definition at line 194 of file a60-svg-composite-and-layer-basics.h.
void svg::kusama_collision_transforms | ( | svg_element & | obj, |
const point_2t | origin, | ||
std::vector< ssize_type > & | vuvalues, | ||
vvstrings & | vids, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
const int | rspace, | ||
const int | rstart, | ||
const typography & | typo, | ||
const bool | weighbyvaluep, | ||
const ssize_type | threshold = 1, | ||
const int | startlenm = 5 ) |
Split values into
Go through values, if there are two values that are adjacent,
A point cluster is a circle whos radius is proportionate to the number of duplicate ids at that point. Duplicate ids splay, stack, or append/concatencate at, after, or around that point cluster.
NB: invariant that @vuvalues > 1
Threshold is the range such that a value is considered adjacent for collisions. If v > previous value + threshold, then the points are not considered neighbors.
startlen is the point at which high-orbit is drawn after transform.
rstart | is the multiple of radius that is startlen. |
Definition at line 401 of file a60-svg-radial-kusama.h.
void svg::kusama_ids_at_uvalue | ( | svg_element & | obj, |
const point_2t | origin, | ||
const strings & | ids, | ||
const ssize_type | v, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
const int | rspace, | ||
const int | rstart, | ||
const int | linelen, | ||
const typography & | typo, | ||
const bool | weighbyvaluep ) |
Layer one value's glyphs and ids.
Definition at line 347 of file a60-svg-radial-kusama.h.
int svg::kusama_ids_orbit_high | ( | svg_element & | obj, |
const point_2t | origin, | ||
const strings & | ids, | ||
const ssize_type | v, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
const int | rspace, | ||
const int | rstart, | ||
const int | linelen, | ||
const typography & | typo, | ||
const bool | wbyvaluep, | ||
const bool | satellitep = false ) |
Draw these ids around a kusama low orbit circle on arcs from the origin circle.
Simplest version, make satellite circle on circumference and splay or append id's around it.
radius | Length of line on a ray from origin to value. |
satdistance | Multiple used to compute distance between two satellite values. Useful defaults: 3.3 for 12pt, 2 for 7pt. |
Definition at line 221 of file a60-svg-radial-kusama.h.
void svg::kusama_ids_orbit_low | ( | svg_element & | obj, |
const point_2t | origin, | ||
const strings & | ids, | ||
const ssize_type | v, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
const int | rspace, | ||
const int | rstart, | ||
const int | linelen, | ||
const typography & | typo, | ||
const bool | wbyvaluep ) |
Draw these ids as a glyph on the circumference of origin circle.
Simplest version.
Definition at line 302 of file a60-svg-radial-kusama.h.
svg_element svg::kusama_ids_per_uvalue_on_arc | ( | svg_element & | obj, |
const point_2t | origin, | ||
const typography & | typo, | ||
const id_value_umap & | ivm, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
const int | rspace, | ||
const bool | weighbyvaluep = true, | ||
const bool | collisionp = false, | ||
const bool | sortstringsbysizep = false ) |
Radiate as *_per_uvalue_on_arc function, but group similar values such that they are globbed into a satellite circle, ids splayed around the satellite, and not written on top of each other on the same arc/angle.
Framing circle radius is the result of dividing page dimensions by (rdenom).
Satellite circle radius is the product of the number of ids with the same value times a base multipler (rbase).
When overlap is detected, move outward on radius if true, otherwise move in.
Definition at line 484 of file a60-svg-radial-kusama.h.
void svg::make_1_channel_insert | ( | svg_element & | obj, |
string | insert1 ) |
Definition at line 34 of file a60-svg-composite-and-layer-basics.h.
void svg::make_2_channel_insert | ( | svg_element & | obj, |
string | insert1, | ||
string | insert2 ) |
Definition at line 57 of file a60-svg-composite-and-layer-basics.h.
circle_element svg::make_circle | ( | const point_2t | origin, |
style | s, | ||
const space_type | r = 4, | ||
const string | xform = "" ) |
Make circle element.
Definition at line 374 of file a60-svg-render-basics.h.
Forwarding function.
Definition at line 153 of file a60-svg-color-band.h.
Generate a color band from starting hue and seeds.
Algorithm is average two known good, where two picked randomly.
Return type is a vector of generated color_qi types.
Definition at line 54 of file a60-svg-color-band.h.
Algorightm is HSV generation.
Definition at line 104 of file a60-svg-color-band.h.
string svg::make_crossed_lines | ( | const point_2t | origin, |
const style | s, | ||
const double | radius, | ||
const double | tiltd = 0.0 ) |
Crossed lines, no fill. X marks the ....
Definition at line 806 of file a60-svg-render-basics.h.
string svg::make_label_for_value | ( | string | pname, |
ssize_type | pvalue, | ||
const uint | valuewidth = 9 ) |
Make radial labels.
Definition at line 176 of file a60-svg-radial-base.h.
line_element svg::make_line | ( | const point_2t | origin, |
const point_2t | end, | ||
style | s, | ||
const string | dasharray = "" ) |
Line primitive.
Definition at line 271 of file a60-svg-render-basics.h.
svg_element svg::make_line_graph | ( | const svg::area<> | aplate, |
const vrange & | points, | ||
const graph_rstate & | gstate, | ||
const point_2t | xrange, | ||
const point_2t | yrange ) |
Returns a svg_element with the chart and labels Assume: vgrange x axis is monotonically increasing.
Definition at line 332 of file a60-svg-graphs-line.h.
svg_element svg::make_line_graph_annotations | ( | const area<> | aplate, |
const vrange & | points, | ||
const graph_rstate & | gstate, | ||
const double | xscalein = 1, | ||
const double | yscalein = 1, | ||
const typography | typo = k::apercu_typo ) |
Axis Labels Axis X/Y Ticmarks X line increments.
Definition at line 177 of file a60-svg-graphs-line.h.
string svg::make_line_graph_markers_tips | ( | const vrange & | points, |
const vrange & | cpoints, | ||
const graph_rstate & | gstate, | ||
const double | radius ) |
Return set of paths corresponding to marker shapes with tooltips.
Definition at line 85 of file a60-svg-graphs-line.h.
marker_element svg::make_marker_circle | ( | const std::string | id, |
const area<> | ma, | ||
const point_2t | mcp, | ||
const uint | radius, | ||
const style | styl ) |
marker_element svg::make_marker_element | ( | const std::string | id, |
const area<> | ma, | ||
const point_2t | mcp, | ||
const std::string | raw ) |
Base function for generating SVG markers in a defs section.
Marker styles, ways to make line start, mid points, and enpoints look distinct.
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/
stroke_dash_array Attribute/stroke-dasharray
polyline marker-mid Attribute/marker-mid
Definition at line 39 of file a60-svg-markers.h.
marker_element svg::make_marker_rect | ( | const std::string | id, |
const area<> | ma, | ||
const point_2t | mcp, | ||
const style | styl ) |
string svg::make_marker_set_n | ( | const double | i | ) |
Create a set of markers bounded by a rectangle of size n.
Definition at line 89 of file a60-svg-markers.h.
marker_element svg::make_marker_triangle | ( | const std::string | id, |
const area<> | ma, | ||
const point_2t | mcp, | ||
const uint | radius, | ||
const style | styl ) |
marker_element svg::make_marker_x | ( | const std::string | id, |
const area<> | ma, | ||
const point_2t | mcp, | ||
const uint | radius, | ||
const style | styl ) |
void svg::make_markers | ( | svg_element & | obj | ) |
Make black/white/wcag markers with sizes 4x4 and 2x2.
Definition at line 113 of file a60-svg-markers.h.
path_element svg::make_path | ( | const string & | pathda, |
const style & | styl, | ||
const string | name = "", | ||
const bool | selfclosingtagp = true ) |
Draw path given serialized path data. Assumes pinstripe, ie top and bottom line layers. top style defaults: fill opac(0), stroke opac(1), stroke sz 1 bottom style defaults: fill opac(0), stroke opac(1), stroke sz 1.25.
Definition at line 602 of file a60-svg-render-basics.h.
string svg::make_path_arc_circumference | ( | const point_2t & | start, |
const point_2t & | end, | ||
const space_type | r, | ||
const int | arcflag = 0, | ||
const int | sweepflag = 1 ) |
Make path segment between two points on a circumference of radius r. Points like: get_circumference_point_d(zero_angle_north_cw(0), r, origin)
Definition at line 700 of file a60-svg-render-basics.h.
string svg::make_path_arc_closed | ( | const point_2t & | origin, |
const double | startd, | ||
const double | endd, | ||
const space_type | r, | ||
const int | arcflag = 0, | ||
const int | sweepflag = 0 ) |
Same but with degree range arguments instead of points. NB: Assumes appropriate zero_angle_north_cw/ccw adjustments on startd/endd.
Definition at line 745 of file a60-svg-render-basics.h.
string svg::make_path_arc_closed | ( | const point_2t & | origin, |
const point_2t & | start, | ||
const point_2t & | end, | ||
const space_type | r, | ||
const int | arcflag = 0, | ||
const int | sweepflag = 0 ) |
Make closed path between two points and the center of a circle of radius r. Points like: get_circumference_point_d(zero_angle_north_cw(0), r, origin)
Definition at line 719 of file a60-svg-render-basics.h.
path_element svg::make_path_center_mark | ( | const point_2t & | origin, |
const style | styl, | ||
const int | len, | ||
const int | width ) |
Plus or x tilt mark as closed path that can be filled.
Definition at line 757 of file a60-svg-render-basics.h.
string svg::make_path_data_from_points | ( | const vrange & | lpoints | ) |
Make single path segment.
Definition at line 578 of file a60-svg-render-basics.h.
path_element svg::make_path_octogon | ( | const point_2t | origin, |
const style | styl, | ||
const double | r = 4, | ||
const uint | pointsn = 8 ) |
Center an octogon at this point. radius 4 is pixels to draw out from center point. pointsn is number of points to draw (8 for octogon)
Definition at line 662 of file a60-svg-render-basics.h.
path_element svg::make_path_triangle | ( | const point_2t | origin, |
const style | styl, | ||
const double | r = 4, | ||
const double | angle = 120, | ||
const bool | selfclosingtagp = true ) |
Center a triangle at this point.
Definition at line 627 of file a60-svg-render-basics.h.
polyline_element svg::make_polyline | ( | const vrange & | points, |
const style | s, | ||
const stroke_style | sstyle = { } ) |
Polyline primitive.
Definition at line 299 of file a60-svg-render-basics.h.
rect_element svg::make_rect | ( | const point_2t | origin, |
const style | s, | ||
const area<> | a, | ||
const string | filterstr = "" ) |
Create rect_element at origin.
Definition at line 313 of file a60-svg-render-basics.h.
rect_element svg::make_rect_centered | ( | const point_2t | origin, |
const style | s, | ||
const area<> | a, | ||
const string | filterstr = "" ) |
Create rect_element centered at origin.
Definition at line 335 of file a60-svg-render-basics.h.
svg_element svg::make_svg_1_channel | ( | const space_type | deltax, |
const space_type | deltay, | ||
const string & | outbase ) |
Take input size and make a one channel (single-image) SVG form.
Definition at line 24 of file a60-svg-composite-and-layer-basics.h.
svg_element svg::make_svg_2_channel | ( | const space_type | deltax, |
const space_type | deltay, | ||
const string & | outbase ) |
Take input size and make a two channel (single-image) SVG form.
Definition at line 47 of file a60-svg-composite-and-layer-basics.h.
Return a variant on saturation/value only.
Definition at line 763 of file a60-svg-color.h.
svg_element svg::nest_inner_svg_element_centered | ( | const svg_element & | obj, |
const point_2t & | p ) |
Take.
obj | as some kind of svg element or group of elements, and embed it as a nested svg at a location centered at |
pos | on the main svg. |
Definition at line 236 of file a60-svg-composite-and-layer-basics.h.
Loop through color array starting at position c. Iff klr is not found, return color::none as the next color.
Definition at line 416 of file a60-svg-color-palette.h.
Flip through color band colors.
bandn | is the number of colors in the colorband. |
Definition at line 163 of file a60-svg-color-band.h.
Definition at line 62 of file a60-svg-render-state.h.
Definition at line 95 of file a60-svg-render-state.h.
Definition at line 748 of file a60-svg-color.h.
Definition at line 515 of file a60-svg-color.h.
Definition at line 77 of file a60-svg-render-state.h.
Definition at line 99 of file a60-svg-render-state.h.
Definition at line 70 of file a60-svg-render-state.h.
Definition at line 91 of file a60-svg-render-state.h.
Definition at line 84 of file a60-svg-render-state.h.
strings svg::optical_sound_dots_seq | ( | const rect_element::data & | drin, |
const color | klr, | ||
size_t | fps = 30, | ||
double | sec = 1.0, | ||
const int | radius = 80, | ||
const int | maxw = 8, | ||
const int | maxh = 4, | ||
const int | xstart = 40, | ||
const int | ystart = 100 ) |
Simulated optical sound dots, or film processing punches, an experimental film stylistic.
"The conclusion of a Warhol film is usually announced by the appearance of a flurry of white dots—an artifact of the identification number punched into the last few feet of the roll at the lab." Kyle Westphal, Andy Warhol's Magic Trick
Analyzing Warhol's Outer and Inner Space frame-by-frame, assume: 1920 x 1080 frame size 160 pixel diameter circles, with 240 pixel horiz/vert spacing 100 pixel from edge
At 30fps, sequence is:
Simplify to:
compositions are no more than four across, and sometimes go off the frame
r == frame size
Definition at line 439 of file a60-svg-sequences.h.
void svg::paint_edges_with_char_index | ( | svg_element & | obj, |
const area<> | a, | ||
const char | firstc, | ||
const svg::color | klr = color::duboisgreen2, | ||
const double | rlen = 24.0 ) |
Paint the edges of a physical page. Assumes page is square. /.
rlen | is height of painted rectangle from edge. NB: 0.125 is a common bleed == 12 pixels. First attempt was, common bleed plus 2 pixel "on page" -> 14. Not enough. |
Definition at line 82 of file a60-svg-composite-and-layer-basics.h.
void svg::place_ray_at_angle | ( | svg_element & | obj, |
const point_2t & | origin, | ||
const point_2t & | circump, | ||
const style & | s, | ||
const string | id = "" ) |
void svg::point_2d_to_ray | ( | svg_element & | obj, |
double | x, | ||
double | y, | ||
style | s, | ||
space_type | r = 4, | ||
const uint | nrays = 10 ) |
Lines radiating from center point (x,y).
Definition at line 473 of file a60-svg-render-basics.h.
void svg::point_to_circle | ( | svg_element & | obj, |
const point_2t | origin, | ||
style | s, | ||
const space_type | r = 4, | ||
const string | xform = "" ) |
Draws a circle around a point (x,y), of style (s), of radius (r).
Definition at line 390 of file a60-svg-render-basics.h.
void svg::point_to_crossed_lines | ( | svg_element & | obj, |
const point_2t | origin, | ||
const style & | styl, | ||
const int | radius, | ||
const double | tiltd = 0.0 ) |
Point to center mark as crossed lines. Default is a plus sign at origin, but.
tiltd | can rotate. |
Definition at line 831 of file a60-svg-render-basics.h.
void svg::point_to_octogon | ( | svg_element & | obj, |
const point_2t | origin, | ||
const style | s, | ||
const double | r = 4 ) |
Center an octogon at this point.
Definition at line 689 of file a60-svg-render-basics.h.
void svg::point_to_rect | ( | svg_element & | obj, |
const point_2t | origin, | ||
style | s, | ||
double | width = 4, | ||
double | height = 4, | ||
const string | filterstr = "" ) |
Rectangle at this point.
Definition at line 351 of file a60-svg-render-basics.h.
void svg::point_to_rect_centered | ( | svg_element & | obj, |
const point_2t | origin, | ||
style | s, | ||
double | width = 4, | ||
double | height = 4, | ||
const string | filterstr = "" ) |
Center a rectangle at this point.
Definition at line 362 of file a60-svg-render-basics.h.
void svg::point_to_ring_halo | ( | svg_element & | obj, |
const point_2t | origin, | ||
const space_type | radius, | ||
const double | blurspace, | ||
const svg::color | klr, | ||
const svg::color | fadeklr = color::none, | ||
const double | opacity = 1 ) |
Draws a ring centered at origin of radius r, with outer and inner radial gradient of blurspace in each direction. klr == fade from fadeklr == fade to. Background is transparent if none.
Definition at line 403 of file a60-svg-render-basics.h.
void svg::point_to_triangle | ( | svg_element & | obj, |
const point_2t | origin, | ||
const style | s, | ||
const double | r = 4, | ||
const double | angle = 120 ) |
Center a triangle at this point.
Definition at line 650 of file a60-svg-render-basics.h.
void svg::points_to_line | ( | svg_element & | obj, |
const style | s, | ||
const point_2t | origin, | ||
const point_2t | end, | ||
const string | dasharray = "" ) |
Line between two points.
Definition at line 288 of file a60-svg-render-basics.h.
double svg::pt_to_px | ( | const uint | i = 1 | ) |
void svg::radial_text_ccw | ( | svg_element & | obj, |
string | text, | ||
const typography & | typo, | ||
const point_2t | origin, | ||
const double | deg ) |
Text with typography, arranged ccw around points (x,y) on a circle.
Definition at line 215 of file a60-svg-radial-base.h.
void svg::radial_text_ccw | ( | svg_element & | obj, |
string | text, | ||
const typography & | typo, | ||
const point_2t | origin, | ||
const double | deg, | ||
const point_2t | rorigin ) |
Text with typography, arranged ccw around points (x,y) on a circle.
Definition at line 241 of file a60-svg-radial-base.h.
void svg::radial_text_cw | ( | svg_element & | obj, |
string | text, | ||
const typography & | typo, | ||
const point_2t | origin, | ||
const double | deg ) |
Text with typography, arranged cw around points (x,y) on a circle.
Definition at line 202 of file a60-svg-radial-base.h.
void svg::radial_text_cw | ( | svg_element & | obj, |
string | text, | ||
const typography & | typo, | ||
const point_2t | origin, | ||
const double | deg, | ||
const point_2t | rorigin ) |
Text with typography, arranged cw around points (x,y) on a circle.
Definition at line 228 of file a60-svg-radial-base.h.
void svg::radial_text_r | ( | svg_element & | obj, |
string | text, | ||
const typography & | typo, | ||
const int | r, | ||
const point_2t | origin, | ||
const double | deg, | ||
const bool | roriginp = false ) |
Easier to read radial text that switches orientation at 180 degrees, instead of going upside-down as it follows the circle around the circumference, aka mirrored or symmetric radial text.
Text with typography, arranged around an origin of a circle with radius r. Text is align left CW (1,180) Text is aligh right CCW (181, 359)
NB: Assume value is un-adjusted, aka from get_angle
roriginp is a switch to use a render origin, not the text position, as the rotation origin.
Definition at line 267 of file a60-svg-radial-base.h.
int svg::radiate_glyph | ( | svg_element & | obj, |
const point_2t | origin, | ||
const double | angled, | ||
const id_rstate | idst, | ||
const int | kr, | ||
const int | rspace, | ||
const int | rstart ) |
Draw glyph on ray from origin as part of kusama.
Definition at line 96 of file a60-svg-radial-kusama.h.
int svg::radiate_glyph_and_id | ( | svg_element & | obj, |
const point_2t | origin, | ||
const double | angled, | ||
const double | kr, | ||
const int | rspace, | ||
const int | rstart, | ||
const string | id, | ||
const typography & | typo ) |
Draw glyph and id on ray from origin as part of kusama. skip (origin to rstart) + rspace + glyph of radius + rspace + id
origin | is center of the primary/base circle for kusama renderings. |
kr | is of the kusama satellite circle on the ray. |
rspace | is the distance between text/vector/glyph elements |
rstart | is the length from origin along the ray to begin rendering |
Returns the length along the arc of the generated glyph.
Definition at line 157 of file a60-svg-radial-kusama.h.
int svg::radiate_glyph_and_id | ( | svg_element & | obj, |
const point_2t | origin, | ||
const ssize_type | v, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
const int | rspace, | ||
const int | rstart, | ||
const string | id, | ||
const typography & | typo ) |
Convenience function for above.
Definition at line 198 of file a60-svg-radial-kusama.h.
void svg::radiate_id_at_value | ( | svg_element & | obj, |
const point_2t | origin, | ||
const typography & | typo, | ||
string | pname, | ||
ssize_type | pvalue, | ||
ssize_type | pmax, | ||
double | r, | ||
bool | rotatep ) |
Draw text on the circumference of a circle of radius r centered at (cx, cy) corresponding to the angle above.
Definition at line 80 of file a60-svg-radial-arc.h.
void svg::radiate_ids_at_uvalue | ( | svg_element & | obj, |
const point_2t | origin, | ||
const typography & | typo, | ||
const strings & | ids, | ||
ssize_type | pvalue, | ||
ssize_type | pmax, | ||
double | r, | ||
double | rspace ) |
Map ids with one value to a point cluster radiating out from a center.
Definition at line 131 of file a60-svg-radial-arc.h.
svg_element svg::radiate_ids_per_uvalue_on_arc | ( | svg_element & | obj, |
const point_2t | origin, | ||
const typography & | typo, | ||
const id_value_umap & | ivm, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
const int | rspace ) |
Radiate as above, but group similar values such that they are splayed, and not written on top of each other on the same arc/angle.
Definition at line 160 of file a60-svg-radial-arc.h.
svg_element svg::radiate_ids_per_value_on_arc | ( | svg_element & | obj, |
const point_2t | origin, | ||
const typography & | typo, | ||
const id_value_umap & | ivm, | ||
const ssize_type | value_max, | ||
const int | radius, | ||
bool | rotatep ) |
Create radial viz of names from input file arranged clockwise around the edge of a circle circumference. The text of the names can be rotated, or not.
Arguments are:
rdenom == scaling factor for radius of circle used for display, where larger values (used as a denominator) make smaller (tighter) circles.
rotatep == rotate name text to be on an arc from the origin of the circle.
Definition at line 108 of file a60-svg-radial-arc.h.
int svg::radiate_line_and_value | ( | svg_element & | obj, |
const point_2t | origin, | ||
const double | angled, | ||
const ssize_type | v, | ||
const int | rspace, | ||
const int | rstart, | ||
const int | linelen, | ||
const typography & | typo, | ||
const style | styl = {color::black, 1, color::black, .25, 1} ) |
Draw line and value on ray from origin as part of kusama. skip (origin to rstart) + rspace + line of length lineline + rspace + value
Returns the length along the arc of the generated glyph minus text part.
Definition at line 71 of file a60-svg-radial-kusama.h.
color_qi svg::random_color | ( | const _Spectrm & | spectrm, |
const uint | startoffset = 0 ) |
Definition at line 404 of file a60-svg-color-palette.h.
Random entry from array above.
Definition at line 392 of file a60-svg-color-palette.h.
id_value_umap svg::remove_matches_id_value_map | ( | id_value_umap & | ivm, |
const strings & | matches ) |
Remove all from map that match the input (matches) strings. Return found match entries.
Definition at line 40 of file a60-svg-radial-arc.h.
double svg::scale_proportional_to_area | ( | double | radius, |
double | weight ) |
Definition at line 24 of file a60-svg-render-basics.h.
double svg::scale_proportional_to_weight | ( | double | radius, |
double | weight ) |
Definition at line 37 of file a60-svg-render-basics.h.
double svg::scale_value_on_range | ( | const ssize_type | value, |
const ssize_type | min, | ||
const ssize_type | max, | ||
const ssize_type | nfloor, | ||
const ssize_type | nceil ) |
int svg::search_dom_for_int_field | ( | const rj::Document & | dom, |
const string | finds ) |
Search DOM for integer values.
Definition at line 164 of file izzi-json-basics.h.
string svg::search_dom_for_string_field | ( | const rj::Document & | dom, |
const string | finds ) |
Search DOM for string literals.
Definition at line 149 of file izzi-json-basics.h.
void svg::serialize_id_types_json | ( | jsonstream & | writer, |
const auto & | ids, | ||
const string | tag ) |
Serialize set of id_type.
Definition at line 50 of file izzi-json-basics.h.
void svg::set_label_spaces | ( | ssize_type | spaces | ) |
Set the number of label spaces.
Definition at line 170 of file a60-svg-radial-base.h.
int svg::set_min_ring_size | ( | const int | sz | ) |
By observation, type size 12pt = 5, 6pt = 2.
Definition at line 35 of file a60-svg-radial-kusama.h.
double svg::set_min_satellite_distance | ( | const double | kuse | ) |
By observation, 7pt = 5 minimum NB: Make sure distance is at least text height away for lowest values.
Definition at line 55 of file a60-svg-radial-kusama.h.
point_2t svg::set_radial_range | ( | const space_type | rmin, |
const space_type | rmax ) |
Convenience for setting radial range.
Definition at line 64 of file a60-svg-radial-base.h.
Forwarding functions.
Definition at line 104 of file a60-svg-render-state.h.
uint svg::significant_digits_in | ( | ssize_type | maxval | ) |
The number of significant digits in.
maxval. |
Definition at line 144 of file a60-svg-radial-base.h.
void svg::sized_text | ( | svg_element & | obj, |
svg::typography | typo, | ||
const int | sz, | ||
const string | text, | ||
const int | tx, | ||
const int | ty ) |
Text at size.
Definition at line 162 of file a60-svg-render-basics.h.
void svg::sized_text_r | ( | svg_element & | obj, |
svg::typography | typo, | ||
const int | sz, | ||
const string | text, | ||
const int | tx, | ||
const int | ty, | ||
const double | deg ) |
Text at size, with a transformation=rotation.
Definition at line 178 of file a60-svg-render-basics.h.
void svg::sort_strings_by_size | ( | strings & | ids | ) |
Sort vectors of strings to largest length string first. (Or use set<>).
Definition at line 192 of file a60-svg-radial-base.h.
void svg::splay_ids_after | ( | svg_element & | obj, |
const typography & | typo, | ||
const strings & | ids, | ||
const double | angledo, | ||
const point_2t | origin, | ||
double | r, | ||
double | rspace ) |
Spread ids past the origin point, along circumference path.
Definition at line 347 of file a60-svg-radial-base.h.
void svg::splay_ids_around | ( | svg_element & | obj, |
const typography & | typo, | ||
const strings & | ids, | ||
const double | angled, | ||
const point_2t | origin, | ||
double | r, | ||
double | rspace, | ||
const bool | satellitep = false ) |
Spread ids on either side of an origin point, along circumference path.
Definition at line 310 of file a60-svg-radial-base.h.
void svg::splay_ids_stagger | ( | svg_element & | obj, |
const typography & | typo, | ||
const strings & | ids, | ||
const double | angled, | ||
const point_2t | origin, | ||
double | r, | ||
double | rspace ) |
Spread ids after in stepping pattern outward.
Definition at line 363 of file a60-svg-radial-base.h.
void svg::stack_ids_at | ( | svg_element & | obj, |
const typography & | typoo, | ||
const strings & | ids, | ||
const double | angled, | ||
const point_2t | origin, | ||
double | r, | ||
const double | rdelta = 10 ) |
Rotate and stack ids at origin point, extending radius for each from point of origin.
Definition at line 383 of file a60-svg-radial-base.h.
Start at specified color bar entry point.
Definition at line 433 of file a60-svg-color-palette.h.
|
inline |
text_element svg::style_text | ( | const string | text, |
const point_2t | origin, | ||
const typography | typo ) |
Text elemetn at.
origin,with | style. |
Definition at line 46 of file a60-svg-render-basics.h.
void svg::styled_text | ( | svg_element & | obj, |
const string | text, | ||
const point_2t | origin, | ||
const typography | typo ) |
Text at.
origin,with | style. |
Definition at line 60 of file a60-svg-render-basics.h.
void svg::styled_text | ( | svg_element & | obj, |
const string | text, | ||
const point_2t | origin, | ||
const typography | typo, | ||
const string | xform ) |
Text at.
origin,with | style and transform |
Definition at line 70 of file a60-svg-render-basics.h.
void svg::styled_text_link | ( | svg_element & | obj, |
const string | text, | ||
const point_2t | origin, | ||
const typography | typo, | ||
const string | uri ) |
XXX Text at.
origin,with | style and link. |
Definition at line 122 of file a60-svg-render-basics.h.
void svg::styled_text_r | ( | svg_element & | obj, |
const string | text, | ||
const point_2t | origin, | ||
const typography | typo, | ||
const double | deg ) |
Text at.
origin,with | style and ... a transformation=rotation of |
deg | about origin. |
Definition at line 87 of file a60-svg-render-basics.h.
void svg::styled_text_r | ( | svg_element & | obj, |
const string | text, | ||
const point_2t | origin, | ||
const typography | typo, | ||
const double | deg, | ||
const point_2t | rorigin ) |
Text at.
origin,with | style and ... a transformation=rotation of |
deg | about |
rorigin. |
Definition at line 104 of file a60-svg-render-basics.h.
strings svg::swipe_left_seq | ( | const rect_element::data & | drin, |
const string | imgf, | ||
const color | klr = color::white, | ||
size_t | fps = 30, | ||
double | sec = 9 ) |
1 channel start with image, background color is klr each "frame" == string in returned strings has an image and a background
Definition at line 476 of file a60-svg-sequences.h.
uint svg::text_line_n | ( | svg_element & | obj, |
const point_2t | origin, | ||
const string | text, | ||
const svg::typography | typo, | ||
const int | sz, | ||
const uint | maxlen ) |
Text of maxlen length, overflow goes on line below.
Definition at line 194 of file a60-svg-render-basics.h.
uint svg::text_line_n_r | ( | svg_element & | obj, |
const point_2t | origin, | ||
const string | text, | ||
const svg::typography | typo, | ||
const uint | sz, | ||
const uint | maxlen, | ||
const uint | lettingsz = 0 ) |
Text of maxlen length rotated, overflow goes on line below.
Definition at line 224 of file a60-svg-render-basics.h.
For positioning a linear list of glyphs along a horizontal line. Assuming i is from find_id_index with tag, so is an offset starting at zero.
Definition at line 188 of file a60-svg-grid-matrix-systems.h.
point_2t svg::to_point_in_1xn_matrix | ( | const area<> | a, |
const uint | n, | ||
const uint | i, | ||
const double | margin, | ||
const double | y, | ||
const bool | centeredp = false ) |
For positioning a linear list of glyphs along a horizontal line.
n | is number of matrix cells, greater than one. |
i | is from find_id_index with tag, so is an offset starting at zero. |
centeredp | adjusts to the center of the cell, default is left aligned. |
y | is what y axis to use. |
Definition at line 209 of file a60-svg-grid-matrix-systems.h.
Move around a 2 by 4 grid of glyphs
1 2 3 4 5 6 7 8
given
Definition at line 148 of file a60-svg-grid-matrix-systems.h.
point_2t svg::to_point_in_3x3_matrix | ( | const area<> | a, |
const uint | i, | ||
const double | margin, | ||
const matrix_variant | vnt = matrix_variant::slim ) |
Move around a three by three grid of glyphs
1 2 3 4 5 6 7 8 9
given
The centerweight matrix_variant has cells arranged as above. The other variant styles, distort the matrix as specified below.
Definition at line 60 of file a60-svg-grid-matrix-systems.h.
Default matrix position.
Definition at line 230 of file a60-svg-grid-matrix-systems.h.
const std::string & svg::to_string | ( | const color | e | ) |
Convert color to RGB color value string.
Definition at line 225 of file a60-svg-color.h.
const std::string svg::to_string | ( | const color_qf | klr | ) |
Convert color_qf to string.
Definition at line 671 of file a60-svg-color.h.
const std::string svg::to_string | ( | const color_qi | klr | ) |
Convert color_qi to string.
Definition at line 526 of file a60-svg-color.h.
string svg::to_string | ( | const scale | e | ) |
Definition at line 141 of file a60-svg-render-state.h.
const string svg::to_string | ( | const style & | s | ) |
const string svg::to_string | ( | const unit | e | ) |
Definition at line 41 of file a60-svg-base-types.h.
string svg::to_string | ( | point_2t | p | ) |
value_id_ummap svg::to_value_id_mmap | ( | const id_value_umap & | ivm, |
value_set & | uniquev ) |
Convert id_value_umap to value_id_mmap + set of unique values.
Definition at line 61 of file a60-svg-radial-arc.h.
Roll through render states given in values squentially, index starts with zero.
Definition at line 363 of file a60-svg-render-state.h.
strings svg::vertical_sync_roll_seq | ( | const rect_element::data & | drin, |
const color | klr, | ||
size_t | , | ||
double | step = 10, | ||
int | blursz = 200, | ||
int | solidsz = 133, | ||
double | opac = 0.6 ) |
Simulated vertical roll, with fades. r == frame size.
Definition at line 271 of file a60-svg-sequences.h.
strings svg::wink_to_color_seq | ( | const rect_element::data & | dr, |
const color | klr, | ||
size_t | fps, | ||
double | sec, | ||
double | twhen, | ||
double | maxclose, | ||
double | winksec ) |
wink sequence of duration sec, given fps to color klr starts on background transparent, so can use with an image behind. at duration twhen winks specific rectangle (r) this much (maxclose) for seconds (winksec)
Definition at line 154 of file a60-svg-sequences.h.
double svg::zero_angle_north_ccw | ( | double | angled | ) |
Zero degrees is top, going clockwise (cw).
Definition at line 566 of file a60-svg-render-basics.h.
double svg::zero_angle_north_cw | ( | double | angled | ) |
Zero degrees is top, going clockwise (cw).
Definition at line 551 of file a60-svg-render-basics.h.
|
constexpr |
Definition at line 42 of file a60-svg-color-band.h.
|
constexpr |
Definition at line 37 of file a60-svg-color-band.h.
|
constexpr |
Izzi palette-specific offsets for colorbands.
Definition at line 35 of file a60-svg-color-band.h.
|
constexpr |
Definition at line 41 of file a60-svg-color-band.h.
|
constexpr |
Definition at line 36 of file a60-svg-color-band.h.
|
constexpr |
Definition at line 39 of file a60-svg-color-band.h.
|
constexpr |
Definition at line 43 of file a60-svg-color-band.h.
|
constexpr |
Definition at line 38 of file a60-svg-color-band.h.
|
constexpr |
Definition at line 40 of file a60-svg-color-band.h.
|
static |
CIECAM02-UCS color space, perceptually different colors, equally spaced out.
Hand-picked values for a 67-68 BTIHA, aka cyberwar. Start with color constraints, generate 264 options, hand-pick to n=68. http://jnnnnn.github.io/category-colors-constrained.html
Definition at line 321 of file a60-svg-color-palette.h.
|
constexpr |
Total number of enumerated colors.
Definition at line 221 of file a60-svg-color.h.
|
static |
ColorBrewer 2.0 https://colorbrewer2.org.
Single hue 3-class sequential, low to high
Definition at line 219 of file a60-svg-color-palette.h.
|
static |
Single hue 7-class sequential, low to high.
Definition at line 278 of file a60-svg-color-palette.h.
|
static |
Single hue 9-class sequential, low to high.
Definition at line 242 of file a60-svg-color-palette.h.
|
static |
Only color no black and white or gray.
Definition at line 108 of file a60-svg-color-palette.h.
|
static |
Default colors for izzi.
Definition at line 38 of file a60-svg-color-palette.h.
|
static |
Japan colors (118) https://en.wikipedia.org/wiki/Traditional_colors_of_Japan.
Definition at line 170 of file a60-svg-color-palette.h.
|
constexpr |
Maximum number of individual items to be placed in grid cells. A 1x4 grid can contain up to 4 items. A 2x4 grid can contain up to 8 items. A 3x3 grid can contain up to 9 items.
Definition at line 25 of file a60-svg-grid-matrix-systems.h.