Giter Site home page Giter Site logo

imagine's Introduction

Hi, I work on Rust stuff.

imagine's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

imagine's Issues

Remove miniz_oxide dependency

At least for when decoding, a zlib decoder should be a small enough module to not pull in an extra dependency at all.

We might keep the optional use of miniz_oxide for encoding images with good compression rates.

[bmp] Converting bitmasked data into RGBA8 should use SIMD

BMP allows for data to be encoded in a "bitmasked" form where bitmasks define the location of channel data within a u16 or u32.
This leads to each channel (R/G/B/A) being treated separately through several math ops.
Since we have 4 channels all doing identical operations, this lends itself very naturally to using SIMD.

Of course, since BMP is not a popular format, the percentage of use cases that would see a benefit from this gain is perhaps quite small. Still, when there's time it wouldn't hurt.

Preferably this would be done once portable-simd is stabilized, because it's not worth keeping the crate nightly-only for.

tag things that require features in their rustdoc

The Cargo.toml and lib.rs is already set up for this, we just need to mark individual elements with a doc(cfg()):

Example:

#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))]

And replace on whatever feature name. This can (I think) go on modules, types, free functions, etc.

Maybe we just need to mark modules and the rest of obvious enough? I guess we don't want to get too spammy with it.

[png] Allocating "automatic" parser for PNG files

We probably want a few possible top level functions here:

  • Get he "direct" data. This involves many option values, and probably different enums because of different pixel formats, and so on. Or maybe you get a Vec and that's good enough because you just cast the slice when you need it? In that case what to do we do about 16-bit channels? Turn them to native-endian maybe and the cast will just work out?
  • Get the RGB8, "somehow". In this case, we upscale lower channel/depth things. If there's an alpha channel, perhaps we blend the image over top of an imagined background and then give the RGB of the composite?
  • Get the RGBA8, upscale stuff, whatever it takes.

Output data is probably:

  • width
  • height
  • pixels
  • colorspace info (usually srgb, but not always)
  • ??? do we need more?

bmp: restore

We just need to restore bmp support from the 0.0.8 version

format: QOI

Not yet fixed, though they're close to having a version 1 defined. Since a goal of the project is that the decoders/encoders are easy to write (at the expense of most other things) then this should be easy to do.

Clean up the pixel formats module.

We ended up not needing the 16-bit BE formats, or the pixel packed formats, they should probably go?

And we should provide standard conversions between the formats.

png: transparency

lots of optional chunks we don't need, but transparency would be very good to support

benchmarks

Probably we should have some benchmarks, ya know.

Auto-decoder size limit

We should place upper limits on how large of a file will be automatically decoded.

Apparently 16,384 is a common upper limit on textures, so a simple 17k limit seems fine I guess?

[png] "Up" filter should use SIMD calculation

It's a small optimization in the scheme of things, but once portable simd is stabilized we should convert the "Up" filtering and unfiltering to use u8xN values.

In this case, we'd want to cancel the normal iteration we'd do using the "PB iterator" (which is byte at a time), just do all the math as wide as possible, and then re-iterate the line for output as if it was a None filtered line the whole time. This will give the correct output while also being significantly faster to compute. The math itself will happen 16x (or more) faster, though having to iterate the row twice will reduce the overall gains.

(Unfortunately, all the other PNG filters are not very SIMD friendly)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.