| 37 | } |
| 38 | |
| 39 | XnStatus XnCodec::CompressData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const |
| 40 | { |
| 41 | XnStatus nRetVal = XN_STATUS_OK; |
| 42 | |
| 43 | XN_VALIDATE_INPUT_PTR(pSrc); |
| 44 | XN_VALIDATE_INPUT_PTR(pDst); |
| 45 | XN_VALIDATE_OUTPUT_PTR(pnBytesWritten); |
| 46 | |
| 47 | if ((nSrcSize * GetWorseCompressionRatio() + GetOverheadSize()) > nDstSize) |
| 48 | { |
| 49 | XN_LOG_ERROR_RETURN(XN_STATUS_OUTPUT_BUFFER_OVERFLOW, XN_MASK_OPEN_NI, "Can't compress data - destination buffer is not large enough"); |
| 50 | } |
| 51 | |
| 52 | nRetVal = CompressImpl((const XnUChar*)pSrc, nSrcSize, (XnUChar*)pDst, &nDstSize); |
| 53 | XN_IS_STATUS_OK_LOG_ERROR("Compress", nRetVal); |
| 54 | |
| 55 | *pnBytesWritten = nDstSize; |
| 56 | |
| 57 | return (XN_STATUS_OK); |
| 58 | } |
| 59 | |
| 60 | XnStatus XnCodec::DecompressData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const |
| 61 | { |
no outgoing calls
no test coverage detected