summaryrefslogtreecommitdiffstats
path: root/include/media/stagefright/YUVImage.h
diff options
context:
space:
mode:
authorNipun Kwatra <nkwatra@google.com>2010-08-19 17:34:52 -0700
committerNipun Kwatra <nkwatra@google.com>2010-08-19 18:26:58 -0700
commit4a6b74563ac0fe752fbdfd15f91772473f8a4711 (patch)
tree02b56aae713d49ee6305b4445a81adb563732d1b /include/media/stagefright/YUVImage.h
parentad2df1d0776066dc7c2e203390c336451238684a (diff)
downloadframeworks_av-4a6b74563ac0fe752fbdfd15f91772473f8a4711.zip
frameworks_av-4a6b74563ac0fe752fbdfd15f91772473f8a4711.tar.gz
frameworks_av-4a6b74563ac0fe752fbdfd15f91772473f8a4711.tar.bz2
const correctness, validPixel test.
- made width(), height() const member functions. - added validPixel() which returns true if pixel is in the allowed range. - now testing validPixel in get/setPixelValue Change-Id: I1dee5060bd4f8dcbdcd542ec4647ea328f0185c3
Diffstat (limited to 'include/media/stagefright/YUVImage.h')
-rw-r--r--include/media/stagefright/YUVImage.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/media/stagefright/YUVImage.h b/include/media/stagefright/YUVImage.h
index afeac3f..4e98618 100644
--- a/include/media/stagefright/YUVImage.h
+++ b/include/media/stagefright/YUVImage.h
@@ -67,18 +67,22 @@ public:
// memory.
static size_t bufferSize(YUVFormat yuvFormat, int32_t width, int32_t height);
- int32_t width() {return mWidth;}
- int32_t height() {return mHeight;}
+ int32_t width() const {return mWidth;}
+ int32_t height() const {return mHeight;}
+
+ // Returns true if pixel is the range [0, width-1] x [0, height-1]
+ // and false otherwise.
+ bool validPixel(int32_t x, int32_t y) const;
// Get the pixel YUV value at pixel (x,y).
// Note that the range of x is [0, width-1] and the range of y is [0, height-1].
- // Returns true if get was succesful and false otherwise.
+ // Returns true if get was successful and false otherwise.
bool getPixelValue(int32_t x, int32_t y,
uint8_t *yPtr, uint8_t *uPtr, uint8_t *vPtr) const;
// Set the pixel YUV value at pixel (x,y).
// Note that the range of x is [0, width-1] and the range of y is [0, height-1].
- // Returns true if set was succesful and false otherwise.
+ // Returns true if set was successful and false otherwise.
bool setPixelValue(int32_t x, int32_t y,
uint8_t yValue, uint8_t uValue, uint8_t vValue);