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 PixMap struct #74

Merged
merged 1 commit into from
Dec 2, 2022
Merged

Add PixMap struct #74

merged 1 commit into from
Dec 2, 2022

Conversation

elgopher
Copy link
Owner

@elgopher elgopher commented Nov 12, 2022

PixMap is a generic data structure for manipulating any kind of pixel data - screen, sprite-sheet etc.

PixMap uses a single byte (8 bits) for storing single color/pixel. This means that max 256 colors can be used.

PixMap can also be used for maps which not necessary contain pixel colors, such as world map (as long as only 256 different tiles are used).

This commit replaces pi.Screen and pi.SpriteSheet with pi.PixMap.

PixMap provides also new methods:

  • Copy - copy PixMap fragment to another PixMap at specific location
  • Merge - customizable variant of Copy. User can provide his own merge function which will be used instead of directly copying pixels.
  • Foreach - run code line by line on selected PixMap fragment
  • Pointer - low-level method for high-performance processing

@elgopher elgopher changed the title Pixmap Add PixMap struct and Select function Nov 12, 2022
@elgopher elgopher force-pushed the pixmap branch 28 times, most recently from b0b4ad7 to ac55d74 Compare November 13, 2022 20:27
@elgopher elgopher force-pushed the pixmap branch 10 times, most recently from 790d23d to 49d263e Compare November 19, 2022 10:15
@elgopher elgopher changed the title Add PixMap struct - reusable low-level API Add PixMap struct - reusable API for everything contaning pixels on 2d surface Nov 19, 2022
@elgopher elgopher changed the title Add PixMap struct - reusable API for everything contaning pixels on 2d surface Add PixMap struct - reusable API for all kind of 2d pixel surfaces Nov 19, 2022
@elgopher elgopher force-pushed the pixmap branch 8 times, most recently from cf7bce1 to 92d1c83 Compare November 20, 2022 10:39
@elgopher elgopher force-pushed the pixmap branch 3 times, most recently from bcb2540 to 359a9fd Compare December 2, 2022 13:10
@elgopher elgopher marked this pull request as ready for review December 2, 2022 13:16
@elgopher elgopher changed the title Add PixMap struct - reusable API for all kind of 2d pixel surfaces Add PixMap struct Dec 2, 2022
PixMap is a generic data structure for manipulating any kind of pixel data - screen, sprite-sheet etc.

PixMap uses a single byte (8 bits) for storing single color/pixel. This means that max 256 colors can be used.

PixMap can also be used for maps which not necessary contain pixel colors, such as world map (as long as only 256 different tiles are used).

This commit replaces pi.Screen and pi.SpriteSheet with pi.PixMap.

PixMap provides also new methods:

* Copy - copy PixMap fragment to another PixMap at specific location
* Merge - customizable variant of Copy. User can provide his own merge function which will be used instead of directly copying pixels.
* Foreach - run code line by line on selected PixMap fragment
* Pointer - low-level method for high-performance processing
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

1 participant