Download Demo/Graphics/Extents.txt from hschumann2/TempleOS-Source-Code: direct link, hf CLI and curl.
- Browser
- Download file 959 Bytes
-
https://huggingface.co/datasets/hschumann2/TempleOS-Source-Code/resolve/main/Demo/Graphics/Extents.txt
- Command line
-
hf download hf://datasets/hschumann2/TempleOS-Source-Code/Demo/Graphics/Extents.txt
-
curl -L -o Extents.txt https://huggingface.co/datasets/hschumann2/TempleOS-Source-Code/resolve/main/Demo/Graphics/Extents.txt
959 Bytes
| //Test image which we will determine the extents of. | |
| <1>/* Graphics Not Rendered in HTML */ | |
| U0 Extents() | |
| { | |
| CDC *dc=DCAlias; | |
| I64 min_x,max_x,min_y,max_y; | |
| //Scrn, not win coordinates. | |
| I64 h=Fs->pix_left+Fs->scroll_x,v=Fs->pix_top+Fs->scroll_y; | |
| DocClear; | |
| DCFill; | |
| //This sets a flag to record the | |
| //extents of what we draw and inits | |
| //the max's and min's. Vals are | |
| //scrn coordinates. | |
| DCExtentsInit(dc); | |
| dc->thick=3; | |
| Sprite3(dc,40,GR_HEIGHT>>1,0,<1>); | |
| dc->color=LTRED; | |
| dc->thick=1; | |
| //This box is the extents. | |
| GrLine(dc,dc->min_x-h,dc->min_y-v,dc->max_x-h,dc->min_y-v); | |
| GrLine(dc,dc->min_x-h,dc->min_y-v,dc->min_x-h,dc->max_y-v); | |
| GrLine(dc,dc->max_x-h,dc->max_y-v,dc->max_x-h,dc->min_y-v); | |
| GrLine(dc,dc->max_x-h,dc->max_y-v,dc->min_x-h,dc->max_y-v); | |
| DCDel(dc); | |
| PressAKey; | |
| DCFill; | |
| SpriteExtents(<1>,&min_x,&max_x,&min_y,&max_y); | |
| "X: %d to %d\n",min_x,max_x; | |
| "Y: %d to %d\n",min_y,max_y; | |
| } | |
| Extents; | |