| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
JPEGGenerator Class Reference#include <JPEGGenerator.h>
Inheritance diagram for JPEGGenerator: ![]() Detailed DescriptionGenerates FilterBankEvents containing JPEG compressed images.There's only one channel per resolution layer, which holds the compressed data. This is mostly intended for being sent over wireless, but if you know how JPEG works, you may be able to interpret the compressed data directly and glean useful information from it. After all, compression is all about throwing away unimportant details and storing the salient information. The generated events use 0 for their event source IDs. The row skip and row stride are 0. (they don't really apply here) This can either compress a greyscale image or an interleaved YUV image. If the source generator's type is not InterleavedYUVGenerator, it will assume greyscale. Call setSource() to override this. The InterleavedYUVGenerator is separated from this because it wouldn't really make things much faster to combine the algorithms, and others might find the interleaved format handy for passing to other libraries which expect that format, such as what happened with libjpeg. This class shares a lot of non-JPEG specific code with PNGGenerator, so you may want to replicate any changes made in that class as well.
Definition at line 39 of file JPEGGenerator.h.
Member Enumeration Documentationdefines how to interpret the source images (see srcMode and curMode)
Definition at line 44 of file JPEGGenerator.h.
Constructor & Destructor Documentation
don't call
Member Function Documentation
This function is taken pretty directly from the write_jpeg_mem() function from Sony's W3AIBO sample code. I have adapted it for this object, and added the ability to process greyscale images as well as color. Implements FilterBankGenerator. Definition at line 204 of file JPEGGenerator.cc.
create new image data storage area for the cache - this called by getImage() only 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 193 of file JPEGGenerator.cc. Referenced by loadBuffer().
deletes the arrays
Reimplemented from FilterBankGenerator. Definition at line 291 of file JPEGGenerator.cc. Referenced by ~JPEGGenerator().
if we don't already know bytesUsed, let's assume the size will be smaller than the original uncompressed. If we fail this assumption, probably better to fail anyway.
Reimplemented from FilterBankGenerator. Definition at line 89 of file JPEGGenerator.cc.
Gives a short description of what this class of behaviors does... you should override this (but don't have to). If you do override this, also consider overriding getDescription() to return it Reimplemented from BehaviorBase. Definition at line 65 of file JPEGGenerator.h.
returns curMode
Definition at line 63 of file JPEGGenerator.h. Referenced by calcImage(), getBinSize(), loadBuffer(), and saveBuffer().
returns the number of bytes used for the image returned by getImage() - will return 0 if the image hasn't been calculated yet (so call it after getImage())
Definition at line 89 of file JPEGGenerator.h. Referenced by LGmixin::uploadCameraImage().
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 109 of file JPEGGenerator.cc.
don't call
should receive FilterBankEvents from a RawCameraGenerator (or a subclass thereof) The const casts in this function are regretable but necessary since the corresponding OPEN-R functions require mutable arguments, even though they shouldn't be modifying the data Reimplemented from FilterBankGenerator. Definition at line 70 of file JPEGGenerator.cc.
you probably don't want to be calling this to access the JPEG -- use getImage() instead (saveBuffer will prepend some header information before the actual image data)
Reimplemented from FilterBankGenerator. Definition at line 141 of file JPEGGenerator.cc.
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. The default implementation is a no-op if(numLayers==nLayers && numChannels==nChannels) Reimplemented from FilterBankGenerator. Definition at line 177 of file JPEGGenerator.cc. Referenced by JPEGGenerator().
sets quality; this will invalidate the cache if q does not equal current quality
Definition at line 81 of file JPEGGenerator.h.
Member Data Documentation
number of bytes used per image to actually store data;
Definition at line 100 of file JPEGGenerator.h. Referenced by calcImage(), destruct(), getBinSize(), getImageSize(), loadBuffer(), saveBuffer(), and setNumImages().
used to interface with libjpeg - holds compression parameters and state
Definition at line 102 of file JPEGGenerator.h. Referenced by calcImage(), JPEGGenerator(), and ~JPEGGenerator().
how to interpret getImage's current image
Definition at line 98 of file JPEGGenerator.h. Referenced by getCurrentSourceFormat(), JPEGGenerator(), processEvent(), and setSourceMode().
used to interface with libjpeg - gives us access to error information
Definition at line 103 of file JPEGGenerator.h. Referenced by JPEGGenerator().
add a bit to the expected size in getBinSize just to leave a little extra room for small images
Definition at line 41 of file JPEGGenerator.h. Referenced by calcImage(), createImageCache(), and getBinSize().
quality level to pass to libjpeg; -1U causes Config::vision_config::rawcam_compress_quality to be used
Definition at line 105 of file JPEGGenerator.h. Referenced by calcImage(), getQuality(), and setQuality().
how to interpret source channel of next filter bank event
Definition at line 97 of file JPEGGenerator.h. Referenced by getSourceMode(), JPEGGenerator(), and setSourceMode().
The documentation for this class was generated from the following files: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Wed Oct 4 00:05:04 2006 by Doxygen 1.4.7 |