# Documentation

Menu

## IMagickLuminanceSource extends LuminanceSourceAbstract
in package

FinalYes
IMagickLuminanceSource.php : 26

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

### Table of Contents

#### Properties

$height : int
$luminances : array<string|int, int>
$options : SettingsContainerInterface|QROptions
$width : int
$imagick : Imagick

#### Methods

__construct() : mixed
  IMagickLuminanceSource constructor.
fromBlob() : static
  Creates a LuminanceSource instance from the given data blob
fromFile() : static
  Creates a LuminanceSource instance from the given file
getHeight() : int
getLuminances() : array<string|int, int>
  Fetches luminance data for the underlying bitmap. Values should be fetched using: `int luminance = array[y * width + x] & 0xff`
getRow() : array<string|int, int>
  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

#### $height

LuminanceSourceAbstract.php : 33
`protected int $height`

#### $luminances

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

#### $options

LuminanceSourceAbstract.php : 29
`protected SettingsContainerInterface|QROptions $options`

#### $width

LuminanceSourceAbstract.php : 32
`protected int $width`

#### $imagick

IMagickLuminanceSource.php : 28
`private Imagick $imagick`

### Methods

#### __construct()

IMagickLuminanceSource.php : 33

IMagickLuminanceSource constructor.

`public __construct(Imagick $imagick[, SettingsContainerInterface|QROptions $options = new QROptions() ]) : mixed`

##### Parameters

$imagick : Imagick
$options : SettingsContainerInterface|QROptions = new QROptions()

#### fromBlob()

IMagickLuminanceSource.php : 68

Creates a LuminanceSource instance from the given data blob

`public static fromBlob(string $blob[, SettingsContainerInterface|QROptions $options = new QROptions() ]) : static`

##### Parameters

$blob : string
$options : SettingsContainerInterface|QROptions = new QROptions()

##### Return values

static

#### fromFile()

IMagickLuminanceSource.php : 64

Creates a LuminanceSource instance from the given file

`public static fromFile(string $path[, SettingsContainerInterface|QROptions $options = new QROptions() ]) : static`

##### Parameters

$path : string
$options : SettingsContainerInterface|QROptions = new QROptions()

##### Return values

static

#### getHeight()

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

##### Return values

int —

The height of the bitmap.

#### getLuminances()

LuminanceSourceAbstract.php : 43

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

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

##### Return values

array<string|int, int> —

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 : 55

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, int>`

##### Parameters

$y : int

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

##### Return values

array<string|int, int> —

An array containing the luminance data.

#### getWidth()

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

##### Return values

int —

The width of the bitmap.

#### checkFile()

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

##### Parameters

$path : string

##### Tags

throws
  QRCodeDecoderException

##### Return values

string

#### setLuminancePixel()

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

##### Parameters

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

#### setLuminancePixels()

IMagickLuminanceSource.php : 55
`private setLuminancePixels() : void`

## Search results