Comments (5)
The common format to represent pixels is BGRA stored in low endian (so bytes in BGRA order). But maybe i should make it more explicit by taking the hxd.Pixels class from Heaps.io and porting it to format, but then it's tight to hxd.BitmapData, etc. https://github.com/ncannasse/heaps/blob/master/hxd/Pixels.hx
from format.
To clarify:
it seems that currently the code would only work with 32bpp bitmaps (
Lines 86 to 89 in 98ebff6
bottomToTop
(i.e. line-by-line, starting from the bottom-most one, with bytes padded to be a multiple of 4 - if I understood the spec correctly), and that's why I get a flipped image with weird bandings.
I think that Data
and Header
should represent the format in a closer way, and delegate the conversion to more familiar/easier formats to other functions (like png
and gif
do, with exctract___
and build___
methods).
I'm not sure it's worth the effort to fix this specific one (due to the fact that BMP is unefficient when compared to png and other formats), but at the same time I thought it would be useful to bring the subject up.
Having some directions on what is the expected way to write support for other file formats and expand this lib would be great!
from format.
In general, when an image has been decoded in format library, it's usually represented in memory / bytes as a top-down 32bits data.
from format.
Yes, that's what extractARGB/BGRA()
would eventually do. But do you agree that Data
should represent the binary file more closely (so that, f.e., modifying it in place and writing it back to disk doesn't need any type of conversion)?
from format.
yes, I agree, it should be as much near from the file data, especially if it's read directly as it.
from format.
Related Issues (20)
- [feature request] APNG support HOT 1
- [Question/Oversight] Haxe 4 still includes `haxe.zip` HOT 4
- Avoid allocating memory for entire swf file in format.swf.Writer
- [SWF] Implement LZMA HOT 6
- [png] circular reference (maybe?!) HOT 1
- Feature Request - Unrar HOT 1
- format-style libraries listing HOT 2
- Invalid TAR end
- Library modernization with @:structInit HOT 1
- final is now a reserved keyword in haxe 4+
- JPG (Image file format - add Reader ?) HOT 2
- cpp error in png.Tools : overloaded operator >> is ambiguous HOT 2
- swf reader vs 31bit frame size HOT 1
- string output bug in format.abc.Writer HOT 1
- CI build stalled
- UnicodeString compatibility
- Can you deploy latest to haxelib? HOT 2
- Midi file support? HOT 2
- AMF3 reader not working since Haxe 4.2 HOT 2
- Eof exception when reading data from SWF file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from format.