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

Added GetPixelSpan() with offsets #2609

Merged
merged 13 commits into from Sep 15, 2023
Merged

Added GetPixelSpan() with offsets #2609

merged 13 commits into from Sep 15, 2023

Conversation

mattleibow
Copy link
Contributor

Description of Change

Added some APIs to help get the span to an offset instead of only allowing the start of the pixmap memory.

Bugs Fixed

  • Not a bug, but more the replacement for the GetAddr members we removed in 3.0

API Changes

// extensions
int SKColorType.GetBitShiftPerPixel ();

// members
Span<byte> SKBitmap.GetPixelSpan (int x, int y);
int SKImageInfo.BitShiftPerPixel { get; };
int SKImageInfo.GetPixelBytesOffset (int x, int y);
int SKPixmap.BitShiftPerPixel { get; };
int SKPixmap.GetPixelBytesOffset (int x, int y);
Span<byte> SKPixmap.GetPixelSpan (int x, int y);
Span<T> SKPixmap.GetPixelSpan<T> (int x, int y);

Behavioral Changes

None.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

@mattleibow mattleibow merged commit eeeb0db into main Sep 15, 2023
2 checks passed
@mattleibow mattleibow deleted the dev/pixels branch September 15, 2023 15:07
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