pixmap

libgdx- pixmap: can I somehow change the width of the line?

风流意气都作罢 提交于 2019-12-10 09:09:34
问题 I want to draw a line and then generate a texture (with libgdx). I found out that creating a texture from circles, rectangles and lines is simple with pixmap. But I didn't find out how to set the linewidth of the drawn shape. Is there any possibility to set the linewidth for pixmap? Here is the code I got so far: (I tried to draw two filled circles and to connect them with a line) Pixmap pixmap = new Pixmap( 16, 16, Format.RGBA8888 ); pixmap.setColor(Color.BLUE); pixmap.fillCircle(x1, y1, 10)

GTK drawable area transparent background color

陌路散爱 提交于 2019-12-08 10:43:59
问题 I have a GTK drawing area and I want to have an image display as the background for it, while other things can be drawn over it. My first attempt at this involved me simply taking the image, putting it into a pixmap, and drawing it before I draw other objects. This resulted in the objects backgrounds completely covering my background image. Now I am thinking I need to change the object's pixmap's gtk.gdk.GC so the background color it has is transparent. Here is where I am having problems. I

How to use shm pixmap with xcb?

不问归期 提交于 2019-12-07 06:04:36
问题 I try to learn how to use shared memory pixmaps in the xcb library. Did any of you have experience with this and want to share example codes and/or information? This would be very helpful. Thanks 回答1: After some research I found out how to use shared memory pixmaps in xcb. Here is my testcode: #include <stdlib.h> #include <stdio.h> #include <sys/ipc.h> #include <sys/shm.h> #include <xcb/xcb.h> #include <xcb/shm.h> #include <xcb/xcb_image.h> #define WID 512 #define HEI 512 int main(){ xcb

Generating textures at runtime with text using libgdx

▼魔方 西西 提交于 2019-12-06 07:10:50
问题 I'm working on a phone word game. Yesterday I decided to switch to OpenGL using libgdx to try and improve graphics performance and battery usage + to target more platforms. The way letter tile drawing was working on a 2D canvas was each letter tile would create a bitmap for itself. I would: Create a new mutable bitmap from the background bitmap. Draw on the letter on the new bitmap. Apply other tile specific effects. Draw the new bitmap for each frame What's the best way for me to achieve

How to use shm pixmap with xcb?

五迷三道 提交于 2019-12-05 11:10:48
I try to learn how to use shared memory pixmaps in the xcb library. Did any of you have experience with this and want to share example codes and/or information? This would be very helpful. Thanks After some research I found out how to use shared memory pixmaps in xcb. Here is my testcode: #include <stdlib.h> #include <stdio.h> #include <sys/ipc.h> #include <sys/shm.h> #include <xcb/xcb.h> #include <xcb/shm.h> #include <xcb/xcb_image.h> #define WID 512 #define HEI 512 int main(){ xcb_connection_t* connection; xcb_window_t window; xcb_screen_t* screen; xcb_gcontext_t gcontext; xcb_generic_event

How to extract the pixel data Use R's pixmap package?

假如想象 提交于 2019-12-04 23:47:34
问题 How to extract the pixel data Use R's pixmap package? so I read the image file using: picture <- read.pnm("picture.pgm") picture Pixmap image Type : pixmapGrey Size : 749x745 Resolution : 1x1 Bounding box : 0 0 745 749 How to extract the pixel data into some matrix? 回答1: You can get the data as a 2-D matrix for grayscale image or 3-D array for color image by getChannels . > x <- read.pnm(system.file("pictures/logo.ppm", package="pixmap")[1]) > y <- getChannels(x) > class(y) [1] "array" > dim

How to extract the pixel data Use R's pixmap package?

大憨熊 提交于 2019-12-03 16:57:12
How to extract the pixel data Use R's pixmap package? so I read the image file using: picture <- read.pnm("picture.pgm") picture Pixmap image Type : pixmapGrey Size : 749x745 Resolution : 1x1 Bounding box : 0 0 745 749 How to extract the pixel data into some matrix? You can get the data as a 2-D matrix for grayscale image or 3-D array for color image by getChannels . > x <- read.pnm(system.file("pictures/logo.ppm", package="pixmap")[1]) > y <- getChannels(x) > class(y) [1] "array" > dim(y) [1] 77 101 3 > > x <- read.pnm(system.file("pictures/logo.pgm", package="pixmap")[1]) > y <- getChannels

Is it possible to use pixmaps on Android via Java API for GLES?

丶灬走出姿态 提交于 2019-11-30 15:14:40
I'm trying to implement off-screen rendering with OpenGL ES on Android. My ultimate goal is to improve performance of texture mapping which I do in plain java and Bitmap/int[] APIs. I tried pbuffer approach, similar to the sample code from a relevant forum thread . It shows rather low performance, glReadPixels call takes up to 50 ms on one device and up to 15 ms on another. There is more modern approach using Frame Buffers. The code samples are rather complicated and I don't expect much faster transfer from Frame Buffer to Android's Bitmaps than it was with pbuffers. Am I right with my

Producing eraser effects using libgdx and OpenGL ES

谁都会走 提交于 2019-11-30 05:06:35
Please consider the following images for the illustration: Initially I fill the whole screen/stage with individual Images until the screen turns pink. Each blob of pink colour is an individual Image actor that I add to the stage. Now I want to implement the touchDown method in such a way that each time the user touches the screen, it erases a part of that Image where the touch event took place. However, that touch event should not effect other Images/actors/TextureRegions that are behind or above the pink blob actors. How am I supposed to achieve this in libgdx using OpenGL ES? Please help me

Is it possible to use pixmaps on Android via Java API for GLES?

放肆的年华 提交于 2019-11-29 21:21:51
问题 I'm trying to implement off-screen rendering with OpenGL ES on Android. My ultimate goal is to improve performance of texture mapping which I do in plain java and Bitmap/int[] APIs. I tried pbuffer approach, similar to the sample code from a relevant forum thread. It shows rather low performance, glReadPixels call takes up to 50 ms on one device and up to 15 ms on another. There is more modern approach using Frame Buffers. The code samples are rather complicated and I don't expect much faster