Default load resource function.
| 111 | |
| 112 | // Default load resource function. |
| 113 | bool defaultLoadResourceFunction( |
| 114 | const string& uri, vector<unsigned char>* pBufferOut, string* pFileNameOut) |
| 115 | { |
| 116 | // Default load resource function just loads URI as file path directly. |
| 117 | ifstream is(uri, ifstream::binary); |
| 118 | if (!is) |
| 119 | return false; |
| 120 | is.seekg(0, is.end); |
| 121 | size_t length = is.tellg(); |
| 122 | is.seekg(0, is.beg); |
| 123 | pBufferOut->resize(length); |
| 124 | is.read((char*)&(*pBufferOut)[0], length); |
| 125 | |
| 126 | // Copy the URI to file name with no manipulation. |
| 127 | *pFileNameOut = uri; |
| 128 | |
| 129 | return true; |
| 130 | } |
| 131 | |
| 132 | // Default process image function. |
| 133 | // Has extra flipImageY argument that must be filled in. |