101 }
else if (lm == 1) {
109 m_animation(animation),
132 }
else if (lm == 1) {
161 }
else if (lm == 1) {
167 LightRendererSimpleLightInfo::LightRendererSimpleLightInfo(
RendererNode anchor,
uint8_t intensity,
float radius, int32_t subdivisions,
float xstretch,
float ystretch,
uint8_t r,
uint8_t g,
uint8_t b, int32_t src, int32_t dst):
169 m_intensity(intensity),
171 m_subdivisions(subdivisions),
172 m_xstretch(xstretch),
173 m_ystretch(ystretch),
190 }
else if (lm == 1) {
196 std::vector<uint8_t> colors;
197 colors.push_back(
m_red);
232 void LightRenderer::addSimpleLight(
const std::string &group,
RendererNode n,
uint8_t intensity,
float radius, int32_t subdivisions,
float xstretch,
float ystretch,
uint8_t r,
uint8_t g,
uint8_t b, int32_t src, int32_t dst) {
233 LightRendererElementInfo* info =
new LightRendererSimpleLightInfo(n, intensity, radius, subdivisions, xstretch, ystretch, r, g, b, src, dst);
243 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
244 for (;info_it !=
m_groups[group].end(); ++info_it) {
245 (*info_it)->setStencil(stencil_ref);
250 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
251 for (;info_it !=
m_groups[group].end(); ++info_it) {
252 (*info_it)->removeStencil();
257 std::list<std::string> groups;
258 std::map<std::string, std::vector<LightRendererElementInfo*> >::iterator group_it =
m_groups.begin();
259 for(; group_it !=
m_groups.end(); ++group_it) {
260 groups.push_back(group_it->first);
268 std::vector<LightRendererElementInfo*> info;
269 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
270 for (;info_it !=
m_groups[group].end(); ++info_it) {
271 info.push_back(*info_it);
277 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
278 for (;info_it !=
m_groups[group].end(); ++info_it) {
300 std::map<std::string, std::vector<LightRendererElementInfo*> >::iterator group_it =
m_groups.begin();
301 for (; group_it !=
m_groups.end(); ++group_it) {
302 std::vector<LightRendererElementInfo*>::const_iterator info_it = group_it->second.begin();
303 for (;info_it != group_it->second.end(); ++info_it) {
305 if ((*info_it)->getStencil() != -1 && (*info_it)->getStencil() < 255) {
306 if(info_it != group_it->second.begin()) {
307 (*info_it)->setStencil((*info_it)->getStencil()+1);
Abstract interface for all the renderbackends.
std::list< std::string > getGroups()
void render(Camera *cam, Layer *layer, RenderList &instances)
This method is called by the view to ask renderer to draw its rendering aspect based on given paramet...
std::vector< RenderItem * > RenderList
void setStencil(uint8_t stencil_ref)
virtual void changeRenderInfos(uint16_t elements, int32_t src, int32_t dst, bool light, bool stentest, uint8_t stenref, GLConstants stenop, GLConstants stenfunc)=0
Dirty helper function to change the render infos.
virtual void render(Camera *cam, Layer *layer, RenderList &instances, RenderBackend *renderbackend)
T h
Height of the rectangle.
void reset()
Resets information in the renderer.
LightRendererAnimationInfo(RendererNode n, AnimationPtr animation, int32_t src, int32_t dst)
LightRendererElementInfo(RendererNode n, int32_t src, int32_t dst)
LightRendererImageInfo(RendererNode n, ImagePtr image, int32_t src, int32_t dst)
virtual void render(Camera *cam, Layer *layer, RenderList &instances, RenderBackend *renderbackend)
uint32_t getDuration() const
Gets the total duration for the whole animation.
Point getCalculatedPoint(Camera *cam, Layer *layer, const bool zoomed=false)
Interface to class owning the renderers Used to get correct subclass of renderer in scripting side (v...
static Logger _log(LM_AUDIO)
bool areInstancesVisible() const
Check object visibility.
virtual RendererBase * getRenderer(const std::string &renderername)=0
Returns renderer with given name.
Camera describes properties of a view port shown in the main screen Main screen can have multiple cam...
static TimeManager * instance()
RendererBase * clone()
Makes copy of this renderer.
virtual uint32_t getLightingModel() const =0
Gets the current light model.
uint32_t getHeight() const
virtual ~LightRenderer()
Destructor.
RenderBackend * m_renderbackend
const Rect & getViewPort() const
Gets the viewport for camera in pixel coordinates.
ImagePtr getFrameByTimestamp(uint32_t timestamp)
Gets the frame image that matches the given timestamp.
std::vector< LightRendererElementInfo * > getLightInfo(const std::string &group)
Base class for all view renderers View renderer renders one aspect of the view shown on screen...
virtual void render(Camera *cam, Layer *layer, RenderList &instances, RenderBackend *renderbackend)
LightRendererResizeInfo(RendererNode n, ImagePtr image, int32_t width, int32_t height, int32_t src, int32_t dst)
double getZoom() const
Gets camera zoom.
void addSimpleLight(const std::string &group, RendererNode n, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t r, uint8_t g, uint8_t b, int32_t src=-1, int32_t dst=-1)
std::map< std::string, std::vector< LightRendererElementInfo * > > m_groups
static LightRenderer * getInstance(IRendererContainer *cnt)
Gets instance for interface access.
virtual void render(Camera *cam, Layer *layer, RenderList &instances, RenderBackend *renderbackend)
virtual void setEnabled(bool enabled)
Enables renderer.
uint32_t getWidth() const
LightRendererSimpleLightInfo(RendererNode n, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t r, uint8_t g, uint8_t b, int32_t src, int32_t dst)
void addStencilTest(const std::string &group, uint8_t stencil_ref=0)
void resizeImage(const std::string &group, RendererNode n, ImagePtr image, int32_t width, int32_t height, int32_t src=-1, int32_t dst=-1)
void removeStencilTest(const std::string &group)
bool intersects(const RectType< T > &rect) const
Check whether two rectangles share some area.
virtual void render(const Rect &rect, uint8_t alpha=255, uint8_t const *rgb=0)=0
Renders itself to the current render target (main screen or attached destination image) at the rectan...
std::vector< uint8_t > getColor()
uint32_t scaleTime(float multiplier, uint32_t ticks)
Utility function to calculate time scaling.
void addAnimation(const std::string &group, RendererNode n, AnimationPtr animation, int32_t src=-1, int32_t dst=-1)
void addImage(const std::string &group, RendererNode n, ImagePtr image, int32_t src=-1, int32_t dst=-1)
virtual void drawLightPrimitive(const Point &p, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t red, uint8_t green, uint8_t blue)=0
Draws a light primitive that based on a triangle fan.
T w
Width of the rectangle.
LightRenderer(RenderBackend *renderbackend, int32_t position)
constructor.