| 34 | #include "cudaNvSci.h" |
| 35 | |
| 36 | void loadImageData(const std::string &filename, |
| 37 | const char **argv, |
| 38 | unsigned char **image_data, |
| 39 | uint32_t &imageWidth, |
| 40 | uint32_t &imageHeight) |
| 41 | { |
| 42 | // load image (needed so we can get the width and height before we create |
| 43 | // the window |
| 44 | char *image_path = sdkFindFilePath(filename.c_str(), argv[0]); |
| 45 | |
| 46 | if (image_path == 0) { |
| 47 | printf("Error finding image file '%s'\n", filename.c_str()); |
| 48 | exit(EXIT_FAILURE); |
| 49 | } |
| 50 | |
| 51 | sdkLoadPPM4(image_path, image_data, &imageWidth, &imageHeight); |
| 52 | |
| 53 | if (!image_data) { |
| 54 | printf("Error opening file '%s'\n", image_path); |
| 55 | exit(EXIT_FAILURE); |
| 56 | } |
| 57 | |
| 58 | printf("Loaded '%s', %d x %d pixels\n", image_path, imageWidth, imageHeight); |
| 59 | } |
| 60 | |
| 61 | int main(int argc, const char **argv) |
| 62 | { |
no test coverage detected