pioneer/src/scenegraph/ColorMap.h

36 lines
782 B
C
Raw Permalink Normal View History

2020-12-31 07:32:16 -08:00
// Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#ifndef _SCENEGRAPH_COLORMAP_H
#define _SCENEGRAPH_COLORMAP_H
/*
* Color look-up texture generator for newmodel pattern system
*/
#include "graphics/Texture.h"
#include "libs.h"
2013-12-11 12:43:31 -08:00
#include <SDL_stdinc.h>
namespace Graphics {
class Renderer;
}
namespace SceneGraph {
class ColorMap {
public:
ColorMap();
Graphics::Texture *GetTexture();
void Generate(Graphics::Renderer *r, const Color &a, const Color &b, const Color &c);
void SetSmooth(bool);
private:
void AddColor(int width, const Color &c, std::vector<Uint8> &out);
bool m_smooth;
RefCountedPtr<Graphics::Texture> m_texture;
};
} // namespace SceneGraph
#endif