// Copyright 2013, 2014, 2015, 2016, 2017 Lovell Fuller and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include #include #include #include "common.h" #include "metadata.h" #include "pipeline.h" #include "utilities.h" NAN_MODULE_INIT(init) { vips_init("sharp"); g_log_set_handler("VIPS", static_cast(G_LOG_LEVEL_WARNING), static_cast(sharp::VipsWarningCallback), nullptr); // Methods available to JavaScript Nan::Set(target, Nan::New("metadata").ToLocalChecked(), Nan::GetFunction(Nan::New(metadata)).ToLocalChecked()); Nan::Set(target, Nan::New("pipeline").ToLocalChecked(), Nan::GetFunction(Nan::New(pipeline)).ToLocalChecked()); Nan::Set(target, Nan::New("cache").ToLocalChecked(), Nan::GetFunction(Nan::New(cache)).ToLocalChecked()); Nan::Set(target, Nan::New("concurrency").ToLocalChecked(), Nan::GetFunction(Nan::New(concurrency)).ToLocalChecked()); Nan::Set(target, Nan::New("counters").ToLocalChecked(), Nan::GetFunction(Nan::New(counters)).ToLocalChecked()); Nan::Set(target, Nan::New("simd").ToLocalChecked(), Nan::GetFunction(Nan::New(simd)).ToLocalChecked()); Nan::Set(target, Nan::New("libvipsVersion").ToLocalChecked(), Nan::GetFunction(Nan::New(libvipsVersion)).ToLocalChecked()); Nan::Set(target, Nan::New("format").ToLocalChecked(), Nan::GetFunction(Nan::New(format)).ToLocalChecked()); Nan::Set(target, Nan::New("_maxColourDistance").ToLocalChecked(), Nan::GetFunction(Nan::New(_maxColourDistance)).ToLocalChecked()); } NODE_MODULE(sharp, init)