Struct openexr::tiled::tiled_input_file::TiledInputFile [−][src]
#[repr(transparent)]pub struct TiledInputFile(_);
Expand description
A TiledInputFile represents reading a tiled EXR file from disk.
Implementations
A constructor that opens the file with the specified name, and reads the file header. The num_threads parameter specifies how many worker threads this file will try to keep busy when decompressing individual tiles. Destroying TiledInputFile objects constructed with this constructor automatically closes the corresponding files.
Errors
This will return an error if the file is not tiled.
Set the current frame buffer – copies the FrameBuffer object into the TiledInputFile object.
The current frame buffer is the destination for the pixel data read from the file. The current frame buffer must be set at least once before read_tile() is called. The current frame buffer can be changed after each call to read_tile().
Errors
Error::InvalidArgument
- if the sampling factors do not match or if the frame buffer does not have a sample count slice.
Access to the current frame buffer
Check if all pixels in the data window are present in the input file
Get the tiles’ x dimension
Get the tiles’ y dimension
Get the level mode
Get the level rounding mode
Get the number of levels in the file
Returns
Ok(1)
ifTiledInputFile::level_mode()
==LevelMode::OneLevel
Ok(rfunc (log (max (w, h)) / log (2)) + 1)
ifTiledInputFile::level_mode()
==LevelMode::MipmapLevels
Err(Error::Logic)
ifTiledInputFile::level_mode()
==LevelMode::RipmapLevels
where rfunc
is either floor()
or ceil()
depending on whether
TiledInputFile::level_rounding_mode()
is LevelRoundingMode::RoundUp
or LevelRoundingMode::RoundDown
Get the number of levels in the file in the x axis
Returns
1
ifTiledInputFile::level_mode()
==LevelMode::OneLevel
rfunc (log (max (w, h)) / log (2)) + 1
ifTiledInputFile::level_mode()
==LevelMode::MipmapLevels
rfunc (log (w) / log (2)) + 1
ifTiledInputFile::level_mode()
==LevelMode::RipmapLevels
where rfunc
is either floor()
or ceil()
depending on whether
TiledInputFile::level_rounding_mode()
is LevelRoundingMode::RoundUp
or LevelRoundingMode::RoundDown
Get the number of levels in the file in the x axis
Returns
1
ifTiledInputFile::level_mode()
==LevelMode::OneLevel
rfunc (log (max (w, h)) / log (2)) + 1
ifTiledInputFile::level_mode()
==LevelMode::MipmapLevels
rfunc (log (h) / log (2)) + 1
ifTiledInputFile::level_mode()
==LevelMode::RipmapLevels
where rfunc
is either floor()
or ceil()
depending on whether
TiledInputFile::level_rounding_mode()
is LevelRoundingMode::RoundUp
or LevelRoundingMode::RoundDown
Returns true
if the file contains a level with level number (lx, ly)
, false
otherwise.
Returns the width of the level with level number (lx, *)
, where *
is any number.
Returns
max (1, rfunc (w / pow (2, lx)))
where rfunc
is either floor()
or ceil()
depending on whether
TiledInputFile::level_rounding_mode()
is LevelRoundingMode::RoundUp
or LevelRoundingMode::RoundDown
Errors
*Error::Base
- If any error occurs
Returns the height of the level with level number (*, ly)
, where *
is any number.
Returns
max (1, rfunc (h / pow (2, ly)))
where rfunc
is either floor()
or ceil()
depending on whether
TiledInputFile::level_rounding_mode()
is LevelRoundingMode::RoundUp
or LevelRoundingMode::RoundDown
Errors
*Error::Base
- If any error occurs
Get the number of tiles in the x axis that cover a level with level number (lx, *)
where *
is any number
Returns
*(level_width(lx) + tile_x_size() - 1) / tile_x_size()
Errors
*Error::InvalidArgument
- If lx
is not a valid level
Get the number of tiles in the y axis that cover a level with level number (*, ly)
where *
is any number
Returns
- (level_height(ly) + tile_y_size() - 1) / tile_y_size()
Errors
*Error::InvalidArgument
- If lx
is not a valid level
Returns a 2-dimensional region of valid pixel coordinates for a level with level number (lx, ly)
Errors
*Error::Base
- if any error occurs
Returns a 2-dimensional region of valid pixel coordinates for a level with tile coordinates (dx, dy)
and level number (lx, ly)
Errors
Error::InvalidArgument
- if the passed tile coordinates are invalidError::Base
- if any other error occurs
Reads the tile with tile coordinates (dx, dy)
, and level number (lx, ly)
,
and stores it in the current frame buffer.
Errors
-
Error::InvalidArgument
- if dx does not lie in the interval [0, num_x_tiles(lx)-1] -
Error::InvalidArgument
- if dy does not lie in the interval [0, num_y_tiles(ly)-1] -
Error::InvalidArgument
-if lx does not lie in the interval [0, num_x_levels()-1] -
Error::InvalidArgument
-if ly does not lie in the inverval [0, num_y_levels()-1] -
Error::Io
- if there is an error reading data from the file -
Error::Base
- if any other error occurs
Reads the sample counts in tile range with coordinates (dx1, dy1)
, to (dx2, dy2)
and level number (lx, ly)
,
and stores it in the current frame buffer.
Errors
-
Error::InvalidArgument
- if dx does not lie in the interval [0, num_x_tiles(lx)-1] -
Error::InvalidArgument
- if dy does not lie in the interval [0, num_y_tiles(ly)-1] -
Error::InvalidArgument
-if lx does not lie in the interval [0, num_x_levels()-1] -
Error::InvalidArgument
-if ly does not lie in the inverval [0, num_y_levels()-1] -
Error::Io
- if there is an error reading data from the file -
Error::Base
- if any other error occurs