phpDocumentor SMap
Objects
[ class tree: SMap ] [ index: SMap ] [ all elements ]

Class: SMap_Object_Area_Raster

Source Location: /SMap/Object.php

Class SMap_Object_Area_Raster

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From SMap_Object_Area_Rec

SMap_Object_Area_Rec::$overlaps
SMap_Object_Area_Rec::$rectBounds

Inherited From SMap_Object_Area

SMap_Object_Area::$borderColor

Inherited From SMap_Object

SMap_Object::$alt
SMap_Object::$color
SMap_Object::$label
SMap_Object::$layer
SMap_Object::$map
SMap_Object::$tile
SMap_Object::$url
SMap_Object::$view

Inherited From SMap_Object_Area_Rec

SMap_Object_Area_Rec::__construct()
Give the object a context
SMap_Object_Area_Rec::applyTile()
SMap_Object_Area_Rec::draw()
Draw this rectangle on an image
SMap_Object_Area_Rec::drawBox()
Draw this rectangle
SMap_Object_Area_Rec::drawShadow()
Draw a shadow around an area, prepare for the main rect to be drawn
SMap_Object_Area_Rec::findOverlap()
Finds if and how a viewport falls on an rectangle
SMap_Object_Area_Rec::getInnerBounds()
SMap_Object_Area_Rec::handleWrap()
Handle wrapping of an rectangle in a viewport
SMap_Object_Area_Rec::label()
Place the label on the rectangle
SMap_Object_Area_Rec::map()
Retrn the appropriate image map for this rectangle

Inherited From SMap_Object_Area

SMap_Object_Area::setBrdrColor()
Set the border color for this image

Inherited From SMap_Object

SMap_Object::__construct()
Give the object a context
SMap_Object::applyTile()
Apply a tile to this object
SMap_Object::draw()
Draw this object on a canvas
SMap_Object::getInnerBounds()
Get the rough inner rectangular bounds for this object.
SMap_Object::label()
Are we drawing a label for this object?
SMap_Object::map()
Return a map of this object
SMap_Object::setColor()
Set the color for this object
SMap_Object::setLink()
Set this to link to something

[ Top ]
Property Summary
array   $files   Raster image files

[ Top ]
Method Summary
SMap_Object_Area_Raster   __construct()   Give the object a context
void   calcImgDim()  
void   draw()   Place this image on the canvas
array   genImage()   Generate an image filename/type of the correct zoom
resource   loadImage()   Open an image (or part of one)

[ Top ]
Properties
array   $files [line 1464]

Raster image files

API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 1471]

  SMap_Object_Area_Raster __construct( SMap_View $view, SMap_Layer $layer, $rectBounds, $files  )

Give the object a context

Parameters:
SMap_View   $view: 
SMap_Layer   $layer: 
   $rectBounds: 
   $files: 

API Tags:
Access:  public


Redefinition of:
SMap_Object_Area_Rec::__construct()
Give the object a context

[ Top ]
calcImgDim  [line 1741]

  void calcImgDim( $zoomFctr  )

Parameters:
   $zoomFctr: 

API Tags:
Access:  protected


[ Top ]
draw  [line 1752]

  void draw( SMap_Canvas $canvas  )

Place this image on the canvas

Parameters:
object   $canvas: 

API Tags:
Access:  public


Redefinition of:
SMap_Object_Area_Rec::draw()
Draw this rectangle on an image

[ Top ]
genImage  [line 1573]

  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


[ Top ]
loadImage  [line 1497]

  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


[ Top ]

Documentation generated on Mon, 09 Apr 2007 18:55:00 -0500 by phpDocumentor 1.3.0