File: ImageUtils.h

package info (click to toggle)
sear 0.5.0-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,408 kB
  • ctags: 2,580
  • sloc: cpp: 14,902; sh: 10,890; makefile: 172
file content (27 lines) | stat: -rw-r--r-- 832 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef SEAR_IMAGE_UTILS_H
#define SEAR_IMAGE_UTILS_H

#include <SDL/SDL.h>
#include <string>

namespace Sear
{
    /** load an image file from the specified path, and flip it
    vertically, so it may be used for OpenGL texturing (perhaps this
    should be optional?
    
    If the image file cannot be loaded for any reason, NULL is returned.
    */
    SDL_Surface* loadImageFromPath(const std::string& filename);

    /** create a copy of the input surface, halved in size, with each 2x2 box
    of pixels in the source image averaged to produce a single destination
    pixel. The source surface is unchanged. Note the source surface's width
    and height must both be divisible by two.
    
    Returns NULL if the mipmap cannot be created for any reason.
    */
    SDL_Surface* mipmapSurface(SDL_Surface* src);
}

#endif