Loading...
Searching...
No Matches
ojph_img_io.h
Go to the documentation of this file.
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_img_io.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_IMG_IO_H
#define OJPH_IMG_IO_H
#include <cstdio>
#include <cassert>
#include "ojph_base.h"
#include "ojph_defs.h"
#ifdef OJPH_ENABLE_TIFF_SUPPORT
#include "tiffio.h"
#endif /* OJPH_ENABLE_TIFF_SUPPORT */
namespace ojph {
// defined elsewhere
class mem_fixed_allocator;
class line_buf;
//
//
//
//
//
class image_in_base
{
public:
virtual ~image_in_base() {}
virtual ui32 read(const line_buf* line, ui32 comp_num) = 0;
virtual void close() {}
};
//
//
//
//
//
class ppm_in : public image_in_base
{
public:
ppm_in(mem_fixed_allocator *p = NULL)
{
fh = 0;
fname = NULL;
alloc_p = p;
temp_buf = NULL;
width = height = num_comps = max_val = max_val_num_bits = 0;
bytes_per_sample = num_ele_per_line = 0;
temp_buf_byte_size = 0;
cur_line = 0;
start_of_data = 0;
planar = false;
bit_depth[2] = bit_depth[1] = bit_depth[0] = 0;
is_signed[2] = is_signed[1] = is_signed[0] = false;
subsampling[2] = subsampling[1] = subsampling[0] = point(1,1);
}
virtual ~ppm_in()
{
close();
if (alloc_p == NULL && temp_buf)
free(temp_buf);
}
void open(const char* filename);
void finalize_alloc();
virtual ui32 read(const line_buf* line, ui32 comp_num);
void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
void set_planar(bool planar) { this->planar = planar; }
size get_size() { assert(fh); return size(width, height); }
ui32 get_width() { assert(fh); return width; }
ui32 get_height() { assert(fh); return height; }
ui32 get_max_val() { assert(fh); return max_val; }
ui32 get_num_components() { assert(fh); return num_comps; }
ui32 get_bit_depth(ui32 comp_num)
{ assert(fh && comp_num < num_comps); return bit_depth[comp_num]; }
bool get_is_signed(ui32 comp_num)
{ assert(fh && comp_num < num_comps); return is_signed[comp_num]; }
point get_comp_subsampling(ui32 comp_num)
{ assert(fh && comp_num < num_comps); return subsampling[comp_num]; }
private:
FILE *fh;
const char *fname;
mem_fixed_allocator *alloc_p;
void *temp_buf;
ui32 width, height, num_comps, max_val, max_val_num_bits;
ui32 bytes_per_sample, num_ele_per_line;
ui32 temp_buf_byte_size;
ui32 cur_line;
si64 start_of_data;
bool planar;
ui32 bit_depth[3];
bool is_signed[3];
point subsampling[3];
};
//
//
//
//
//
#ifdef OJPH_ENABLE_TIFF_SUPPORT
class tif_in : public image_in_base
{
public:
tif_in()
{
tiff_handle = NULL;
fname = NULL;
line_buffer = NULL;
line_buffer_for_planar_support_uint8 = NULL;
line_buffer_for_planar_support_uint16 = NULL;
width = height = num_comps = 0;
bytes_per_sample = 0;
bytes_per_line = 0;
planar_configuration = 0;
cur_line = 0;
bit_depth[3] = bit_depth[2] = bit_depth[1] = bit_depth[0] = 0;
is_signed[3] = is_signed[2] = is_signed[1] = is_signed[0] = false;
subsampling[3] = subsampling[2] = point(1, 1);
subsampling[1] = subsampling[0] = point(1, 1);
}
virtual ~tif_in()
{
close();
if (line_buffer)
free(line_buffer);
if (line_buffer_for_planar_support_uint8)
free(line_buffer_for_planar_support_uint8);
if (line_buffer_for_planar_support_uint16)
free(line_buffer_for_planar_support_uint16);
}
void open(const char* filename);
virtual ui32 read(const line_buf* line, ui32 comp_num);
void close() {
if (tiff_handle) {
TIFFClose(tiff_handle);
tiff_handle = NULL;
}
fname = NULL;
}
size get_size() { assert(tiff_handle); return size(width, height); }
ui32 get_num_components() { assert(tiff_handle); return num_comps; }
void set_bit_depth(ui32 num_bit_depths, ui32* bit_depth);
ui32 get_bit_depth(ui32 comp_num) {
assert(tiff_handle && comp_num < num_comps);
return bit_depth[comp_num];
}
bool get_is_signed(ui32 comp_num) {
assert(tiff_handle && comp_num < num_comps);
return is_signed[comp_num];
}
point get_comp_subsampling(ui32 comp_num) {
assert(tiff_handle && comp_num < num_comps);
return subsampling[comp_num];
}
private:
TIFF* tiff_handle;
size_t bytes_per_line;
ui16 planar_configuration;
const char* fname;
void* line_buffer;
ui8* line_buffer_for_planar_support_uint8;
ui16* line_buffer_for_planar_support_uint16;
ui32 width, height;
ui32 num_comps;
ui32 bytes_per_sample;
ui32 cur_line;
ui32 bit_depth[4];
bool is_signed[4];
point subsampling[4];
};
#endif /* OJPH_ENABLE_TIFF_SUPPORT */
// A simple DPX file reader supporting commonly used 10bit and 16bit formats
// DPX is an uncompressed file format used by the motion picture industry
// DPX is standardized by SMPTE ST 268-1:2014
//
//
class dpx_in : public image_in_base
{
public:
dpx_in()
{
file_handle = NULL;
fname = NULL;
line_buffer = NULL;
line_buffer_16bit_samples = NULL;
width = height = 0;
num_comps = 0;
number_of_samples_per_line = 0;
cur_line = 0;
bit_depth[3] = bit_depth[2] = bit_depth[1] = bit_depth[0] = 0;
is_signed[3] = is_signed[2] = is_signed[1] = is_signed[0] = false;
subsampling[3] = subsampling[2] = point(1, 1);
subsampling[1] = subsampling[0] = point(1, 1);
is_byte_swapping_necessary = false;
}
virtual ~dpx_in()
{
close();
if (line_buffer)
free(line_buffer);
if (line_buffer_16bit_samples)
free(line_buffer_16bit_samples);
}
void open(const char* filename);
virtual ui32 read(const line_buf* line, ui32 comp_num);
void close() {
if (file_handle) {
fclose(file_handle);
file_handle = NULL;
}
fname = NULL;
}
size get_size() { assert(file_handle); return size(width, height); }
ui32 get_num_components() { assert(file_handle); return num_comps; }
ui32 get_bit_depth(ui32 comp_num) {
assert(file_handle && comp_num < num_comps);
return bit_depth[comp_num];
}
bool get_is_signed(ui32 comp_num) {
assert(file_handle && comp_num < num_comps);
return is_signed[comp_num];
}
point get_comp_subsampling(ui32 comp_num) {
assert(file_handle && comp_num < num_comps);
return subsampling[comp_num];
}
private:
FILE* file_handle;
const char* fname;
void* line_buffer;
ui32 width, height;
ui32 num_comps;
ui32 cur_line;
ui32 bit_depth[4];
bool is_signed[4];
point subsampling[4];
ui32 number_of_samples_per_line;
ui16* line_buffer_16bit_samples;
// DPX specific members
bool is_byte_swapping_necessary;
// file info header
ui32 offset_to_image_data_in_bytes;
char version[8];
ui32 total_image_file_size_in_bytes;
// image information header
ui16 image_orientation;
ui16 number_of_image_elements;
ui32 pixels_per_line;
ui32 lines_per_image_element;
// image element 1
ui32 data_sign_for_image_element_1;
ui8 descriptor_for_image_element_1;
ui8 transfer_characteristic_for_image_element_1;
ui8 colormetric_specification_for_image_element_1;
ui8 bitdepth_for_image_element_1;
ui16 packing_for_image_element_1;
ui16 encoding_for_image_element_1;
ui32 offset_to_data_for_image_element_1;
size_t number_of_32_bit_words_per_line;
};
//
//
//
//
//
class yuv_in : public image_in_base
{
public:
yuv_in()
{
fh = NULL;
fname = NULL;
temp_buf = NULL;
for (int i = 0; i < 3; ++i)
{
width[i] = height[i] = bit_depth[i] = 0;
subsampling[i] = point(1,1);
comp_address[i] = 0;
bytes_per_sample[i] = 0;
}
num_com = 0;
cur_line = 0;
last_comp = 0;
planar = false;
}
virtual ~yuv_in()
{
close();
if (temp_buf)
free(temp_buf);
}
void open(const char* filename);
virtual ui32 read(const line_buf* line, ui32 comp_num);
void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
void set_bit_depth(ui32 num_bit_depths, ui32* bit_depth);
void set_img_props(const size& s, ui32 num_components,
ui32 num_downsampling, const point *downsampling);
ui32 get_num_components() { assert(fh); return num_com; }
ui32 *get_bit_depth() { assert(fh); return bit_depth; }
point *get_comp_subsampling() { assert(fh); return subsampling; }
private:
FILE *fh;
const char *fname;
void *temp_buf;
ui32 width[3], height[3], num_com;
ui32 bytes_per_sample[3];
ui32 comp_address[3];
ui32 cur_line, last_comp;
bool planar;
ui32 bit_depth[3];
point subsampling[3];
};
//
//
//
//
//
class raw_in : public image_in_base
{
public:
raw_in()
{
fh = NULL;
fname = NULL;
width = height = bit_depth = 0;
bytes_per_sample = 0;
is_signed = false;
cur_line = 0;
buffer = NULL;
buffer_size = 0;
}
virtual ~raw_in()
{
close();
if (buffer)
free(buffer);
}
void open(const char* filename);
virtual ui32 read(const line_buf* line, ui32 comp_num = 0);
void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
void set_img_props(const size& s, ui32 bit_depth, bool is_signed);
ui32 get_bit_depth() { assert(fh); return bit_depth; }
bool get_is_signed() { assert(fh); return is_signed; }
private:
FILE *fh;
const char *fname;
ui32 width, height, bit_depth;
ui32 bytes_per_sample;
bool is_signed;
ui32 cur_line;
void* buffer;
size_t buffer_size;
};
//
//
//
//
//
class pfm_in : public image_in_base
{
public:
pfm_in(mem_fixed_allocator *p = NULL)
{
fh = 0;
fname = NULL;
alloc_p = p;
temp_buf = NULL;
temp_buf_byte_size = 0;
bit_depth[0] = bit_depth[1] = bit_depth[2] = 32;
scale = 0.0f;
little_endian = true;
width = height = num_comps = 0;
cur_line = 0;
start_of_data = 0;
}
virtual ~pfm_in()
{
close();
if (alloc_p == NULL && temp_buf)
free(temp_buf);
}
void open(const char* filename);
void finalize_alloc();
void configure(ui32* bit_depth) {
assert(num_comps != 0);
for (ui32 c = 0; c < num_comps; ++c)
this->bit_depth[c] = bit_depth[c];
}
virtual ui32 read(const line_buf* line, ui32 comp_num);
void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
size get_size() { assert(fh); return size(width, height); }
ui32 get_width() { assert(fh); return width; }
ui32 get_height() { assert(fh); return height; }
ui32 get_num_components() { assert(fh); return num_comps; }
private:
FILE *fh;
const char *fname;
mem_fixed_allocator *alloc_p;
float *temp_buf;
size_t temp_buf_byte_size;
ui32 bit_depth[3]; // this truncates data to bit_depth in the LSB
float scale;
bool little_endian;
ui32 width, height, num_comps;
ui32 cur_line;
si64 start_of_data;
};
// Accelerators (defined in ojph_img_io_*)
typedef void (*conversion_fun)(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void gen_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void gen_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void gen_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void gen_cvrt_32b3c_to_16ub3c_le(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void gen_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void gen_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void sse41_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void sse41_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void sse41_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void sse41_cvrt_32b3c_to_16ub3c_le(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void sse41_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void sse41_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void avx2_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void avx2_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void avx2_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
void avx2_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1,
const line_buf *ln2, void *dp,
ui32 bit_depth, ui32 count);
//
//
//
//
//
class image_out_base
{
public:
virtual ~image_out_base() {}
virtual ui32 write(const line_buf* line, ui32 comp_num) = 0;
virtual void close() {}
};
//
//
//
//
//
class ppm_out : public image_out_base
{
public:
ppm_out()
{
fh = NULL;
fname = NULL;
buffer = NULL;
width = height = num_components = 0;
bit_depth = bytes_per_sample = 0;
buffer_size = 0;
cur_line = samples_per_line = bytes_per_line = 0;
converter = NULL;
lptr[0] = lptr[1] = lptr[2] = 0;
}
virtual ~ppm_out()
{
close();
if (buffer)
free(buffer);
}
void open(char* filename);
void configure(ui32 width, ui32 height, ui32 num_components,
ui32 bit_depth);
virtual ui32 write(const line_buf* line, ui32 comp_num);
virtual void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
private:
FILE *fh;
const char *fname;
ui32 width, height, num_components;
ui32 bit_depth, bytes_per_sample;
ui8* buffer;
size_t buffer_size;
ui32 cur_line, samples_per_line, bytes_per_line;
conversion_fun converter;
const line_buf *lptr[3];
};
#ifdef OJPH_ENABLE_TIFF_SUPPORT
//
//
//
//
//
class tif_out : public image_out_base
{
public:
tif_out()
{
tiff_handle = NULL;
fname = NULL;
buffer = NULL;
width = height = num_components = 0;
bytes_per_sample = 0;
bit_depth_of_data[0] = bit_depth_of_data[1] = 0;
bit_depth_of_data[2] = bit_depth_of_data[3] = 0;
buffer_size = 0;
cur_line = samples_per_line = 0;
bytes_per_line = 0;
planar_configuration = 0;
}
virtual ~tif_out()
{
close();
if (buffer)
free(buffer);
}
void open(char* filename);
void configure(ui32 width, ui32 height, ui32 num_components,
ui32 *bit_depth);
virtual ui32 write(const line_buf* line, ui32 comp_num);
virtual void close() {
if (tiff_handle) {
TIFFClose(tiff_handle);
tiff_handle = NULL;
}
fname = NULL;
}
private:
TIFF* tiff_handle;
size_t bytes_per_line;
unsigned short planar_configuration;
const char* fname;
ui32 width, height, num_components;
ui32 bit_depth_of_data[4];
ui32 bytes_per_sample;
ui8* buffer;
size_t buffer_size;
ui32 cur_line, samples_per_line;
};
#endif /* OJPH_ENABLE_TIFF_SUPPORT */
//
//
//
//
//
class yuv_out : public image_out_base
{
public:
yuv_out()
{
fh = NULL;
fname = NULL;
width = num_components = 0;
bit_depth = 0;
comp_width = NULL;
buffer = NULL;
buffer_size = 0;
}
virtual ~yuv_out();
void open(char* filename);
void configure(ui32 bit_depth, ui32 num_components, ui32 *comp_width);
virtual ui32 write(const line_buf* line, ui32 comp_num);
virtual void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
private:
FILE *fh;
const char *fname;
ui32 width;
ui32 num_components;
ui32 bit_depth;
ui32 *comp_width;
ui8 *buffer;
ui32 buffer_size;
};
//
//
//
//
//
class raw_out : public image_out_base
{
public:
raw_out()
{
fh = NULL;
fname = NULL;
is_signed = false;
bit_depth = bytes_per_sample = 0;
lower_val = upper_val = 0;
width = 0;
buffer = NULL;
buffer_size = 0;
}
virtual ~raw_out();
void open(char* filename);
void configure(bool is_signed, ui32 bit_depth, ui32 width);
virtual ui32 write(const line_buf* line, ui32 comp_num = 0);
virtual void close() { if (fh) { fclose(fh); fh = NULL; } fname = NULL; }
private:
FILE* fh;
const char* fname;
bool is_signed;
ui32 bit_depth, bytes_per_sample;
si64 lower_val, upper_val;
ui32 width;
ui8* buffer;
ui32 buffer_size;
};
//
//
//
//
//
class pfm_out : public image_out_base
{
public:
pfm_out()
{
fh = NULL;
fname = NULL;
buffer = NULL;
buffer_size = 0;
width = height = num_components = 0;
scale = -1.0f;
bit_depth[0] = bit_depth[1] = bit_depth[2] = 32;
cur_line = 0;
start_of_data = 0;
}
virtual ~pfm_out()
{
close();
if (buffer)
free(buffer);
}
void open(char* filename);
void configure(ui32 width, ui32 height, ui32 num_components,
float scale, ui32* bit_depth);
virtual ui32 write(const line_buf* line, ui32 comp_num);
virtual void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
private:
FILE *fh;
const char *fname;
float* buffer;
size_t buffer_size;
ui32 width, height, num_components;
float scale;
ui32 bit_depth[3];
ui32 cur_line;
si64 start_of_data;
};
}
#endif // !OJPH_IMG_IO_H
ojph::dpx_in::get_num_components
ui32 get_num_components()
Definition ojph_img_io.h:284
ojph::dpx_in::line_buffer
void * line_buffer
Definition ojph_img_io.h:302
ojph::dpx_in::get_is_signed
bool get_is_signed(ui32 comp_num)
Definition ojph_img_io.h:289
ojph::dpx_in::number_of_32_bit_words_per_line
size_t number_of_32_bit_words_per_line
Definition ojph_img_io.h:336
ojph::dpx_in::open
void open(const char *filename)
Definition ojph_img_io.cpp:1796
ojph::dpx_in::packing_for_image_element_1
ui16 packing_for_image_element_1
Definition ojph_img_io.h:332
ojph::dpx_in::descriptor_for_image_element_1
ui8 descriptor_for_image_element_1
Definition ojph_img_io.h:328
ojph::dpx_in::dpx_in
dpx_in()
Definition ojph_img_io.h:242
ojph::dpx_in::offset_to_data_for_image_element_1
ui32 offset_to_data_for_image_element_1
Definition ojph_img_io.h:334
ojph::dpx_in::height
ui32 height
Definition ojph_img_io.h:303
ojph::dpx_in::total_image_file_size_in_bytes
ui32 total_image_file_size_in_bytes
Definition ojph_img_io.h:320
ojph::dpx_in::file_handle
FILE * file_handle
Definition ojph_img_io.h:299
ojph::dpx_in::pixels_per_line
ui32 pixels_per_line
Definition ojph_img_io.h:324
ojph::dpx_in::subsampling
point subsampling[4]
Definition ojph_img_io.h:309
ojph::dpx_in::number_of_image_elements
ui16 number_of_image_elements
Definition ojph_img_io.h:323
ojph::dpx_in::bitdepth_for_image_element_1
ui8 bitdepth_for_image_element_1
Definition ojph_img_io.h:331
ojph::dpx_in::read
virtual ui32 read(const line_buf *line, ui32 comp_num)
Definition ojph_img_io.cpp:2038
ojph::dpx_in::line_buffer_16bit_samples
ui16 * line_buffer_16bit_samples
Definition ojph_img_io.h:313
ojph::dpx_in::version
char version[8]
Definition ojph_img_io.h:319
ojph::dpx_in::offset_to_image_data_in_bytes
ui32 offset_to_image_data_in_bytes
Definition ojph_img_io.h:318
ojph::dpx_in::num_comps
ui32 num_comps
Definition ojph_img_io.h:304
ojph::dpx_in::width
ui32 width
Definition ojph_img_io.h:303
ojph::dpx_in::get_bit_depth
ui32 get_bit_depth(ui32 comp_num)
Definition ojph_img_io.h:285
ojph::dpx_in::encoding_for_image_element_1
ui16 encoding_for_image_element_1
Definition ojph_img_io.h:333
ojph::dpx_in::get_size
size get_size()
Definition ojph_img_io.h:283
ojph::dpx_in::number_of_samples_per_line
ui32 number_of_samples_per_line
Definition ojph_img_io.h:311
ojph::dpx_in::~dpx_in
virtual ~dpx_in()
Definition ojph_img_io.h:264
ojph::dpx_in::transfer_characteristic_for_image_element_1
ui8 transfer_characteristic_for_image_element_1
Definition ojph_img_io.h:329
ojph::dpx_in::get_comp_subsampling
point get_comp_subsampling(ui32 comp_num)
Definition ojph_img_io.h:293
ojph::dpx_in::colormetric_specification_for_image_element_1
ui8 colormetric_specification_for_image_element_1
Definition ojph_img_io.h:330
ojph::dpx_in::cur_line
ui32 cur_line
Definition ojph_img_io.h:306
ojph::dpx_in::lines_per_image_element
ui32 lines_per_image_element
Definition ojph_img_io.h:325
ojph::dpx_in::image_orientation
ui16 image_orientation
Definition ojph_img_io.h:322
ojph::dpx_in::is_signed
bool is_signed[4]
Definition ojph_img_io.h:308
ojph::dpx_in::fname
const char * fname
Definition ojph_img_io.h:301
ojph::dpx_in::close
void close()
Definition ojph_img_io.h:275
ojph::dpx_in::bit_depth
ui32 bit_depth[4]
Definition ojph_img_io.h:307
ojph::dpx_in::is_byte_swapping_necessary
bool is_byte_swapping_necessary
Definition ojph_img_io.h:316
ojph::dpx_in::data_sign_for_image_element_1
ui32 data_sign_for_image_element_1
Definition ojph_img_io.h:327
ojph::image_in_base
Definition ojph_img_io.h:67
ojph::image_in_base::close
virtual void close()
Definition ojph_img_io.h:71
ojph::image_in_base::read
virtual ui32 read(const line_buf *line, ui32 comp_num)=0
ojph::image_in_base::~image_in_base
virtual ~image_in_base()
Definition ojph_img_io.h:69
ojph::image_out_base
Definition ojph_img_io.h:576
ojph::image_out_base::write
virtual ui32 write(const line_buf *line, ui32 comp_num)=0
ojph::image_out_base::close
virtual void close()
Definition ojph_img_io.h:580
ojph::image_out_base::~image_out_base
virtual ~image_out_base()
Definition ojph_img_io.h:578
ojph::line_buf
Definition ojph_mem.h:161
ojph::mem_fixed_allocator
Definition ojph_mem.h:59
ojph::pfm_in::pfm_in
pfm_in(mem_fixed_allocator *p=NULL)
Definition ojph_img_io.h:459
ojph::pfm_in::fh
FILE * fh
Definition ojph_img_io.h:497
ojph::pfm_in::little_endian
bool little_endian
Definition ojph_img_io.h:504
ojph::pfm_in::read
virtual ui32 read(const line_buf *line, ui32 comp_num)
Definition ojph_img_io.cpp:649
ojph::pfm_in::bit_depth
ui32 bit_depth[3]
Definition ojph_img_io.h:502
ojph::pfm_in::alloc_p
mem_fixed_allocator * alloc_p
Definition ojph_img_io.h:499
ojph::pfm_in::get_size
size get_size()
Definition ojph_img_io.h:491
ojph::pfm_in::start_of_data
si64 start_of_data
Definition ojph_img_io.h:507
ojph::pfm_in::finalize_alloc
void finalize_alloc()
Definition ojph_img_io.cpp:641
ojph::pfm_in::fname
const char * fname
Definition ojph_img_io.h:498
ojph::pfm_in::height
ui32 height
Definition ojph_img_io.h:505
ojph::pfm_in::get_width
ui32 get_width()
Definition ojph_img_io.h:492
ojph::pfm_in::num_comps
ui32 num_comps
Definition ojph_img_io.h:505
ojph::pfm_in::get_height
ui32 get_height()
Definition ojph_img_io.h:493
ojph::pfm_in::cur_line
ui32 cur_line
Definition ojph_img_io.h:506
ojph::pfm_in::open
void open(const char *filename)
Definition ojph_img_io.cpp:566
ojph::pfm_in::width
ui32 width
Definition ojph_img_io.h:505
ojph::pfm_in::close
void close()
Definition ojph_img_io.h:489
ojph::pfm_in::temp_buf_byte_size
size_t temp_buf_byte_size
Definition ojph_img_io.h:501
ojph::pfm_in::get_num_components
ui32 get_num_components()
Definition ojph_img_io.h:494
ojph::pfm_in::temp_buf
float * temp_buf
Definition ojph_img_io.h:500
ojph::pfm_in::scale
float scale
Definition ojph_img_io.h:503
ojph::pfm_in::configure
void configure(ui32 *bit_depth)
Definition ojph_img_io.h:483
ojph::pfm_in::~pfm_in
virtual ~pfm_in()
Definition ojph_img_io.h:474
ojph::pfm_out::~pfm_out
virtual ~pfm_out()
Definition ojph_img_io.h:791
ojph::pfm_out::fname
const char * fname
Definition ojph_img_io.h:806
ojph::pfm_out::cur_line
ui32 cur_line
Definition ojph_img_io.h:812
ojph::pfm_out::fh
FILE * fh
Definition ojph_img_io.h:805
ojph::pfm_out::num_components
ui32 num_components
Definition ojph_img_io.h:809
ojph::pfm_out::open
void open(char *filename)
Definition ojph_img_io.cpp:726
ojph::pfm_out::buffer_size
size_t buffer_size
Definition ojph_img_io.h:808
ojph::pfm_out::pfm_out
pfm_out()
Definition ojph_img_io.h:779
ojph::pfm_out::scale
float scale
Definition ojph_img_io.h:810
ojph::pfm_out::configure
void configure(ui32 width, ui32 height, ui32 num_components, float scale, ui32 *bit_depth)
Definition ojph_img_io.cpp:746
ojph::pfm_out::write
virtual ui32 write(const line_buf *line, ui32 comp_num)
Definition ojph_img_io.cpp:762
ojph::pfm_out::bit_depth
ui32 bit_depth[3]
Definition ojph_img_io.h:811
ojph::pfm_out::close
virtual void close()
Definition ojph_img_io.h:802
ojph::pfm_out::height
ui32 height
Definition ojph_img_io.h:809
ojph::pfm_out::start_of_data
si64 start_of_data
Definition ojph_img_io.h:813
ojph::pfm_out::buffer
float * buffer
Definition ojph_img_io.h:807
ojph::pfm_out::width
ui32 width
Definition ojph_img_io.h:809
ojph::ppm_in::subsampling
point subsampling[3]
Definition ojph_img_io.h:141
ojph::ppm_in::get_height
ui32 get_height()
Definition ojph_img_io.h:117
ojph::ppm_in::open
void open(const char *filename)
Definition ojph_img_io.cpp:245
ojph::ppm_in::get_num_components
ui32 get_num_components()
Definition ojph_img_io.h:119
ojph::ppm_in::width
ui32 width
Definition ojph_img_io.h:132
ojph::ppm_in::set_planar
void set_planar(bool planar)
Definition ojph_img_io.h:113
ojph::ppm_in::get_size
size get_size()
Definition ojph_img_io.h:115
ojph::ppm_in::num_ele_per_line
ui32 num_ele_per_line
Definition ojph_img_io.h:133
ojph::ppm_in::planar
bool planar
Definition ojph_img_io.h:138
ojph::ppm_in::bytes_per_sample
ui32 bytes_per_sample
Definition ojph_img_io.h:133
ojph::ppm_in::get_width
ui32 get_width()
Definition ojph_img_io.h:116
ojph::ppm_in::max_val_num_bits
ui32 max_val_num_bits
Definition ojph_img_io.h:132
ojph::ppm_in::get_bit_depth
ui32 get_bit_depth(ui32 comp_num)
Definition ojph_img_io.h:120
ojph::ppm_in::fname
const char * fname
Definition ojph_img_io.h:129
ojph::ppm_in::finalize_alloc
void finalize_alloc()
Definition ojph_img_io.cpp:326
ojph::ppm_in::height
ui32 height
Definition ojph_img_io.h:132
ojph::ppm_in::num_comps
ui32 num_comps
Definition ojph_img_io.h:132
ojph::ppm_in::temp_buf_byte_size
ui32 temp_buf_byte_size
Definition ojph_img_io.h:134
ojph::ppm_in::ppm_in
ppm_in(mem_fixed_allocator *p=NULL)
Definition ojph_img_io.h:84
ojph::ppm_in::get_max_val
ui32 get_max_val()
Definition ojph_img_io.h:118
ojph::ppm_in::temp_buf
void * temp_buf
Definition ojph_img_io.h:131
ojph::ppm_in::~ppm_in
virtual ~ppm_in()
Definition ojph_img_io.h:102
ojph::ppm_in::close
void close()
Definition ojph_img_io.h:112
ojph::ppm_in::fh
FILE * fh
Definition ojph_img_io.h:128
ojph::ppm_in::get_comp_subsampling
point get_comp_subsampling(ui32 comp_num)
Definition ojph_img_io.h:124
ojph::ppm_in::alloc_p
mem_fixed_allocator * alloc_p
Definition ojph_img_io.h:130
ojph::ppm_in::get_is_signed
bool get_is_signed(ui32 comp_num)
Definition ojph_img_io.h:122
ojph::ppm_in::cur_line
ui32 cur_line
Definition ojph_img_io.h:136
ojph::ppm_in::is_signed
bool is_signed[3]
Definition ojph_img_io.h:140
ojph::ppm_in::start_of_data
si64 start_of_data
Definition ojph_img_io.h:137
ojph::ppm_in::bit_depth
ui32 bit_depth[3]
Definition ojph_img_io.h:139
ojph::ppm_in::read
virtual ui32 read(const line_buf *line, ui32 comp_num)
Definition ojph_img_io.cpp:338
ojph::ppm_in::max_val
ui32 max_val
Definition ojph_img_io.h:132
ojph::ppm_out::ppm_out
ppm_out()
Definition ojph_img_io.h:593
ojph::ppm_out::num_components
ui32 num_components
Definition ojph_img_io.h:621
ojph::ppm_out::fname
const char * fname
Definition ojph_img_io.h:620
ojph::ppm_out::close
virtual void close()
Definition ojph_img_io.h:616
ojph::ppm_out::height
ui32 height
Definition ojph_img_io.h:621
ojph::ppm_out::width
ui32 width
Definition ojph_img_io.h:621
ojph::ppm_out::open
void open(char *filename)
Definition ojph_img_io.cpp:386
ojph::ppm_out::write
virtual ui32 write(const line_buf *line, ui32 comp_num)
Definition ojph_img_io.cpp:539
ojph::ppm_out::cur_line
ui32 cur_line
Definition ojph_img_io.h:625
ojph::ppm_out::fh
FILE * fh
Definition ojph_img_io.h:619
ojph::ppm_out::bit_depth
ui32 bit_depth
Definition ojph_img_io.h:622
ojph::ppm_out::bytes_per_line
ui32 bytes_per_line
Definition ojph_img_io.h:625
ojph::ppm_out::bytes_per_sample
ui32 bytes_per_sample
Definition ojph_img_io.h:622
ojph::ppm_out::lptr
const line_buf * lptr[3]
Definition ojph_img_io.h:627
ojph::ppm_out::~ppm_out
virtual ~ppm_out()
Definition ojph_img_io.h:605
ojph::ppm_out::converter
conversion_fun converter
Definition ojph_img_io.h:626
ojph::ppm_out::configure
void configure(ui32 width, ui32 height, ui32 num_components, ui32 bit_depth)
Definition ojph_img_io.cpp:446
ojph::ppm_out::samples_per_line
ui32 samples_per_line
Definition ojph_img_io.h:625
ojph::ppm_out::buffer_size
size_t buffer_size
Definition ojph_img_io.h:624
ojph::ppm_out::buffer
ui8 * buffer
Definition ojph_img_io.h:623
ojph::raw_in::close
void close()
Definition ojph_img_io.h:431
ojph::raw_in::bytes_per_sample
ui32 bytes_per_sample
Definition ojph_img_io.h:442
ojph::raw_in::is_signed
bool is_signed
Definition ojph_img_io.h:443
ojph::raw_in::height
ui32 height
Definition ojph_img_io.h:441
ojph::raw_in::bit_depth
ui32 bit_depth
Definition ojph_img_io.h:441
ojph::raw_in::~raw_in
virtual ~raw_in()
Definition ojph_img_io.h:422
ojph::raw_in::get_bit_depth
ui32 get_bit_depth()
Definition ojph_img_io.h:435
ojph::raw_in::width
ui32 width
Definition ojph_img_io.h:441
ojph::raw_in::buffer
void * buffer
Definition ojph_img_io.h:445
ojph::raw_in::cur_line
ui32 cur_line
Definition ojph_img_io.h:444
ojph::raw_in::set_img_props
void set_img_props(const size &s, ui32 bit_depth, bool is_signed)
Definition ojph_img_io.cpp:1591
ojph::raw_in::buffer_size
size_t buffer_size
Definition ojph_img_io.h:446
ojph::raw_in::fname
const char * fname
Definition ojph_img_io.h:440
ojph::raw_in::fh
FILE * fh
Definition ojph_img_io.h:439
ojph::raw_in::open
void open(const char *filename)
Definition ojph_img_io.cpp:1495
ojph::raw_in::raw_in
raw_in()
Definition ojph_img_io.h:411
ojph::raw_in::read
virtual ui32 read(const line_buf *line, ui32 comp_num=0)
Definition ojph_img_io.cpp:1510
ojph::raw_in::get_is_signed
bool get_is_signed()
Definition ojph_img_io.h:436
ojph::raw_out::open
void open(char *filename)
Definition ojph_img_io.cpp:1622
ojph::raw_out::raw_out
raw_out()
Definition ojph_img_io.h:740
ojph::raw_out::configure
void configure(bool is_signed, ui32 bit_depth, ui32 width)
Definition ojph_img_io.cpp:1632
ojph::raw_out::close
virtual void close()
Definition ojph_img_io.h:756
ojph::raw_out::lower_val
si64 lower_val
Definition ojph_img_io.h:763
ojph::raw_out::upper_val
si64 upper_val
Definition ojph_img_io.h:763
ojph::raw_out::fh
FILE * fh
Definition ojph_img_io.h:759
ojph::raw_out::width
ui32 width
Definition ojph_img_io.h:764
ojph::raw_out::~raw_out
virtual ~raw_out()
Definition ojph_img_io.cpp:1610
ojph::raw_out::bit_depth
ui32 bit_depth
Definition ojph_img_io.h:762
ojph::raw_out::buffer_size
ui32 buffer_size
Definition ojph_img_io.h:766
ojph::raw_out::is_signed
bool is_signed
Definition ojph_img_io.h:761
ojph::raw_out::fname
const char * fname
Definition ojph_img_io.h:760
ojph::raw_out::buffer
ui8 * buffer
Definition ojph_img_io.h:765
ojph::raw_out::write
virtual ui32 write(const line_buf *line, ui32 comp_num=0)
Definition ojph_img_io.cpp:1653
ojph::raw_out::bytes_per_sample
ui32 bytes_per_sample
Definition ojph_img_io.h:762
ojph::yuv_in::get_comp_subsampling
point * get_comp_subsampling()
Definition ojph_img_io.h:385
ojph::yuv_in::width
ui32 width[3]
Definition ojph_img_io.h:391
ojph::yuv_in::read
virtual ui32 read(const line_buf *line, ui32 comp_num)
Definition ojph_img_io.cpp:1321
ojph::yuv_in::height
ui32 height[3]
Definition ojph_img_io.h:391
ojph::yuv_in::open
void open(const char *filename)
Definition ojph_img_io.cpp:1296
ojph::yuv_in::temp_buf
void * temp_buf
Definition ojph_img_io.h:390
ojph::yuv_in::fname
const char * fname
Definition ojph_img_io.h:389
ojph::yuv_in::set_img_props
void set_img_props(const size &s, ui32 num_components, ui32 num_downsampling, const point *downsampling)
Definition ojph_img_io.cpp:1351
ojph::yuv_in::set_bit_depth
void set_bit_depth(ui32 num_bit_depths, ui32 *bit_depth)
Definition ojph_img_io.cpp:1378
ojph::yuv_in::yuv_in
yuv_in()
Definition ojph_img_io.h:350
ojph::yuv_in::~yuv_in
virtual ~yuv_in()
Definition ojph_img_io.h:368
ojph::yuv_in::bytes_per_sample
ui32 bytes_per_sample[3]
Definition ojph_img_io.h:392
ojph::yuv_in::get_bit_depth
ui32 * get_bit_depth()
Definition ojph_img_io.h:384
ojph::yuv_in::subsampling
point subsampling[3]
Definition ojph_img_io.h:398
ojph::yuv_in::close
void close()
Definition ojph_img_io.h:377
ojph::yuv_in::num_com
ui32 num_com
Definition ojph_img_io.h:391
ojph::yuv_in::planar
bool planar
Definition ojph_img_io.h:396
ojph::yuv_in::fh
FILE * fh
Definition ojph_img_io.h:388
ojph::yuv_in::get_num_components
ui32 get_num_components()
Definition ojph_img_io.h:383
ojph::yuv_in::bit_depth
ui32 bit_depth[3]
Definition ojph_img_io.h:397
ojph::yuv_in::comp_address
ui32 comp_address[3]
Definition ojph_img_io.h:393
ojph::yuv_in::last_comp
ui32 last_comp
Definition ojph_img_io.h:395
ojph::yuv_in::cur_line
ui32 cur_line
Definition ojph_img_io.h:395
ojph::yuv_out::buffer
ui8 * buffer
Definition ojph_img_io.h:726
ojph::yuv_out::fname
const char * fname
Definition ojph_img_io.h:721
ojph::yuv_out::open
void open(char *filename)
Definition ojph_img_io.cpp:1418
ojph::yuv_out::comp_width
ui32 * comp_width
Definition ojph_img_io.h:725
ojph::yuv_out::num_components
ui32 num_components
Definition ojph_img_io.h:723
ojph::yuv_out::configure
void configure(ui32 bit_depth, ui32 num_components, ui32 *comp_width)
Definition ojph_img_io.cpp:1428
ojph::yuv_out::buffer_size
ui32 buffer_size
Definition ojph_img_io.h:727
ojph::yuv_out::width
ui32 width
Definition ojph_img_io.h:722
ojph::yuv_out::close
virtual void close()
Definition ojph_img_io.h:717
ojph::yuv_out::~yuv_out
virtual ~yuv_out()
Definition ojph_img_io.cpp:1401
ojph::yuv_out::fh
FILE * fh
Definition ojph_img_io.h:720
ojph::yuv_out::write
virtual ui32 write(const line_buf *line, ui32 comp_num)
Definition ojph_img_io.cpp:1447
ojph::yuv_out::yuv_out
yuv_out()
Definition ojph_img_io.h:702
ojph::yuv_out::bit_depth
ui32 bit_depth
Definition ojph_img_io.h:724
ojph
Definition ojph_img_io.h:52
ojph::sse41_cvrt_32b3c_to_8ub3c
void sse41_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::conversion_fun
void(* conversion_fun)(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
Definition ojph_img_io.h:513
ojph::sse41_cvrt_32b3c_to_16ub3c_le
void sse41_cvrt_32b3c_to_16ub3c_le(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::si64
int64_t si64
Definition ojph_defs.h:57
ojph::gen_cvrt_32b3c_to_16ub3c_le
void gen_cvrt_32b3c_to_16ub3c_le(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
Definition ojph_img_io.cpp:163
ojph::avx2_cvrt_32b3c_to_8ub3c
void avx2_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::ui16
uint16_t ui16
Definition ojph_defs.h:52
ojph::gen_cvrt_32b1c_to_16ub1c_le
void gen_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
Definition ojph_img_io.cpp:145
ojph::sse41_cvrt_32b1c_to_16ub1c_be
void sse41_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::avx2_cvrt_32b1c_to_16ub1c_be
void avx2_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::sse41_cvrt_32b1c_to_8ub1c
void sse41_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::avx2_cvrt_32b1c_to_8ub1c
void avx2_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::gen_cvrt_32b3c_to_16ub3c_be
void gen_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
Definition ojph_img_io.cpp:208
ojph::sse41_cvrt_32b1c_to_16ub1c_le
void sse41_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::avx2_cvrt_32b1c_to_16ub1c_le
void avx2_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::gen_cvrt_32b1c_to_8ub1c
void gen_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
Definition ojph_img_io.cpp:99
ojph::sse41_cvrt_32b3c_to_16ub3c_be
void sse41_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
ojph::ui32
uint32_t ui32
Definition ojph_defs.h:54
ojph::ui8
uint8_t ui8
Definition ojph_defs.h:50
ojph::gen_cvrt_32b1c_to_16ub1c_be
void gen_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
Definition ojph_img_io.cpp:190
ojph::gen_cvrt_32b3c_to_8ub3c
void gen_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
Definition ojph_img_io.cpp:118
ojph_base.h
ojph_defs.h
ojph::point
Definition ojph_base.h:58
ojph::size
Definition ojph_base.h:48