Homepage Demos Overview Downloads Tutorials Reference
Credits

InterleavedYUVGenerator Class Reference

#include <InterleavedYUVGenerator.h>

Inheritance diagram for InterleavedYUVGenerator:

Inheritance graph
[legend]
List of all members.

Detailed Description

Generates FilterBankEvents containing raw camera images with interleaved pixels (YVUYVUYVU... instead of YYY...UUU...VVV...).

Note:
That's not a typo - the byte ordering is YVU, not YUV
Sorry about the misleading name... This takes YUV images, however, the main reason for this class is to interleave the image in order to pass it to the jpeg compression routines. JPEG expect YCrCb, which is apparently YVU order. *shrug* I dunno, there's something weird there.

There's only one channel, which holds the interleaved data. The increment is set to 3, but if you want to access each component in order, just use 1 instead (as you would expect hopefully, since that's the whole point of this class)

The generated events use 0 for their event source IDs. The row skip is always 0, and the row stride is always width*3. But it would be better to use the proper accessor functions to be more general.

should receive FilterBankEvents from any standard format FilterBankGenerator (like RawCameraGenerator)

Definition at line 28 of file InterleavedYUVGenerator.h.

Public Member Functions

 InterleavedYUVGenerator (EventBase::EventGeneratorID_t gid, unsigned int sid, unsigned int mysid)
 constructor

 InterleavedYUVGenerator (EventBase::EventGeneratorID_t gid, unsigned int sid, unsigned int mysid, unsigned int syc, unsigned int suc, unsigned int svc)
 constructor, you can pass which channels to interleave

virtual void processEvent (const EventBase &event)
 should receive FilterBankEvents from any standard format FilterBankGenerator (like RawCameraGenerator)

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).


Static Public Attributes

const unsigned int CHAN_YUV = 0
 so you can refer to the YUV channel symbolically.


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 width, height, skip and stride parameters

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


Protected Attributes

const FilterBankGeneratorsrc
 the generator of the last FilterBankEvent received

unsigned int srcYChan
 the channel of the source's Y channel

unsigned int srcUChan
 the channel of the source's U channel

unsigned int srcVChan
 the channel of the source's V channel


Private Member Functions

 InterleavedYUVGenerator (const InterleavedYUVGenerator &fbk)
 don't call

const InterleavedYUVGeneratoroperator= (const InterleavedYUVGenerator &fbk)
 don't call


Constructor & Destructor Documentation

InterleavedYUVGenerator::InterleavedYUVGenerator EventBase::EventGeneratorID_t  gid,
unsigned int  sid,
unsigned int  mysid
 

constructor

Definition at line 9 of file InterleavedYUVGenerator.cc.

InterleavedYUVGenerator::InterleavedYUVGenerator EventBase::EventGeneratorID_t  gid,
unsigned int  sid,
unsigned int  mysid,
unsigned int  syc,
unsigned int  suc,
unsigned int  svc
 

constructor, you can pass which channels to interleave

Definition at line 15 of file InterleavedYUVGenerator.cc.

InterleavedYUVGenerator::InterleavedYUVGenerator const InterleavedYUVGenerator fbk  )  [private]
 

don't call


Member Function Documentation

void InterleavedYUVGenerator::calcImage unsigned int  layer,
unsigned int  chan
const [protected, virtual]
 

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 201 of file InterleavedYUVGenerator.cc.

unsigned char * InterleavedYUVGenerator::createImageCache unsigned int  layer,
unsigned int  chan
const [protected, virtual]
 

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 196 of file InterleavedYUVGenerator.cc.

Referenced by LoadBuffer().

unsigned int InterleavedYUVGenerator::getBinSize  )  const [virtual]
 

calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.

Returns:
number of bytes read/written, 0 if error (or empty)

Reimplemented from FilterBankGenerator.

Definition at line 46 of file InterleavedYUVGenerator.cc.

std::string InterleavedYUVGenerator::getClassDescription  )  [inline, static]
 

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 37 of file InterleavedYUVGenerator.h.

unsigned int InterleavedYUVGenerator::LoadBuffer const char  buf[],
unsigned int  len
[virtual]
 

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 57 of file InterleavedYUVGenerator.cc.

const InterleavedYUVGenerator& InterleavedYUVGenerator::operator= const InterleavedYUVGenerator fbk  )  [private]
 

don't call

void InterleavedYUVGenerator::processEvent const EventBase event  )  [virtual]
 

should receive FilterBankEvents from any standard format FilterBankGenerator (like RawCameraGenerator)

Reimplemented from FilterBankGenerator.

Definition at line 29 of file InterleavedYUVGenerator.cc.

unsigned int InterleavedYUVGenerator::SaveBuffer char  buf[],
unsigned int  len
const [virtual]
 

Save to a given buffer.

Parameters:
buf pointer to the memory where you should begin writing
len length of buf available. (this isn't all yours, constrain yourself to what you returned in getBinSize() )
Returns:
the number of bytes actually used

Reimplemented from FilterBankGenerator.

Definition at line 106 of file InterleavedYUVGenerator.cc.

void InterleavedYUVGenerator::setDimensions  )  [protected, virtual]
 

resets width, height, skip and stride parameters

Definition at line 160 of file InterleavedYUVGenerator.cc.

Referenced by processEvent().

void InterleavedYUVGenerator::setNumImages unsigned int  nLayers,
unsigned int  nChannels
[protected, virtual]
 

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 InterleavedYUVGenerator.cc.

Referenced by InterleavedYUVGenerator(), and processEvent().


Member Data Documentation

const unsigned int InterleavedYUVGenerator::CHAN_YUV = 0 [static]
 

so you can refer to the YUV channel symbolically.

Definition at line 35 of file InterleavedYUVGenerator.h.

const FilterBankGenerator* InterleavedYUVGenerator::src [protected]
 

the generator of the last FilterBankEvent received

Definition at line 54 of file InterleavedYUVGenerator.h.

Referenced by calcImage(), processEvent(), and setDimensions().

unsigned int InterleavedYUVGenerator::srcUChan [protected]
 

the channel of the source's U channel

Definition at line 56 of file InterleavedYUVGenerator.h.

Referenced by calcImage().

unsigned int InterleavedYUVGenerator::srcVChan [protected]
 

the channel of the source's V channel

Definition at line 57 of file InterleavedYUVGenerator.h.

Referenced by calcImage().

unsigned int InterleavedYUVGenerator::srcYChan [protected]
 

the channel of the source's Y channel

Definition at line 55 of file InterleavedYUVGenerator.h.

Referenced by calcImage().


The documentation for this class was generated from the following files:
Tekkotsu v2.0
Generated Wed Jan 21 03:23:14 2004 by Doxygen 1.3.4