[RQt-devel] a couple of minor things
Michael Lawrence
lawrence.michael at gene.com
Fri Sep 17 15:15:11 CEST 2010
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
> > Qt$QByteArray()
> NULL
>
> 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/20100917/68c3d806/attachment.htm>
More information about the Qtinterfaces-devel
mailing list