<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Ok. I found out this logic does not work. It seems there is only one plane that is created by picture_New, not four.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>I am confused. Is there a RGB lookup table that I need to provide and index into?</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new
york,times,serif; background-color: transparent; font-style: normal;"><span>I would really appreciate it if someone can help.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Regards,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Peter<br></span></div><div><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span
style="font-weight:bold;">From:</span></b> Peter Tap <ptrtap@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> Mailing list for VLC media player developers <vlc-devel@videolan.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, August 27, 2012 1:40 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [vlc-devel] How to draw a line in subpicture_t region<br> </font> </div> <br>Olivier,<br><br>Thanks once again for your help.<br><br><br>It is not the algorithm that I need help with. It is VLC structures (picture_t) that I need help with on how to draw a line. <br><br><br>Let's say I have to draw a line from (0, 0) to (100, 100) in RGB color 0xAABBCC.<br><br>Looking at some existing code, I guess I can start as the following:<br><br>int width = 100;<br>int height = 100;<br><br><br>picture_t* pPic = picture_New(VLC_CODEC_RGBA, width, height, 0, 1); <br><br><br>Now, picture_t structure has four
planes. I am guessing the first three planes are for R, G, and B, and the fourth plane is alpha.<br><br>for(int i=0;i<100;i++) { *(pPic->p[0].p_pixels + (i * p[0].i_pitch) + i) = 0xAA; <br><br> *(pPic->p[1].p_pixels + (i * p[1].i_pitch) + i) = 0xBB; <br><br> *(pPic->p[2].p_pixels + (i * p[2].i_pitch) + i) = 0xCC; <br><br> *(pPic->p[3].p_pixels + (i * p[3].i_pitch) + i) = 0x00; // No transparency for alpha channel<br><br>}<br><br>Is this thought process correct? Am I missing something?<br><br><br>Regards,<br>Peter<br><br><br><br><br>----- Original Message -----<br>From: Olivier Aubert <<a ymailto="mailto:olivier.aubert@liris.cnrs.fr" href="mailto:olivier.aubert@liris.cnrs.fr">olivier.aubert@liris.cnrs.fr</a>><br>To: <a ymailto="mailto:vlc-devel@videolan.org" href="mailto:vlc-devel@videolan.org">vlc-devel@videolan.org</a><br>Cc: <br>Sent: Monday, August 27, 2012 11:59 AM<br>Subject: Re:
[vlc-devel] How to draw a line in subpicture_t region<br><br>Hi <br><br>On Mon, 2012-08-27 at 10:05 -0700, Peter Tap wrote:<br>> Hi Olivier,<br>> <br>> Thank you for your help.<br>> <br>> $ cd vlc/modules/video_filter<br>> $ grep -i svg *<br>> I don't get any matching files.<br>True, it is in fact a text renderer. If you feed it text, it will render<br>it through a template. If you feed it svg it will render svg.<br><br>> Can you please point me to a VLC sample that I can look up?<br>See the last post of <a href="http://forum.videolan.org/viewtopic.php?f=2&t=874&p=298269&hilit=svg#p298269" target="_blank">http://forum.videolan.org/viewtopic.php?f=2&t=874&p=298269&hilit=svg#p298269</a><br><br>> Also, I am thinking just drawing a line should not be that hard. The problem is I cannot identify a sample file I can look up to get an idea. Most filters dealing with graphics seem to load/copy images.<br>See <a
href="http://en.wikipedia.org/wiki/Line_drawing_algorithm" target="_blank">http://en.wikipedia.org/wiki/Line_drawing_algorithm</a><br>Bresenham algorithm is the most well known.<br><br>Regards,<br>Olivier<br><br><br>_______________________________________________<br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br><br>_______________________________________________<br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br><br><br> </div> </div> </div></body></html>