GithubHelp home page GithubHelp logo

masflam / xcbased.jl Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 206 KB

Based XCB Julia bindings with futures. ๐Ÿ˜ฎ

License: GNU General Public License v3.0

Julia 100.00%
x11 xcb xcb-bindings

xcbased.jl's People

Contributors

masflam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

borysjb

xcbased.jl's Issues

Error: libxcb.so.1 not defined

Getting the following error now:

ERROR: UndefVarError: libxcb.so.1 not defined
Stacktrace:
 [1] xcb_connect(displayname::String, screenp::Base.RefValue{Int32})
   @ XCBased.LibXCB ~/.julia/packages/XCBased/I86AA/gen/xcb_api.jl:90
 [2] xcb_connect(display_name::String)
   @ XCBased ~/.julia/packages/XCBased/I86AA/src/XCBased.jl:38
 [3] top-level scope
   @ REPL[3]:1

Probably something to do with dbf19f0 ?

ERROR: type xcb_get_image_reply_t has no field data

Hi, I was using this to take a screenshot, but got the following error:

ERROR: type xcb_get_image_reply_t has no field data
Stacktrace:
 [1] getproperty(x::XCBased.LibXCB.xcb_get_image_reply_t, f::Symbol)
   @ Base ./Base.jl:33
 [2] XCBGetImageReply(replyptr::Ptr{XCBased.LibXCB.xcb_get_image_reply_t})
   @ XCBased ~/.julia/packages/XCBased/nDjnG/src/replies/get_image.jl:10
 [3] fetch(f::XCBGetImageFuture)
   @ XCBased ~/.julia/packages/XCBased/nDjnG/src/futures/get_image.jl:26
 [4] top-level scope
   @ REPL[12]:1

Segmentation Fault when using this Library to take a screenshot

I was using the following code to take a screenshot:

using XCBased, FileIO, ColorTypes

x11_display = ENV["DISPLAY"]
conn = xcb_connect(x11_display)
setup = get_setup(conn)

screen = setup.screens[1]
width = screen.width_in_pixels
height = screen.height_in_pixels
root = screen.root

output_format = XCB_IMAGE_FORMAT_Z_PIXMAP
plane_mask = 2^32 - 1

rep = xcb_get_image(conn, output_format, root, 0, 0, width, height, plane_mask, checked = false)

reply = fetch(rep)

img_data = reply.data

img = Array{Any}(zeros(height, width))

for i in 1:length(img_data)/4
	# The next line is the one causing problems
	img[Int(ceil(i/width)),Int((4i%width)/4)+1] = RGBX(img_data[Int(4(i-1)+1)]/255, img_data[Int(4(i-1)+2)]/255, img_data[Int(4(i-1)+3)]/255)
end

save("./image.png", img)

xcb_disconnect(conn)

but got a segmentation fault:

signal (11): Segmentation fault
in expression starting at /home/wali/Documents/julia/xshot.jl:23
getindex at ./array.jl:805
unknown function (ip: 0x7faebf2cf9d6)
top-level scope at /home/wali/Documents/julia/xshot.jl:24
unknown function (ip: 0x7faf4635db5f)
unknown function (ip: 0x7faf4635e46c)
jl_toplevel_eval_in at /usr/bin/../lib/julia/libjulia-internal.so.1 (unknown line)
unknown function (ip: 0x7faf342cb837)
unknown function (ip: 0x7faf34302d33)
unknown function (ip: 0x7faf340f70f2)
unknown function (ip: 0x7faf3403bc3d)
unknown function (ip: 0x7faf3403cc6a)
unknown function (ip: 0x7faf3403cdb5)
unknown function (ip: 0x7faf46380ade)
repl_entrypoint at /usr/bin/../lib/julia/libjulia-internal.so.1 (unknown line)
main at julia (unknown line)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
_start at julia (unknown line)
Allocations: 10511937 (Pool: 10510873; Big: 1064); GC: 6
[1]    52961 segmentation fault (core dumped)  julia xshot.jl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.