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

Refactor native part #34

Closed
EyalAr opened this issue Sep 9, 2014 · 0 comments
Closed

Refactor native part #34

EyalAr opened this issue Sep 9, 2014 · 0 comments
Milestone

Comments

@EyalAr
Copy link
Owner

EyalAr commented Sep 9, 2014

In order to facilitate the transition to NAN (issue #28) and allow more flexibility in image sources other than files on disk (e.g. network, streams) (issue #23); the native module will be broken down to 3 modules:

  1. Decoder - Will receive a Buffer object of an encoded image (JPEG, PNG, GIF, etc.) and will create a buffer of uncompressed pixels data.

    // buffer is a jpeg image loaded from disk (e.g.)
    Decoder.decode(buffer, 'jpeg', function(err, pixbuf){
        // pixbuf is a buffer of RGB pixels.
    });
    
  2. Encoder - The counterpart of 'decoder'. Will receive a Buffer object of uncompressed pixels and will create a buffer of an encoded image.

    Encoder.encode(pixbuf, 'jpeg', function(err, jpegbuf){
        // jpegbuf is a jpeg image
    });
    
  3. Image - Will receive a buffer of uncompressed pixels and create an 'image' object, upon which image operations can be made.

    Image.create(pixbuf, function(err, image){
        // image.resize(...)
    });
    
@EyalAr EyalAr added this to the v0.0.3 milestone Sep 9, 2014
@EyalAr EyalAr mentioned this issue Sep 9, 2014
EyalAr added a commit that referenced this issue Sep 9, 2014
EyalAr added a commit that referenced this issue Sep 11, 2014
@EyalAr EyalAr closed this as completed Sep 12, 2014
@EyalAr EyalAr mentioned this issue Sep 14, 2014
EyalAr added a commit that referenced this issue Sep 15, 2014
0. Refactors code to components: decoder, encoder, image (#34)
0. Compatibility with Node 0.11 (#28)
0. Decoding of Buffer objects (#35)
0. Sharpen image (#16)
0. Adjust saturation (#8)
0. Adjust lightness (#10)
0. Adjust hue (#9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant