Advertisement
Guest User

VideoTutorialsRock imageloader.h

a guest
Nov 13th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.81 KB | None | 0 0
  1. /* Permission is hereby granted, free of charge, to any person obtaining a copy
  2.  * of this software and associated documentation files (the "Software"), to deal
  3.  * in the Software without restriction, including without limitation the rights
  4.  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5.  * copies of the Software, and to permit persons to whom the Software is
  6.  * furnished to do so, subject to the following conditions:
  7.  *
  8.  * The above notice and this permission notice shall be included in all copies
  9.  * or substantial portions of the Software.
  10.  *
  11.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14.  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16.  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17.  * SOFTWARE.
  18.  */
  19. /* File for "Terrain" lesson of the OpenGL tutorial on
  20.  * www.videotutorialsrock.com
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef IMAGE_LOADER_H_INCLUDED
  26. #define IMAGE_LOADER_H_INCLUDED
  27.  
  28. //Represents an image
  29. class Image {
  30.     public:
  31.         Image(char* ps, int w, int h);
  32.         ~Image();
  33.        
  34.         /* An array of the form (R1, G1, B1, R2, G2, B2, ...) indicating the
  35.          * color of each pixel in image.  Color components range from 0 to 255.
  36.          * The array starts the bottom-left pixel, then moves right to the end
  37.          * of the row, then moves up to the next column, and so on.  This is the
  38.          * format in which OpenGL likes images.
  39.          */
  40.         char* pixels;
  41.         int width;
  42.         int height;
  43. };
  44.  
  45. //Reads a bitmap image from file.
  46. Image* loadBMP(const char* filename);
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. #endif
  58.  
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement