Parser
in package
Table of Contents
Properties
- $features : mixed
- $data_was_skipped : mixed
- $handle : mixed
- $num_parsed_boxes : mixed
Methods
- __construct() : mixed
- parse_file() : bool
- Parses a file stream.
- parse_ftyp() : bool
- Parses a file stream.
- parse_ipco() : Status
- Parses an "ipco" box.
- parse_iprp() : Status
- Parses an "iprp" box.
- parse_iref() : Status
- Parses an "iref" box.
- parse_meta() : Status
- Parses a "meta" box.
Properties
$features
public
mixed
$features
$data_was_skipped
private
mixed
$data_was_skipped
= false
$handle
private
mixed
$handle
$num_parsed_boxes
private
mixed
$num_parsed_boxes
= 0
Methods
__construct()
public
__construct(mixed $handle) : mixed
Parameters
- $handle : mixed
parse_file()
Parses a file stream.
public
parse_file() : bool
Features are extracted from the "meta" box.
Return values
bool —True if the main features of the primary item were parsed or false.
parse_ftyp()
Parses a file stream.
public
parse_ftyp() : bool
The file type is checked through the "ftyp" box.
Return values
bool —True if the input stream is an AVIF bitstream or false.
parse_ipco()
Parses an "ipco" box.
private
parse_ipco(int $num_remaining_bytes) : Status
"ispe" is used for width and height, "pixi" and "av1C" are used for bit depth and number of channels, and "auxC" is used for alpha.
Parameters
- $num_remaining_bytes : int
-
The number of bytes that should be available from the resource.
Return values
Status —FOUND on success or an error on failure.
parse_iprp()
Parses an "iprp" box.
private
parse_iprp(int $num_remaining_bytes) : Status
The "ipco" box contain the properties which are linked to items by the "ipma" box.
Parameters
- $num_remaining_bytes : int
-
The number of bytes that should be available from the resource.
Return values
Status —FOUND on success or an error on failure.
parse_iref()
Parses an "iref" box.
private
parse_iref(int $num_remaining_bytes) : Status
The "dimg" boxes contain links between tiles and their parent items, which can be used to infer bit depth and number of channels for the primary item when the latter does not have these properties.
Parameters
- $num_remaining_bytes : int
-
The number of bytes that should be available from the resource.
Return values
Status —FOUND on success or an error on failure.
parse_meta()
Parses a "meta" box.
private
parse_meta(int $num_remaining_bytes) : Status
It looks for the primary item ID in the "pitm" box and recurses into other boxes to find its features.
Parameters
- $num_remaining_bytes : int
-
The number of bytes that should be available from the resource.
Return values
Status —FOUND on success or an error on failure.