Browse Source

No need to have `const` also in function declarations.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
61e1ec0082
  1. 6
      src/Text/AbstractFont.h
  2. 4
      src/Text/DistanceFieldGlyphCache.h
  3. 10
      src/Text/GlyphCache.h
  4. 8
      src/Text/TextRenderer.h
  5. 2
      src/TextureTools/DistanceField.h
  6. 6
      src/Trade/AbstractImageConverter.h

6
src/Text/AbstractFont.h

@ -96,7 +96,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public Corrade::PluginManager::AbstractPl
*
* Fills the cache with given characters.
*/
virtual void createGlyphCache(GlyphCache* const cache, const std::string& characters) = 0;
virtual void createGlyphCache(GlyphCache* cache, const std::string& characters) = 0;
/**
* @brief Layout the text using font own layouter
@ -106,7 +106,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public Corrade::PluginManager::AbstractPl
*
* @see createGlyphCache()
*/
virtual AbstractLayouter* layout(const GlyphCache* const cache, const Float size, const std::string& text) = 0;
virtual AbstractLayouter* layout(const GlyphCache* cache, Float size, const std::string& text) = 0;
#ifdef DOXYGEN_GENERATING_OUTPUT
private:
@ -144,7 +144,7 @@ class MAGNUM_TEXT_EXPORT AbstractLayouter {
* Returns quad position, texture coordinates and advance to next
* glyph.
*/
virtual std::tuple<Rectangle, Rectangle, Vector2> renderGlyph(const Vector2& cursorPosition, const UnsignedInt i) = 0;
virtual std::tuple<Rectangle, Rectangle, Vector2> renderGlyph(const Vector2& cursorPosition, UnsignedInt i) = 0;
#ifdef DOXYGEN_GENERATING_OUTPUT
private:

4
src/Text/DistanceFieldGlyphCache.h

@ -72,7 +72,7 @@ class MAGNUM_TEXT_EXPORT DistanceFieldGlyphCache: public GlyphCache {
* Uploads image for one or more glyphs to given offset in original
* cache texture. The texture is then converted to distance field.
*/
void setImage(const Vector2i& offset, Image2D* const image) override;
void setImage(const Vector2i& offset, Image2D* image) override;
/**
* @brief Set distance field cache image
@ -80,7 +80,7 @@ class MAGNUM_TEXT_EXPORT DistanceFieldGlyphCache: public GlyphCache {
* Uploads already computed distance field image to given offset in
* distance field texture.
*/
void setDistanceFieldImage(const Vector2i& offset, Image2D* const image);
void setDistanceFieldImage(const Vector2i& offset, Image2D* image);
private:
const Vector2 scale;

10
src/Text/GlyphCache.h

@ -62,7 +62,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache {
* @param size Glyph cache texture size
* @param internalFormat Internal texture format
*/
explicit GlyphCache(const Vector2i& size, const Texture2D::InternalFormat internalFormat);
explicit GlyphCache(const Vector2i& size, Texture2D::InternalFormat internalFormat);
/**
* @brief Constructor
@ -97,7 +97,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache {
* second element is glyph region in texture atlas. If no glyph is
* found, glyph on zero index is returned.
*/
inline std::pair<Vector2i, Rectanglei> operator[](const UnsignedInt glyph) const {
inline std::pair<Vector2i, Rectanglei> operator[](UnsignedInt glyph) const {
auto it = glyphs.find(glyph);
return it == glyphs.end() ? glyphs.at(0) : it->second;
}
@ -124,7 +124,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache {
* You can obtain unused non-overlapping regions with reserve(). See
* also setImage() to upload glyph image.
*/
void insert(const UnsignedInt glyph, Vector2i position, Rectanglei rectangle);
void insert(UnsignedInt glyph, Vector2i position, Rectanglei rectangle);
/**
* @brief Set cache image
@ -132,7 +132,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache {
* Uploads image for one or more glyphs to given offset in cache
* texture.
*/
virtual void setImage(const Vector2i& offset, Image2D* const image);
virtual void setImage(const Vector2i& offset, Image2D* image);
#ifdef DOXYGEN_GENERATING_OUTPUT
private:
@ -142,7 +142,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache {
/* Used from DistanceFieldGlyphCache */
explicit MAGNUM_LOCAL GlyphCache(const Vector2i& size, const Vector2i& padding);
void MAGNUM_LOCAL initialize(const Texture2D::InternalFormat internalFormat, const Vector2i& size);
void MAGNUM_LOCAL initialize(Texture2D::InternalFormat internalFormat, const Vector2i& size);
const Vector2i _size;
Texture2D _texture;

8
src/Text/TextRenderer.h

@ -60,7 +60,7 @@ class MAGNUM_TEXT_EXPORT AbstractTextRenderer {
* Returns tuple with vertex positions, texture coordinates, indices
* and rectangle spanning the rendered text.
*/
static std::tuple<std::vector<Vector2>, std::vector<Vector2>, std::vector<UnsignedInt>, Rectangle> render(AbstractFont* const font, const GlyphCache* const cache, Float size, const std::string& text);
static std::tuple<std::vector<Vector2>, std::vector<Vector2>, std::vector<UnsignedInt>, Rectangle> render(AbstractFont* font, const GlyphCache* cache, Float size, const std::string& text);
/**
* @brief Constructor
@ -68,7 +68,7 @@ class MAGNUM_TEXT_EXPORT AbstractTextRenderer {
* @param cache Glyph cache
* @param size Font size
*/
explicit AbstractTextRenderer(AbstractFont* const font, const GlyphCache* const cache, Float size);
explicit AbstractTextRenderer(AbstractFont* font, const GlyphCache* cache, Float size);
virtual ~AbstractTextRenderer() = 0;
@ -97,7 +97,7 @@ class MAGNUM_TEXT_EXPORT AbstractTextRenderer {
* Initially zero capacity is reserved.
* @see capacity()
*/
void reserve(const UnsignedInt glyphCount, const Buffer::Usage vertexBufferUsage, const Buffer::Usage indexBufferUsage);
void reserve(UnsignedInt glyphCount, Buffer::Usage vertexBufferUsage, Buffer::Usage indexBufferUsage);
/**
* @brief Render text
@ -117,7 +117,7 @@ class MAGNUM_TEXT_EXPORT AbstractTextRenderer {
#else
private:
#endif
static std::tuple<Mesh, Rectangle> MAGNUM_LOCAL render(AbstractFont* const font, const GlyphCache* const cache, Float size, const std::string& text, Buffer* vertexBuffer, Buffer* indexBuffer, Buffer::Usage usage);
static std::tuple<Mesh, Rectangle> MAGNUM_LOCAL render(AbstractFont* font, const GlyphCache* cache, Float size, const std::string& text, Buffer* vertexBuffer, Buffer* indexBuffer, Buffer::Usage usage);
Mesh _mesh;
Buffer vertexBuffer, indexBuffer;

2
src/TextureTools/DistanceField.h

@ -67,7 +67,7 @@ http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnifica
@attention This is GPU-only implementation, so it expects active context.
*/
void MAGNUM_TEXTURETOOLS_EXPORT distanceField(Texture2D* input, Texture2D* output, const Rectanglei& rectangle, const Int radius);
void MAGNUM_TEXTURETOOLS_EXPORT distanceField(Texture2D* input, Texture2D* output, const Rectanglei& rectangle, Int radius);
}}

6
src/Trade/AbstractImageConverter.h

@ -91,7 +91,7 @@ class MAGNUM_EXPORT AbstractImageConverter: public Corrade::PluginManager::Abstr
* Returns converted image on success, `nullptr` otherwise.
* @see features(), convertToData(), convertToFile()
*/
virtual Image2D* convertToImage(const Image2D* const image) const;
virtual Image2D* convertToImage(const Image2D* image) const;
/**
* @brief Convert image to raw data
@ -100,7 +100,7 @@ class MAGNUM_EXPORT AbstractImageConverter: public Corrade::PluginManager::Abstr
* Returns data pointer and size on success, `nullptr` otherwise.
* @see features(), convertToImage(), convertToFile()
*/
virtual std::pair<const unsigned char*, std::size_t> convertToData(const Image2D* const image) const;
virtual std::pair<const unsigned char*, std::size_t> convertToData(const Image2D* image) const;
/**
* @brief Convert image and save it to file
@ -109,7 +109,7 @@ class MAGNUM_EXPORT AbstractImageConverter: public Corrade::PluginManager::Abstr
* Returns `true` on success, `false` otherwise.
* @see features(), convertToImage(), convertToData()
*/
virtual bool convertToFile(const Image2D* const image, const std::string& filename) const;
virtual bool convertToFile(const Image2D* image, const std::string& filename) const;
};
CORRADE_ENUMSET_OPERATORS(AbstractImageConverter::Features)

Loading…
Cancel
Save