TYPO3
7.6
|
Public Member Functions | |
gifBuild () | |
make () | |
checkTextObj ($conf) | |
calcOffset ($string) | |
checkFile ($file) | |
extension () | |
Public Member Functions inherited from GraphicalFunctions | |
init () | |
maskImageOntoImage (&$im, $conf, $workArea) | |
copyImageOntoImage (&$im, $conf, $workArea) | |
copyGifOntoGif (&$im, $cpImg, $conf, $workArea) | |
imagecopyresized (&$dstImg, $srcImg, $dstX, $dstY, $srcX, $srcY, $dstWidth, $dstHeight, $srcWidth, $srcHeight) | |
makeText (&$im, $conf, $workArea) | |
txtPosition ($conf, $workArea, $BB) | |
calcBBox ($conf) | |
addToMap ($cords, $conf) | |
calcTextCordsForMap ($cords, $offset, $conf) | |
SpacedImageTTFText (&$im, $fontSize, $angle, $x, $y, $Fcolor, $fontFile, $text, $spacing, $wordSpacing, $splitRenderingConf, $sF=1) | |
fontResize ($conf) | |
ImageTTFBBoxWrapper ($fontSize, $angle, $fontFile, $string, $splitRendering, $sF=1) | |
ImageTTFTextWrapper ($im, $fontSize, $angle, $x, $y, $color, $fontFile, $string, $splitRendering, $sF=1) | |
splitString ($string, $splitRendering, $fontSize, $fontFile) | |
calcWordSpacing ($conf, $scaleFactor=1) | |
getTextScalFactor ($conf) | |
makeOutline (&$im, $conf, $workArea, $txtConf) | |
circleOffset ($distance, $iterations) | |
makeEmboss (&$im, $conf, $workArea, $txtConf) | |
makeShadow (&$im, $conf, $workArea, $txtConf) | |
makeBox (&$im, $conf, $workArea) | |
makeEllipse (&$im, array $conf, array $workArea) | |
makeEffect (&$im, $conf) | |
IMparams ($setup) | |
adjust (&$im, $conf) | |
crop (&$im, $conf) | |
scale (&$im, $conf) | |
setWorkArea ($workArea) | |
autolevels (&$im) | |
outputLevels (&$im, $low, $high, $swap= '') | |
inputLevels (&$im, $low, $high) | |
IMreduceColors ($file, $cols) | |
prependAbsolutePath ($fontFile) | |
v5_sharpen ($factor) | |
v5_blur ($factor) | |
randomName () | |
applyOffset ($cords, $OFFSET) | |
convertColor ($string) | |
recodeString ($string) | |
singleChars ($theText, $returnUnicodeNumber=false) | |
objPosition ($conf, $workArea, $BB) | |
imageMagickConvert ($imagefile, $newExt= '', $w= '', $h= '', $params= '', $frame= '', $options=array(), $mustCreate=false) | |
getImageDimensions ($imageFile) | |
getImageScale ($info, $w, $h, $options) | |
imageMagickIdentify ($imagefile) | |
imageMagickExec ($input, $output, $params, $frame=0) | |
combineExec ($input, $overlay, $mask, $output, $handleNegation=false) | |
checkFile ($file) | |
createTempSubDir ($dirName) | |
applyImageMagickToPHPGif (&$im, $command) | |
gif_or_jpg ($type, $w, $h) | |
output ($file) | |
destroy () | |
imgTag ($imgInfo) | |
ImageWrite ($destImg, $theImage, $quality=0) | |
imageCreateFromFile ($sourceImg) | |
hexColor ($col) | |
unifyColors (&$img, $colArr, $closest=false) | |
getTemporaryImageWithText ($filename, $textline1, $textline2, $textline3) | |
Protected Member Functions | |
calculateValue ($string) | |
calculateFunctions ($string) | |
calculateMaximum ($string) | |
Protected Member Functions inherited from GraphicalFunctions | |
renderTTFText (&$im, $fontSize, $angle, $x, $y, $color, $fontFile, $string, $splitRendering, $conf, $sF=1) | |
getWordPairsForLineBreak ($string) | |
getRenderedTextWidth ($text, $conf) | |
getBreakSpace ($conf, array $boundingBox=null) | |
generateCacheKeyForImageFile ($filePath) | |
generateStatusHashForImageFile ($filePath) | |
Additional Inherited Members | |
Static Public Member Functions inherited from GraphicalFunctions | |
static | gifCompress ($theFile, $type) |
static | pngToGifByImagemagick ($theFile) |
static | readPngGif ($theFile, $output_png=false) |
Protected Attributes inherited from GraphicalFunctions | |
$colorspace = 'RGB' | |
$allowedColorSpaceNames | |
$saveAlphaLayer = false | |
GIFBUILDER
Generating gif/png-files from TypoScript Used by the menu-objects and imgResource in TypoScript.
This class allows for advanced rendering of images with various layers of images, text and graphical primitives. The concept is known from TypoScript as "GIFBUILDER" where you can define a "numerical array" (TypoScript term as well) of "GIFBUILDER OBJECTS" (like "TEXT", "IMAGE", etc.) and they will be rendered onto an image one by one. The name "GIFBUILDER" comes from the time where GIF was the only file format supported. PNG is just as well to create today (configured with TYPO3_CONF_VARS[GFX]) Not all instances of this class is truely building gif/png files by layers; You may also see the class instantiated for the purpose of using the scaling functions in the parent class.
Here is an example of how to use this class (from tslib_content.php, function getImgResource):
$gifCreator = GeneralUtility::makeInstance(::class); $gifCreator->init(); $theImage=''; if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']) { $gifCreator->start($fileArray, $this->data); $theImage = $gifCreator->gifBuild(); } return $gifCreator->getImageDimensions($theImage);
Definition at line 48 of file GifBuilder.php.
calcOffset | ( | $string | ) |
Calculation of offset using "splitCalc" and insertion of dimensions from other GIFBUILDER objects.
Example: Input: 2+2, 2*3, 123, [10.w] Output: 4,6,123,45 (provided that the width of object in position 10 was 45 pixels wide)
string | $string | The string to resolve/calculate the result of. The string is divided by a comma first and each resulting part is calculated into an integer. |
Definition at line 690 of file GifBuilder.php.
References GifBuilder\calculateFunctions(), GifBuilder\calculateValue(), and GeneralUtility\trimExplode().
Referenced by GifBuilder\calculateMaximum().
|
protected |
Calculates special functions:
string | $string | The raw string with functions to be calculated |
Definition at line 839 of file GifBuilder.php.
References GifBuilder\calculateMaximum().
Referenced by GifBuilder\calcOffset().
|
protected |
Calculates the maximum of a set of values defined like "[10.h],[20.h],1000"
string | $string | The string to be used to calculate the maximum (e.g. "[10.h],[20.h],1000") |
Definition at line 855 of file GifBuilder.php.
References GifBuilder\calcOffset(), and GeneralUtility\trimExplode().
Referenced by GifBuilder\calculateFunctions().
|
protected |
Calculates the value concerning the dimensions of objects.
string | $string | The string to be calculated (e.g. "[20.h]+13") |
Definition at line 790 of file GifBuilder.php.
References elseif, and GeneralUtility\splitCalc().
Referenced by GifBuilder\calcOffset().
checkFile | ( | $file | ) |
Returns the reference to a "resource" in TypoScript.
string | $file | The resource value. |
Definition at line 733 of file GifBuilder.php.
References $GLOBALS.
Referenced by GifBuilder\checkTextObj().
checkTextObj | ( | $conf | ) |
Initializing/Cleaning of TypoScript properties for TEXT GIFBUILDER objects
'cleans' TEXT-object; Checks fontfile and other vital setup Finds the title if its a 'variable' (instantiates a cObj and loads it with the ->data record) Performs caseshift if any.
array | $conf | GIFBUILDER object TypoScript properties |
Definition at line 592 of file GifBuilder.php.
References GifBuilder\$cObj, GifBuilder\checkFile(), and GeneralUtility\makeInstance().
Referenced by GifBuilder\make().
extension | ( | ) |
Returns the file extension used in the filename
Definition at line 764 of file GifBuilder.php.
References GraphicalFunctions\$gifExtension.
gifBuild | ( | ) |
Initiates the image file generation if ->setup is TRUE and if the file did not exist already. Gets filename from fileName() and if file exists in typo3temp/ dir it will - of course - not be rendered again. Otherwise rendering means calling ->make(), then ->output(), then ->destroy()
Definition at line 387 of file GifBuilder.php.
References GraphicalFunctions\createTempSubDir(), GraphicalFunctions\destroy(), GifBuilder\make(), and GraphicalFunctions\output().
make | ( | ) |
The actual rendering of the image file. Basically sets the dimensions, the background color, the traverses the array of GIFBUILDER objects and finally setting the transparent color if defined. Creates a GDlib resource in $this->im and works on that Called by gifBuild()
Definition at line 416 of file GifBuilder.php.
References GifBuilder\$defaultWorkArea, GifBuilder\$XY, GraphicalFunctions\adjust(), GifBuilder\checkTextObj(), GraphicalFunctions\convertColor(), GraphicalFunctions\copyImageOntoImage(), GraphicalFunctions\crop(), elseif, GraphicalFunctions\makeBox(), GraphicalFunctions\makeEffect(), GraphicalFunctions\makeEllipse(), GraphicalFunctions\makeEmboss(), GraphicalFunctions\makeOutline(), GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), GraphicalFunctions\maskImageOntoImage(), GraphicalFunctions\scale(), GraphicalFunctions\setWorkArea(), TemplateService\sortedKeyList(), and GraphicalFunctions\unifyColors().
Referenced by GifBuilder\gifBuild().
$charRangeMap = array() |
Definition at line 124 of file GifBuilder.php.
$cObj |
Definition at line 139 of file GifBuilder.php.
Referenced by GifBuilder\checkTextObj().
$combinedFileNames = array() |
Definition at line 102 of file GifBuilder.php.
$combinedTextStrings = array() |
Definition at line 95 of file GifBuilder.php.
$data = array() |
Definition at line 109 of file GifBuilder.php.
$defaultWorkArea = array() |
Definition at line 144 of file GifBuilder.php.
Referenced by GifBuilder\make().
$h = 0 |
Definition at line 69 of file GifBuilder.php.
$im = '' |
Definition at line 55 of file GifBuilder.php.
$map |
Definition at line 76 of file GifBuilder.php.
$myClassName = 'gifbuilder' |
Definition at line 119 of file GifBuilder.php.
$objBB = array() |
Definition at line 114 of file GifBuilder.php.
$OFFSET = array() |
Definition at line 134 of file GifBuilder.php.
$setup = array() |
Definition at line 88 of file GifBuilder.php.
$w = 0 |
Definition at line 62 of file GifBuilder.php.
$workArea |
Definition at line 81 of file GifBuilder.php.
$XY = array() |
Definition at line 129 of file GifBuilder.php.
Referenced by GifBuilder\make().