[RQt-devel] a couple of minor things
Michael Lawrence
lawrence.michael at gene.com
Mon Sep 20 23:34:58 CEST 2010
On Fri, Sep 17, 2010 at 6:15 AM, Michael Lawrence <michafla at gene.com> wrote:
>
>
> On Fri, Sep 17, 2010 at 4:39 AM, Deepayan Sarkar <
> deepayan.sarkar at gmail.com> wrote:
>
>> Hi,
>>
>> A couple of low-priority things that might be nice to have:
>>
>> (1) In dealing with images, Qt used unsigned int for colors.
>>
>> > qimg <- Qt$QImage(100, 100, Qt$QImage$Format_ARGB32_Premultiplied)
>> > qimg$fill(0L)
>> > qimg$pixel(40, 50)
>> [1] 0
>>
>> Is there an easy way to implement conversion to/from R colors? (Maybe
>> through R color <-> R integer <-> unsigned int.)
>>
>>
> For images, I was thinking we could have a converter between QImage and R
> images stored as matrices (as used by graphics devices in recent versions of
> R). Any pixel-wise manipulation of images from R would be too slow in
> general.
>
> Btw, there is already conversion between QColor and the output of
> col2rgb(), using qcol2rgb() and qcolor().
>
> (2) QByteArrays are almost like strings, and used in various places. E.g.,
>>
>> > Qt$QImageReader$supportedImageFormats()
>> Error in qinvokeStatic(cl, name, ...) :
>> Attempt to create SmokeObject with NULL class
>>
>
In latest svn:
> sapply(Qt$QImageReader$supportedImageFormats(), rawToChar)
[1] "bmp" "gif" "ico" "jpeg" "jpg" "pbm" "pgm" "png" "ppm" "svg"
[11] "xbm" "xpm"
> > Qt$QByteArray()
>> NULL
>>
>>
> Qt$QByteArray()
raw(0)
> Is there a risk in allowing the conversion?
>>
>
>
> The above looks like a bug. QByteArray is supposed to be converted to a raw
> vector (closest R equivalent in my opinion, as QByteArray has no notion of
> locale, etc), which is then easily converted to a string if necessary with
> rawToChar().
>
>
>> -Deepayan
>> _______________________________________________
>> Qtinterfaces-devel mailing list
>> Qtinterfaces-devel at lists.r-forge.r-project.org
>>
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20100920/0077b8c4/attachment.htm>
More information about the Qtinterfaces-devel
mailing list