Menu

## GDLuminanceSource extends LuminanceSourceAbstract
in package

GDLuminanceSource.php : 25

This class is used to help decode images from files which arrive as GD Resource It does not support rotation.

### Table of Contents

$gdImage : resource|GdImage
$height : int
$luminances : array<string|int, mixed>
$options : SettingsContainerInterface
$width : int
__construct() : mixed
  GDLuminanceSource constructor.
fromBlob() : self
fromFile() : self
getHeight() : int
getLuminances() : array<string|int, mixed>
  Fetches luminance data for the underlying bitmap. Values should be fetched using: `int luminance = array[y * width + x] & 0xff`
getRow() : array<string|int, mixed>
  Fetches one row of luminance data from the underlying platform's bitmap. Values range from 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have to bitwise and with 0xff for each value. It is preferable for implementations of this method to only fetch this row rather than the whole image, since no 2D Readers may be installed and getLuminances() may never be called.
getWidth() : int
checkFile() : string
setLuminancePixel() : void
setLuminancePixels() : void

### Properties

#### $gdImage

GDLuminanceSource.php : 30
`protected resource|GdImage $gdImage`

#### $height

LuminanceSourceAbstract.php : 34
`protected int $height`

#### $luminances

LuminanceSourceAbstract.php : 32
`protected array<string|int, mixed> $luminances`

#### $options

LuminanceSourceAbstract.php : 31
`protected SettingsContainerInterface $options`

#### $width

LuminanceSourceAbstract.php : 33
`protected int $width`

### Methods

#### __construct()

GDLuminanceSource.php : 40

GDLuminanceSource constructor.

`public __construct(resource|GdImage $gdImage[, SettingsContainerInterface|null $options = null ]) : mixed`

##### Parameters

$gdImage : resource|GdImage
$options : SettingsContainerInterface|null = null

##### Tags

throws
  QRCodeDecoderException

##### Return values

mixed —

#### fromBlob()

GDLuminanceSource.php : 88
`public static fromBlob(string $blob[, SettingsContainerInterface $options = null ]) : self`

##### Parameters

$blob : string
$options : SettingsContainerInterface = null

##### Tags

inheritDoc

##### Return values

self —

#### fromFile()

GDLuminanceSource.php : 83
`public static fromFile(string $path[, SettingsContainerInterface $options = null ]) : self`

##### Parameters

$path : string
$options : SettingsContainerInterface = null

##### Tags

inheritDoc

##### Return values

self —

#### getHeight()

LuminanceSourceAbstract.php : 58
`public getHeight() : int`

##### Tags

inheritDoc

##### Return values

int —

The height of the bitmap.

#### getLuminances()

LuminanceSourceAbstract.php : 48

Fetches luminance data for the underlying bitmap. Values should be fetched using: `int luminance = array[y * width + x] & 0xff`

`public getLuminances() : array<string|int, mixed>`

##### Tags

inheritDoc

##### Return values

array<string|int, mixed> —

A row-major 2D array of luminance values. Do not use result $length as it may be larger than $width * $height bytes on some platforms. Do not modify the contents of the result.

#### getRow()

LuminanceSourceAbstract.php : 63

Fetches one row of luminance data from the underlying platform's bitmap. Values range from 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have to bitwise and with 0xff for each value. It is preferable for implementations of this method to only fetch this row rather than the whole image, since no 2D Readers may be installed and getLuminances() may never be called.

`public getRow(int $y) : array<string|int, mixed>`

##### Parameters

$y : int

  The row to fetch, which must be in [0,getHeight())

##### Tags

inheritDoc

##### Return values

array<string|int, mixed> —

An array containing the luminance data.

#### getWidth()

LuminanceSourceAbstract.php : 53
`public getWidth() : int`

##### Tags

inheritDoc

##### Return values

int —

The width of the bitmap.

#### checkFile()

LuminanceSourceAbstract.php : 90
`protected static checkFile(string $path) : string`

##### Parameters

$path : string

##### Tags

throws
  QRCodeDecoderException

##### Return values

string —

#### setLuminancePixel()

LuminanceSourceAbstract.php : 79
`protected setLuminancePixel(int $r, int $g, int $b) : void`

##### Parameters

$r : int
$g : int
$b : int

##### Return values

void —

#### setLuminancePixels()

GDLuminanceSource.php : 60
`protected setLuminancePixels() : void`

##### Return values

void —

## Search results