setasign\SetaPDF2\Core\Image

Gif Class representing a GIF image

File: /SetaPDF v2/Core/Image/Gif.php
Old class name (alias): \SetaPDF_Core_Image_Gif

Class hierarchy

Summary

Constants

TYPE_GIF

public const string Image::TYPE_GIF = 'gif'

Image type

TYPE_JPEG

public const string Image::TYPE_JPEG = 'jpeg'

Image type

TYPE_JPEG2000

public const string Image::TYPE_JPEG2000 = 'jpeg2000'

Image type

TYPE_PNG

public const string Image::TYPE_PNG = 'png'

Image type

TYPE_TIFF

public const string Image::TYPE_TIFF = 'tiff'

Image type

TYPE_UNKNOWN

public const string Image::TYPE_UNKNOWN = 'unknown'

Image type


Properties

$_binaryReader

$_bitsPerComponent

protected int Image::$_bitsPerComponent = 8

Bits per component

$_colorSpace

protected int Image::$_colorSpace = -1

The image type specific colorspace

$_dpiX

protected int Image::$_dpiX = 0

Dots-per-inch in the X direction

$_dpiY

protected int Image::$_dpiY = 0

Dots-per-inch in the Y direction

$_frame

private int Gif::$_frame = 0

The frame that will get rendered when calling toXObject().

$_frames

The given frames.

$_height

protected int Image::$_height

The pixel height

$_inverted

protected bool Image::$_inverted = false

Flag for color inversion

$_width

protected int Image::$_width

The pixel width


Static Methods

get()

Get an image by a reader.

Parameters
$reader : \SetaPDF_Core_Reader_ReaderInterface

The reader instance

Exceptions

Throws \setasign\SetaPDF2\NotImplementedException If the image type is not supported (supported types: JPEG, PNG, JPEG2000).

getByPath()

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

Get an image by a path.

Parameters
$path : string

The path to the image

getType()

public static Image::getType (): string

Get an image type by a reader.

Parameters
$reader : \SetaPDF_Core_Reader_ReaderInterface
 

Methods

__construct()

The constructor.

Parameters
$reader : ?\SetaPDF_Core_Reader_ReaderInterface
 

_process()

protected Gif::_process (
void
): void

Processes the image data.

Exceptions

Throws Exception

Throws \setasign\SetaPDF2\NotImplementedException

getBitsPerComponent()

public Image::getBitsPerComponent (
void
): int

Get the bits per component value.

getColorSpace()

public Image::getColorSpace (
void
): number

Get the image type specific colorspace.

getDpiX()

public Image::getDpiX (
void
): number

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

getDpiY()

public Image::getDpiY (
void
): number

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

getFrame()

public Gif::getFrame (
void
): int

Get the active frame.

getFrameCount()

public Gif::getFrameCount (
void
): int

Returns the total number of available frames.

getHeight()

public Image::getHeight (
float $width = null
): number

Get the height.

Parameters
$width : float

Value for keeping the aspect ratio

getWidth()

public Image::getWidth (
float $height = null
): number

Get the width.

Parameters
$height : float

Value for keeping the aspect ratio

setFrame()

public Gif::setFrame (
int $value
): void

Sets the active frame.

Parameters
$value : int

Numbering starts by zero.

Exceptions

Throws Exception

toXObject()

Converts an image to an external object.

Parameters
$document : \SetaPDF_Core_Document
 
Exceptions

Throws Exception