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

Uc8151 Improvements DrawBitmap and DrawBuffer #680

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

conejoninja
Copy link
Member

No description provided.

@deadprogram
Copy link
Member

@conejoninja please rebase against latest dev. Thanks!

interface and DrawBuffer to set directly the buffer.
Build on top of tinygo-org#679
@conejoninja conejoninja force-pushed the uc8151-fillbuffer branch 2 times, most recently from 34ef366 to 5f2645f Compare May 15, 2024 08:28
@conejoninja
Copy link
Member Author

Probably the first time I rebase locally, hope I didn't screw up.

@deadprogram
Copy link
Member

Probably the first time I rebase locally, hope I didn't screw up.

That was perfect. 👍

@@ -201,6 +201,31 @@ func (d *Device) DrawBitmap(x, y int16, bitmap pixel.Image[pixel.Monochrome]) er
return nil
}

// DrawBuffer copies the buffer directly to the screen at the given coordinates (no rotation taken into account). X coordinate and width need to be a multiple of 8.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(no rotation taken into account)

That seems is a possible issue, since most of the time with this screen we operate at 270 degrees rotation.

@aykevl
Copy link
Member

aykevl commented May 25, 2024

DrawBuffer is a new interface, why didn't you use the conventional DrawBitmap interface? (Or even DrawRGBBitmap8)

@conejoninja
Copy link
Member Author

DrawBitmap already exists and it calls d.SetPixel for each pixel, but I already had the buffer with the data in the correct format, should should avoid a bunch of operations if just copy it instead. It's convenient (in my case)

@deadprogram
Copy link
Member

DrawBitmap already exists and it calls d.SetPixel for each pixel

Perhaps you would like to improve the implementation of DrawBitmap() instead? 😸

@conejoninja
Copy link
Member Author

DrawBitmap already exists and it calls d.SetPixel for each pixel

Perhaps you would like to improve the implementation of DrawBitmap() instead? 😸

Not sure if possible or worthy.
Each byte of the buffer represent a row of 1x8 pixels. Using arbitrary coordinates x,y (ie not a multiple of 8), size and different rotations could be quite complex.

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

Successfully merging this pull request may close these issues.

None yet

3 participants