Exemplo n.º 1
0
void	
InputFile::Data::deleteCachedBuffer()
{
    //
    // Delete the cached frame buffer, and all memory
    // allocated for the slices in the cached frameBuffer.
    //

    if (cachedBuffer)
    {
	for (FrameBuffer::Iterator k = cachedBuffer->begin();
	     k != cachedBuffer->end();
	     ++k)
	{
	    Slice &s = k.slice();

	    switch (s.type)
	    {
	      case OPENEXR_IMF_INTERNAL_NAMESPACE::UINT:

		delete [] (((unsigned int *)s.base) + offset);
		break;

	      case OPENEXR_IMF_INTERNAL_NAMESPACE::HALF:

		delete [] ((half *)s.base + offset);
		break;

	      case OPENEXR_IMF_INTERNAL_NAMESPACE::FLOAT:

		delete [] (((float *)s.base) + offset);
		break;
              case NUM_PIXELTYPES :
                  throw(IEX_NAMESPACE::ArgExc("Invalid pixel type"));
	    }                
	}

	//
	// delete the cached frame buffer
	//

	delete cachedBuffer;
	cachedBuffer = 0;
    }
}
Exemplo n.º 2
0
void
InputFile::Data::deleteCachedBuffer()
{
    //
    // Delete the cached frame buffer, and all memory
    // allocated for the slices in the cached frameBuffer.
    //

    if (cachedBuffer)
    {
	for (FrameBuffer::Iterator k = cachedBuffer->begin();
	     k != cachedBuffer->end();
	     ++k)
	{
	    Slice &s = k.slice();

	    switch (s.type)
	    {
	      case UINT:

		delete [] (((unsigned int *)s.base) + offset);
		break;

	      case HALF:

		delete [] ((half *)s.base + offset);
		break;

	      case FLOAT:

		delete [] (((float *)s.base) + offset);
		break;
	    }
	}

	//
	// delete the cached frame buffer
	//

	delete cachedBuffer;
	cachedBuffer = 0;
    }
}