[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> class-avif-info.php (summary)

Copyright (c) 2021, Alliance for Open Media. All rights reserved This source code is subject to the terms of the BSD 2 Clause License and the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was not distributed with this source code in the LICENSE file, you can obtain it at www.aomedia.org/license/software. If the Alliance for Open Media Patent License 1.0 was not distributed with this source code in the PATENTS file, you can obtain it at www.aomedia.org/license/patent.

File Size: 781 lines (30 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 classes

Tile:: (0 methods):

Prop:: (0 methods):

Dim_Prop:: (0 methods):

Chan_Prop:: (0 methods):

Features:: (2 methods):
  get_item_features()
  get_primary_item_features()

Box:: (1 method):
  parse()

Parser:: (7 methods):
  __construct()
  parse_ipco()
  parse_iprp()
  parse_iref()
  parse_meta()
  parse_ftyp()
  parse_file()

Defines 7 functions

  read_big_endian()
  read()
  skip()

Class: Tile  - X-Ref

Class: Prop  - X-Ref

Class: Dim_Prop  - X-Ref

Class: Chan_Prop  - X-Ref

Class: Features  - X-Ref

get_item_features( $target_item_id, $tile_depth )   X-Ref
Binds the width, height, bit depth and number of channels from stored internal features.

param: int     $target_item_id Id of the item whose features will be bound.
param: int     $tile_depth     Maximum recursion to search within tile-parent relations.
return: Status                 FOUND on success or NOT_FOUND on failure.

get_primary_item_features()   X-Ref
Finds the width, height, bit depth and number of channels of the primary item.

return: Status FOUND on success or NOT_FOUND on failure.

Class: Box  - X-Ref

parse( $handle, &$num_parsed_boxes, $num_remaining_bytes = MAX_SIZE )   X-Ref
Reads the box header.

param: stream  $handle              The resource the header will be parsed from.
param: int     $num_parsed_boxes    The total number of parsed boxes. Prevents timeouts.
param: int     $num_remaining_bytes The number of bytes that should be available from the resource.
return: Status                      FOUND on success or an error on failure.

Class: Parser  - X-Ref

__construct( $handle )   X-Ref
No description

parse_ipco( $num_remaining_bytes )   X-Ref
Parses an "ipco" box.

"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.

param: stream  $handle              The resource the box will be parsed from.
param: int     $num_remaining_bytes The number of bytes that should be available from the resource.
return: Status                      FOUND on success or an error on failure.

parse_iprp( $num_remaining_bytes )   X-Ref
Parses an "iprp" box.

The "ipco" box contain the properties which are linked to items by the "ipma" box.

param: stream  $handle              The resource the box will be parsed from.
param: int     $num_remaining_bytes The number of bytes that should be available from the resource.
return: Status                      FOUND on success or an error on failure.

parse_iref( $num_remaining_bytes )   X-Ref
Parses an "iref" box.

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.

param: stream  $handle              The resource the box will be parsed from.
param: int     $num_remaining_bytes The number of bytes that should be available from the resource.
return: Status                      FOUND on success or an error on failure.

parse_meta( $num_remaining_bytes )   X-Ref
Parses a "meta" box.

It looks for the primary item ID in the "pitm" box and recurses into other boxes
to find its features.

param: stream  $handle              The resource the box will be parsed from.
param: int     $num_remaining_bytes The number of bytes that should be available from the resource.
return: Status                      FOUND on success or an error on failure.

parse_ftyp()   X-Ref
Parses a file stream.

The file type is checked through the "ftyp" box.

return: bool True if the input stream is an AVIF bitstream or false.

parse_file()   X-Ref
Parses a file stream.

Features are extracted from the "meta" box.

return: bool True if the main features of the primary item were parsed or false.

Functions
Functions that are not part of a class:

read_big_endian( $input, $num_bytes )   X-Ref
Reads an unsigned integer with most significant bits first.

param: binary string $input     Must be at least $num_bytes-long.
param: int           $num_bytes Number of parsed bytes.
return: int                     Value.

read( $handle, $num_bytes )   X-Ref
Reads bytes and advances the stream position by the same count.

param: stream               $handle    Bytes will be read from this resource.
param: int                  $num_bytes Number of bytes read. Must be greater than 0.
return: binary string|false            The raw bytes or false on failure.

skip( $handle, $num_bytes )   X-Ref
Advances the stream position by the given offset.

param: stream $handle    Bytes will be skipped from this resource.
param: int    $num_bytes Number of skipped bytes. Can be 0.
return: bool             True on success or false on failure.



Generated : Tue Dec 24 08:20:01 2024 Cross-referenced by PHPXref