Skip to content
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

Add Graphics.drawImage (and image class) #198

Closed
gfwilliams opened this issue Jan 27, 2014 · 4 comments
Closed

Add Graphics.drawImage (and image class) #198

gfwilliams opened this issue Jan 27, 2014 · 4 comments

Comments

@gfwilliams
Copy link
Member

Originally posted by Kim here:

espruino/EspruinoDocs#21

A lot of the functions with IO allow to send a lot of data at once since, as the performance page indicates, there is a noticeable overhead with executing code. Make it possible to send an array of pixel coordinates or even an array filled with the desired colours at each row,col position to make addressing the display more efficient.

@gfwilliams
Copy link
Member Author

@kimbauters: Can you give me an example? Do you actually mean having the ability to write a bitmap into a Graphics area? I'd got something for one bit pixmaps internally, but having the ability to blit a typed array into graphics would be quite cool.

Or do you mean when you use: http://www.espruino.com/Reference#l_Graphics_createCallback

However nothing is using that one right now...

@kimbauters
Copy link

The idea would indeed be to dump a typed array into graphics. If you want to display custom graphics, you can dabble with lines and circles and such, but being able to get your own graphics in there now comes down to just doing a pixel by pixel update.

PS: sorry about all issues in the docs section. I added all issues and only then realised I was in the wrong repository. The web version of github isn't all that intuitive for first time users ... :-s

@gfwilliams
Copy link
Member Author

No worries :)

While we could add a Graphics.blitArrayBuffer(arrayBuf,x,y,width,height,bufWidth,bufHeight,bpp), it might be nice to have a Bitmap class instead that stored information on the bitmap. Perhaps that could even be used as the target when Graphics.createArrayBuffer was used.

Whatever we do it'd be very nice to be able to draw a subimage (and to be able to draw different bits per pixel bitmaps). That way people could easily upload their own bitmap fonts and things like that.

@gfwilliams
Copy link
Member Author

It'd be nice if this somehow has support for:

  • Alpha channel (or specifying a transparent colour)
  • Drawing 1 bit bitmaps in a specific colour (text is the obvious use case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants