Conflicts: src/basics/Disk.cpp src/basics/Disk.h src/basics/SpaceSegment.cpp src/definition/DefinitionNode.cpp src/definition/DefinitionNode.h src/definition/Scenery.cpp src/definition/Scenery.h src/definition/SurfaceMaterial.cpp src/definition/SurfaceMaterial.h src/definition/TextureLayerDefinition.cpp src/definition/definition_global.h src/interface/commandline/tests.cpp src/render/opengl/OpenGLRenderer.cpp src/render/software/SoftwareCanvasRenderer.cpp src/render/software/SoftwareCanvasRenderer.h src/render/software/SoftwareRenderer.h src/render/software/TerrainRasterizer.cpp src/render/software/TerrainRasterizer.h src/render/software/TerrainRenderer.h src/render/software/software_global.h
47 lines
988 B
C++
47 lines
988 B
C++
#ifndef CANVASPIXEL_H
|
|
#define CANVASPIXEL_H
|
|
|
|
#include "software_global.h"
|
|
|
|
#include "CanvasFragment.h"
|
|
|
|
const int MAX_FRAGMENTS_PER_PIXEL = 5;
|
|
|
|
namespace paysages {
|
|
namespace software {
|
|
|
|
/**
|
|
* @brief One pixel of a Canvas.
|
|
*
|
|
* A pixel stores superimposed fragments (CanvasFragment), sorted by their distance to camera.
|
|
*/
|
|
class SOFTWARESHARED_EXPORT CanvasPixel {
|
|
public:
|
|
CanvasPixel();
|
|
|
|
inline int getFragmentCount() const {
|
|
return count;
|
|
}
|
|
inline const Color &getComposite() const {
|
|
return composite;
|
|
}
|
|
inline const CanvasFragment &getFragment(int position) const {
|
|
return fragments[position];
|
|
}
|
|
const CanvasFragment *getFrontFragment() const;
|
|
|
|
void reset();
|
|
void pushFragment(const CanvasFragment &fragment);
|
|
void updateComposite();
|
|
void setComposite(const Color &color);
|
|
|
|
private:
|
|
int count;
|
|
CanvasFragment fragments[MAX_FRAGMENTS_PER_PIXEL];
|
|
Color composite;
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif // CANVASPIXEL_H
|