예제 #1
0
static OPJ_SIZE_T jp2_io_read(void *buf, OPJ_SIZE_T size, void *io)
{
	ssize_t ret;
	ret = GP_IORead(io, buf, size);

	if (ret == 0)
		return -1;

	return ret;
}
예제 #2
0
static boolean fill_input_buffer(struct jpeg_decompress_struct *cinfo)
{
	int ret;
	struct my_source_mgr* src = (void*)cinfo->src;

	ret = GP_IORead(src->io, src->buffer, src->size);

	if (ret <= 0) {
		GP_WARN("Failed to fill buffer, IORead returned %i", ret);
		return FALSE;
	}

	src->mgr.next_input_byte = src->buffer;
	src->mgr.bytes_in_buffer = ret;
	return TRUE;
}
예제 #3
0
static int gif_input_func(GifFileType* gif, GifByteType* bytes, int size)
{
	GP_IO *io = gif->UserData;

	return GP_IORead(io, bytes, size);
}