File indexing completed on 2026-09-26 09:03:44
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() = default;
0026
0027
0028 bool Init(const occ::handle<NCollection_BaseAllocator>& theAlloc,
0029 size_t theSizeX,
0030 size_t theSizeY,
0031 size_t theSizeRowBytes = 0,
0032 uint8_t* theDataPtr = nullptr)
0033 {
0034 const size_t aSizeBPP = sizeof(PixelType_t);
0035 return Image_PixMapData::Init(theAlloc,
0036 aSizeBPP,
0037 theSizeX,
0038 theSizeY,
0039 theSizeRowBytes,
0040 theDataPtr);
0041 }
0042
0043
0044 void Init(const PixelType_t& theValue)
0045 {
0046 for (size_t aRowIter = 0; aRowIter < SizeY; ++aRowIter)
0047 {
0048 for (size_t aColIter = 0; aColIter < SizeX; ++aColIter)
0049 {
0050 ChangeValue(aRowIter, aColIter) = theValue;
0051 }
0052 }
0053 }
0054
0055
0056 const PixelType_t* Row(size_t theRow) const
0057 {
0058 return (const PixelType_t*)Image_PixMapData::Row(theRow);
0059 }
0060
0061
0062 PixelType_t* ChangeRow(size_t theRow)
0063 {
0064 return (PixelType_t*)Image_PixMapData::ChangeRow(theRow);
0065 }
0066
0067
0068 const PixelType_t& Value(size_t theRow, size_t theCol) const
0069 {
0070 return *(const PixelType_t*)Image_PixMapData::Value(theRow, theCol);
0071 }
0072
0073
0074 PixelType_t& ChangeValue(size_t theRow, size_t theCol)
0075 {
0076 return *(PixelType_t*)Image_PixMapData::ChangeValue(theRow, theCol);
0077 }
0078 };
0079
0080 #endif