<br><br><div class="gmail_quote">On Mon, Sep 20, 2010 at 11:12 PM, Deepayan Sarkar <span dir="ltr"><<a href="mailto:deepayan.sarkar@gmail.com">deepayan.sarkar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Mon, Sep 20, 2010 at 2:34 PM, Michael Lawrence<br>
<<a href="mailto:lawrence.michael@gene.com">lawrence.michael@gene.com</a>> wrote:<br>
><br>
><br>
> On Fri, Sep 17, 2010 at 6:15 AM, Michael Lawrence <<a href="mailto:michafla@gene.com">michafla@gene.com</a>> wrote:<br>
>><br>
>><br>
>> On Fri, Sep 17, 2010 at 4:39 AM, Deepayan Sarkar<br>
>> <<a href="mailto:deepayan.sarkar@gmail.com">deepayan.sarkar@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi,<br>
>>><br>
>>> A couple of low-priority things that might be nice to have:<br>
>>><br>
>>> (1) In dealing with images, Qt used unsigned int for colors.<br>
>>><br>
>>> > qimg <- Qt$QImage(100, 100, Qt$QImage$Format_ARGB32_Premultiplied)<br>
>>> > qimg$fill(0L)<br>
>>> > qimg$pixel(40, 50)<br>
>>> [1] 0<br>
>>><br>
>>> Is there an easy way to implement conversion to/from R colors? (Maybe<br>
>>> through R color <-> R integer <-> unsigned int.)<br>
>>><br>
>><br>
>> For images, I was thinking we could have a converter between QImage and R<br>
>> images stored as matrices (as used by graphics devices in recent versions of<br>
>> R). Any pixel-wise manipulation of images from R would be too slow in<br>
>> general.<br>
<br>
</div>True. The $fill() example above is the only realistic use-case. <br></blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Anyway, a one-off converter should be easy enough.<br>
<div class="im"><br></div></blockquote><div><br>I will work on this conversion.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">
>> Btw, there is already conversion between QColor and the output of<br>
>> col2rgb(), using qcol2rgb() and qcolor().<br>
<br>
</div>Yes, and it would have been nice if QImage methods accepted QColor<br>
whenever appropriate.<br>
<div class="im"><br></div></blockquote><div><br>Still, it's not hard to move between the two:<br> <br>image.fill(qcolor("red")$rgb())<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">
>>> (2) QByteArrays are almost like strings, and used in various places.<br>
>>> E.g.,<br>
>>><br>
>>> > Qt$QImageReader$supportedImageFormats()<br>
>>> Error in qinvokeStatic(cl, name, ...) :<br>
>>> Attempt to create SmokeObject with NULL class<br>
><br>
> In latest svn:<br>
><br>
>> sapply(Qt$QImageReader$supportedImageFormats(), rawToChar)<br>
> [1] "bmp" "gif" "ico" "jpeg" "jpg" "pbm" "pgm" "png" "ppm" "svg"<br>
> [11] "xbm" "xpm"<br>
<br>
</div>Thanks. The new QT() screen device in qtutils now uses this to create<br>
a dynamic "Export As" context menu.<br>
<div><div></div><div class="h5"><br>
-Deepayan<br>
_______________________________________________<br>
Qtinterfaces-devel mailing list<br>
<a href="mailto:Qtinterfaces-devel@lists.r-forge.r-project.org">Qtinterfaces-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel</a><br>
</div></div></blockquote></div><br>