Scope
scope::ScopeMultiImageEncoder Class Reference

#include <ScopeMultiImageEncoder.h>

Public Member Functions

 ScopeMultiImageEncoder (const bool &_dosave, const uint32_t &_channels, const bool &_compresstiff=true)
 
 ~ScopeMultiImageEncoder ()
 
void Initialize (const std::vector< std::wstring > &_filenames)
 
void NewFrame ()
 
void WriteMetadata ()
 
void WriteFrame (ScopeMultiImagePtr const _multiimage)
 
void WriteFrameNewPart (ScopeMultiImagePtr const _multiimage)
 
uint32_t Framecount () const
 

Protected Member Functions

 ScopeMultiImageEncoder (const ScopeMultiImageEncoder &)
 
ScopeMultiImageEncoder operator= (const ScopeMultiImageEncoder &)
 

Protected Attributes

HResult hr
 
const bool dosave
 
const uint32_t channels
 
const bool compresstiff
 
uint32_t framecount
 
IWICImagingFactory * factory
 
std::vector< IWICStream * > streams
 
std::vector< IWICBitmapEncoder * > encoders
 
std::vector< IWICBitmapFrameEncode * > frameencoders
 

Detailed Description

Encodes multi images to TIFF using Windows Imaging Components.

For more information about WIC see e.g. "Windows Imaging Component Basics" by Kenny Kerr at http://msdn.microsoft.com/en-us/magazine/cc500647.aspx)

Definition at line 9 of file ScopeMultiImageEncoder.h.

Constructor & Destructor Documentation

scope::ScopeMultiImageEncoder::ScopeMultiImageEncoder ( const ScopeMultiImageEncoder )
protected

disable copy and assignment

scope::ScopeMultiImageEncoder::ScopeMultiImageEncoder ( const bool &  _dosave,
const uint32_t &  _channels,
const bool &  _compresstiff = true 
)

Initializes COM and creates WIC imaging factory.

Parameters
[in]_dosaveif false images are not actually saved only counted
[in]_channelsnumber of channels for saving
[in]_compresstifftrue if you want to write ZIP compressed TIFF, false for uncompressed TIFF

Definition at line 9 of file ScopeMultiImageEncoder.cpp.

scope::ScopeMultiImageEncoder::~ScopeMultiImageEncoder ( )

Releases resources and uninitializes COM.

Definition at line 24 of file ScopeMultiImageEncoder.cpp.

Member Function Documentation

ScopeMultiImageEncoder scope::ScopeMultiImageEncoder::operator= ( const ScopeMultiImageEncoder )
protected

because we want RAII but not frequent calling of CoInitialize etc...

void scope::ScopeMultiImageEncoder::Initialize ( const std::vector< std::wstring > &  _filenames)

Creates and initializes encoders and streams for disk writing.

Parameters
[in]_filenamesvector with filenames for each channel (since each channel will be written to a separate file)

Definition at line 40 of file ScopeMultiImageEncoder.cpp.

void scope::ScopeMultiImageEncoder::NewFrame ( )

Creates a new frame, initializes its frameencoder, and writes metadata.

Definition at line 55 of file ScopeMultiImageEncoder.cpp.

void scope::ScopeMultiImageEncoder::WriteMetadata ( )

Writes metadata via the current frameencoder into a frame Is not functional, due to limitations in WIC TIFF encoder.

Therefore StorageControllerImpl::FixTIFFFlags.

Definition at line 83 of file ScopeMultiImageEncoder.cpp.

void scope::ScopeMultiImageEncoder::WriteFrame ( ScopeMultiImagePtr const  _multiimage)

Writes a complete multi image into the current frames.

Parameters
[in]_multiimagethe multi image to write to disk

Definition at line 112 of file ScopeMultiImageEncoder.cpp.

void scope::ScopeMultiImageEncoder::WriteFrameNewPart ( ScopeMultiImagePtr const  _multiimage)

Writes the new part of a multiimage into the current frames.

Parameters
[in]_multiimagethe multi image whose new part to write to disk

Definition at line 170 of file ScopeMultiImageEncoder.cpp.

uint32_t scope::ScopeMultiImageEncoder::Framecount ( ) const
inline
Returns
current framecount

Definition at line 76 of file ScopeMultiImageEncoder.h.

Member Data Documentation

HResult scope::ScopeMultiImageEncoder::hr
protected

error handler

Definition at line 13 of file ScopeMultiImageEncoder.h.

const bool scope::ScopeMultiImageEncoder::dosave
protected

do we actually save (true) or only count the frames (false)

Definition at line 16 of file ScopeMultiImageEncoder.h.

const uint32_t scope::ScopeMultiImageEncoder::channels
protected

how many channels to encode

Definition at line 19 of file ScopeMultiImageEncoder.h.

const bool scope::ScopeMultiImageEncoder::compresstiff
protected

do TIFF compressiong?

Definition at line 22 of file ScopeMultiImageEncoder.h.

uint32_t scope::ScopeMultiImageEncoder::framecount
protected

keeping track of how many frames we encoded

Definition at line 25 of file ScopeMultiImageEncoder.h.

IWICImagingFactory* scope::ScopeMultiImageEncoder::factory
protected

our Windows Imaging Component factory

Definition at line 28 of file ScopeMultiImageEncoder.h.

std::vector<IWICStream*> scope::ScopeMultiImageEncoder::streams
protected

a stream for each channel

Definition at line 31 of file ScopeMultiImageEncoder.h.

std::vector<IWICBitmapEncoder*> scope::ScopeMultiImageEncoder::encoders
protected

an encoder for each channel

Definition at line 34 of file ScopeMultiImageEncoder.h.

std::vector<IWICBitmapFrameEncode*> scope::ScopeMultiImageEncoder::frameencoders
protected

a frameencoder for each channel (remade for each frame)

Definition at line 37 of file ScopeMultiImageEncoder.h.


The documentation for this class was generated from the following files: