Additions to Array2D.
This commit is contained in:
parent
5f8e3df5df
commit
83c287727f
@ -171,7 +171,7 @@ namespace PolyVox
|
||||
typedef Array<1,uint32_t> Array1DUint32;
|
||||
|
||||
///A 2D Array of floats.
|
||||
typedef Array<2,float> Array2DFloat;
|
||||
/*typedef Array<2,float> Array2DFloat;
|
||||
///A 2D Array of doubles.
|
||||
typedef Array<2,double> Array2DDouble;
|
||||
///A 2D Array of signed 8-bit values.
|
||||
@ -185,7 +185,7 @@ namespace PolyVox
|
||||
///A 2D Array of signed 32-bit values.
|
||||
typedef Array<2,int32_t> Array2DInt32;
|
||||
///A 2D Array of unsigned 32-bit values.
|
||||
typedef Array<2,uint32_t> Array2DUint32;
|
||||
typedef Array<2,uint32_t> Array2DUint32;*/
|
||||
|
||||
///A 3D Array of floats.
|
||||
typedef Array<3,float> Array3DFloat;
|
||||
|
@ -44,17 +44,56 @@ namespace PolyVox
|
||||
delete[] m_pData;
|
||||
}
|
||||
|
||||
ElementType operator()(uint32_t x, uint32_t y) const
|
||||
{
|
||||
return m_pData[y * m_uWidth + x];
|
||||
}
|
||||
|
||||
ElementType& operator()(uint32_t x, uint32_t y)
|
||||
{
|
||||
return m_pData[y * m_uWidth + x];
|
||||
}
|
||||
|
||||
ElementType* getRawData()
|
||||
{
|
||||
return m_pData;
|
||||
}
|
||||
|
||||
size_t getNoOfElements()
|
||||
{
|
||||
return m_uWidth * m_uHeight;
|
||||
}
|
||||
|
||||
void swap(Array2D& other)
|
||||
{
|
||||
ElementType* temp = other.m_pData;
|
||||
other.m_pData = m_pData;
|
||||
m_pData = temp;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
uint32_t m_uWidth;
|
||||
uint32_t m_uHeight;
|
||||
ElementType* m_pData;
|
||||
};
|
||||
|
||||
///A 2D Array of floats.
|
||||
typedef Array2D<float> Array2DFloat;
|
||||
///A 2D Array of doubles.
|
||||
typedef Array2D<double> Array2DDouble;
|
||||
///A 2D Array of signed 8-bit values.
|
||||
typedef Array2D<int8_t> Array2DInt8;
|
||||
///A 2D Array of unsigned 8-bit values.
|
||||
typedef Array2D<uint8_t> Array2DUint8;
|
||||
///A 2D Array of signed 16-bit values.
|
||||
typedef Array2D<int16_t> Array2DInt16;
|
||||
///A 2D Array of unsigned 16-bit values.
|
||||
typedef Array2D<uint16_t> Array2DUint16;
|
||||
///A 2D Array of signed 32-bit values.
|
||||
typedef Array2D<int32_t> Array2DInt32;
|
||||
///A 2D Array of unsigned 32-bit values.
|
||||
typedef Array2D<uint32_t> Array2DUint32;
|
||||
}
|
||||
|
||||
#endif //__PolyVox_Array2D_H__
|
@ -44,14 +44,14 @@ namespace PolyVox
|
||||
typedef Array<1,int32_t> Array1DInt32;
|
||||
typedef Array<1,uint32_t> Array1DUint32;
|
||||
|
||||
typedef Array<2,float> Array2DFloat;
|
||||
/*typedef Array<2,float> Array2DFloat;
|
||||
typedef Array<2,double> Array2DDouble;
|
||||
typedef Array<2,int8_t> Array2DInt8;
|
||||
typedef Array<2,uint8_t> Array2DUint8;
|
||||
typedef Array<2,int16_t> Array2DInt16;
|
||||
typedef Array<2,uint16_t> Array2DUint16;
|
||||
typedef Array<2,int32_t> Array2DInt32;
|
||||
typedef Array<2,uint32_t> Array2DUint32;
|
||||
typedef Array<2,uint32_t> Array2DUint32;*/
|
||||
|
||||
typedef Array<3,float> Array3DFloat;
|
||||
typedef Array<3,double> Array3DDouble;
|
||||
|
Loading…
x
Reference in New Issue
Block a user