-
Notifications
You must be signed in to change notification settings - Fork 125
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to manipulate raw pixel data? #95
Comments
Looks like it is missing, and I already have a request to add it #72. Will add next week |
Thanks for the fast reply. Digging deeper I saw that there are quite some essentials missing. My use cases would be:
Hope this helps as input to cover my needs 😁 . |
Added everything except SKBitmap.Decode (will add later). Check out https://github.com/JetBrains/skija/blob/3fda7b5b74a42b2b015bebe2031fccff631fb409/examples/scenes/src/BitmapImageScene.java for examples. From your description, you should be able to do what you set up to do. Jar version 0.89.32 |
Thanks a lot for the fast extensions. The changes seem to cover my usecases. The memory load might not be optimal because the read/installPixel workflows usually result in a full copy of the raw buffer instead sharing buffers or accessing the raw buffer of a bitmap for in-place modifications. In my concrete case it shouldn't be a problem with the memory consumption. It also seems with my rework that I do not have a direct need for |
Will see if direct memory access is possible via ByteBuffers |
https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#NewDirectByteBuffer |
What about manipulating raw pixels in a raster based SkSurface? on SkiaSharp we have ´SkSurface.peekPixels´ which returns a SkPixmap,and no copying is involved. So how to do so in Skija? |
@cqjjjzr if you need it, please open a new issue |
I was wondering how I can access the raw pixel byte array of an
Image
in Skija. After loading anImage
viaImage.makeFromEncoded
I somehow could not find a good way to convert theImage
to aBitmap
. And even if I would be able to create aBitmap
there seems no accessor for the rawbyte[]
of the image representing the pixels. I need to do some raw pixel manipulation (for diffing purposes).On SkiaSharp you can create a
SKBitmap
either by usingSKBitmap.Decode()
or viaSKBitmap.FromImage
. The raw pixels are then accessible viaskBitmap.Bytes
.Is this missing in Skija?
The text was updated successfully, but these errors were encountered: