File indexing completed on 2025-01-18 10:04:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Image_PixMapTypedData_Header
0015 #define _Image_PixMapTypedData_Header
0016
0017 #include <Image_PixMapData.hxx>
0018
0019
0020 template<typename PixelType_t>
0021 class Image_PixMapTypedData : public Image_PixMapData
0022 {
0023 public:
0024
0025 Image_PixMapTypedData() {}
0026
0027
0028 bool Init (const Handle(NCollection_BaseAllocator)& theAlloc,
0029 Standard_Size theSizeX,
0030 Standard_Size theSizeY,
0031 Standard_Size theSizeRowBytes = 0,
0032 Standard_Byte* theDataPtr = 0)
0033 {
0034 const Standard_Size aSizeBPP = sizeof(PixelType_t);
0035 return Image_PixMapData::Init (theAlloc, aSizeBPP, theSizeX, theSizeY, theSizeRowBytes, theDataPtr);
0036 }
0037
0038
0039 void Init (const PixelType_t& theValue)
0040 {
0041 for (Standard_Size aRowIter = 0; aRowIter < SizeY; ++aRowIter)
0042 {
0043 for (Standard_Size aColIter = 0; aColIter < SizeX; ++aColIter)
0044 {
0045 ChangeValue (aRowIter, aColIter) = theValue;
0046 }
0047 }
0048 }
0049
0050
0051 const PixelType_t* Row (Standard_Size theRow) const { return (const PixelType_t* )Image_PixMapData::Row (theRow); }
0052
0053
0054 PixelType_t* ChangeRow (Standard_Size theRow) { return (PixelType_t* )Image_PixMapData::ChangeRow (theRow); }
0055
0056
0057 const PixelType_t& Value (Standard_Size theRow, Standard_Size theCol) const { return *(const PixelType_t* )Image_PixMapData::Value (theRow, theCol); }
0058
0059
0060 PixelType_t& ChangeValue (Standard_Size theRow, Standard_Size theCol) { return *(PixelType_t* )Image_PixMapData::ChangeValue (theRow, theCol); }
0061
0062 };
0063
0064 #endif