Skip to content

Commit

Permalink
refactor(pixel): update ARGB8888, update deps
Browse files Browse the repository at this point in the history
- re-use swapLane13() from thi.ng/binary
- update readme
  • Loading branch information
postspectacular committed Feb 3, 2021
1 parent 1ef7341 commit 9b86922
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/pixel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This project is part of the

## About

Typed array backed, packed integer and unpacked floating point pixel buffers w/ customizable formats, blitting, dithering, conversions.
Typed array backed, integer and floating point pixel buffers w/ customizable formats, blitting, dithering, conversions.

![screenshot](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/pixel/pixel-basics.png)

Expand Down Expand Up @@ -133,11 +133,12 @@ yarn add @thi.ng/pixel
<script src="https://unpkg.com/@thi.ng/pixel/lib/index.umd.js" crossorigin></script>
```

Package sizes (gzipped, pre-treeshake): ESM: 5.29 KB / CJS: 5.48 KB / UMD: 5.39 KB
Package sizes (gzipped, pre-treeshake): ESM: 5.31 KB / CJS: 5.50 KB / UMD: 5.46 KB

## Dependencies

- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
- [@thi.ng/binary](https://github.com/thi-ng/umbrella/tree/develop/packages/binary)
- [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/develop/packages/checks)
- [@thi.ng/math](https://github.com/thi-ng/umbrella/tree/develop/packages/math)
- [@thi.ng/porter-duff](https://github.com/thi-ng/umbrella/tree/develop/packages/porter-duff)
Expand Down
1 change: 1 addition & 0 deletions packages/pixel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
},
"dependencies": {
"@thi.ng/api": "^6.13.6",
"@thi.ng/binary": "^2.0.21",
"@thi.ng/checks": "^2.8.0",
"@thi.ng/math": "^3.1.0",
"@thi.ng/porter-duff": "^0.1.37"
Expand Down
3 changes: 3 additions & 0 deletions packages/pixel/src/format/argb8888.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { swapLane13 } from "@thi.ng/binary";
import { Lane } from "../api";
import { defPackedFormat } from "./packed-format";

Expand All @@ -11,4 +12,6 @@ export const ARGB8888 = defPackedFormat({
{ size: 8, lane: Lane.GREEN },
{ size: 8, lane: Lane.BLUE },
],
fromABGR: swapLane13,
toABGR: swapLane13,
});

0 comments on commit 9b86922

Please sign in to comment.