loaders: JPG: Fix bussy loop on corrupted file.
[gfxprim.git] / doc / coordinate_system.txt
blob7ef90814595d04918f0c1b96d7c9d837b0910fbd
1 Coordinate System
2 -----------------
4 Coordinates
5 ~~~~~~~~~~~
7 GFXprim uses Cartesian coordinate system. The pixel '(0, 0)' lies at the upper
8 left corner of the bitmap and coordinates grows to the right and to the
9 bottom. The last valid pixel, that still lies in the bitmap of size 'w' and
10 'h', occupies coordinate '(w-1,h-1)'. The precise position of the point with
11 integer coordinates is in the middle of the pixel (and borders between the
12 pixels lies are integers + 0.5).
14 [[Coordinates]]
15 .GFXprim coordinate system and GP_LineXYXY(5, 3, 9, 3)
16 image::coordinates-1.svg["Coordinate system"]
18 Width and Height
19 ~~~~~~~~~~~~~~~~
21 The width and height, when passed as an argument, are interpreted as number of
22 pixels to draw (rather than lengt from one pixel center to another pixel
23 center). Which means that for rectangle of size '(w,h)' starting at '(x,y)'
24 first pixel to draw would be '(x,y)' and last one would be '(x+w-1,y+h-1)'.
25 Especially when 'w' or 'h' is less than or equal to zero no action is taken.
27 [[Coordinates_Rectangle]]
28 .GP_RectangleXYWH(2, 1, 8, 4)
29 image::coordinates-2.svg["Coordinates Rectangle"]