### ----------------------------------------------------
### -- PDF::ISO_32000
### -- Licenses: Artistic-2.0
### -- Authors: David Warring
### -- File: resources/ISO_32000/misc/Table_128-Predefined_spot_functions.json
### ----------------------------------------------------
{
  "table": {
    "caption": "Table 128 – Predefined spot functions",
    "head": [
      "Name",
      "Appearance",
      "Definition"
    ],
    "rows": [
      [
        "SimpleDot",
        "",
        "1 − (x 2 + y 2)\n{ dup mul exch dup mul add 1 exch sub }"
      ],
      [
        "InvertedSimpleDot",
        "",
        "x 2 + y 2 − 1\n{ dup mul exch dup mul add 1 sub }"
      ],
      [
        "DoubleDot",
        "",
        "360x×()sin 2 ------------------------------ 360y×()sin 2 ------------------------------+\n{ 360 mul sin 2 div exch 360 mul sin 2 div add }"
      ],
      [
        "InvertedDoubleDot",
        "",
        "360x×()sin 2 ------------------------------ 360y×()sin 2 ------------------------------+ ⎝ ⎛ – ⎠ ⎞\n{ 360 mul sin 2 div exch 360 mul sin 2 div add neg }"
      ],
      [
        "CosineDot",
        "",
        "180x×()cos 2 ------------------------------- 180y×()cos 2 -------------------------------+\n{ 180 mul cos exch 180 mul cos add 2 div }"
      ],
      [
        "Double",
        "",
        "360 x 2 ---× ⎝⎠ ⎛⎞ sin 2 ------------------------------- 360y×()sin 2 ------------------------------+\n{ 360 mul sin 2 div exch 2 div 360 mul sin 2 div add }"
      ],
      [
        "InvertedDouble",
        "",
        "360 x 2 ---× ⎝⎠ ⎛⎞ sin 2 ------------------------------- 360y×()sin 2 ------------------------------+ ⎠ ⎟ ⎟ ⎟ ⎞ ⎝ ⎜ ⎜ ⎜ ⎛ –\n{ 360 mul sin 2 div exch 2 div 360 mul sin 2 div add neg }"
      ],
      [
        "Line",
        "",
        "− | y |\n{ exch pop abs neg }"
      ],
      [
        "LineX",
        "",
        "x\n{ pop }"
      ],
      [
        "LineY",
        "",
        "y\n{ exch pop }"
      ],
      [
        "Round",
        "",
        "if | x | + | y | ≤ 1 then 1 − (x 2 + y 2) else (| x | − 1) 2 + (| y | − 1) 2 − 1\n{ abs exch abs 2 copy add 1 le { dup mul exch dup mul add 1 exch sub } { 1 sub dup mul exch 1 sub dup mul add 1 sub }\nifelse }"
      ],
      [
        "Ellipse",
        "",
        "let w = (3 × | x |) + (4 × | y |) − 3\nif w < 0 then 1 x2y 0.75 ---------- ⎝⎠ ⎛⎞2+ 4 ------------------------------–\nelse if w > 1 then 1x–()21y– 0.75 --------------- ⎝⎠ ⎛⎞2+ 4 ------------------------------------------------------1– else 0.5 − w\n{ abs exch abs 2 copy 3 mul exch 4 mul add 3 sub dup 0 lt\n{ pop dup mul exch 0.75 div dup mul add 4 div 1 exch sub } { dup 1 gt\n{ pop 1 exch sub dup mul exch 1 exch sub 0.75 div dup mul add 4 div 1 sub } { 0.5 exch sub exch pop exch pop }\nifelse }\nifelse }"
      ],
      [
        "EllipseA",
        "",
        "1 − (x 2 + 0.9 × y 2)\n{ dup mul 0.9 mul exch dup mul add 1 exch sub }"
      ],
      [
        "InvertedEllipseA",
        "",
        "x 2 + 0.9 × y 2 − 1\n{ dup mul 0.9 mul exch dup mul add 1 sub }"
      ],
      [
        "EllipseB",
        "",
        "1x25 8 ---y2×+–\n{ dup 5 mul 8 div mul exch dup mul exch add sqrt 1 exch sub }"
      ],
      [
        "EllipseC",
        "",
        "1 − (0.9 × x2 + y2)\n{ dup mul exch dup mul 0.9 mul add 1 exch sub }"
      ],
      [
        "InvertedEllipseC",
        "",
        "0.9 × x 2 + y 2 − 1\n{ dup mul exch dup mul 0.9 mul add 1 sub }"
      ],
      [
        "Square",
        "",
        "−max (| x | , | y |)\n{ abs exch abs 2 copy lt { exch } if pop neg }"
      ],
      [
        "Cross",
        "",
        "−min (| x | , | y |)\n{ abs exch abs 2 copy gt { exch } if pop neg }"
      ],
      [
        "Rhomboid",
        "",
        "0.9x×y+ 2 ---------------------------------\n{ abs exch abs 0.9 mul add 2 div }"
      ],
      [
        "Diamond",
        "",
        "if | x | + | y | ≤ 0.75 then 1 − (x 2 + y 2) else if | x | + | y | ≤ 1.23 then 1 − (0.85 × | x | + | y |) else (| x | − 1) 2 + (| y | − 1) 2 − 1\n{ abs exch abs 2 copy add 0.75 le\n{ dup mul exch dup mul add 1 exch sub } { 2 copy add 1.23 le\n{ 0.85 mul add 1 exch sub } { 1 sub dup mul exch 1 sub du mul add 1 sub }\nifelse }\nifelse }"
      ]
    ]
  }
}


