This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via e5413bf88214d6a7a13b0ad251befe8098a5e387 (commit) from e40b6e745f6ca131059addb2b05297eccf9a474a (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/e5413bf88214d6a7a13b0ad251befe8098a5e...
commit e5413bf88214d6a7a13b0ad251befe8098a5e387 Author: Cyril Hrubis metan@ucw.cz Date: Fri Jan 11 15:11:02 2013 +0100
doc: Edhance coordinate system description.
diff --git a/doc/coordinate_system.txt b/doc/coordinate_system.txt index fb3f408..7ef9081 100644 --- a/doc/coordinate_system.txt +++ b/doc/coordinate_system.txt @@ -1,11 +1,30 @@ Coordinate System -----------------
-GFXprim uses Cartesian coordinate system. The pixel +(0, 0)+ lies at the upper +Coordinates +~~~~~~~~~~~ + +GFXprim uses Cartesian coordinate system. The pixel '(0, 0)' lies at the upper left corner of the bitmap and coordinates grows to the right and to the -bottom. The last valid pixel, that still lies in the bitmap of size +w+ and -+h+, occupies coordinates +(w - 1, h - 1)+. The precise position of the point -with integer coordinates is in the middle of the pixel (and borders between -the pixels lies are integers + 0.5). +bottom. The last valid pixel, that still lies in the bitmap of size 'w' and +'h', occupies coordinate '(w-1,h-1)'. The precise position of the point with +integer coordinates is in the middle of the pixel (and borders between the +pixels lies are integers + 0.5). + +[[Coordinates]] +.GFXprim coordinate system and GP_LineXYXY(5, 3, 9, 3) +image::coordinates-1.svg["Coordinate system"] + +Width and Height +~~~~~~~~~~~~~~~~ + +The width and height, when passed as an argument, are interpreted as number of +pixels to draw (rather than lengt from one pixel center to another pixel +center). Which means that for rectangle of size '(w,h)' starting at '(x,y)' +first pixel to draw would be '(x,y)' and last one would be '(x+w-1,y+h-1)'. +Especially when 'w' or 'h' is less than or equal to zero no action is taken. + +[[Coordinates_Rectangle]] +.GP_RectangleXYWH(2, 1, 8, 4) +image::coordinates-2.svg["Coordinates Rectangle"]
-image:coordinates-1.svg[Coordinate System] diff --git a/doc/coordinates-1.svg b/doc/coordinates-1.svg index 841444d..427b812 100644 --- a/doc/coordinates-1.svg +++ b/doc/coordinates-1.svg @@ -9,8 +9,8 @@ xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" - width="546.91302" - height="426.914" + width="666.91302" + height="366.91162" id="svg2" xml:space="preserve"><metadata id="metadata8">rdf:RDF<cc:Work @@ -18,159 +18,213 @@ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs id="defs6"><clipPath id="clipPath18"><path - d="m 0,0 437.5304,0 0,341.5312 L 0,341.5312 0,0 z" + d="m 0,0 533.5304,0 0,293.5293 L 0,293.5293 0,0 z" inkscape:connector-curvature="0" id="path20" /></clipPath></defs><g - transform="matrix(1.25,0,0,-1.25,0,426.914)" + transform="matrix(1.25,0,0,-1.25,0,366.91162)" id="g10"><g id="g12"><g id="g14"><g clip-path="url(#clipPath18)" id="g16"><g - transform="translate(0,341.5312)" + transform="translate(0,293.5293)" id="g22"><g - transform="translate(3.5304,-339.5312)" - id="g24"><path - d="M 0,0 432,0" - inkscape:connector-curvature="0" - id="path26" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,48 432,0" - inkscape:connector-curvature="0" - id="path28" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,96 432,0" - inkscape:connector-curvature="0" - id="path30" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,144 432,0" - inkscape:connector-curvature="0" - id="path32" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,192 432,0" - inkscape:connector-curvature="0" - id="path34" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,240 432,0" - inkscape:connector-curvature="0" - id="path36" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,288 432,0" - inkscape:connector-curvature="0" - id="path38" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,336 432,0" - inkscape:connector-curvature="0" - id="path40" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="M 0,0 0,336" - inkscape:connector-curvature="0" - id="path42" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 48,0 0,336" - inkscape:connector-curvature="0" - id="path44" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 96,0 0,336" - inkscape:connector-curvature="0" - id="path46" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 144,0 0,336" - inkscape:connector-curvature="0" - id="path48" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 192,0 0,336" - inkscape:connector-curvature="0" - id="path50" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 240,0 0,336" - inkscape:connector-curvature="0" - id="path52" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 288,0 0,336" - inkscape:connector-curvature="0" - id="path54" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 336,0 0,336" - inkscape:connector-curvature="0" - id="path56" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 384,0 0,336" - inkscape:connector-curvature="0" - id="path58" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 432,0 0,336" - inkscape:connector-curvature="0" - id="path60" - style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="M 0,336 0,0" - inkscape:connector-curvature="0" - id="path62" - style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="M -1.5304,3.6946 0,0 l 1.5304,3.6946 -3.0608,0 z" - inkscape:connector-curvature="0" - id="path64" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="M 0,0 432,0" - inkscape:connector-curvature="0" - id="path66" - style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 432,0 0,336" - inkscape:connector-curvature="0" - id="path68" - style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="m 0,336 432,0" - inkscape:connector-curvature="0" - id="path70" - style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path - d="M 428.30338,334.46877 432,336 l -3.69662,1.53123 0,-3.06246 z" - inkscape:connector-curvature="0" - id="path72" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g - transform="translate(0,341.5312)" - id="g74"><text - transform="matrix(1,0,0,-1,12.1001,-24.0405)" - id="text76"><tspan + transform="translate(3.5304,-291.5293)" + id="g24"><g + transform="translate(0,293.5293)" + id="g26"><text + transform="matrix(1,0,0,-1,12.1001,-24.0386)" + id="text28"><tspan x="0 3.8744552 8.8557549 14.940911 19.922211" y="0" - id="tspan78" + id="tspan30" style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(0,0)</tspan></text> <g - transform="translate(0,-341.5312)" - id="g80"><path - d="m 24,312 0,0" + transform="translate(0,-293.5293)" + id="g32"><path + d="m 24,264 0,0" inkscape:connector-curvature="0" - id="path82" + id="path34" style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g - transform="translate(0,341.5312)" - id="g84"><text - transform="matrix(1,0,0,-1,386.4142,-312.0405)" - id="text86"><tspan + transform="translate(0,293.5293)" + id="g36"><text + transform="matrix(1,0,0,-1,482.4142,-264.0386)" + id="text38"><tspan x="0 3.8744552 11.069445 14.389979 19.371279 25.456436 30.991655 34.312191 39.293491" y="0" - id="tspan88" + id="tspan40" style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(w-1,h-1)</tspan></text> <g - transform="translate(0,-341.5312)" - id="g90"><path - d="m 408,24 0,0" + transform="translate(0,-293.5293)" + id="g42"><path + d="m 504,24 0,0" inkscape:connector-curvature="0" - id="path92" + id="path44" style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g - transform="translate(0,341.5312)" - id="g94"><text - transform="matrix(1,0,0,-1,98.1,-120.9405)" - id="text96"><tspan + transform="translate(0,293.5293)" + id="g46"><text + transform="matrix(1,0,0,-1,98.1,-120.9386)" + id="text48"><tspan x="0 3.8744552 8.8557549 11.623365 16.604666 22.689821 27.671122" y="0" - id="tspan98" + id="tspan50" style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(1.5,2)</tspan></text> <g - transform="translate(0,-341.5312)" - id="g100"><path - d="m 96,216 0,0" + transform="translate(0,-293.5293)" + id="g52"><path + d="m 96,168 0,0" inkscape:connector-curvature="0" - id="path102" - style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g - transform="translate(0,341.5312)" - id="g104" /></g></g></g></g></g></g></g></g></g></g></g></g></svg> No newline at end of file + id="path54" + style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 240,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path56" + style="fill:#9999ff;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 288,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path58" + style="fill:#9999ff;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 336,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path60" + style="fill:#9999ff;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 384,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path62" + style="fill:#9999ff;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 432,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path64" + style="fill:#9999ff;fill-opacity:1;fill-rule:nonzero;stroke:none" /><g + transform="translate(0,293.5293)" + id="g66"><text + transform="matrix(1,0,0,-1,252.1001,-168.0386)" + id="text68"><tspan + x="0 3.8744552 8.8557549 14.940911 19.922211" + y="0" + id="tspan70" + style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(5,3)</tspan></text> +<g + transform="translate(0,-293.5293)" + id="g72"><path + d="m 264,120 0,0" + inkscape:connector-curvature="0" + id="path74" + style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g + transform="translate(0,293.5293)" + id="g76"><text + transform="matrix(1,0,0,-1,444.1001,-168.0386)" + id="text78"><tspan + x="0 3.8744552 8.8557549 14.940911 19.922211" + y="0" + id="tspan80" + style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(9,3)</tspan></text> +<g + transform="translate(0,-293.5293)" + id="g82"><path + d="m 456,120 0,0" + inkscape:connector-curvature="0" + id="path84" + style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,0 528,0" + inkscape:connector-curvature="0" + id="path86" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,48 528,0" + inkscape:connector-curvature="0" + id="path88" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,96 528,0" + inkscape:connector-curvature="0" + id="path90" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,144 528,0" + inkscape:connector-curvature="0" + id="path92" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,192 528,0" + inkscape:connector-curvature="0" + id="path94" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,240 528,0" + inkscape:connector-curvature="0" + id="path96" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,288 528,0" + inkscape:connector-curvature="0" + id="path98" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,0 0,288" + inkscape:connector-curvature="0" + id="path100" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 48,0 0,288" + inkscape:connector-curvature="0" + id="path102" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 96,0 0,288" + inkscape:connector-curvature="0" + id="path104" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 144,0 0,288" + inkscape:connector-curvature="0" + id="path106" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 192,0 0,288" + inkscape:connector-curvature="0" + id="path108" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 240,0 0,288" + inkscape:connector-curvature="0" + id="path110" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 288,0 0,288" + inkscape:connector-curvature="0" + id="path112" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 336,0 0,288" + inkscape:connector-curvature="0" + id="path114" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 384,0 0,288" + inkscape:connector-curvature="0" + id="path116" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 432,0 0,288" + inkscape:connector-curvature="0" + id="path118" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 480,0 0,288" + inkscape:connector-curvature="0" + id="path120" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 528,0 0,288" + inkscape:connector-curvature="0" + id="path122" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,288 0,0" + inkscape:connector-curvature="0" + id="path124" + style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M -1.5304,3.6946 0,0 l 1.5304,3.6946 -3.0608,0 z" + inkscape:connector-curvature="0" + id="path126" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,0 528,0" + inkscape:connector-curvature="0" + id="path128" + style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 528,0 0,288" + inkscape:connector-curvature="0" + id="path130" + style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,288 528,0" + inkscape:connector-curvature="0" + id="path132" + style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 524.30812,286.47073 528,288 l -3.69188,1.52927 0,-3.05854 z" + inkscape:connector-curvature="0" + id="path134" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g + transform="translate(0,293.5293)" + id="g136" /></g></g></g></g></g></g></g></g></g></g></g></g></g></g></g></g></svg> No newline at end of file diff --git a/doc/coordinates-2.svg b/doc/coordinates-2.svg new file mode 100644 index 0000000..ffa02d7 --- /dev/null +++ b/doc/coordinates-2.svg @@ -0,0 +1,308 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="666.91302" + height="366.91162" + id="svg2" + xml:space="preserve"><metadata + id="metadata8">rdf:RDF<cc:Work + rdf:about="">dc:formatimage/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs6"><clipPath + id="clipPath18"><path + d="m 0,0 533.5304,0 0,293.5293 L 0,293.5293 0,0 z" + inkscape:connector-curvature="0" + id="path20" /></clipPath></defs><g + transform="matrix(1.25,0,0,-1.25,0,366.91162)" + id="g10"><g + id="g12"><g + id="g14"><g + clip-path="url(#clipPath18)" + id="g16"><g + transform="translate(0,293.5293)" + id="g22"><g + transform="translate(3.5304,-291.5293)" + id="g24"><g + transform="translate(0,293.5293)" + id="g26"><text + transform="matrix(1,0,0,-1,12.1001,-24.0386)" + id="text28"><tspan + x="0 3.8744552 8.8557549 14.940911 19.922211" + y="0" + id="tspan30" + style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(0,0)</tspan></text> +<g + transform="translate(0,-293.5293)" + id="g32"><path + d="m 24,264 0,0" + inkscape:connector-curvature="0" + id="path34" + style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 96,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path36" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 96,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path38" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 96,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path40" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 96,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path42" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 144,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path44" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 144,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path46" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 144,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path48" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 144,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path50" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 192,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path52" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 192,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path54" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 192,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path56" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 192,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path58" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 240,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path60" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 240,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path62" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 240,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path64" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 240,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path66" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 288,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path68" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 288,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path70" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 288,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path72" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 288,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path74" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 336,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path76" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 336,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path78" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 336,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path80" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 336,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path82" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 384,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path84" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 384,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path86" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 384,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path88" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 384,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path90" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 432,192 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path92" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 432,144 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path94" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 432,96 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path96" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path + d="m 432,48 48,0 0,48 -48,0 0,-48 z" + inkscape:connector-curvature="0" + id="path98" + style="fill:#99ff99;fill-opacity:1;fill-rule:nonzero;stroke:none" /><g + transform="translate(0,293.5293)" + id="g100"><text + transform="matrix(1,0,0,-1,108.1001,-72.0386)" + id="text102"><tspan + x="0 3.8744552 8.8557549 14.940911 19.922211" + y="0" + id="tspan104" + style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(2,1)</tspan></text> +<g + transform="translate(0,-293.5293)" + id="g106"><path + d="m 120,216 0,0" + inkscape:connector-curvature="0" + id="path108" + style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g + transform="translate(0,293.5293)" + id="g110"><text + transform="matrix(1,0,0,-1,444.1001,-216.0386)" + id="text112"><tspan + x="0 3.8744552 8.8557549 14.940911 19.922211" + y="0" + id="tspan114" + style="font-size:9.96259975px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR10;-inkscape-font-specification:CMR10">(9,4)</tspan></text> +<g + transform="translate(0,-293.5293)" + id="g116"><path + d="m 456,72 0,0" + inkscape:connector-curvature="0" + id="path118" + style="fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,0 528,0" + inkscape:connector-curvature="0" + id="path120" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,48 528,0" + inkscape:connector-curvature="0" + id="path122" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,96 528,0" + inkscape:connector-curvature="0" + id="path124" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,144 528,0" + inkscape:connector-curvature="0" + id="path126" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,192 528,0" + inkscape:connector-curvature="0" + id="path128" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,240 528,0" + inkscape:connector-curvature="0" + id="path130" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,288 528,0" + inkscape:connector-curvature="0" + id="path132" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,0 0,288" + inkscape:connector-curvature="0" + id="path134" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 48,0 0,288" + inkscape:connector-curvature="0" + id="path136" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 96,0 0,288" + inkscape:connector-curvature="0" + id="path138" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 144,0 0,288" + inkscape:connector-curvature="0" + id="path140" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 192,0 0,288" + inkscape:connector-curvature="0" + id="path142" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 240,0 0,288" + inkscape:connector-curvature="0" + id="path144" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 288,0 0,288" + inkscape:connector-curvature="0" + id="path146" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 336,0 0,288" + inkscape:connector-curvature="0" + id="path148" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 384,0 0,288" + inkscape:connector-curvature="0" + id="path150" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 432,0 0,288" + inkscape:connector-curvature="0" + id="path152" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 480,0 0,288" + inkscape:connector-curvature="0" + id="path154" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 528,0 0,288" + inkscape:connector-curvature="0" + id="path156" + style="fill:none;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,288 0,0" + inkscape:connector-curvature="0" + id="path158" + style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M -1.5304,3.6946 0,0 l 1.5304,3.6946 -3.0608,0 z" + inkscape:connector-curvature="0" + id="path160" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 0,0 528,0" + inkscape:connector-curvature="0" + id="path162" + style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 528,0 0,288" + inkscape:connector-curvature="0" + id="path164" + style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="m 0,288 528,0" + inkscape:connector-curvature="0" + id="path166" + style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><path + d="M 524.30812,286.47073 528,288 l -3.69188,1.52927 0,-3.05854 z" + inkscape:connector-curvature="0" + id="path168" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none" /><g + transform="translate(0,293.5293)" + id="g170" /></g></g></g></g></g></g></g></g></g></g></g></g></svg> No newline at end of file diff --git a/doc/coordinates.mp b/doc/coordinates.mp index 404ff70..c048e6e 100644 --- a/doc/coordinates.mp +++ b/doc/coordinates.mp @@ -1,14 +1,5 @@ -% -% Compile to svg by: -% -% mptopdf coordinates.mp; inkscape -l coordinates-1.svg coordinates-1.pdf -% -beginfig(1) +def draw_grid = % Draw grid - u := 48; - w := 9; - h := 7; - for i=0 upto h: draw (0, i * u) -- (w * u, i * u); endfor @@ -29,12 +20,62 @@ beginfig(1) draw A -- B withpen pencircle scaled 2; draw B -- C withpen pencircle scaled 2; drawarrow D -- C withpen pencircle scaled 4; +enddef; + +vardef pixel_coord(expr x, y) = + px := u/2 + x * u; + py := h * u - u/2 - u * y; + (px,py) +enddef; + +def fill_pixel(expr x, y, col) = + fill unitsquare scaled u shifted pixel_coord(x - 0.5, y + 0.5) withcolor col +enddef; + +beginfig(1) + u = 48; + w = 11; + h = 6; + + % Draw labels + dotlabel.top(btex (0, 0) etex, pixel_coord(0, 0)); + dotlabel.top(btex (w-1, h-1) etex, pixel_coord(w-1, h-1)); + dotlabel.urt(btex (1.5, 2) etex, pixel_coord(1.5, 2)); + + % Draw line + lxs = 5; + lxe = 9; + ly = 3;
+ for i = lxs upto lxe: + fill_pixel(i, ly, (0.6, 0.6, 1)); + endfor + + dotlabel.top(btex (5, 3) etex, pixel_coord(lxs, ly)); + dotlabel.top(btex (9, 3) etex, pixel_coord(lxe, ly)); + + draw_grid; +endfig; + +beginfig(2) + u := 48; + w := 11; + h := 6; + % Draw labels - dotlabel.top(btex (0, 0) etex, (u/2, h * u - u/2)); - dotlabel.top(btex (w-1, h-1) etex, (w * u - u/2, u/2)); + dotlabel.top(btex (0, 0) etex, pixel_coord(0, 0)); - dotlabel.urt(btex (1.5, 2) etex, (2 * u, h * u - 2 * u - u/2)); + for i = 2 upto 9: + for j = 1 upto 4: + fill_pixel(i, j, (0.6, 1, 0.6)); + endfor + endfor
+ % Draw rectangle + dotlabel.top(btex (2, 1) etex, pixel_coord(2, 1)); + dotlabel.top(btex (9, 4) etex, pixel_coord(9, 4)); + + draw_grid; endfig; + end diff --git a/doc/gen_mp.sh b/doc/gen_mp.sh new file mode 100755 index 0000000..27c622c --- /dev/null +++ b/doc/gen_mp.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Script to regenerate svgs from metapost +# +# The resulting svg images are stored in git so you need +# to run the script only after you changed the metapost +# source files. +# + +SRC=coordinates + +echo "$SRC.mp -> $SRC-*.pdf" +mptopdf "$SRC.mp" + +for i in $SRC*.pdf; do + SVG=`echo "$i" | sed s/.pdf/.svg/` + echo "$i -> $SVG" + inkscape -l "$SVG" "$i" + rm "$i" +done
-----------------------------------------------------------------------
Summary of changes: doc/coordinate_system.txt | 31 ++++- doc/coordinates-1.svg | 320 ++++++++++++++++++++++++++------------------- doc/coordinates-2.svg | 308 +++++++++++++++++++++++++++++++++++++++++++ doc/coordinates.mp | 67 ++++++++-- doc/gen_mp.sh | 20 +++ 5 files changed, 594 insertions(+), 152 deletions(-) create mode 100644 doc/coordinates-2.svg create mode 100755 doc/gen_mp.sh
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.