11 #ifndef UT_SCCOMPRESSIONFILTER_H_
12 #define UT_SCCOMPRESSIONFILTER_H_
34 bool doShuffer =
true,
35 int compressionLevel = 9);
38 template<
typename Sink>
39 std::streamsize
write(Sink& dest,
const char* sourceBuffer,
40 std::streamsize sourceBufferSize);
42 template<
typename Sink>
43 void close(Sink& dest);
49 int myCompressionLevel;
53 bios::filtering_ostream* myOutputStream;
54 std::ostream* myOutputAdapter;
64 : myTypeSize(typeSize)
65 , myBlockSize(blockSize)
66 , myCompressionLevel(compressionLevel)
67 , myDoShuffle(doShuffle)
68 , myOutputWriter(NULL)
69 , myOutputStream(NULL)
76 delete myOutputWriter;
79 template<
typename Sink>
80 inline std::streamsize
82 std::streamsize sourceBufferSize)
86 myOutputWriter =
new UT_SCFWriter(myDoShuffle, myTypeSize, myBlockSize,
89 myOutputAdapter =
new std::ostream(&dest);
93 if(!myOutputStream->write((
const char*)sourceBuffer, sourceBufferSize))
98 return sourceBufferSize;
101 template<
typename Sink>
108 myOutputWriter->
close();
109 delete myOutputWriter;
110 delete myOutputAdapter;
112 myOutputWriter = NULL;
115 #endif // UT_SCCOMPRESSIONFILTER_H_
UT_SCCompressionFilter(size_t typesize, size_t blocksize, bool doShuffer=true, int compressionLevel=9)
SC Compression Filter.
std::streamsize write(Sink &dest, const char *sourceBuffer, std::streamsize sourceBufferSize)
Interface for writing Seekable Compressed Format (SCF) files.
bios::filtering_ostream * getOutputStream(const char *filename)
static const size_t theDefaultBlockSize
static const size_t theDefaultTypeSize
void close()
Closes the file.
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t blockSize(VULKAN_HPP_NAMESPACE::Format format)
virtual ~UT_SCCompressionFilter()