escpos-php
Public Member Functions | Protected Member Functions | List of all members
Mike42\Escpos\GdEscposImage Class Reference

Implementation of EscposImage using the GD PHP plugin. More...

Inheritance diagram for Mike42\Escpos\GdEscposImage:
Inheritance graph
[legend]
Collaboration diagram for Mike42\Escpos\GdEscposImage:
Collaboration graph
[legend]

Public Member Functions

 readImageFromGdResource ($im)
 Load actual image pixels from GD resource. More...
 
- Public Member Functions inherited from Mike42\Escpos\EscposImage
 __construct ($filename=null, $allowOptimisations=true)
 Construct a new EscposImage. More...
 
 getHeight ()
 
 getHeightBytes ()
 
 getWidth ()
 
 getWidthBytes ()
 
 toRasterFormat ()
 Output the image in raster (row) format. More...
 
 toColumnFormat ($doubleDensity=false)
 Output the image in column format. More...
 

Protected Member Functions

 loadImageData (string $filename=null)
 Load an image from disk, into memory, using GD. More...
 
- Protected Member Functions inherited from Mike42\Escpos\EscposImage
 loadImageData (string $filename=null)
 Load an image from disk. More...
 
 setImgData ($data)
 Set image data. More...
 
 setImgWidth ($width)
 Set image width. More...
 
 setImgHeight ($height)
 Set image height. More...
 
 getRasterFormatFromFile ($filename=null)
 
 getColumnFormatFromFile ($filename=null, $highDensityVertical=true)
 

Additional Inherited Members

- Static Public Member Functions inherited from Mike42\Escpos\EscposImage
static isGdLoaded ()
 
static isImagickLoaded ()
 
static load (string $filename, bool $allowOptimisations=true, array $preferred=['imagick', 'gd', 'native'])
 This is a convinience method to load an image from file, auto-selecting an EscposImage implementation which uses an available library. More...
 
- Protected Attributes inherited from Mike42\Escpos\EscposImage
 $imgHeight = 0
 height of the image.
 
 $imgWidth = 0
 width of the image
 

Detailed Description

Implementation of EscposImage using the GD PHP plugin.

Member Function Documentation

◆ loadImageData()

Mike42\Escpos\GdEscposImage::loadImageData ( string  $filename = null)
protected

Load an image from disk, into memory, using GD.

Parameters
string | null$filenameThe filename to load from
Exceptions
Exceptionif the image format is not supported, or the file cannot be opened.

◆ readImageFromGdResource()

Mike42\Escpos\GdEscposImage::readImageFromGdResource (   $im)

Load actual image pixels from GD resource.

Parameters
resource$imGD resource to use
Exceptions
ExceptionWhere the image can't be read.

The documentation for this class was generated from the following file: