diff --git a/czi/source_code/app/include/czi/czi_parser.h b/czi/source_code/app/include/czi/czi_parser.h index f1b1b0d5babd25093249d145dcaf60b6ef018931..0984d57a6a775af326be8e3d6f1ca16ca4346542 100644 --- a/czi/source_code/app/include/czi/czi_parser.h +++ b/czi/source_code/app/include/czi/czi_parser.h @@ -7,16 +7,16 @@ class CziParser { private: bool parseMetadata; - SegmentHeader parse_segment_header(BinaryFileStream &cziStream); - FileHeaderSegment parse_file_header(BinaryFileStream &cziStream); - MetadataSegment parse_metadata(BinaryFileStream &cziStream, const long position); - SubBlockDirectorySegment parse_subblock_directory(BinaryFileStream &cziStream, const long position); - AttachmentDirectorySegment parse_attachment_directory(BinaryFileStream &cziStream, const long position); - DirectoryEntryDV parse_subblock_directory_entry(BinaryFileStream &cziStream); - AttachmentEntryA1 parse_attachment_entry(BinaryFileStream &cziStream); - DimensionEntryDV1 parse_dimension_entry(BinaryFileStream &cziStream); - SubBlockSegment parse_subblock(BinaryFileStream &cziStream, const long position, const int entryIndex, const int entrySize); - AttachmentSegment parse_attachment_segment(BinaryFileStream &cziStream, const long position, const int entryIndex); + SegmentHeader parse_segment_header(azgra::BinaryFileStream &cziStream); + FileHeaderSegment parse_file_header(azgra::BinaryFileStream &cziStream); + MetadataSegment parse_metadata(azgra::BinaryFileStream &cziStream, const long position); + SubBlockDirectorySegment parse_subblock_directory(azgra::BinaryFileStream &cziStream, const long position); + AttachmentDirectorySegment parse_attachment_directory(azgra::BinaryFileStream &cziStream, const long position); + DirectoryEntryDV parse_subblock_directory_entry(azgra::BinaryFileStream &cziStream); + AttachmentEntryA1 parse_attachment_entry(azgra::BinaryFileStream &cziStream); + DimensionEntryDV1 parse_dimension_entry(azgra::BinaryFileStream &cziStream); + SubBlockSegment parse_subblock(azgra::BinaryFileStream &cziStream, const long position, const int entryIndex, const int entrySize); + AttachmentSegment parse_attachment_segment(azgra::BinaryFileStream &cziStream, const long position, const int entryIndex); PixelType to_pixel_type(const int value); PyramidType to_pyramid_type(const byte value); CompressionType to_compression_type(const int value); diff --git a/czi/source_code/app/src/compression/benchmark.cpp b/czi/source_code/app/src/compression/benchmark.cpp index 205bf40ee00b624cdbd87265e3670475eb34e9e2..2c35e4d6b79803c4b22e7a70a9d09f5880f1fcfc 100644 --- a/czi/source_code/app/src/compression/benchmark.cpp +++ b/czi/source_code/app/src/compression/benchmark.cpp @@ -1,5 +1,7 @@ #include <compression/benchmark.h> +using namespace azgra; + template <typename T> void save_histogram(const std::map<T, size_t> &histogram, const char *fileName) { diff --git a/czi/source_code/app/src/compression/compressors.cpp b/czi/source_code/app/src/compression/compressors.cpp index e04a36dceaa190f8e717e19ba099139507fb0200..9c81ff75c938c71bcd201f178769767caed7c6f9 100644 --- a/czi/source_code/app/src/compression/compressors.cpp +++ b/czi/source_code/app/src/compression/compressors.cpp @@ -1,5 +1,7 @@ #include <compression/compressors.h> +using namespace azgra; + const char *compression_method_str(const CompressionMethod cm) { switch (cm) diff --git a/czi/source_code/app/src/czi/czi_file.cpp b/czi/source_code/app/src/czi/czi_file.cpp index dd1047200b321f3a961d9c606c97d8d166a46307..8ce06d00db1bfbf1638e8ff32eedf872954315ab 100644 --- a/czi/source_code/app/src/czi/czi_file.cpp +++ b/czi/source_code/app/src/czi/czi_file.cpp @@ -1,5 +1,7 @@ #include <czi/czi_file.h> +using namespace azgra; + bool CziFile::is_master_file() const { return ((header.filePart == 0) && (header.fileGuid == header.masterFileGuid)); diff --git a/czi/source_code/app/src/czi/czi_parser.cpp b/czi/source_code/app/src/czi/czi_parser.cpp index e5171c0537bb216c0a0f7581a7a174afa6a4d3c3..3a7c8b95b9f5d61ee747f5a2d73cb5ada8c7bd83 100644 --- a/czi/source_code/app/src/czi/czi_parser.cpp +++ b/czi/source_code/app/src/czi/czi_parser.cpp @@ -1,5 +1,7 @@ #include <czi/czi_parser.h> +using namespace azgra; + CziParser::CziParser(bool parseMetadata) { this->parseMetadata = parseMetadata; diff --git a/czi/source_code/app/src/image/pixel_parse_functions.cpp b/czi/source_code/app/src/image/pixel_parse_functions.cpp index 920e3d692917a293d142f5b89b4293f9449bc06c..4feb314aeade4867d481aa10eaa806eb409c70a6 100644 --- a/czi/source_code/app/src/image/pixel_parse_functions.cpp +++ b/czi/source_code/app/src/image/pixel_parse_functions.cpp @@ -1,5 +1,7 @@ #include <image/pixel_parse_functions.h> +using namespace azgra; + std::shared_ptr<Gray8Pixel> bytes_to_Gray8Pixel(const ByteArray &bytes, ulong &index) { std::shared_ptr<Gray8Pixel> pixel(new Gray8Pixel(bytes[index])); diff --git a/czi/source_code/azgra_lib/include/azgra/stream/binary_converter.h b/czi/source_code/azgra_lib/include/azgra/stream/binary_converter.h index cf84614b0b6107b55249b72e6b66514cb5546285..2a8a5619127efba93fddf63ba1a2b922bda3e8ef 100644 --- a/czi/source_code/azgra_lib/include/azgra/stream/binary_converter.h +++ b/czi/source_code/azgra_lib/include/azgra/stream/binary_converter.h @@ -14,6 +14,9 @@ #include <string> #include <boost/locale.hpp> +namespace azgra +{ + // Convert two bytes, from specified index, to short. short bytes_to_short(const ByteArray &bytes, const ulong fromIndex = 0); // Convert four bytes, from specified index, to int. @@ -45,4 +48,6 @@ void ushort_to_bytes(const ushort &x, ByteArray &buffer, size_t bufferPosition); std::vector<ushort> bytes_to_ushort_array(const ByteArray &data); ByteArray int_array_to_bytes(const std::vector<int> &data); -ByteArray ushort_array_to_bytes(const std::vector<ushort> &data); \ No newline at end of file +ByteArray ushort_array_to_bytes(const std::vector<ushort> &data); + +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/stream/binary_file_stream.h b/czi/source_code/azgra_lib/include/azgra/stream/binary_file_stream.h index 4990990fde21598ff5cecae2013c26978a4182f4..c7174c3b2770c6e1a18afdec1064a3dabf905443 100644 --- a/czi/source_code/azgra_lib/include/azgra/stream/binary_file_stream.h +++ b/czi/source_code/azgra_lib/include/azgra/stream/binary_file_stream.h @@ -3,6 +3,9 @@ #include <fstream> #include <iterator> +namespace azgra +{ + class BinaryFileStream : public BinaryStreamBase { private: @@ -42,4 +45,5 @@ public: ByteArray consume_bytes(const ulong byteCount) override; // Read specified number of bytes into dst buffer, insert read bytes from pos. void consume_into(ByteArray &dst, size_t pos, size_t byteCount); -}; \ No newline at end of file +}; +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/stream/binary_stream_base.h b/czi/source_code/azgra_lib/include/azgra/stream/binary_stream_base.h index fb081044b4ffac542a7a5abcb99cf0e25068a355..b7c25ac1174bee4c19f97b2e0732ac5aad8dc772 100644 --- a/czi/source_code/azgra_lib/include/azgra/stream/binary_stream_base.h +++ b/czi/source_code/azgra_lib/include/azgra/stream/binary_stream_base.h @@ -1,6 +1,9 @@ #pragma once #include "binary_converter.h" +namespace azgra +{ + // Base class for custom binary streams. class BinaryStreamBase { @@ -45,4 +48,6 @@ public: virtual ByteArray consume_bytes(const ulong byteCount) = 0; // Move stream to requested position and read specified number of bytes. virtual ByteArray move_and_consume_bytes(const long position, const long byteCount); -}; \ No newline at end of file +}; + +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/stream/binary_writer.h b/czi/source_code/azgra_lib/include/azgra/stream/binary_writer.h index 8cff2182e74f8877ffddc63ff61955e5bbf38897..1c95a0d81fe4ec7bc81bf7d6c1de074dcc2f46ff 100644 --- a/czi/source_code/azgra_lib/include/azgra/stream/binary_writer.h +++ b/czi/source_code/azgra_lib/include/azgra/stream/binary_writer.h @@ -2,9 +2,12 @@ #include <azgra/azgra.h> #include <fstream> +namespace azgra +{ inline void write_bytes_to_file(const ByteArray &bytes, const char *fileName) { std::ofstream binaryStream(fileName, std::ios::binary | std::ios::out); always_assert(binaryStream.is_open()); binaryStream.write(reinterpret_cast<const char *>(bytes.data()), bytes.size()); -} \ No newline at end of file +} +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/stream/buffer_source_type.h b/czi/source_code/azgra_lib/include/azgra/stream/buffer_source_type.h index fc9d694ed3978c067a792db1b44ce7037c12d0a3..a4b12fd81503f8147fff11080184bf48b42edd36 100644 --- a/czi/source_code/azgra_lib/include/azgra/stream/buffer_source_type.h +++ b/czi/source_code/azgra_lib/include/azgra/stream/buffer_source_type.h @@ -1,8 +1,11 @@ #pragma once +namespace azgra +{ enum BufferSourceType { BufferSourceType_Stream, BufferSourceType_Memory, BufferSourceType_NoSource -}; \ No newline at end of file +}; +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/stream/buffered_binary_stream.h b/czi/source_code/azgra_lib/include/azgra/stream/buffered_binary_stream.h index 629bdda78d526e123ebd654a787086cb471d6401..2b7429b9e51ebea3ef23f0559ed95d64d9ee9021 100644 --- a/czi/source_code/azgra_lib/include/azgra/stream/buffered_binary_stream.h +++ b/czi/source_code/azgra_lib/include/azgra/stream/buffered_binary_stream.h @@ -2,6 +2,9 @@ #include "buffer_source_type.h" #include "binary_stream_base.h" +namespace azgra +{ + class BufferedBinaryStream : public BinaryStreamBase { private: @@ -41,4 +44,5 @@ public: void move_by(const long distance) override; // Read specified number of bytes. ByteArray consume_bytes(const ulong byteCount) override; -}; \ No newline at end of file +}; +} // namespace azgra diff --git a/czi/source_code/azgra_lib/include/azgra/stream/memory_bit_stream.h b/czi/source_code/azgra_lib/include/azgra/stream/memory_bit_stream.h index d1eeeff3b9c3ec6195c80af27d3390514506059b..0bed46a2e03e1fdceb746052be8cdec3569705e2 100644 --- a/czi/source_code/azgra_lib/include/azgra/stream/memory_bit_stream.h +++ b/czi/source_code/azgra_lib/include/azgra/stream/memory_bit_stream.h @@ -1,116 +1,119 @@ #pragma once #include <azgra/azgra.h> +namespace azgra +{ constexpr size_t MAX_BIT_COUNT = 255; // Class allowing to write invidual bits to memory buffer. class OutMemoryBitStream { - private: - // Memory buffer. - ByteArray buffer; - // Index to the next write in memory buffer. - size_t memoryBufferIndex = 0; - // Bit buffer. - byte bitBuffer; - // Actual size of bit buffer. - byte bitBufferSize = 0; - // Number of bits to which value will be encoded when `write_value` is called. - size_t valueEncodeBitCount = 0; +private: + // Memory buffer. + ByteArray buffer; + // Index to the next write in memory buffer. + size_t memoryBufferIndex = 0; + // Bit buffer. + byte bitBuffer; + // Actual size of bit buffer. + byte bitBufferSize = 0; + // Number of bits to which value will be encoded when `write_value` is called. + size_t valueEncodeBitCount = 0; - void internal_write_bit(const bool &bit, const bool &alloc); - void internal_flush_bit_buffer(const bool &alloc); + void internal_write_bit(const bool &bit, const bool &alloc); + void internal_flush_bit_buffer(const bool &alloc); - public: - OutMemoryBitStream(size_t valueEncodeBitCount = 1); - ~OutMemoryBitStream(); - // Resize the memory buffer for `write_value_no_alloc` and `write_bit_no_alloc` - void resize_for_raw_write(const size_t size); +public: + OutMemoryBitStream(size_t valueEncodeBitCount = 1); + ~OutMemoryBitStream(); + // Resize the memory buffer for `write_value_no_alloc` and `write_bit_no_alloc` + void resize_for_raw_write(const size_t size); - // Write bit to memory stream. - void write_bit(const bool &bit); - // Write bit without resizing buffer. Buffer must be allocated using `resize_for_raw_write` ! - void write_bit_no_alloc(const bool &bit); - // Write bit to memory stream. - void operator<<(const bool &bit); + // Write bit to memory stream. + void write_bit(const bool &bit); + // Write bit without resizing buffer. Buffer must be allocated using `resize_for_raw_write` ! + void write_bit_no_alloc(const bool &bit); + // Write bit to memory stream. + void operator<<(const bool &bit); - // If flush buffer is not flushed, flush it to main buffer and clear it. - void flush_bit_buffer(); - // Get buffer of written bits, which may not be flushed. - ByteArray get_buffer() const; - // Get buffer of written bits, which is flushed. - ByteArray get_flushed_buffer(); - // Get buffer of written bits, which is flushed. For allocated buffer. - ByteArray get_flushed_buffer_no_alloc(); + // If flush buffer is not flushed, flush it to main buffer and clear it. + void flush_bit_buffer(); + // Get buffer of written bits, which may not be flushed. + ByteArray get_buffer() const; + // Get buffer of written bits, which is flushed. + ByteArray get_flushed_buffer(); + // Get buffer of written bits, which is flushed. For allocated buffer. + ByteArray get_flushed_buffer_no_alloc(); - template <typename T> - void write_value(const T &value) + template <typename T> + void write_value(const T &value) + { + // Lets do it Little-Endian way, start with LSB and move to MSB. + bool bit; + for (size_t bitPos = 0; bitPos < valueEncodeBitCount; bitPos++) { - // Lets do it Little-Endian way, start with LSB and move to MSB. - bool bit; - for (size_t bitPos = 0; bitPos < valueEncodeBitCount; bitPos++) - { - bit = value & (1 << bitPos); - write_bit(bit); - } + bit = value & (1 << bitPos); + write_bit(bit); } + } - // Write value without resizing buffer. Buffer must be allocated using `resize_for_raw_write` ! - template <typename T> - void write_value_no_alloc(const T &value) + // Write value without resizing buffer. Buffer must be allocated using `resize_for_raw_write` ! + template <typename T> + void write_value_no_alloc(const T &value) + { + // Lets do it Little-Endian way, start with LSB and move to MSB. + bool bit; + for (size_t bitPos = 0; bitPos < valueEncodeBitCount; bitPos++) { - // Lets do it Little-Endian way, start with LSB and move to MSB. - bool bit; - for (size_t bitPos = 0; bitPos < valueEncodeBitCount; bitPos++) - { - bit = value & (1 << bitPos); - write_bit_no_alloc(bit); - } + bit = value & (1 << bitPos); + write_bit_no_alloc(bit); } + } }; // Class alowing to read invidual bits from memory buffer. class InMemoryBitStream { - private: - // Memory buffer. - const ByteArray *memoryBuffer = nullptr; - // Position in memory buffer. - size_t memoryBufferPosition = 0; - // Bit buffer. - byte bitBuffer = 0; - // Current bit buffer size. - byte bitBufferSize = 0; - // Number of bits to consume when reading value by `read_value`. - size_t valueEncodeBitCount; +private: + // Memory buffer. + const ByteArray *memoryBuffer = nullptr; + // Position in memory buffer. + size_t memoryBufferPosition = 0; + // Bit buffer. + byte bitBuffer = 0; + // Current bit buffer size. + byte bitBufferSize = 0; + // Number of bits to consume when reading value by `read_value`. + size_t valueEncodeBitCount; - // Read byte into bit buffer. - void read_byte_to_bit_buffer(); + // Read byte into bit buffer. + void read_byte_to_bit_buffer(); - public: - InMemoryBitStream(const ByteArray *buffer, size_t bufferPosition = 0, size_t valueEncodeBitCount = 1); - ~InMemoryBitStream(); +public: + InMemoryBitStream(const ByteArray *buffer, size_t bufferPosition = 0, size_t valueEncodeBitCount = 1); + ~InMemoryBitStream(); - // Read one bit from memory buffer. - bool read_bit(); - // Read one bit from memory buffer. - void operator>>(bool &bit); - // Check wheter atleast one bit can be read. - bool can_read() const; + // Read one bit from memory buffer. + bool read_bit(); + // Read one bit from memory buffer. + void operator>>(bool &bit); + // Check wheter atleast one bit can be read. + bool can_read() const; - template <typename T> - T read_value() + template <typename T> + T read_value() + { + bool bit; + T result = 0; + for (size_t bitPos = 0; bitPos < valueEncodeBitCount; bitPos++) { - bool bit; - T result = 0; - for (size_t bitPos = 0; bitPos < valueEncodeBitCount; bitPos++) - { - bit = read_bit(); - result |= (bit << bitPos); - } - return result; + bit = read_bit(); + result |= (bit << bitPos); } + return result; + } }; // Find number of bits required to encode value of `maxValue`. -size_t bits_required(size_t maxValue); \ No newline at end of file +size_t bits_required(size_t maxValue); +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/utilities/Stopwatch.h b/czi/source_code/azgra_lib/include/azgra/utilities/Stopwatch.h index 33b7e51d8db5af5ad3ca220b42cb4e74d2b82d81..b0492e5ac304cfd8aa8afd263dc0c715aca21917 100644 --- a/czi/source_code/azgra_lib/include/azgra/utilities/Stopwatch.h +++ b/czi/source_code/azgra_lib/include/azgra/utilities/Stopwatch.h @@ -7,6 +7,9 @@ #include <tgmath.h> #include <vector> +namespace azgra +{ + /// Stopwatch class, support multiple stopwatches inside one instance. Contains functionality to manage those stopwatches. class Stopwatch { @@ -149,4 +152,5 @@ public: /// Get stopwatch name. /// \return Name in string. const std::string get_name(); -}; \ No newline at end of file +}; +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/utilities/type_mapper.h b/czi/source_code/azgra_lib/include/azgra/utilities/type_mapper.h index 3b88397849ef45fc13c775e49e8a93483eae0504..be2afa6209a3b243d0f0a461cb2690b0b652483a 100644 --- a/czi/source_code/azgra_lib/include/azgra/utilities/type_mapper.h +++ b/czi/source_code/azgra_lib/include/azgra/utilities/type_mapper.h @@ -2,6 +2,9 @@ #include "vector_utilities.h" #include <azgra/azgra.h> +namespace azgra +{ + // Provide mapping utilites from signed types to big enaugh unsigned types. template <typename SourceType, typename TargetType> class TypeMapper @@ -66,4 +69,5 @@ class TypeMapper } return result; } -}; \ No newline at end of file +}; +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/utilities/vector_utilities.h b/czi/source_code/azgra_lib/include/azgra/utilities/vector_utilities.h index 274761c2594b333f9fae4dadc05bf8329579faaa..b1b3c9ea9f73c14973a00a2601be3ce404179e94 100644 --- a/czi/source_code/azgra_lib/include/azgra/utilities/vector_utilities.h +++ b/czi/source_code/azgra_lib/include/azgra/utilities/vector_utilities.h @@ -5,6 +5,9 @@ #include <limits> #include <map> +namespace azgra +{ + template <typename T> struct MinMax { // Minimum value. @@ -141,3 +144,4 @@ std::map<T, size_t> create_histogram(const std::vector<T> &data) } }; // namespace vecUtil +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/include/azgra/utilities/z_order.h b/czi/source_code/azgra_lib/include/azgra/utilities/z_order.h index 27e511cc8aaf807baa1947a7b6042b0894032986..b4db38aa2f4a021bf1925c1060ef1ba87a2b618b 100644 --- a/czi/source_code/azgra_lib/include/azgra/utilities/z_order.h +++ b/czi/source_code/azgra_lib/include/azgra/utilities/z_order.h @@ -7,6 +7,9 @@ https://lemire.me/blog/2018/01/08/how-fast-can-you-bit-interleave-32-bit-integers/ */ +namespace azgra +{ + static inline ulong interleave_uint_with_zeros(uint input) { ulong word = input; @@ -72,4 +75,5 @@ std::vector<PointWithIndex> generate_ordered_z_order_indices(const uint colCount ByteArray reorder_bytes_to_z_order(const ByteArray &bytes, const std::vector<PointWithIndex> &zIndices, const uint componentSize); ByteArray reorder_bytes_from_z_order(const ByteArray &zOrderedBytes, const std::vector<PointWithIndex> &zIndices, - const uint componentSize); \ No newline at end of file + const uint componentSize); +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/src/stream/binary_converter.cpp b/czi/source_code/azgra_lib/src/stream/binary_converter.cpp index 74d750409baecd7278de4160405fdd76376c5a5a..ea7fba7c99eee312a279ad844fe82a150a5b3886 100644 --- a/czi/source_code/azgra_lib/src/stream/binary_converter.cpp +++ b/czi/source_code/azgra_lib/src/stream/binary_converter.cpp @@ -1,5 +1,8 @@ #include <azgra/stream/binary_converter.h> +namespace azgra +{ + short bytes_to_short(const ByteArray &bytes, const ulong fromIndex) { always_assert(bytes.size() >= sizeof(short)); @@ -172,4 +175,5 @@ ByteArray ushort_array_to_bytes(const std::vector<ushort> &data) } return result; -} \ No newline at end of file +} +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/src/stream/binary_file_stream.cpp b/czi/source_code/azgra_lib/src/stream/binary_file_stream.cpp index d1b953ec2bfcc4b1755f645e713c11dfb78f52c6..09042b97a3f09f9993cdefdfd1a0ad215650bcb1 100644 --- a/czi/source_code/azgra_lib/src/stream/binary_file_stream.cpp +++ b/czi/source_code/azgra_lib/src/stream/binary_file_stream.cpp @@ -1,5 +1,8 @@ #include <azgra/stream/binary_file_stream.h> +namespace azgra +{ + BinaryFileStream::BinaryFileStream() { this->isOpen = false; @@ -142,4 +145,5 @@ void BinaryFileStream::consume_into(ByteArray &dst, size_t pos, size_t byteCount } // This is done, so we don't move stream one position too far. dst[to - 1] = *readIterator; -} \ No newline at end of file +} +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/src/stream/binary_stream_base.cpp b/czi/source_code/azgra_lib/src/stream/binary_stream_base.cpp index 3c67a75640ca86a9738a0a8470a89ac8070a2fd1..7c9bb3e1c9b2918e3ed81d5b8924503db613aedc 100644 --- a/czi/source_code/azgra_lib/src/stream/binary_stream_base.cpp +++ b/czi/source_code/azgra_lib/src/stream/binary_stream_base.cpp @@ -1,5 +1,8 @@ #include <azgra/stream/binary_stream_base.h> +namespace azgra +{ + bool BinaryStreamBase::is_open() const { return this->isOpen; @@ -58,4 +61,5 @@ ByteArray BinaryStreamBase::move_and_consume_bytes(const long position, const lo always_assert(this->isOpen); move_to(position); return consume_bytes(byteCount); -} \ No newline at end of file +} +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/src/stream/buffered_binary_stream.cpp b/czi/source_code/azgra_lib/src/stream/buffered_binary_stream.cpp index bd782665b9729ecd699ebf650c4c926ee4704ace..d3022feecaae0a0004fe12466038e577724e2462 100644 --- a/czi/source_code/azgra_lib/src/stream/buffered_binary_stream.cpp +++ b/czi/source_code/azgra_lib/src/stream/buffered_binary_stream.cpp @@ -1,4 +1,6 @@ #include <azgra/stream/buffered_binary_stream.h> +namespace azgra +{ BufferedBinaryStream::BufferedBinaryStream() { @@ -282,4 +284,5 @@ ByteArray BufferedBinaryStream::consume_bytes(const ulong byteCount) } return ByteArray(); -} \ No newline at end of file +} +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/src/stream/memory_bit_stream.cpp b/czi/source_code/azgra_lib/src/stream/memory_bit_stream.cpp index 05a61c19da94ea74adb5efc8691680dfade5cf98..badf08539600d9faa6677540879ed995cf101198 100644 --- a/czi/source_code/azgra_lib/src/stream/memory_bit_stream.cpp +++ b/czi/source_code/azgra_lib/src/stream/memory_bit_stream.cpp @@ -1,5 +1,8 @@ #include <azgra/stream/memory_bit_stream.h> +namespace azgra +{ + /****************************************************************************************************************************** * OutMemoryBitStream implementation ****************************************************************************************************************************/ @@ -165,4 +168,6 @@ size_t bits_required(size_t maxValue) always_assert(false && "Max value is too large"); return 0; -} \ No newline at end of file +} + +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/src/utilities/Stopwatch.cpp b/czi/source_code/azgra_lib/src/utilities/Stopwatch.cpp index ac6538a2e49706626ec5a0c09d8074bc45f80ca7..57b3bbce67098704831c587d71aef4aeabac3284 100644 --- a/czi/source_code/azgra_lib/src/utilities/Stopwatch.cpp +++ b/czi/source_code/azgra_lib/src/utilities/Stopwatch.cpp @@ -1,5 +1,8 @@ #include <azgra/utilities/Stopwatch.h> +namespace azgra +{ + /** * Initialize basic stopwatch. */ @@ -234,4 +237,6 @@ void Stopwatch::end_lap(int stopwatchId) const std::string Stopwatch::get_name() { return this->name; -} \ No newline at end of file +} + +} // namespace azgra \ No newline at end of file diff --git a/czi/source_code/azgra_lib/src/utilities/z_order.cpp b/czi/source_code/azgra_lib/src/utilities/z_order.cpp index b4bb2c09ddcfac885cf8d10e1c3f3cf3c3a3a8ae..78fb1991a00f90231a87059b2acb450bf736344b 100644 --- a/czi/source_code/azgra_lib/src/utilities/z_order.cpp +++ b/czi/source_code/azgra_lib/src/utilities/z_order.cpp @@ -1,5 +1,7 @@ #include <azgra/utilities/z_order.h> +namespace azgra +{ std::vector<PointWithIndex> generate_ordered_z_order_indices(const uint colCount, const uint rowCount, const uint componentCount) { std::vector<PointWithIndex> result; @@ -60,4 +62,5 @@ ByteArray reorder_bytes_from_z_order(const ByteArray &zOrderedBytes, const std:: always_assert(bytes.size() == zOrderedBytes.size()); return bytes; +} } \ No newline at end of file