[Jprogramming] Read image with Qt?
Cliff Reiter
reiterc at lafayette.edu
Wed May 7 15:43:38 UTC 2014
I think that writeimg_jqtide_ needs an adjustment in order to specify
jpeg (or png) quality.
The only time "opt" is nonempty is when quality is set and then it has
two boxed items.
Thus the <. {. 0&".opt in
if. ''-:opt do. quality=. _1 else. quality=. <. {. 0&".opt end.
fails.
Can be fixed with
if. ''-:opt do. quality=. _1 else. quality=. <. {. 0&".>{:opt end.
but probably simplifies the function if the earlier
opt=. (":&.>1{opt) 1}opt
is changed.
Best, Cliff
On 8/6/2013 8:09 PM, bill lam wrote:
> There are verbs in the jqtide locale for reading and writing
> images.
>
> NB. reading file images to argb matrix
> img=. readimg_jqtide_ 'foo.jpg'
>
> NB. reading file images from memory to argb matrix
> img=. getimg_jqtide_ 'foo.jpg'
>
> NB. write image data to file
> NB. x rgb matrix
> NB. y filename [ ; 'jpeg|png|ico|bmp' [ ; 'quality' ; [0,100]|_1
>
> img writeimg_jqtide_ 'foo.png'
>
> However I guess these verbs cannot be used in jconsole. Neither
> can J8 load or use gtk stuff.
>
> Вт, 06 авг 2013, Dan Farmer писал(а):
>> Hello,
>>
>> New J user here (well I've been dabbling for a few months, but getting
>> more serious now). I'm using J8 (which I realize is considered beta, I
>> figured since I'm using it on Linux, Windows and Android I may as well
>> use the latest, I won't even know what's missing versus J6).
>>
>> Anyway to come to the point, I found a post on the jwiki about image
>> processing and the author used the GTK facilities from J7 to load
>> images, I'm curious if this functionality has been exposed via jqt? I
>> saw the wd demo that loads an image and displays it on a form, but it
>> wasn't clear to me if I could actually get an array out of that or if
>> it just returned a QImage for GUI usage. I've seen references to
>> image3 and platimg but neither of these seem to be available for J8 at
>> this time.
>>
>> I have a few other questions, but since this is my first post I
>> thought I would ask if this group prefers a separate email per "topic"
>> (more google-able) or if a batch of questions is ok (more humane on
>> the inbox)?
>>
>> [I tried posting this from Nabble initially and it said the mailing
>> list did not accept it so I am resending it in the usual fashion,
>> apologies if anyone has seen this twice now]
>>
>> Thank you,
>> Dan
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
--
Clifford A. Reiter
Lafayette College, Easton, PA 18042
http://webbox.lafayette.edu/~reiterc/
More information about the Programming
mailing list