107 m_animation(animation),
130 }
else if (lm == 1) {
159 }
else if (lm == 1) {
165 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):
167 m_intensity(intensity),
169 m_subdivisions(subdivisions),
170 m_xstretch(xstretch),
171 m_ystretch(ystretch),
188 }
else if (lm == 1) {
194 std::vector<uint8_t> colors;
195 colors.push_back(
m_red);
230 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) {
231 LightRendererElementInfo* info =
new LightRendererSimpleLightInfo(n, intensity, radius, subdivisions, xstretch, ystretch, r, g, b, src, dst);
241 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
242 for (;info_it !=
m_groups[group].end(); ++info_it) {
243 (*info_it)->setStencil(stencil_ref);
248 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
249 for (;info_it !=
m_groups[group].end(); ++info_it) {
250 (*info_it)->removeStencil();
255 std::list<std::string> groups;
256 std::map<std::string, std::vector<LightRendererElementInfo*> >::iterator group_it =
m_groups.begin();
257 for(; group_it !=
m_groups.end(); ++group_it) {
258 groups.push_back(group_it->first);
266 std::vector<LightRendererElementInfo*> info;
267 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
268 for (;info_it !=
m_groups[group].end(); ++info_it) {
269 info.push_back(*info_it);
275 std::vector<LightRendererElementInfo*>::const_iterator info_it =
m_groups[group].begin();
276 for (;info_it !=
m_groups[group].end(); ++info_it) {
284 std::map<std::string, std::vector<LightRendererElementInfo*> >::iterator it =
m_groups.begin();
285 for (; it !=
m_groups.end(); ++it) {
286 std::vector<LightRendererElementInfo*>::const_iterator info_it = it->second.begin();
287 for (;info_it != it->second.end(); ++info_it) {
305 std::map<std::string, std::vector<LightRendererElementInfo*> >::iterator group_it =
m_groups.begin();
306 for (; group_it !=
m_groups.end(); ++group_it) {
307 std::vector<LightRendererElementInfo*>::const_iterator info_it = group_it->second.begin();
308 for (;info_it != group_it->second.end(); ++info_it) {
310 if ((*info_it)->getStencil() != -1 && (*info_it)->getStencil() < 255) {
311 if(info_it != group_it->second.begin()) {
312 (*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 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)
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)
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.
bool intersects(const RectType< T > &rect) const
Check whether two rectangles share some area.
virtual ~LightRenderer()
Destructor.
RenderBackend * m_renderbackend
virtual void changeRenderInfos(RenderDataType type, uint16_t elements, int32_t src, int32_t dst, bool light, bool stentest, uint8_t stenref, GLConstants stenop, GLConstants stenfunc, OverlayType otype=OVERLAY_TYPE_NONE)=0
Dirty helper function to change the render infos.
ImagePtr getFrameByTimestamp(uint32_t timestamp)
Gets the frame image that matches the given timestamp.
uint32_t getHeight() const
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)
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)
bool areInstancesVisible() const
Check object visibility.
virtual void setEnabled(bool enabled)
Enables renderer.
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)
double getZoom() const
Gets camera zoom.
const Rect & getViewPort() const
Gets the viewport for camera in pixel coordinates.
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)
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.
uint32_t getDuration() const
Gets the total duration for the whole animation.
T w
Width of the rectangle.
uint32_t getWidth() const
LightRenderer(RenderBackend *renderbackend, int32_t position)
constructor.