SetaPDF_Core_Image_Png Class representing an PNG image

File: /SetaPDF v2/Core/Image/Png.php

Class hierarchy

Summary

Properties

$_binaryReader

protected SetaPDF_Core_Reader_Binary SetaPDF_Core_Image_Png::$_binaryReader

Binary Reader

$_bitsPerComponent

protected integer SetaPDF_Core_Image_Png::$_bitsPerComponent = 8

Bits per component

$_colorSpace

protected integer SetaPDF_Core_Image_Png::$_colorSpace

The image type specific colorspace

$_dpiX

protected integer SetaPDF_Core_Image_Png::$_dpiX = 0

Dots-per-inch in the X direction

$_dpiY

protected integer SetaPDF_Core_Image_Png::$_dpiY = 0

Dots-per-inch in the Y direction

$_height

protected integer SetaPDF_Core_Image_Png::$_height

The pixel height

$_imageData

protected string SetaPDF_Core_Image_Png::$_imageData = ''

Image data

$_inverted

protected boolean todo SetaPDF_Core_Image_Png::$_inverted = false

Use it

Flag for color inversion

$_palette

protected string SetaPDF_Core_Image_Png::$_palette = ''

Palette data

$_transparency

protected array SetaPDF_Core_Image_Png::$_transparency = array()

Transparency data

$_width

protected integer SetaPDF_Core_Image_Png::$_width

The pixel width


Static Methods

get()

Get an image by a reader.

Parameters
$reader : SetaPDF_Core_Reader_ReaderInterface

The reader instance

Exceptions

Throws SetaPDF_Exception_NotImplemented If the image type is not supported (supported types: JPEG, PNG, JPEG2000).

getByPath()

public static SetaPDF_Core_Image::getByPath (
string $path
): SetaPDF_Core_Image

Get an image by a path.

Parameters
$path : string

The path to the image

getType()

Get an image type by a reader.

Parameters
$reader : SetaPDF_Core_Reader_ReaderInterface
 

Methods

__construct()

The constructor.

Parameters
$reader : SetaPDF_Core_Reader_ReaderInterface
 

_extractAlphaChannel()

protected SetaPDF_Core_Image_Png::_extractAlphaChannel (
array $decodeParameters
): array

Extracts the alpha channel from the image data.

Parameters
$decodeParameters : array
 

_process()

protected SetaPDF_Core_Image_Png::_process (
void
): void

Processes the image data so all needed information is available.

getBitsPerComponent()

public SetaPDF_Core_Image::getBitsPerComponent (
void
): number

Get the bits per component value.

getColorSpace()

public SetaPDF_Core_Image::getColorSpace (
void
): number

Get the image type specific colorspace.

getDpiX()

public SetaPDF_Core_Image::getDpiX (
void
): number

Get the dots-per-inch in the X direction.

getDpiY()

public SetaPDF_Core_Image::getDpiY (
void
): number

Get the dots-per-inch in the Y direction.

getHeight()

public SetaPDF_Core_Image::getHeight (
[ float $width = null ]
): number

Get the height.

Parameters
$width : float

Value for keeping the aspect ratio

getWidth()

public SetaPDF_Core_Image::getWidth (
[ float $height = null ]
): number

Get the width.

Parameters
$height : float

Value for keeping the aspect ratio

toXObject()

Converts the PNG image to an external object.

Parameters
$document : SetaPDF_Core_Document
 
Exceptions

Throws SetaPDF_Core_Image_Exception

See