ofxDepthStream
|
A read-only wrapper around a data block of a specified size. More...
#include <Frame.h>
Public Types | |
typedef std::function< void(const void *, size_t)> | InputFunc |
Public Member Functions | |
Frame () | |
Create an uninitialized, empty Frame instance. More... | |
Frame (size_t size) | |
Allocates size bytes of owned data. More... | |
Frame (const void *data, size_t size) | |
Initializes with external data. More... | |
~Frame () | |
Deallocates owned data (if any) More... | |
const void * | data () |
size_t | size () |
template<typename ResultType > | |
ResultType | convert (std::function< ResultType(const void *, size_t)> func) |
execute the given function with the frame's current content More... | |
Static Public Member Functions | |
static FrameRef | ref (size_t size) |
Allocates a Frame for owned data. More... | |
static FrameRef | refToExternalData (const void *data, size_t size) |
Initializes a frame with external data. More... | |
static FrameRef | refWithData (void *data, size_t size) |
Initializes a Frame with owned data ("adopts" the provided data) More... | |
A read-only wrapper around a data block of a specified size.
Frame is a read-only wrapper around a data block pointer and a size attribute. Frames can be initialized both with owned data (which will be deallocated by the Frame's destructor) as well as with external data (which will simply be abandoned by the Frame's destructor).
typedef std::function<void(const void*, size_t)> depth::Frame::InputFunc |
|
inline |
Create an uninitialized, empty Frame instance.
|
inline |
Allocates size bytes of owned data.
|
inline |
Initializes with external data.
|
inline |
Deallocates owned data (if any)
|
inline |
execute the given function with the frame's current content
This template function fascilitates specifically towards functional programming and lets the owner "convert" the data by choosing a return-value type. When converting to another Frame reference, linked notation is possible; frame->convert<FrameRef>(scaleDown)->convert<FrameRef>(blackAndWhite)->convert<FrameRef>(blur)
|
inline |
Referenced by depth::compress(), convert(), depth::inflate(), refToExternalData(), and refWithData().
|
inlinestatic |
Allocates a Frame for owned data.
Referenced by refWithData().
|
inlinestatic |
Initializes a frame with external data.
Referenced by depth::compress(), depth::inflate(), and depth::Buffer::write().
|
inlinestatic |
Initializes a Frame with owned data ("adopts" the provided data)
Referenced by depth::convert_16bit_to_8bit(), depth::convert_32bit_to_8bit(), and depth::convertTo8bitGrayscaleData().
|
inline |
Referenced by depth::compress(), convert(), Frame(), depth::inflate(), ref(), refToExternalData(), and refWithData().