From 0053d01843c19c40b3f175a71601df24fb2f0b38 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 20 Dec 2011 20:13:29 +0000 Subject: [PATCH] ssize_t isn't defined on windows, but we don't need it here --- panda/src/vision/openCVTexture.cxx | 20 ++++++++++---------- panda/src/vision/openCVTexture.h | 2 +- panda/src/vision/webcamVideoCursorOpenCV.cxx | 14 +++++++------- panda/src/vision/webcamVideoCursorOpenCV.h | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/panda/src/vision/openCVTexture.cxx b/panda/src/vision/openCVTexture.cxx index 040ca63817..aaa056acea 100644 --- a/panda/src/vision/openCVTexture.cxx +++ b/panda/src/vision/openCVTexture.cxx @@ -310,14 +310,14 @@ do_update_frame(Texture::CData *cdata, int frame, int z) { do_modify_ram_image(cdata); ++(cdata->_image_modified); } - ssize_t dest_x_pitch = cdata->_num_components * cdata->_component_width; - ssize_t dest_y_pitch = cdata->_x_size * dest_x_pitch; + int dest_x_pitch = cdata->_num_components * cdata->_component_width; + int dest_y_pitch = cdata->_x_size * dest_x_pitch; if (page._color.is_valid()) { nassertv(get_num_components() >= 3 && get_component_width() == 1); const unsigned char *r, *g, *b; - ssize_t x_pitch, y_pitch; + int x_pitch, y_pitch; if (page._color.get_frame_data(frame, r, g, b, x_pitch, y_pitch)) { nassertv(get_video_width() <= cdata->_x_size && get_video_height() <= cdata->_y_size); nassertv(!cdata->_ram_images.empty()) @@ -325,7 +325,7 @@ do_update_frame(Texture::CData *cdata, int frame, int z) { if (cdata->_num_components == 3 && x_pitch == 3) { // The easy case--copy the whole thing in, row by row. - ssize_t copy_bytes = get_video_width() * dest_x_pitch; + int copy_bytes = get_video_width() * dest_x_pitch; nassertv(copy_bytes <= dest_y_pitch && copy_bytes <= abs(y_pitch)); for (int y = 0; y < get_video_height(); ++y) { @@ -339,8 +339,8 @@ do_update_frame(Texture::CData *cdata, int frame, int z) { // pixel, possibly leaving room for alpha. for (int y = 0; y < get_video_height(); ++y) { - ssize_t dx = 0; - ssize_t sx = 0; + int dx = 0; + int sx = 0; for (int x = 0; x < get_video_width(); ++x) { dest[dx] = r[sx]; dest[dx + 1] = g[sx]; @@ -360,7 +360,7 @@ do_update_frame(Texture::CData *cdata, int frame, int z) { nassertv(get_component_width() == 1); const unsigned char *source[3]; - ssize_t x_pitch, y_pitch; + int x_pitch, y_pitch; if (page._alpha.get_frame_data(frame, source[0], source[1], source[2], x_pitch, y_pitch)) { nassertv(get_video_width() <= cdata->_x_size && get_video_height() <= cdata->_y_size); @@ -378,8 +378,8 @@ do_update_frame(Texture::CData *cdata, int frame, int z) { for (int y = 0; y < get_video_height(); ++y) { // Start dx at _num_components - 1, which writes to the last // channel, i.e. the alpha channel. - ssize_t dx = (cdata->_num_components - 1) * cdata->_component_width; - ssize_t sx = 0; + int dx = (cdata->_num_components - 1) * cdata->_component_width; + int sx = 0; for (int x = 0; x < get_video_width(); ++x) { dest[dx] = sch[sx]; dx += dest_x_pitch; @@ -586,7 +586,7 @@ get_frame_data(int frame, const unsigned char *&r, const unsigned char *&g, const unsigned char *&b, - ssize_t &x_pitch, ssize_t &y_pitch) { + int &x_pitch, int &y_pitch) { nassertr(is_valid(), false); if (is_from_file() && _next_frame != frame) { diff --git a/panda/src/vision/openCVTexture.h b/panda/src/vision/openCVTexture.h index 19e21328e1..55acc3ec60 100644 --- a/panda/src/vision/openCVTexture.h +++ b/panda/src/vision/openCVTexture.h @@ -90,7 +90,7 @@ private: const unsigned char *&r, const unsigned char *&g, const unsigned char *&b, - ssize_t &x_pitch, ssize_t &y_pitch); + int &x_pitch, int &y_pitch); CvCapture *_capture; Filename _filename; diff --git a/panda/src/vision/webcamVideoCursorOpenCV.cxx b/panda/src/vision/webcamVideoCursorOpenCV.cxx index d81c519775..826cf16fdd 100644 --- a/panda/src/vision/webcamVideoCursorOpenCV.cxx +++ b/panda/src/vision/webcamVideoCursorOpenCV.cxx @@ -73,15 +73,15 @@ fetch_buffer() { unsigned char *dest = buffer->_block; int num_components = get_num_components(); nassertr(num_components == 3, NULL); - ssize_t dest_x_pitch = num_components; // Assume component_width == 1 - ssize_t dest_y_pitch = _size_x * dest_x_pitch; + int dest_x_pitch = num_components; // Assume component_width == 1 + int dest_y_pitch = _size_x * dest_x_pitch; const unsigned char *r, *g, *b; - ssize_t x_pitch, y_pitch; + int x_pitch, y_pitch; if (get_frame_data(r, g, b, x_pitch, y_pitch)) { if (num_components == 3 && x_pitch == 3) { // The easy case--copy the whole thing in, row by row. - ssize_t copy_bytes = _size_x * dest_x_pitch; + int copy_bytes = _size_x * dest_x_pitch; nassertr(copy_bytes <= dest_y_pitch && copy_bytes <= abs(y_pitch), NULL); for (int y = 0; y < _size_y; ++y) { @@ -95,8 +95,8 @@ fetch_buffer() { // pixel. for (int y = 0; y < _size_y; ++y) { - ssize_t dx = 0; - ssize_t sx = 0; + int dx = 0; + int sx = 0; for (int x = 0; x < _size_x; ++x) { dest[dx] = r[sx]; dest[dx + 1] = g[sx]; @@ -140,7 +140,7 @@ bool WebcamVideoCursorOpenCV:: get_frame_data(const unsigned char *&r, const unsigned char *&g, const unsigned char *&b, - ssize_t &x_pitch, ssize_t &y_pitch) { + int &x_pitch, int &y_pitch) { nassertr(ready(), false); IplImage *image = cvQueryFrame(_capture); diff --git a/panda/src/vision/webcamVideoCursorOpenCV.h b/panda/src/vision/webcamVideoCursorOpenCV.h index 4e8a6f8e7a..2f2ebbd6f6 100644 --- a/panda/src/vision/webcamVideoCursorOpenCV.h +++ b/panda/src/vision/webcamVideoCursorOpenCV.h @@ -37,7 +37,7 @@ private: bool get_frame_data(const unsigned char *&r, const unsigned char *&g, const unsigned char *&b, - ssize_t &x_pitch, ssize_t &y_pitch); + int &x_pitch, int &y_pitch); CvCapture *_capture;