hu2prod / gpu Goto Github PK
View Code? Open in Web Editor NEWmakes opencl stuff suck less
makes opencl stuff suck less
Proposal
new special buffer types:
On creation can specify max_size_x, max_size_y, can_resize (only less than)
img_buf = ctx.buffer_image max_size_x=1920, max_size_y=1080, can_resize=false
img_list_buf = ctx.buffer_image_list max_size_x=1920, max_size_y=1080, max_count=100, can_resize=false
img_list_nu_buf = ctx.buffer_image_list_non_uniform max_size_x=1920, max_size_y=1080, max_count=100, can_resize=false
# autodetect API
img_buf.load "path.png"
img_buf.load "path.jpg"
img_buf.load "path.jpeg"
img_buf.load "path.raw" # will check size == max_size_x*max_size_y, otherwise can't detect size -> error
img_buf.load "path.PNG"
img_buf.load "path.JPG"
img_buf.load "path.png"
# any extension != png, jpg, raw -> error
# buffer manual only (prevent false positive raw as png)
img_buf.load_buf_raw buf # just buffer copy + size check
img_buf.load_buf_png buf
img_buf.load_buf_jpg buf
img_buf.load_buf_jpeg buf
# NOTE arg_list_set should be called before kernel call
# save (for buffer_image_rgb[a])
img_buf.save "path.png"
png_buf = img_buf.save_buf_png(reuse_buf)
png_buf = img_buf.save_buf_png(image_write_buffer_pool)
jpg_buf = img_buf.save_buf_jpg(reuse_buf)
raw_buf = img_buf.save_buf_raw(reuse_buf) # will check size, error if not match
# batch load
img_list_buf.load_list ["file1.png", "file2.png"]
img_list_buf.load_folder "folder" # note all files after fs.readdirSync will be sorded with sort (a,b)->a.localeCompare b
# batch save
img_list_buf.save_list ["file1.png", "file2.png"]
img_list_buf.save_folder "folder" # anonymous names would be generated
checklist
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.