Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef TGAWRITER_H
  8. #define TGAWRITER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "tier1/interface.h"
  13. #include "bitmap/imageformat.h" //ImageFormat enum definition
  14. class CUtlBuffer;
  15. namespace TGAWriter
  16. {
  17. bool WriteToBuffer( unsigned char *pImageData, CUtlBuffer &buffer, int width, int height,
  18. ImageFormat srcFormat, ImageFormat dstFormat );
  19. // write out a simple tga file from a memory buffer.
  20. bool WriteTGAFile( const char *fileName, int width, int height, enum ImageFormat srcFormat, uint8 const *srcData, int nStride );
  21. // A pair of routines for writing to files without allocating any memory in the TGA writer
  22. // Useful for very large files such as posters, which are rendered as sub-rects anyway
  23. bool WriteDummyFileNoAlloc( const char *fileName, int width, int height, ImageFormat dstFormat );
  24. bool WriteRectNoAlloc( unsigned char *pImageData, const char *fileName, int nXOrigin, int nYOrigin, int width, int height, int nStride, ImageFormat srcFormat );
  25. } // end namespace TGAWriter
  26. #endif // TGAWRITER_H