Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
testing.tools.strip_jp2_comments Namespace Reference

Functions

 parse_box (buffer, offset)
 
 parse_marker (buffer, offset)
 
 rewrite_jp2c (buffer)
 
 main (in_file, out_file)
 

Variables

int BOX_HEADER_SIZE = 8
 
str BOX_TAG_JP2C = b'jp2c'
 
int MARKER_SIZE = 2
 
int MARKER_START = 0xff
 
int MARKER_TAG_IGNORE = 0x00
 
int MARKER_TAG_COMMENT = 0x64
 
int MARKER_TAG_FILL = 0xff
 

Detailed Description

Strips comments from a JP2 file.

This is a simple filter script to strip comments from a JP2 file, in order to
save a few bytes from the final file size.

Function Documentation

◆ main()

testing.tools.strip_jp2_comments.main ( in_file,
out_file )

Definition at line 105 of file strip_jp2_comments.py.

References main(), testing.tools.strip_jp2_comments.parse_box(), and testing.tools.strip_jp2_comments.rewrite_jp2c().

+ Here is the call graph for this function:

◆ parse_box()

testing.tools.strip_jp2_comments.parse_box ( buffer,
offset )
Parses the next box in a JP2 file.

Args:
  buffer: A buffer containing the JP2 file contents.
  offset: The starting offset into the buffer.

Returns:
  A tuple (next_offset, tag) where next_offset is the ending offset, and tag
  is the type tag. The box contents will be buffer[offset + 8:next_offset].

Definition at line 24 of file strip_jp2_comments.py.

Referenced by testing.tools.strip_jp2_comments.main().

+ Here is the caller graph for this function:

◆ parse_marker()

testing.tools.strip_jp2_comments.parse_marker ( buffer,
offset )
Parses the next marker in a codestream.

Args:
  buffer: A buffer containing the codestream.
  offset: The starting offset into the buffer.

Returns:
  A tuple (next_offset, tag) where next_offset is the offset after the marker,
  and tag is the type tag. If no marker was found, next_offset will point to
  the end of the buffer, and tag will be None. A marker is always 2 bytes.

Definition at line 39 of file strip_jp2_comments.py.

Referenced by testing.tools.strip_jp2_comments.rewrite_jp2c().

+ Here is the caller graph for this function:

◆ rewrite_jp2c()

testing.tools.strip_jp2_comments.rewrite_jp2c ( buffer)

Definition at line 76 of file strip_jp2_comments.py.

References bytearray, and testing.tools.strip_jp2_comments.parse_marker().

Referenced by testing.tools.strip_jp2_comments.main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ BOX_HEADER_SIZE

int testing.tools.strip_jp2_comments.BOX_HEADER_SIZE = 8

Definition at line 14 of file strip_jp2_comments.py.

◆ BOX_TAG_JP2C

str testing.tools.strip_jp2_comments.BOX_TAG_JP2C = b'jp2c'

Definition at line 15 of file strip_jp2_comments.py.

◆ MARKER_SIZE

int testing.tools.strip_jp2_comments.MARKER_SIZE = 2

Definition at line 17 of file strip_jp2_comments.py.

◆ MARKER_START

int testing.tools.strip_jp2_comments.MARKER_START = 0xff

Definition at line 18 of file strip_jp2_comments.py.

◆ MARKER_TAG_COMMENT

int testing.tools.strip_jp2_comments.MARKER_TAG_COMMENT = 0x64

Definition at line 20 of file strip_jp2_comments.py.

◆ MARKER_TAG_FILL

int testing.tools.strip_jp2_comments.MARKER_TAG_FILL = 0xff

Definition at line 21 of file strip_jp2_comments.py.

◆ MARKER_TAG_IGNORE

int testing.tools.strip_jp2_comments.MARKER_TAG_IGNORE = 0x00

Definition at line 19 of file strip_jp2_comments.py.