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