How can I encode an image by using a stream

96 views
Skip to first unread message

cookienya

unread,
Aug 28, 2018, 8:28:56 AM8/28/18
to OpenJPEG
I learn that when I encode an image by using obj_compress of openjpeg 2.3.0, I find that it need a file handle.
/* open a byte stream for writing and allocate memory for all tiles */
l_stream = opj_stream_create_default_file_stream(parameters.outfile, OPJ_FALSE);
if (! l_stream) {
return 1;
}
So if I want to encode an image and output a stream, how could I do?
I have defined a struct of the struct.
typedef struct{
unsigned char * pData;
OPJ_SIZE_T dataSize;
OPJ_SIZE_T offset;
}opj_stream;
And when I use the function, how should I initialize this struct?

szuk...@arcor.de

unread,
Aug 29, 2018, 1:48:48 AM8/29/18
to OpenJPEG
Q1. Did you read 'opj_compress.c' ?
Q2. Why don't you use 'opj_compress?

winfried
Reply all
Reply to author
Forward
0 new messages