[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: How to get raw pixel data into JavaFX
From:       Benjamin Gudehus <hastebrot () gmail ! com>
Date:       2015-04-29 14:29:39
Message-ID: CANdUZf9HPKbZ4V2cOnNq0Fj8bkLKCDdf76u3ax-xgxLjqQ-1Mw () mail ! gmail ! com
[Download RAW message or body]

Hi Philipp,

as far as I know PixelWriter, WritableImage and ImageView fits better for
handling raster images than Canvas.

TestFX uses PixelWriter.setArgb() to convert screenshots from Glass with
Monocle to PNG files:

https://github.com/TestFX/TestFX/blob/fd75122/subprojects/testfx-core/src/m=
ain/java/org/testfx/service/adapter/impl/GlassRobotAdapter.java#L230

--Benjamin

On Wed, Apr 29, 2015 at 4:21 PM, Philipp D=C3=B6rfler <phdoerfler@gmail.com=
>
wrote:

> Hello list,
>
> I got some very low level pixel data residing in memory with a pixel
> format and want to get that into JavaFX. I am talking about raw bytes, BG=
R,
> 24 bit per pixel etc..
> The library providing this pixel data is OpenCV and although it allows fo=
r
> encoding the data into a standard format like ".bmp" or ".png" which then
> can be read by JavaFX, I would like to avoid this extra conversion proces=
s
> because I got some real time constraints.
>
> As far as I understand this is what the PixelReader and PixelWriter
> interface is for. Is this correct? Where can I find additional informatio=
n
> on how to use them besides the Javadoc? Would using the Canvas be easier?
> Can I somehow use the GraphicsContext of Canvas to do that?
> I'd be grateful for any pointers even when it's just "check out the class
> XZY in the underlying prism code: <link to bitbucket>".
>
> Thanks and best regards!
>
> Philipp D=C3=B6rfler
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic