void calcImgDim(
$zoomFctr
)
|
|
Parameters:
API Tags:
array genImage(
integer
$reqZoom, [integer
$funcDepth = 0]
)
|
|
Generate an image filename/type of the correct zoom
Ideally, this will already be done for us (or cached). But if not, then we'll need to handle things.
"Handle things" means to generate and use mipmaps. In 3D rendering, we would, scale the image down to half the size in each dimension, and save it. This should only take 1.333... the size of the original file. We'll vary a bit here depending on the compression techniques and requested zoom ratios.
The mipmap will be saved in GD2 image format with lossless compression. The default chunk size is 4x the size of a SMap_Tile. If the original file is newer than the mipmap file, the mipmap is regenerated. The file is saved in the caching directory, with the file name: mipmap_md5($origFName)_$zoom.gd2
Lock files should be used to prevent us from generating more than one of the same mipmap at the same time.
The returned array has indicies in ['fname'], ['type'].
Parameters:
|
integer |
$reqZoom: |
Zoom level |
|
integer |
$funcDepth: |
Recursive function depth |
API Tags:
| Return: | Image attributes |
| Access: | protected |
resource loadImage(
SMap_Canvas
$canvas, integer
$zoom, integer
$vx, integer
$vy, integer
$rx, integer
$ry,
$width,
$height
)
|
|
Open an image (or part of one)
It is strongly recommended that all source images are in GD2 format to make this function more efficent than the other formats that could be used. GD2 is a format native to the GD library that PHP uses, so it will be faster when reading and writing. GD2 also stores the image itself as "chunks"
If the height or width parameters are -1, the entire image is loaded.
All parameters are in pixels.
Parameters:
|
object Canvas |
$canvas: |
|
|
integer |
$zoom: |
Zoom level |
|
integer |
$vx: |
Lower left X |
|
integer |
$vy: |
Lower left Y |
|
integer |
$rx: |
Chunk width |
|
integer |
$ry: |
Chunk height |
|
|
$width: |
|
|
|
$height: |
|
API Tags:
| Return: | GD Image resource |
| Access: | protected |