Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #25564 > unrolled thread

Re: Image processing in Java

Started byWayne <nospam@all.invalid>
First post2011-02-09 12:14 -0500
Last post2011-02-09 19:40 +0100
Articles 5 — 4 participants

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Image processing in Java Wayne <nospam@all.invalid> - 2011-02-09 12:14 -0500
    Re: Image processing in Java Wayne <nospam@all.invalid> - 2011-02-10 14:10 -0500
    Re: Image processing in Java Lew <lew@lewscanon.com> - 2011-02-09 11:48 -0800
      Re: Image processing in Java Roedy Green <see_website@mindprod.com.invalid> - 2011-02-11 15:13 -0800
    Re: Image processing in Java Mayeul <mayeul.marguet@free.fr> - 2011-02-09 19:40 +0100

#25564 — Re: Image processing in Java

FromWayne <nospam@all.invalid>
Date2011-02-09 12:14 -0500
SubjectRe: Image processing in Java
Message-ID<4d52cb92$0$7961$9a6e19ea@unlimited.newshosting.com>
On 2/8/2011 9:22 PM, Stefan Ram wrote:
> Wayne <profwaynepollock@gmail.com> writes:
>> How can I obtain the raster data from an Image, without
>> serializing it to disk?
> 
>   By looking up the documentation of the image's class.
> 

I did, there was no method that gets the raw data out of an
Image that I saw.  What method are you thinking of?

-- 
Wayne

[toc] | [next] | [standalone]


#25646

FromWayne <nospam@all.invalid>
Date2011-02-10 14:10 -0500
Message-ID<4d543821$0$7966$9a6e19ea@unlimited.newshosting.com>
In reply to#25564
On 2/9/2011 2:48 PM, Lew wrote:
> Wayne writes:
>>>>> How can I obtain the raster data from an Image, without serializing it to disk?
>>
> 
> Stefan Ram wrote:
>>>>    By looking up the documentation of the image's class.
>>
> 
> Wayne wrote:
>>> I did, there was no method that gets the raw data out of an
>>> Image that I saw.  What method are you thinking of?
>>
> 
> Mayeul wrote:
>> getSource() probably. Just need to look up the chain from it.
>>
>> Note that this is a necessity for the absolutely all-purpose generic
>> Image class. If you happen to be manipulating an instance of its
>> BufferedImage subclass, and if you can assume you always will, you will
>> notice it offers more direct access to buffered data.
>>
> 
> Ah, the fine art of RTFMing.
> 
> 'getSource()' is the only one of the fewer than eleven methods that
> has the verbiage: "Gets the object that produces the pixels for the
> image."  That seems relevant to the OP's question, so one must ask
> oneself, "What sort of object is that, pray tell?"  (Assuming you see
> "pixels for the image" and understand that as a synonym for "raster
> data from an Image", which surely anyone would.)  (Right?)
> 
> So you look up that type, which is 'ImageProducer', by clicking on the
> handy-dandy link so politely offered in the description of the
> 'getSource()' method.  Then you iteratively apply the technique for a
> while, until it lands you on 'PixelGrabber', which seems to do what
> you want.
> <http://download.oracle.com/javase/6/docs/api/java/awt/image/
> PixelGrabber.html>
> 
> As Mayeul pointed out, 'BufferedImage' is marginally more direct, if
> you call working through a 'Raster' more direct.  (I do.)
> 
> When all else fails, you could try reading articles or a book.  It's
> not like the art of programming requires study beyond a few Usenet
> questions or anything.
> 
> --
> Lew

Thanks for the information.  I didn't know about PixelGrabber and when I was
asked I said "post the question".  My account was used to post.  I told
the person that while some replies will be caustic you will get the
information you seek.  (I did know about BufferedImage, but they wanted
an Image specifically.)  Sorry if the question was offensive!

-- 
Wayne

[toc] | [prev] | [next] | [standalone]


#25753

FromLew <lew@lewscanon.com>
Date2011-02-09 11:48 -0800
Message-ID<4b43377d-b557-4087-9ba7-fb3fdcf4facc@n16g2000prc.googlegroups.com>
In reply to#25564
Wayne writes:
>>>> How can I obtain the raster data from an Image, without serializing it to disk?
>

Stefan Ram wrote:
>>>    By looking up the documentation of the image's class.
>

Wayne wrote:
>> I did, there was no method that gets the raw data out of an
>> Image that I saw.  What method are you thinking of?
>

Mayeul wrote:
> getSource() probably. Just need to look up the chain from it.
>
> Note that this is a necessity for the absolutely all-purpose generic
> Image class. If you happen to be manipulating an instance of its
> BufferedImage subclass, and if you can assume you always will, you will
> notice it offers more direct access to buffered data.
>

Ah, the fine art of RTFMing.

'getSource()' is the only one of the fewer than eleven methods that
has the verbiage: "Gets the object that produces the pixels for the
image."  That seems relevant to the OP's question, so one must ask
oneself, "What sort of object is that, pray tell?"  (Assuming you see
"pixels for the image" and understand that as a synonym for "raster
data from an Image", which surely anyone would.)  (Right?)

So you look up that type, which is 'ImageProducer', by clicking on the
handy-dandy link so politely offered in the description of the
'getSource()' method.  Then you iteratively apply the technique for a
while, until it lands you on 'PixelGrabber', which seems to do what
you want.
<http://download.oracle.com/javase/6/docs/api/java/awt/image/
PixelGrabber.html>

As Mayeul pointed out, 'BufferedImage' is marginally more direct, if
you call working through a 'Raster' more direct.  (I do.)

When all else fails, you could try reading articles or a book.  It's
not like the art of programming requires study beyond a few Usenet
questions or anything.

--
Lew

[toc] | [prev] | [next] | [standalone]


#25865

FromRoedy Green <see_website@mindprod.com.invalid>
Date2011-02-11 15:13 -0800
Message-ID<oigbl619ggr3gi22dtu184v7pge2tiqm5c@4ax.com>
In reply to#25753
On Wed, 9 Feb 2011 11:48:31 -0800 (PST), Lew <lew@lewscanon.com>
wrote, quoted or indirectly quoted someone who said :

>
>So you look up that type, which is 'ImageProducer', by clicking on the
>handy-dandy link so politely offered in the description of the
>'getSource()' method.  Then you iteratively apply the technique for a
>while, until it lands you on 'PixelGrabber', which seems to do what
>you want.
><http://download.oracle.com/javase/6/docs/api/java/awt/image/
>PixelGrabber.html>

THe problem is pixel grabbing has gone through evolution.  There is a
considerable amount of old code in there you would want to avoid in
new applications.  The docs are not as forthcoming on this as you
might hope.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
.

[toc] | [prev] | [next] | [standalone]


#25871

FromMayeul <mayeul.marguet@free.fr>
Date2011-02-09 19:40 +0100
Message-ID<4d52df86$0$17735$426a74cc@news.free.fr>
In reply to#25564
On 09/02/2011 18:14, Wayne wrote:
> On 2/8/2011 9:22 PM, Stefan Ram wrote:
>> Wayne<profwaynepollock@gmail.com>  writes:
>>> How can I obtain the raster data from an Image, without
>>> serializing it to disk?
>>
>>    By looking up the documentation of the image's class.
>>
>
> I did, there was no method that gets the raw data out of an
> Image that I saw.  What method are you thinking of?

getSource() probably. Just need to look up the chain from it.

Note that this is a necessity for the absolutely all-purpose generic 
Image class. If you happen to be manipulating an instance of its 
BufferedImage subclass, and if you can assume you always will, you will 
notice it offers more direct access to buffered data.

--
Mayeul

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web