MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / allocate

Method allocate

src/cpu_depth_packet_processor.cpp:77–95  ·  view source on GitHub ↗

* Allocate a buffer. * @param width Width of the matrix. * @param height Height of the matrix. * @param external_buffer If not \c null, use the provided buffer, else make a new one. */

Source from the content-addressed store, hash-verified

75 * @param external_buffer If not \c null, use the provided buffer, else make a new one.
76 */
77 void allocate(int width, int height, unsigned char *external_buffer = 0)
78 {
79 this->width_ = width;
80 this->height_ = height;
81 x_step = sizeof(ScalarT);
82 y_step = width * x_step;
83
84 owns_buffer = external_buffer == 0;
85
86 if(owns_buffer)
87 {
88 buffer_ = new unsigned char[y_step * height];
89 }
90 else
91 {
92 buffer_ = external_buffer;
93 }
94 buffer_end_ = buffer_ + (y_step * height);
95 }
96
97 void deallocate()
98 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected