ZipCompressor::ZipCompressor (const Header &hdr, size_t maxScanLineSize, size_t numScanLines) : Compressor (hdr), _maxScanLineSize (maxScanLineSize), _numScanLines (numScanLines), _tmpBuffer (0), _outBuffer (0) { size_t maxInBytes = uiMult (maxScanLineSize, numScanLines); size_t maxOutBytes = uiAdd (uiAdd (maxInBytes, size_t (ceil (maxInBytes * 0.01))), size_t (100)); _tmpBuffer = new char [maxInBytes]; _outBuffer = new char [maxOutBytes]; }
OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER PreviewImage::PreviewImage (unsigned int width, unsigned int height, const PreviewRgba pixels[]) { _width = width; _height = height; _pixels = new PreviewRgba [checkArraySize (uiMult (_width, _height), sizeof (PreviewRgba))]; if (pixels) { for (unsigned int i = 0; i < _width * _height; ++i) _pixels[i] = pixels[i]; } else { for (unsigned int i = 0; i < _width * _height; ++i) _pixels[i] = PreviewRgba(); } }