Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <RawCameraGenerator.h>
Inheritance diagram for RawCameraGenerator:
Definition at line 11 of file RawCameraGenerator.h.
Public Types | |
enum | channel_id_t { CHAN_Y, CHAN_U, CHAN_V, CHAN_Y_DY, CHAN_Y_DX, CHAN_Y_DXDY, NUM_CHANNELS } |
holds id values for specifying image channel/bands More... | |
Public Member Functions | |
RawCameraGenerator (unsigned int numRawLayers, unsigned int numCalcLayers, EventBase::EventGeneratorID_t gid, unsigned int sid, unsigned int mysid) | |
constructor, numRawLayers is the number of real layers passed from the system, numCalcLayers is the total number of layers to make available | |
virtual | ~RawCameraGenerator () |
destructor | |
virtual void | processEvent (const EventBase &event) |
called with system's image info | |
virtual void | freeCaches () |
the memory for all layers except the double layer was allocated by system, so we just set them to NULL before calling FilterBankGenerator::freeCaches() so it won't try to delete them | |
virtual unsigned int | getBinSize () const |
calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work. | |
virtual unsigned int | LoadBuffer (const char buf[], unsigned int len) |
virtual unsigned int | SaveBuffer (char buf[], unsigned int len) const |
Save to a given buffer. | |
Static Public Member Functions | |
std::string | getClassDescription () |
Gives a short description of what this class of behaviors does... you should override this (but don't have to). | |
Protected Member Functions | |
virtual void | setNumImages (unsigned int nLayers, unsigned int nChannels) |
resizes the filter bank information storage area, you should override this to do your setup and call it from your constructor | |
virtual void | setDimensions () |
resets the width, height, skip and stride values | |
virtual unsigned char * | createImageCache (unsigned int layer, unsigned int chan) const |
create new image data storage area for the cache - this is only called when the corresponding entry in images is NULL | |
virtual void | calcImage (unsigned int layer, unsigned int chan) const |
should calculate new image data, only called when imageValids indicates the image being requested is dirty | |
virtual void | destruct () |
deletes the arrays | |
void | upsampleImage (channel_id_t chan) const |
Creates a double resolution version of a channel, doesn't do any smoothing. | |
void | reconstructImage () const |
Creates a double resolution Y-channel from the Y and Y gradient channels. | |
Static Protected Member Functions | |
unsigned int | mapChannelID (channel_id_t chan) |
returns the value to pass to OPENR functions corresponding to the desired channel_id_t. | |
unsigned char | clipRange (int val) |
helper functions for reconstructImage() - see documentation for that function | |
Protected Attributes | |
unsigned int | numRealLayers |
the number of "real" layers being sent from the system | |
unsigned char ** | layers |
points to the image data supplied by the system, one per layer (all channels are interleaved by row) | |
const OFbkImageInfo ** | imageInfos |
image info provided by the system | |
Private Member Functions | |
RawCameraGenerator (const RawCameraGenerator &fbk) | |
don't call | |
const RawCameraGenerator & | operator= (const RawCameraGenerator &fbk) |
don't call |
|
holds id values for specifying image channel/bands
Definition at line 35 of file RawCameraGenerator.h. |
|
constructor, numRawLayers is the number of real layers passed from the system, numCalcLayers is the total number of layers to make available The extra calculated layers are simply created by giving larger increments, they reference the same data (no computational cost, marginal memory costs... it's just nice to have more layers in the image pyramid. However you'll have to write your code to use the getIncrement() value properly if you want it to work. Otherwise, you could write a de-interlace generator which will do the resampling. The top most layer (largest index) is a double-scale image. For the Y-channel, it is reconstructed from the 4 Y channels. For the other channels, it just does a fast scaling (but these operations do cost, so use the top layer conservatively. Definition at line 14 of file RawCameraGenerator.cc. |
|
destructor
Definition at line 20 of file RawCameraGenerator.cc. |
|
don't call
|
|
should calculate new image data, only called when imageValids indicates the image being requested is dirty This is where you'll want to put your user-specific code for calculating the image data Implements FilterBankGenerator. Definition at line 192 of file RawCameraGenerator.cc. |
|
helper functions for reconstructImage() - see documentation for that function
Definition at line 75 of file RawCameraGenerator.h. Referenced by reconstructImage(). |
|
create new image data storage area for the cache - this is only called when the corresponding entry in images is NULL You should return the pointer you want stored in images to be returned by any calls to getFirstRow. Interpretation of the data it points to is dependant on the the generator which creates it Implements FilterBankGenerator. Definition at line 184 of file RawCameraGenerator.cc. Referenced by LoadBuffer(). |
|
deletes the arrays
Reimplemented from FilterBankGenerator. Definition at line 248 of file RawCameraGenerator.cc. Referenced by ~RawCameraGenerator(). |
|
the memory for all layers except the double layer was allocated by system, so we just set them to NULL before calling FilterBankGenerator::freeCaches() so it won't try to delete them
Reimplemented from FilterBankGenerator. Definition at line 159 of file RawCameraGenerator.cc. Referenced by setDimensions(), and ~RawCameraGenerator(). |
|
calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.
Reimplemented from FilterBankGenerator. Definition at line 69 of file RawCameraGenerator.cc. |
|
Gives a short description of what this class of behaviors does... you should override this (but don't have to).
Reimplemented from BehaviorBase. Definition at line 32 of file RawCameraGenerator.h. |
|
The LoadBuffer() functions of the included subclasses aren't tested, so don't assume they'll work without a little debugging... Reimplemented from FilterBankGenerator. Definition at line 77 of file RawCameraGenerator.cc. |
|
returns the value to pass to OPENR functions corresponding to the desired channel_id_t.
Definition at line 257 of file RawCameraGenerator.cc. Referenced by calcImage(). |
|
don't call
|
|
called with system's image info The const casts in this function are regretable but necessary since the OPEN-R OFbkImage constructor requires mutable arguments, even though it shouldn't be modifying the data Reimplemented from FilterBankGenerator. Definition at line 30 of file RawCameraGenerator.cc. |
|
Creates a double resolution Y-channel from the Y and Y gradient channels. This function is lifted from Sony's ImageObserver sample code. Here's Sony's original license for the file (ImageObserver.cc) that contained this function:
|
|
Save to a given buffer.
Reimplemented from FilterBankGenerator. Definition at line 106 of file RawCameraGenerator.cc. |
|
resets the width, height, skip and stride values
Definition at line 144 of file RawCameraGenerator.cc. Referenced by processEvent(). |
|
resizes the filter bank information storage area, you should override this to do your setup and call it from your constructor In general, it isn't expected that FilterBankGenerator's should necessarily be dynamically resizeable (although it would be nice), which is why this isn't public. If yours is, just add some pubic accessor functions which call this. In general, the included subclasses should be able to handle being resized, but there's no reason to do so since the system won't be changing its available resolutions at run time. Reimplemented from FilterBankGenerator. Definition at line 170 of file RawCameraGenerator.cc. Referenced by RawCameraGenerator(). |
|
Creates a double resolution version of a channel, doesn't do any smoothing.
Definition at line 278 of file RawCameraGenerator.cc. Referenced by calcImage(). |
|
image info provided by the system
Definition at line 84 of file RawCameraGenerator.h. Referenced by calcImage(), destruct(), processEvent(), setDimensions(), and setNumImages(). |
|
points to the image data supplied by the system, one per layer (all channels are interleaved by row)
Definition at line 83 of file RawCameraGenerator.h. Referenced by calcImage(), destruct(), processEvent(), and setNumImages(). |
|
the number of "real" layers being sent from the system
Definition at line 81 of file RawCameraGenerator.h. Referenced by calcImage(), processEvent(), setDimensions(), and setNumImages(). |
Tekkotsu v2.0 |
Generated Wed Jan 21 03:23:22 2004 by Doxygen 1.3.4 |