0030483: Visualization, Path Tracing - make Tile Size configurable
[occt.git] / src / Image / Image_PixMapData.hxx
index 155ee61..ec870b1 100644 (file)
@@ -38,7 +38,7 @@ public:
   }
 
   //! Initializer.
-  void Init (const Handle(NCollection_BaseAllocator)& theAlloc,
+  bool Init (const Handle(NCollection_BaseAllocator)& theAlloc,
              const Standard_Size                      theSizeBPP,
              const Standard_Size                      theSizeX,
              const Standard_Size                      theSizeY,
@@ -59,6 +59,16 @@ public:
       Allocate (mySize);
     }
     SetTopDown (TopToDown == 1);
+    return !IsEmpty();
+  }
+
+  //! Reset all values to zeros.
+  void ZeroData()
+  {
+    if (myData != NULL)
+    {
+      memset (myData, 0, mySize);
+    }
   }
 
   //! @return data pointer to requested row (first column).
@@ -124,8 +134,13 @@ public:
   Standard_Size  SizeRowBytes; //!< number of bytes per line (in most cases equal to 3 * sizeX)
   Standard_Size  TopToDown;    //!< image scanlines direction in memory from Top to the Down
 
+
+public:
+
+  DEFINE_STANDARD_RTTI_INLINE(Image_PixMapData,NCollection_Buffer) // Type definition
+
 };
 
-typedef NCollection_Handle<Image_PixMapData> Handle(Image_PixMapData);
+DEFINE_STANDARD_HANDLE(Image_PixMapData, NCollection_Buffer)
 
 #endif // _Image_PixMapData_H__