Scope
|
#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 |
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.
|
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.
[in] | _dosave | if false images are not actually saved only counted |
[in] | _channels | number of channels for saving |
[in] | _compresstiff | true 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.
|
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.
[in] | _filenames | vector 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.
[in] | _multiimage | the 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.
[in] | _multiimage | the multi image whose new part to write to disk |
Definition at line 170 of file ScopeMultiImageEncoder.cpp.
|
inline |
Definition at line 76 of file ScopeMultiImageEncoder.h.
|
protected |
error handler
Definition at line 13 of file ScopeMultiImageEncoder.h.
|
protected |
do we actually save (true) or only count the frames (false)
Definition at line 16 of file ScopeMultiImageEncoder.h.
|
protected |
how many channels to encode
Definition at line 19 of file ScopeMultiImageEncoder.h.
|
protected |
do TIFF compressiong?
Definition at line 22 of file ScopeMultiImageEncoder.h.
|
protected |
keeping track of how many frames we encoded
Definition at line 25 of file ScopeMultiImageEncoder.h.
|
protected |
our Windows Imaging Component factory
Definition at line 28 of file ScopeMultiImageEncoder.h.
|
protected |
a stream for each channel
Definition at line 31 of file ScopeMultiImageEncoder.h.
|
protected |
an encoder for each channel
Definition at line 34 of file ScopeMultiImageEncoder.h.
|
protected |
a frameencoder for each channel (remade for each frame)
Definition at line 37 of file ScopeMultiImageEncoder.h.