Giter Club home page Giter Club logo

openjpegdotnet's Introduction

Alt text OpenJpegDotNet GitHub license

OpenJpeg wrapper written in C++ and C# for Windows, MacOS, Linux, iOS and Android

OpenJpegDotNet

Package OS x86 x64 ARM ARM64 Nuget
OpenJpegDotNet Windows - - NuGet version
Linux - NuGet version
OSX - - - NuGet version
OpenJpegDotNet (Xamarin) UWP NuGet version
Android NuGet version
iOS - - NuGet version

How to use?

OpenJpegDotNet provides OpenJpeg APIs and Auxiliary APIs. Auxiliary APIs allows developers to decode/encode jpeg 2000 data easily.

⚠️ Warning

Auxiliary APIs only wraps native OpenJpeg APIs. Auxiliary APIs may be changed in the future.

Read

byte[] image = System.IO.File.ReadAllBytes("test.j2k");
using OpenJpegDotNet.IO.Reader reader = new OpenJpegDotNet.IO.Reader(image);
bool result = reader.ReadHeader();
System.Drawing.Bitmap bitmap = reader.ReadData();

Dependencies Libraries and Products

License: BSD 2-clause "Simplified" License

Author: Université de Louvain

Principal Use: An open-source JPEG 2000 codec written in C language. Main goal of OpenJpegDotNet is what wraps OpenJpeg by C#.

openjpegdotnet's People

Contributors

cinderblocks avatar takuya-takeuchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openjpegdotnet's Issues

Errors when trying to use from nuget

Hi,
I'm trying to install version 2.4.0.20210417 via the nuget package manager and I get an error
image
Seems like a dll is missing. Are there any additional steps I need to take for me to be able to use the package?
Please let me know if I'm missing anything.
I'm testing this on a .net framework 4.7.2 app for some basic jp2000 image conversions.

Functions List

openjpeg version

  • opj_version

image functions

  • opj_image_create
  • opj_image_destroy
  • opj_image_tile_create
  • opj_image_data_alloc
  • opj_image_data_free

stream functions

  • opj_stream_default_create
  • opj_stream_create
  • opj_stream_destroy
  • opj_stream_set_read_function
  • opj_stream_set_write_function
  • opj_stream_set_skip_function
  • opj_stream_set_seek_function
  • opj_stream_set_user_data
  • opj_stream_set_user_data_length
  • opj_stream_create_default_file_stream
  • opj_stream_create_file_stream

event manager functions

  • opj_set_info_handler
  • opj_set_warning_handler
  • opj_set_error_handler

codec functions

DECOMPRESSION FUNCTIONS

  • opj_create_decompress
  • opj_destroy_codec
  • opj_end_decompress
  • opj_set_default_decoder_parameters
  • opj_setup_decoder
  • opj_codec_set_threads
  • opj_read_header
  • opj_set_decoded_components
  • opj_set_decode_area
  • opj_decode
  • opj_get_decoded_tile
  • opj_set_decoded_resolution_factor
  • opj_write_tile
  • opj_read_tile_header
  • opj_decode_tile_data

COMPRESSION FUNCTIONS

  • opj_create_compress
  • opj_set_default_encoder_parameters
  • opj_setup_encoder
  • opj_encoder_set_extra_options
  • opj_start_compress
  • opj_end_compress
  • opj_encode

codec output functions

  • opj_destroy_cstr_info
  • opj_dump_codec
  • opj_get_cstr_info
  • opj_get_cstr_index
  • opj_destroy_cstr_index
  • opj_get_jp2_metadata
  • opj_get_jp2_index

MCT functions

  • opj_set_MCT

Thread function

  • opj_has_thread_support
  • opj_get_num_cpus

Error in Alpine docker

Error in Alpine docker: Segmentation fault (core dumped). But run correctly in Centos VM.
Help, please. Thank you.

Example for Encoding

Can you provide an example of how to encode a Bitmap image as J2K stored in byte[] ?
The README has an example of decoding from byte[] to Bitmap. How is the opposite achieved?

Error in x86(32bit)

OpenJpegDotNet is perfect in x64 but it's has a problem in x86.
I used your library to encode bitmap file to jpeg2000. However, the following problem occurred in x86.

var buffer = new Buffer
{
Data = outputBuffer,
Length = bufferLength,
Position = 0
};

Data has address, length has imageSize + 1024, Position is zero.
After setting StreamCreate, StreamSetUpdateData, SteamSetUserDataLength and CallBack. I start to encode.

But the following problem occurred in StreamWriteCallBack()

var buf = (Buffer*)userData;

buf->Data has address, buf->Length is zero and buf->position is imageSize + 1024.
I'm wondering why is change Length and Position?
Always buf->Length is zero condition, so it's return unchecked((ulong)-1);

I think maybe the OpenJpegDotNetNative.dll of 32bit and 64bit is different. What do you think?

Redefine size_t as long

size_t is implementation defined and it may be signed long.
Therefore, C# side must use long rather than ulong.

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.