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.

57 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // A class representing an image
  4. //
  5. //=============================================================================
  6. #ifndef DMEIMAGE_H
  7. #define DMEIMAGE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "datamodel/dmelement.h"
  12. //-----------------------------------------------------------------------------
  13. // Forward declarations
  14. //-----------------------------------------------------------------------------
  15. enum ImageFormat;
  16. //-----------------------------------------------------------------------------
  17. // A class representing an image (2d or 3d bitmap)
  18. //-----------------------------------------------------------------------------
  19. class CDmeImage : public CDmElement
  20. {
  21. DEFINE_ELEMENT( CDmeImage, CDmElement );
  22. public:
  23. // Methods related to image format
  24. ImageFormat Format() const;
  25. const char *FormatName() const;
  26. // returns a pointer to the image bits buffer
  27. const void *ImageBits() const;
  28. public:
  29. CDmAttributeVar<int> m_Width;
  30. CDmAttributeVar<int> m_Height;
  31. CDmAttributeVar<int> m_Depth;
  32. private:
  33. CDmAttributeVar<int> m_Format;
  34. CDmAttributeVarBinaryBlock m_Bits;
  35. };
  36. //-----------------------------------------------------------------------------
  37. // returns a pointer to the image bits buffer
  38. //-----------------------------------------------------------------------------
  39. inline const void *CDmeImage::ImageBits() const
  40. {
  41. return m_Bits.Get();
  42. }
  43. #endif // DMEIMAGE_H