Menu

## LuminanceSourceInterface
in

LuminanceSourceInterface.php : 15

### Table of Contents

fromBlob() : self
  Creates a LuminanceSource instance from the given data blob
fromFile() : self
  Creates a LuminanceSource instance from the given file
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

### Methods

#### fromBlob()

LuminanceSourceInterface.php : 59

Creates a LuminanceSource instance from the given data blob

`public static fromBlob(string $blob) : self`

##### Parameters

$blob : string

##### Return values

self —

#### fromFile()

LuminanceSourceInterface.php : 54

Creates a LuminanceSource instance from the given file

`public static fromFile(string $path) : self`

##### Parameters

$path : string

##### Return values

self —

#### getHeight()

LuminanceSourceInterface.php : 35
`public getHeight() : int`

##### Return values

int —

The height of the bitmap.

#### getLuminances()

LuminanceSourceInterface.php : 25

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

##### 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()

LuminanceSourceInterface.php : 49

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

throws
  QRCodeDecoderException

##### Return values

array<string|int, mixed> —

An array containing the luminance data.

#### getWidth()

LuminanceSourceInterface.php : 30
`public getWidth() : int`

##### Return values

int —

The width of the bitmap.

## Search results