summaryrefslogtreecommitdiff
path: root/public/movieobjects/dmeimage.h
blob: e30b109bf4bcb9cef3035ede9d10d621c1f942a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// A class representing an image
//
//=============================================================================

#ifndef DMEIMAGE_H
#define DMEIMAGE_H
#ifdef _WIN32
#pragma once
#endif

#include "datamodel/dmelement.h"


//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
enum ImageFormat;


//-----------------------------------------------------------------------------
// A class representing an image (2d or 3d bitmap)
//-----------------------------------------------------------------------------
class CDmeImage : public CDmElement
{
	DEFINE_ELEMENT( CDmeImage, CDmElement );

public:
	// Methods related to image format
	ImageFormat Format() const;
	const char *FormatName() const;

	// returns a pointer to the image bits buffer
	const void *ImageBits() const;

public:
	CDmAttributeVar<int> m_Width;
	CDmAttributeVar<int> m_Height;
	CDmAttributeVar<int> m_Depth;

private:
	CDmAttributeVar<int> m_Format;
	CDmAttributeVarBinaryBlock m_Bits;
};


//-----------------------------------------------------------------------------
// returns a pointer to the image bits buffer
//-----------------------------------------------------------------------------
inline const void *CDmeImage::ImageBits() const
{
	return m_Bits.Get();
}


#endif // DMEIMAGE_H