! @brief This function writes the projection image @param image 1 of 3 projects or the visual @param imageType identifies the image format desired. @param pBuffer pointer the buffer @param start position in the block to start reading @param count size of desired chunk or buffer size */
| 85 | @param count size of desired chunk or buffer size |
| 86 | */ |
| 87 | static size_t _writeImage2DNode( const StructureNode &image, Image2DType imageType, |
| 88 | uint8_t *pBuffer, int64_t start, size_t count ) |
| 89 | { |
| 90 | size_t transferred = 0; |
| 91 | |
| 92 | switch ( imageType ) |
| 93 | { |
| 94 | case ImageNone: |
| 95 | return 0; |
| 96 | |
| 97 | case ImageJPEG: |
| 98 | if ( image.isDefined( "jpegImage" ) ) |
| 99 | { |
| 100 | BlobNode jpegImage( image.get( "jpegImage" ) ); |
| 101 | jpegImage.write( pBuffer, start, count ); |
| 102 | transferred = count; |
| 103 | } |
| 104 | break; |
| 105 | |
| 106 | case ImagePNG: |
| 107 | if ( image.isDefined( "pngImage" ) ) |
| 108 | { |
| 109 | BlobNode pngImage( image.get( "pngImage" ) ); |
| 110 | pngImage.write( pBuffer, start, count ); |
| 111 | transferred = count; |
| 112 | } |
| 113 | break; |
| 114 | |
| 115 | case ImageMaskPNG: |
| 116 | if ( image.isDefined( "imageMask" ) ) |
| 117 | { |
| 118 | BlobNode imageMask( image.get( "imageMask" ) ); |
| 119 | imageMask.write( pBuffer, start, count ); |
| 120 | transferred = count; |
| 121 | } |
| 122 | break; |
| 123 | } |
| 124 | |
| 125 | return transferred; |
| 126 | } |
| 127 | |
| 128 | WriterImpl::WriterImpl( const ustring &filePath, const WriterOptions &options ) : |
| 129 | imf_( filePath, "w" ), root_( imf_.root() ), data3D_( imf_, true ), images2D_( imf_, true ) |
no test coverage detected