]> Dogcows Code - chaz/yoink/blobdiff - src/moof/image.hh
fixed documentation about where to find licenses
[chaz/yoink] / src / moof / image.hh
index 6aa251bad0a658a3ca48fd24ba61c87f124d9e9e..89a7faa1518dfeeb8245ae31ba8e9446e662a396 100644 (file)
@@ -1,22 +1,15 @@
 
-/*]  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_
 
-/**
- * \file image.hh
- * Defines classes for loading and manipulating images.
- */
-
 #include <boost/noncopyable.hpp>
 
 #include <moof/dispatcher.hh>
 #include <moof/resource.hh>
 
 
+/**
+ * \file image.hh
+ * Defines classes for loading and manipulating images.
+ */
+
 namespace moof {
 
 
@@ -33,9 +31,7 @@ public:
 
        static const int no_tile = -1;
 
-
        explicit image(const std::string& path);
-
        ~image();
 
        int width() const
@@ -63,69 +59,58 @@ public:
                return channels_;
        }
 
-
-       std::string comment() const
-       {
-               return comment_;
-       }
-
        const char* pixels() const
        {
                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,
         * then down.
         * \param index The tile index.
-        * \param coords An array of scalars where the texture coordinates will
-        * be stored after this call.  The first coordinate (u,v) will be in
-        * the first two places and so on until all four coordinates are
+        * \param coords An array of scalars where the texture coordinates
+        * will be stored after this call.  The first coordinate (u,v) will be
+        * in the first two places and so on until all four coordinates are
         * stored, therefore requiring enough room for an array of eight
-        * scalars.  The winding of the coordinates is always counter-clockwise
-        * (the GL default).
+        * scalars.  The winding of the coordinates is always
+        * counter-clockwise (the GL default).
         * \return True if index is valid, false otherwise.
         */
        bool tile_coordinates(int index, scalar coords[8]) const;
 
+       void fix_uv(std::vector<vector2>& p) const;
 
        void bind() const;
        static void reset_binding();
 
-
 private:
 
+       void postprocess();
        void upload_to_gl() const;
        void unload_from_gl() const;
        void context_recreated();
        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_;
-
-       std::string                     comment_;
-
-       unsigned                        min_filter_;
-       unsigned                        mag_filter_;
-       int                                     tile_s_;
-       int                                     tile_t_;
-       unsigned                        wrap_s_;
-       unsigned                        wrap_t_;
+       int                     width_;
+       int                     height_;
+       int                     depth_;
+       int                     pitch_;
+       int                     channels_;
+
+       unsigned                min_filter_;
+       unsigned                mag_filter_;
+       int                     tile_s_;
+       int                     tile_t_;
+       unsigned                wrap_s_;
+       unsigned                wrap_t_;
 
        //mutable dispatcher::handle    new_context_;
 };
This page took 0.020091 seconds and 4 git commands to generate.