From df5c339f6445aa236fdf833b22855e8c0ec15a72 Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Mon, 4 Mar 2013 15:36:11 +0100 Subject: [PATCH] Just remembered that we settled on a different formatting for the API docs so that it gets highlighted better in KDE. --- .../include/PolyVoxCore/Compressor.h | 79 ++++++++++--------- .../PolyVoxCore/source/MinizCompressor.cpp | 8 +- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Compressor.h b/library/PolyVoxCore/include/PolyVoxCore/Compressor.h index 510b7e20..8c00be5e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Compressor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Compressor.h @@ -48,48 +48,51 @@ namespace PolyVox /// Destructor virtual ~Compressor() {}; - /// Computes a worst-case scenario for how big the output can be for a given input size. - /// - /// If necessary you can use this as a destination buffer size, though it may be somewhat - /// wasteful. It is not guarenteed that compression actually shrinks the data, so the - /// worst-case value returned by this function may be bigger than the input size. - /// - /// \param uUncompressedInputSize The size of the uncompressed input data - /// \return The largest possible size of the compressed output data. - /// + /** + * Computes a worst-case scenario for how big the output can be for a given input size. + * + * If necessary you can use this as a destination buffer size, though it may be somewhat + * wasteful. It is not guarenteed that compression actually shrinks the data, so the + * worst-case value returned by this function may be bigger than the input size. + * + * \param uUncompressedInputSize The size of the uncompressed input data + * \return The largest possible size of the compressed output data. + */ virtual uint32_t getMaxCompressedSize(uint32_t uUncompressedInputSize) = 0; - /// Compresses the data. - /// - /// Performs compression of the data pointed to by pSrcData and stores the result in pDstData. - /// The user is responsible for allocating both buffers and for making sure that the destination - /// buffer is large enough to hold the result. If you don't know how big the compressed data - /// will be (and you probably won't know this) then you can call getMaxCompressedSize() to get - /// an upper bound. The *actual* compressed size is then returned by this function and you can - /// use this to copy your compressed data to a more suitably size buffer. - /// - /// \param pSrcData A pointer to the data to be compressed. - /// \param uSrcLength The length of the data to be compressed. - /// \param pDstData A pointer to the memory where the result should be stored. - /// \param uDstLength The length of the destination buffer (compression will fail if this isn't big enough). - /// \return The size of the resulting compressed data. - /// + /** + * Compresses the data. + * + * Performs compression of the data pointed to by pSrcData and stores the result in pDstData. + * The user is responsible for allocating both buffers and for making sure that the destination + * buffer is large enough to hold the result. If you don't know how big the compressed data + * will be (and you probably won't know this) then you can call getMaxCompressedSize() to get + * an upper bound. The *actual* compressed size is then returned by this function and you can + * use this to copy your compressed data to a more suitably size buffer. + * + * \param pSrcData A pointer to the data to be compressed. + * \param uSrcLength The length of the data to be compressed. + * \param pDstData A pointer to the memory where the result should be stored. + * \param uDstLength The length of the destination buffer (compression will fail if this isn't big enough). + * \return The size of the resulting compressed data. + */ virtual uint32_t compress(void* pSrcData, uint32_t uSrcLength, void* pDstData, uint32_t uDstLength) = 0; - /// Decompresses the data. - /// - /// Performs decompression of the data pointed to by pSrcData and stores the result in pDstData. - /// The user is responsible for allocating both buffers and for making sure that the destination - /// buffer is large enough to hold the result. This means you need to know how large the resulting - /// data might be, so before you compress the data it may be worth storing this information somewhere. - /// The *actual* decompressed size is then returned by this function - /// - /// \param pSrcData A pointer to the data to be decompressed. - /// \param uSrcLength The length of the data to be decompressed. - /// \param pDstData A pointer to the memory where the result should be stored. - /// \param uDstLength The length of the destination buffer (decompression will fail if this isn't big enough). - /// \return The size of the resulting uncompressed data. - /// + /** + * Decompresses the data. + * + * Performs decompression of the data pointed to by pSrcData and stores the result in pDstData. + * The user is responsible for allocating both buffers and for making sure that the destination + * buffer is large enough to hold the result. This means you need to know how large the resulting + * data might be, so before you compress the data it may be worth storing this information somewhere. + * The *actual* decompressed size is then returned by this function + * + * \param pSrcData A pointer to the data to be decompressed. + * \param uSrcLength The length of the data to be decompressed. + * \param pDstData A pointer to the memory where the result should be stored. + * \param uDstLength The length of the destination buffer (decompression will fail if this isn't big enough). + * \return The size of the resulting uncompressed data. + */ virtual uint32_t decompress(void* pSrcData, uint32_t uSrcLength, void* pDstData, uint32_t uDstLength) = 0; }; } diff --git a/library/PolyVoxCore/source/MinizCompressor.cpp b/library/PolyVoxCore/source/MinizCompressor.cpp index 4c17ae65..a341ff81 100644 --- a/library/PolyVoxCore/source/MinizCompressor.cpp +++ b/library/PolyVoxCore/source/MinizCompressor.cpp @@ -29,9 +29,11 @@ using namespace std; namespace PolyVox { - /// You can specify a compression level when constructing this compressor. This controls the tradeoff between speed and compression - /// rate. Levels 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow). - /// \param iCompressionLevel The desired compression level. + /** + * You can specify a compression level when constructing this compressor. This controls the tradeoff between speed and compression + * rate. Levels 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow). + * \param iCompressionLevel The desired compression level. + */ MinizCompressor::MinizCompressor(int iCompressionLevel) :m_pDeflator(0) {