-/*] Copyright (c) 2009-2010, Charles McGarvey [**************************
+/*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
**] All rights reserved.
*
-* vi:ts=4 sw=4 tw=75
-*
* Distributable under the terms and conditions of the 2-clause BSD license;
* see the file COPYING for a complete text of the license.
*
-**************************************************************************/
+*****************************************************************************/
#ifndef _MOOF_IMAGE_HH_
#define _MOOF_IMAGE_HH_
static const int no_tile = -1;
-
explicit image(const std::string& path);
-
~image();
int width() const
return channels_;
}
-
std::string comment() const
{
return comment_;
return pixels_;
}
-
void set_as_icon() const;
-
/**
* Calculate texture coordinates for a tile at a certain index. Tiles
* are indexed start with zero as the top-left tile and moving across,
*/
bool tile_coordinates(int index, scalar coords[8]) const;
-
void bind() const;
static void reset_binding();
-
private:
void upload_to_gl() const;
void set_properties() const;
void set_texture_info(const std::string& info);
-
- char* pixels_;
+ char* pixels_;
mutable unsigned object_;
static unsigned global_object_;
- int width_;
- int height_;
- int depth_;
- int pitch_;
- int channels_;
+ int width_;
+ int height_;
+ int depth_;
+ int pitch_;
+ int channels_;
- std::string comment_;
+ std::string comment_;
- unsigned min_filter_;
- unsigned mag_filter_;
- unsigned wrap_s_;
- unsigned wrap_t_;
- int tile_width_;
- int tile_height_;
+ unsigned min_filter_;
+ unsigned mag_filter_;
+ int tile_s_;
+ int tile_t_;
+ unsigned wrap_s_;
+ unsigned wrap_t_;
//mutable dispatcher::handle new_context_;
};