PHP Class Newscoop\Image\Rendition

Show file Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$coords string
$height integer
$label string
$name string
$offset integer
$specs string
$width integer

Public Methods

Method Description
__construct ( integer $width, integer $height, string $specs = 'fit', string $name = null, integer $offset = null, string $label = null )
__toString ( ) : string
fits ( Newscoop\Image\ImageInterface $image ) : boolean Test if rendition fits image
generateImage ( string $imagePath ) : Imagine\Gd\Image Generate image
getAspectRatio ( ) : float Get aspect ratio
getHeight ( ) : integer Get height
getInfo ( ) : string Get info
getLabel ( ) : string Get label
getMinSize ( Newscoop\Image\ImageInterface $image ) : array Get min size
getName ( ) : string Get name
getPreview ( integer $width, integer $height ) : Newscoop\Image\Rendition Get preview
getSelectArea ( Newscoop\Image\ImageInterface $image ) : array Get select area
getSpecs ( ) : string Get specification
getThumbnail ( Newscoop\Image\ImageInterface $image, ImageService $imageService ) : Newscoop\Image\Thumbnail Get thumbnail
getWidth ( ) : void Get width
isCrop ( ) : boolean Test if is crop defined
setCoords ( string $coords ) : void Set coordinates for image
setHeight ( integer $height ) : void Set height
setLabel ( string $label ) : void Set label
setOffset ( integer $offset ) : void Set offset
setSpecs ( string $specs ) : void Set specification
setWidth ( integer $width ) : void Set width

Private Methods

Method Description
getFlags ( ) : integer Get flags

Method Details

__construct() public method

public __construct ( integer $width, integer $height, string $specs = 'fit', string $name = null, integer $offset = null, string $label = null )
$width integer
$height integer
$specs string
$name string
$offset integer
$label string

__toString() public method

public __toString ( ) : string
return string

fits() public method

Test if rendition fits image
public fits ( Newscoop\Image\ImageInterface $image ) : boolean
$image Newscoop\Image\ImageInterface
return boolean

generateImage() public method

Generate image
public generateImage ( string $imagePath ) : Imagine\Gd\Image
$imagePath string
return Imagine\Gd\Image

getAspectRatio() public method

Get aspect ratio
public getAspectRatio ( ) : float
return float

getHeight() public method

Get height
public getHeight ( ) : integer
return integer

getInfo() public method

Get info
public getInfo ( ) : string
return string

getLabel() public method

Get label
public getLabel ( ) : string
return string

getMinSize() public method

Get min size
public getMinSize ( Newscoop\Image\ImageInterface $image ) : array
$image Newscoop\Image\ImageInterface
return array

getName() public method

Get name
public getName ( ) : string
return string

getPreview() public method

Get preview
public getPreview ( integer $width, integer $height ) : Newscoop\Image\Rendition
$width integer
$height integer
return Newscoop\Image\Rendition

getSelectArea() public method

Get select area
public getSelectArea ( Newscoop\Image\ImageInterface $image ) : array
$image Newscoop\Image\ImageInterface
return array

getSpecs() public method

Get specification
public getSpecs ( ) : string
return string

getThumbnail() public method

Get thumbnail
public getThumbnail ( Newscoop\Image\ImageInterface $image, ImageService $imageService ) : Newscoop\Image\Thumbnail
$image Newscoop\Image\ImageInterface
$imageService ImageService
return Newscoop\Image\Thumbnail

getWidth() public method

Get width
public getWidth ( ) : void
return void

isCrop() public method

Test if is crop defined
public isCrop ( ) : boolean
return boolean

setCoords() public method

Set coordinates for image
public setCoords ( string $coords ) : void
$coords string
return void

setHeight() public method

Set height
public setHeight ( integer $height ) : void
$height integer
return void

setLabel() public method

Set label
public setLabel ( string $label ) : void
$label string
return void

setOffset() public method

Set offset
public setOffset ( integer $offset ) : void
$offset integer
return void

setSpecs() public method

Set specification
public setSpecs ( string $specs ) : void
$specs string
return void

setWidth() public method

Set width
public setWidth ( integer $width ) : void
$width integer
return void

Property Details

$coords protected property

protected string $coords
return string

$height protected property

protected int $height
return integer

$label protected property

protected string $label
return string

$name protected property

protected string $name
return string

$offset protected property

protected int $offset
return integer

$specs protected property

protected string $specs
return string

$width protected property

protected int $width
return integer