pub struct CziReader(/* private fields */);Expand description
CZI-reader object.
Implementations§
Source§impl CziReader
impl CziReader
Sourcepub fn create() -> Result<Self, Error>
pub fn create() -> Result<Self, Error>
Create a new CZI-reader object.
\param [out] reader_object If the operation is successful, a handle to the newly created reader object is put here.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn open(&self, open_info: ReaderOpenInfo) -> Result<(), Error>
pub fn open(&self, open_info: ReaderOpenInfo) -> Result<(), Error>
Instruct the specified reader-object to open a CZI-document. The ‘open_info’ parameter contains a handle to a stream-object which is used to read the document.
\param reader_object A handle representing the reader-object. \param open_info Parameters controlling the operation.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn get_file_header_info(&self) -> Result<FileHeaderInfo, Error>
pub fn get_file_header_info(&self) -> Result<FileHeaderInfo, Error>
Get information about the file-header of the CZI document. The information is put into the ‘file_header_info_interop’ structure. This file_header_info_interop structure contains the GUID of the CZI document and the version levels of CZI.
\param reader_object The reader object. \param [out] file_header_info_interop If successful, the retrieved information is put here.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn read_sub_block(&self, index: i32) -> Result<SubBlock, Error>
pub fn read_sub_block(&self, index: i32) -> Result<SubBlock, Error>
Reads the sub-block identified by the specified index. If there is no sub-block present (for the specified index) then the function returns ‘LibCZIApi_ErrorCode_OK’, but the ‘sub_block_object’ is set to ‘kInvalidObjectHandle’.
\param reader_object The reader object. \param index Index of the sub-block. \param [out] sub_block_object If successful, a handle to the sub-block object is put here; otherwise ‘kInvalidObjectHandle’.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn get_statistics_simple(&self) -> Result<SubBlockStatistics, Error>
pub fn get_statistics_simple(&self) -> Result<SubBlockStatistics, Error>
Get statistics about the sub-blocks in the CZI-document. This function provides a simple version of the statistics, the information retrieved does not include the per-scene statistics.
\param reader_object The reader object. \param [out] statistics If non-null, the simple statistics will be put here.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn get_statistics_ex(
&self,
number_of_per_channel_bounding_boxes: i32,
) -> Result<(SubBlockStatisticsEx, i32), Error>
pub fn get_statistics_ex( &self, number_of_per_channel_bounding_boxes: i32, ) -> Result<(SubBlockStatisticsEx, i32), Error>
Get extended statistics about the sub-blocks in the CZI-document. This function provides a more detailed version of the statistics, including the per-scene statistics. Note that the statistics is of variable size, and the semantic is as follows:
- On input, the argument ‘number_of_per_channel_bounding_boxes’ must point to an integer which describes the size of the argument ‘statistics’. This number gives how many elements the array ‘per_scenes_bounding_boxes’ in ‘SubBlockStatisticsInteropEx’ can hold. Only that number of per-scene information elements will be put into the ‘statistics’ structure at most, in any case.
- On output, the argument ‘number_of_per_channel_bounding_boxes’ will be set to the number of per-channel bounding boxes that were actually available.
- In the returned ‘SubBlockStatisticsInteropEx’ structure, the ‘number_of_per_scenes_bounding_boxes’ field will be set to the number of per-scene information that is put into this struct (which may be less than number of scenes that are available).
So, the caller is expected to check the returned ‘number_of_per_channel_bounding_boxes’ to see how many per-channel bounding boxes are available. If this number is greater than the number of elements (given with the ‘number_of_per_scenes_bounding_boxes’ value in the ‘statistics’ structure), then the caller should allocate a larger ‘statistics’ structure and call this function again (with an increased ‘number_of_per_scenes_bounding_boxes’).
\param reader_object The reader object. \param [out] statistics If non-null, the statistics will be put here. \param [in,out] number_of_per_channel_bounding_boxes On input, it gives the number of elements that can be put into the ‘per_scenes_bounding_boxes’ array. On output, it gives the number of elements which are available.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn get_pyramid_statistics(&self) -> Result<String, Error>
pub fn get_pyramid_statistics(&self) -> Result<String, Error>
Get "pyramid-statistics" about the CZI-document. This function provides a JSON-formatted string which contains information about the pyramid. The JSON-schema is as follows: \code { "scenePyramidStatistics": { <sceneIndex>: [ { "layerInfo": { "minificationFactor": <number>, "pyramidLayerNo" : <number> }, "count" : <number> } ]} } \endcode It resembles the corresponding C++-structure ‘PyramidStatistics’ in the libCZI-library.
\param reader_object The reader object. \param [out] pyramid_statistics_as_json If successful, a pointer to a JSON-formatted string is placed here. The caller is responsible for freeing this memory (by calling libCZI_Free).
\returns An error-code indicating success or failure of the operation.
Sourcepub fn get_metadata_segment(&self) -> Result<MetadataSegment, Error>
pub fn get_metadata_segment(&self) -> Result<MetadataSegment, Error>
Create a metadata-segment object from the reader-object. The metadata-segment object can be used to retrieve the XML-metadata of the CZI-document.
\param reader_object The reader object. \param [out] metadata_segment_object If successful, a handle to the metadata-segment object is put here.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn get_attachment_count(&self) -> Result<i32, Error>
pub fn get_attachment_count(&self) -> Result<i32, Error>
Get the number of attachments available.
\param reader_object The reader object. \param [out] count The number of available attachments is put here. \returns An error-code indicating success or failure of the operation.
Sourcepub fn get_attachment_info_from_directory(
&self,
index: i32,
) -> Result<AttachmentInfo, Error>
pub fn get_attachment_info_from_directory( &self, index: i32, ) -> Result<AttachmentInfo, Error>
Get information about the attachment at the specified index. The information is put into the ‘attachment_info_interop’ structure. If the index is not valid, then the function returns ‘LibCZIApi_ErrorCode_IndexOutOfRange’.
\param reader_object The reader object. \param index The index of the attachment to query information for. \param [out] attachment_info_interop If successful, the retrieved information is put here.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn read_attachment(&self, index: i32) -> Result<Attachment, Error>
pub fn read_attachment(&self, index: i32) -> Result<Attachment, Error>
Read the attachment with the specified index and create an attachment object representing it. If the specified index is invalid, then the returned attachment-object handle will have the value ‘kInvalidObjectHandle’. \param reader_object The reader object. \param index The index of the attachment to get. \param [out] attachment_object If successful and index is valid, a handle representing the attachment object is put here. If the index is invalid, then the handle will have the value ‘kInvalidObjectHandle’. \returns An error-code indicating success or failure of the operation.
Sourcepub fn release(&self) -> Result<(), Error>
pub fn release(&self) -> Result<(), Error>
Release the specified reader-object. After this function is called, the handle is no longer valid.
\param reader_object The reader object.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn try_get_sub_block_info_for_index(
&self,
index: i32,
) -> Result<SubBlockInfo, Error>
pub fn try_get_sub_block_info_for_index( &self, index: i32, ) -> Result<SubBlockInfo, Error>
Get information about the sub-block with the specified index. The information is put into the ‘sub_block_info_interop’ structure. If the index is not valid, then the function returns ‘LibCZIApi_ErrorCode_IndexOutOfRange’.
\param reader_object The reader object. \param index The index of the attachment to query information for. \param [out] sub_block_info_interop If successful, the retrieved information is put here.
\returns An error-code indicating success or failure of the operation.
Sourcepub fn create_single_channel_tile_accessor(
&self,
) -> Result<SingleChannelScalingTileAccessor, Error>
pub fn create_single_channel_tile_accessor( &self, ) -> Result<SingleChannelScalingTileAccessor, Error>
Create a single channel scaling tile accessor.
\param reader_object A handle representing the reader-object. \param accessor_object [out] If the operation is successful, a handle to the newly created single-channel-scaling-tile-accessor is put here.
\returns An error-code indicating success or failure of the operation.