#include <ImageData.h>
Public Member Functions | |
ImageData (int bytesPerPixel) | |
~ImageData () | |
int | GetBuffSize (const int &startx, const int &starty, const int &sizex, const int &sizey, const int req_wid, const int req_ht, const byte *src) |
int | GetImageDataSize (void) |
int | AddImage (const int req_wid, byte *dest=NULL) |
void | WriteHeader (ImageDataCombine_t combine, const liveVizRequest *req, byte *dest) |
void | ReadHeader (ImageDataCombine_t &combine, liveVizRequest *req, const byte *src) |
int | CombineImageDataSize (int nMsg, CkReductionMsg **msgs) |
void | CombineImageData (int nMsg, CkReductionMsg **msgs, byte *dest) |
byte * | ConstructImage (byte *src, liveVizRequest &req) |
Private Member Functions | |
int | CopyImageData (byte *dest, int n, const CkReductionMsg *msg, ImageDataCombine_t reducer) |
byte * | GetClippedImage (const byte *img, const int &startx, const int &starty, const int &sizex, const int &sizey, const int req_wid, const int req_ht) |
bool | IsPixelOn (const byte *pixel) |
void | CopyPixel (byte *dest, const byte *src) |
int | NumNonNullLists (int *pos, const int *size, const int &n) |
int | GetNonNullListIndex (const int *pos, const int &n) |
void | SetSize (int nLines, int nPixels) |
Make our image size be this many lines and pixels. | |
LineHeader * | getHeader (void *src, int lineNo) |
Get the header for this line of this compressed image. | |
ImageData () | |
Private Attributes | |
int | m_bytesPerPixel |
int | m_size |
int | m_headerSize |
int | m_numDataLines |
byte * | m_header |
byte * | m_clippedImage |
bool | m_clippedImageAllocated |
int | m_startx |
int | m_starty |
int | m_sizex |
int | m_sizey |
Data Structures | |
class | ImageHeader |
This header is stored as the first thing in our buffer. More... | |
class | LineHeader |
Describes a row of image data. More... |
Definition at line 13 of file ImageData.h.
ImageData::ImageData | ( | int | bytesPerPixel | ) |
Definition at line 3 of file ImageData.C.
References m_bytesPerPixel, m_clippedImage, m_clippedImageAllocated, m_header, m_headerSize, m_numDataLines, m_size, m_sizex, m_sizey, m_startx, and m_starty.
ImageData::~ImageData | ( | ) |
Definition at line 18 of file ImageData.C.
References m_clippedImage, m_clippedImageAllocated, and m_header.
ImageData::ImageData | ( | ) | [inline, private] |
Definition at line 298 of file ImageData.h.
int ImageData::GetBuffSize | ( | const int & | startx, | |
const int & | starty, | |||
const int & | sizex, | |||
const int & | sizey, | |||
const int | req_wid, | |||
const int | req_ht, | |||
const byte * | src | |||
) |
Definition at line 67 of file ImageData.C.
References AddImage(), and GetClippedImage().
Referenced by liveVizPollDeposit().
int ImageData::GetImageDataSize | ( | void | ) | [inline] |
Definition at line 186 of file ImageData.C.
References CopyPixel(), IsPixelOn(), m_bytesPerPixel, m_clippedImage, ImageData::ImageHeader::m_lines, m_numDataLines, ImageData::LineHeader::m_pos, m_size, ImageData::LineHeader::m_size, m_sizex, m_sizey, m_startx, m_starty, SetSize(), src, and x.
Referenced by GetBuffSize(), and liveVizPollDeposit().
void ImageData::WriteHeader | ( | ImageDataCombine_t | combine, | |
const liveVizRequest * | req, | |||
byte * | dest | |||
) |
Definition at line 31 of file ImageData.C.
References ImageData::ImageHeader::m_combine, and ImageData::ImageHeader::m_req.
Referenced by liveVizPollDeposit().
void ImageData::ReadHeader | ( | ImageDataCombine_t & | combine, | |
liveVizRequest * | req, | |||
const byte * | src | |||
) |
Definition at line 43 of file ImageData.C.
References ImageData::ImageHeader::m_combine, and ImageData::ImageHeader::m_req.
int ImageData::CombineImageDataSize | ( | int | nMsg, | |
CkReductionMsg ** | msgs | |||
) |
"buff" consists of two totally different things: 1.) It's got a compressed image header and lineheaders for the merged image. 2.) It's got the "pos" and "size" arrays used for sorting.
Definition at line 478 of file ImageData.C.
References getHeader(), GetNonNullListIndex(), int, m_header, ImageData::LineHeader::m_pos, m_size, ImageData::LineHeader::m_size, NumNonNullLists(), SetSize(), and size.
Referenced by imagePollCombineReducer().
void ImageData::CombineImageData | ( | int | nMsg, | |
CkReductionMsg ** | msgs, | |||
byte * | dest | |||
) |
Definition at line 672 of file ImageData.C.
References CopyImageData(), m_header, m_headerSize, m_numDataLines, and m_size.
Referenced by imagePollCombineReducer().
byte * ImageData::ConstructImage | ( | byte * | src, | |
liveVizRequest & | req | |||
) |
Definition at line 783 of file ImageData.C.
References liveVizRequest::ht, ImageData::ImageHeader::m_lines, ImageData::LineHeader::m_pos, ImageData::ImageHeader::m_req, ImageData::LineHeader::m_size, and liveVizRequest::wid.
int ImageData::CopyImageData | ( | byte * | dest, | |
int | n, | |||
const CkReductionMsg * | msg, | |||
ImageDataCombine_t | reducer | |||
) | [private] |
Definition at line 712 of file ImageData.C.
References CkReductionMsg::getData(), ImageData::LineHeader::m_pos, ImageData::LineHeader::m_size, max_float_image_data, max_image_data, maxArrayT(), sum_float_image_data, sum_image_data, sumArrayClipT(), and sumArrayT().
Referenced by CombineImageData().
byte * ImageData::GetClippedImage | ( | const byte * | img, | |
const int & | startx, | |||
const int & | starty, | |||
const int & | sizex, | |||
const int & | sizey, | |||
const int | req_wid, | |||
const int | req_ht | |||
) | [private] |
Definition at line 88 of file ImageData.C.
References CmiPrintf(), m_bytesPerPixel, m_clippedImage, m_clippedImageAllocated, m_sizex, m_sizey, m_startx, m_starty, and x.
Referenced by GetBuffSize().
Definition at line 150 of file ImageData.h.
References m_bytesPerPixel.
Referenced by AddImage().
Definition at line 168 of file ImageData.h.
References m_bytesPerPixel.
Referenced by AddImage().
Definition at line 178 of file ImageData.h.
Referenced by CombineImageDataSize().
Definition at line 200 of file ImageData.h.
Referenced by CombineImageDataSize().
Make our image size be this many lines and pixels.
Definition at line 238 of file ImageData.h.
References m_bytesPerPixel, m_headerSize, m_numDataLines, and m_size.
Referenced by AddImage(), and CombineImageDataSize().
LineHeader* ImageData::getHeader | ( | void * | src, | |
int | lineNo | |||
) | [inline, private] |
Get the header for this line of this compressed image.
Definition at line 247 of file ImageData.h.
Referenced by CombineImageDataSize().
int ImageData::m_bytesPerPixel [private] |
Definition at line 218 of file ImageData.h.
Referenced by AddImage(), CopyPixel(), GetClippedImage(), ImageData(), IsPixelOn(), and SetSize().
int ImageData::m_size [private] |
Definition at line 224 of file ImageData.h.
Referenced by AddImage(), CombineImageData(), CombineImageDataSize(), GetImageDataSize(), ImageData(), and SetSize().
int ImageData::m_headerSize [private] |
Definition at line 229 of file ImageData.h.
Referenced by CombineImageData(), ImageData(), and SetSize().
int ImageData::m_numDataLines [private] |
Definition at line 234 of file ImageData.h.
Referenced by AddImage(), CombineImageData(), ImageData(), and SetSize().
byte* ImageData::m_header [private] |
Definition at line 260 of file ImageData.h.
Referenced by CombineImageData(), CombineImageDataSize(), ImageData(), and ~ImageData().
byte* ImageData::m_clippedImage [private] |
Definition at line 268 of file ImageData.h.
Referenced by AddImage(), GetClippedImage(), ImageData(), and ~ImageData().
bool ImageData::m_clippedImageAllocated [private] |
Definition at line 273 of file ImageData.h.
Referenced by GetClippedImage(), ImageData(), and ~ImageData().
int ImageData::m_startx [private] |
Definition at line 278 of file ImageData.h.
Referenced by AddImage(), GetClippedImage(), and ImageData().
int ImageData::m_starty [private] |
Definition at line 283 of file ImageData.h.
Referenced by AddImage(), GetClippedImage(), and ImageData().
int ImageData::m_sizex [private] |
Definition at line 288 of file ImageData.h.
Referenced by AddImage(), GetClippedImage(), and ImageData().
int ImageData::m_sizey [private] |
Definition at line 293 of file ImageData.h.
Referenced by AddImage(), GetClippedImage(), and ImageData().