class GdkPixbuf::Pixbuf

Public Instance Methods

to_arrow() click to toggle source
# File lib/arrow-gdk-pixbuf/to-arrow.rb, line 17
def to_arrow
  bytes = read_pixel_bytes
  buffer = Arrow::Buffer.new(bytes.to_s)
  buffer.instance_variable_set(:@bytes, bytes)
  shape = [height, width, n_channels]
  Arrow::Tensor.new(Arrow::UInt8DataType.new,
                    buffer,
                    shape,
                    nil,
                    nil)
end