grok_private.h File Reference
`#include "grok.h"`

Go to the source code of this file.

## Typedefs

typedef grk_object | grk_stream
typedef size_t(* | grk_stream_read_fn) (uint8_t *buffer, size_t numBytes, void *user_data)
typedef size_t(* | grk_stream_write_fn) (const uint8_t *buffer, size_t numBytes, void *user_data)
typedef bool(* | grk_stream_seek_fn) (uint64_t numBytes, void *user_data)
typedef void(* | grk_stream_free_user_data_fn) (void *user_data)

## Functions

void | grk_stream_set_read_function (grk_stream *stream, grk_stream_read_fn func)
| Set read function.
void | grk_stream_set_write_function (grk_stream *stream, grk_stream_write_fn func)
| Set write function.
void | grk_stream_set_seek_function (grk_stream *stream, grk_stream_seek_fn func)
| Set (absolute) seek function (stream must be seekable)
void | grk_stream_set_user_data (grk_stream *stream, void *data, grk_stream_free_user_data_fn func)
| Set user data for JPEG 2000 stream.
void | grk_stream_set_user_data_length (grk_stream *stream, uint64_t data_length)
| Set the length of the user data for the stream.

## Typedef Documentation

## grk_stream

typedef grk_object grk_stream

## grk_stream_free_user_data_fn

typedef void(* grk_stream_free_user_data_fn) (void *user_data)

## grk_stream_read_fn

typedef size_t(* grk_stream_read_fn) (uint8_t *buffer, size_t numBytes, void *user_data)

## grk_stream_seek_fn

typedef bool(* grk_stream_seek_fn) (uint64_t numBytes, void *user_data)

## grk_stream_write_fn

typedef size_t(* grk_stream_write_fn) (const uint8_t *buffer, size_t numBytes, void *user_data)

## Function Documentation

## grk_stream_set_read_function()

void grk_stream_set_read_function | ( | grk_stream * | stream,
|  | grk_stream_read_fn | func
| ) |  |

Set read function.

Parameters

  stream | JPEG 2000 stream
  func | read function

References grk::BufferedStream::getImpl(), grk::grk_read(), and GROK_STREAM_STATUS_INPUT.

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().

## grk_stream_set_seek_function()

void grk_stream_set_seek_function | ( | grk_stream * | stream,
|  | grk_stream_seek_fn | func
| ) |  |

Set (absolute) seek function (stream must be seekable)

Parameters

  stream | JPEG 2000 stream
  func | (absolute) seek function.

References grk::BufferedStream::getImpl(), and grk::grk_read().

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().

## grk_stream_set_user_data()

void grk_stream_set_user_data | ( | grk_stream * | stream,
|  | void * | data,
|  | grk_stream_free_user_data_fn | func
| ) |  |

Set user data for JPEG 2000 stream.

Parameters

  stream | JPEG 2000 stream
  data | user data
  func | function to free data when grk_object_unref() is called.

References grk::BufferedStream::getImpl(), and grk::grk_read().

Referenced by grk::create_mapped_file_read_stream(), grk::create_mapped_file_write_stream(), grk::create_mem_stream(), and grk_stream_create_file_stream().

## grk_stream_set_user_data_length()

void grk_stream_set_user_data_length | ( | grk_stream * | stream,
|  | uint64_t | data_length
| ) |  |

Set the length of the user data for the stream.

Parameters

  stream | JPEG 2000 stream
  data_length | length of data.

References grk::BufferedStream::getImpl(), and grk::grk_read().

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().

## grk_stream_set_write_function()

void grk_stream_set_write_function | ( | grk_stream * | stream,
|  | grk_stream_write_fn | func
| ) |  |

Set write function.

Parameters

  stream | JPEG 2000 stream
  func | write function

References grk::BufferedStream::getImpl(), grk::grk_read(), and GROK_STREAM_STATUS_OUTPUT.

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().