OpenJPH
Open-source implementation of JPEG2000 Part-15
ojph_img_io.h
Go to the documentation of this file.
1//***************************************************************************/
2// This software is released under the 2-Clause BSD license, included
3// below.
4//
5// Copyright (c) 2019, Aous Naman
6// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
7// Copyright (c) 2019, The University of New South Wales, Australia
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12//
13// 1. Redistributions of source code must retain the above copyright
14// notice, this list of conditions and the following disclaimer.
15//
16// 2. Redistributions in binary form must reproduce the above copyright
17// notice, this list of conditions and the following disclaimer in the
18// documentation and/or other materials provided with the distribution.
19//
20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31//***************************************************************************/
32// This file is part of the OpenJPH software implementation.
33// File: ojph_img_io.h
34// Author: Aous Naman
35// Date: 28 August 2019
36//***************************************************************************/
37
38
39#ifndef OJPH_IMG_IO_H
40#define OJPH_IMG_IO_H
41
42#include <cstdio>
43#include <cassert>
44
45#include "ojph_base.h"
46#include "ojph_defs.h"
47
48#ifdef OJPH_ENABLE_TIFF_SUPPORT
49 #include "tiffio.h"
50#endif /* OJPH_ENABLE_TIFF_SUPPORT */
51
52namespace ojph {
53
55 // defined elsewhere
57 struct line_buf;
58
60 //
61 //
62 //
63 //
64 //
67 {
68 public:
69 virtual ~image_in_base() {}
70 virtual ui32 read(const line_buf* line, ui32 comp_num) = 0;
71 virtual void close() {}
72 };
73
75 //
76 //
77 //
78 //
79 //
81 class ppm_in : public image_in_base
82 {
83 public:
85 {
86 fh = 0;
87 fname = NULL;
88 alloc_p = p;
89 temp_buf = NULL;
93
94 cur_line = 0;
95 start_of_data = 0;
96 planar = false;
97
98 bit_depth[2] = bit_depth[1] = bit_depth[0] = 0;
99 is_signed[2] = is_signed[1] = is_signed[0] = false;
100 subsampling[2] = subsampling[1] = subsampling[0] = point(1,1);
101 }
102 virtual ~ppm_in()
103 {
104 close();
105 if (alloc_p == NULL && temp_buf)
106 free(temp_buf);
107 }
108
109 void open(const char* filename);
110 void finalize_alloc();
111 virtual ui32 read(const line_buf* line, ui32 comp_num);
112 void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
113 void set_planar(bool planar) { this->planar = planar; }
114
115 size get_size() { assert(fh); return size(width, height); }
116 ui32 get_width() { assert(fh); return width; }
117 ui32 get_height() { assert(fh); return height; }
118 ui32 get_max_val() { assert(fh); return max_val; }
119 ui32 get_num_components() { assert(fh); return num_comps; }
121 { assert(fh && comp_num < num_comps); return bit_depth[comp_num]; }
122 bool get_is_signed(ui32 comp_num)
123 { assert(fh && comp_num < num_comps); return is_signed[comp_num]; }
125 { assert(fh && comp_num < num_comps); return subsampling[comp_num]; }
126
127 private:
128 FILE *fh;
129 const char *fname;
131 void *temp_buf;
135
140 bool is_signed[3];
142 };
143
145 //
146 //
147 //
148 //
149 //
151#ifdef OJPH_ENABLE_TIFF_SUPPORT
152 class tif_in : public image_in_base
153 {
154 public:
155 tif_in()
156 {
157 tiff_handle = NULL;
158 fname = NULL;
159 line_buffer = NULL;
160 line_buffer_for_planar_support_uint8 = NULL;
161 line_buffer_for_planar_support_uint16 = NULL;
162
163 width = height = num_comps = 0;
164 bytes_per_sample = 0;
165
166 bytes_per_line = 0;
167 planar_configuration = 0;
168
169 cur_line = 0;
170
171 bit_depth[3] = bit_depth[2] = bit_depth[1] = bit_depth[0] = 0;
172 is_signed[3] = is_signed[2] = is_signed[1] = is_signed[0] = false;
173 subsampling[3] = subsampling[2] = point(1, 1);
174 subsampling[1] = subsampling[0] = point(1, 1);
175 }
176 virtual ~tif_in()
177 {
178 close();
179 if (line_buffer)
180 free(line_buffer);
181 if (line_buffer_for_planar_support_uint8)
182 free(line_buffer_for_planar_support_uint8);
183 if (line_buffer_for_planar_support_uint16)
184 free(line_buffer_for_planar_support_uint16);
185 }
186
187 void open(const char* filename);
188 virtual ui32 read(const line_buf* line, ui32 comp_num);
189 void close() {
190 if (tiff_handle) {
191 TIFFClose(tiff_handle);
192 tiff_handle = NULL;
193 }
194 fname = NULL;
195 }
196
197 size get_size() { assert(tiff_handle); return size(width, height); }
198 ui32 get_num_components() { assert(tiff_handle); return num_comps; }
199 void set_bit_depth(ui32 num_bit_depths, ui32* bit_depth);
200 ui32 get_bit_depth(ui32 comp_num) {
201 assert(tiff_handle && comp_num < num_comps);
202 return bit_depth[comp_num];
203 }
204 bool get_is_signed(ui32 comp_num) {
205 assert(tiff_handle && comp_num < num_comps);
206 return is_signed[comp_num];
207 }
208 point get_comp_subsampling(ui32 comp_num) {
209 assert(tiff_handle && comp_num < num_comps);
210 return subsampling[comp_num];
211 }
212
213 private:
214 TIFF* tiff_handle;
215 size_t bytes_per_line;
216 ui16 planar_configuration;
217
218 const char* fname;
219 void* line_buffer;
220 ui8* line_buffer_for_planar_support_uint8;
221 ui16* line_buffer_for_planar_support_uint16;
222 ui32 width, height;
223 ui32 num_comps;
224 ui32 bytes_per_sample;
225 ui32 cur_line;
226 ui32 bit_depth[4];
227 bool is_signed[4];
228 point subsampling[4];
229 };
230#endif /* OJPH_ENABLE_TIFF_SUPPORT */
231
233 // A simple DPX file reader supporting commonly used 10bit and 16bit formats
234 // DPX is an uncompressed file format used by the motion picture industry
235 // DPX is standardized by SMPTE ST 268-1:2014
236 //
237 //
239 class dpx_in : public image_in_base
240 {
241 public:
243 {
244 file_handle = NULL;
245 fname = NULL;
246
247 line_buffer = NULL;
249
250 width = height = 0;
251 num_comps = 0;
252
254
255 cur_line = 0;
256
257 bit_depth[3] = bit_depth[2] = bit_depth[1] = bit_depth[0] = 0;
258 is_signed[3] = is_signed[2] = is_signed[1] = is_signed[0] = false;
259 subsampling[3] = subsampling[2] = point(1, 1);
260 subsampling[1] = subsampling[0] = point(1, 1);
261
263 }
264 virtual ~dpx_in()
265 {
266 close();
267 if (line_buffer)
268 free(line_buffer);
271 }
272
273 void open(const char* filename);
274 virtual ui32 read(const line_buf* line, ui32 comp_num);
275 void close() {
276 if (file_handle) {
277 fclose(file_handle);
278 file_handle = NULL;
279 }
280 fname = NULL;
281 }
282
283 size get_size() { assert(file_handle); return size(width, height); }
286 assert(file_handle && comp_num < num_comps);
287 return bit_depth[comp_num];
288 }
289 bool get_is_signed(ui32 comp_num) {
290 assert(file_handle && comp_num < num_comps);
291 return is_signed[comp_num];
292 }
294 assert(file_handle && comp_num < num_comps);
295 return subsampling[comp_num];
296 }
297
298 private:
300
301 const char* fname;
305
308 bool is_signed[4];
310
312
314
315 // DPX specific members
317 // file info header
319 char version[8];
321 // image information header
326 // image element 1
335
337
338 };
339
341 //
342 //
343 //
344 //
345 //
347 class yuv_in : public image_in_base
348 {
349 public:
351 {
352 fh = NULL;
353 fname = NULL;
354 temp_buf = NULL;
355 for (int i = 0; i < 3; ++i)
356 {
357 width[i] = height[i] = bit_depth[i] = 0;
358 subsampling[i] = point(1,1);
359 comp_address[i] = 0;
360 bytes_per_sample[i] = 0;
361 }
362 num_com = 0;
363
364 cur_line = 0;
365 last_comp = 0;
366 planar = false;
367 }
368 virtual ~yuv_in()
369 {
370 close();
371 if (temp_buf)
372 free(temp_buf);
373 }
374
375 void open(const char* filename);
376 virtual ui32 read(const line_buf* line, ui32 comp_num);
377 void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
378
379 void set_bit_depth(ui32 num_bit_depths, ui32* bit_depth);
380 void set_img_props(const size& s, ui32 num_components,
381 ui32 num_downsampling, const point *downsampling);
382
383 ui32 get_num_components() { assert(fh); return num_com; }
384 ui32 *get_bit_depth() { assert(fh); return bit_depth; }
385 point *get_comp_subsampling() { assert(fh); return subsampling; }
386
387 private:
388 FILE *fh;
389 const char *fname;
390 void *temp_buf;
394
396 bool planar;
399 };
400
402 //
403 //
404 //
405 //
406 //
408 class raw_in : public image_in_base
409 {
410 public:
412 {
413 fh = NULL;
414 fname = NULL;
415 width = height = bit_depth = 0;
417 is_signed = false;
418 cur_line = 0;
419 buffer = NULL;
420 buffer_size = 0;
421 }
422 virtual ~raw_in()
423 {
424 close();
425 if (buffer)
426 free(buffer);
427 }
428
429 void open(const char* filename);
430 virtual ui32 read(const line_buf* line, ui32 comp_num = 0);
431 void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
432
433 void set_img_props(const size& s, ui32 bit_depth, bool is_signed);
434
435 ui32 get_bit_depth() { assert(fh); return bit_depth; }
436 bool get_is_signed() { assert(fh); return is_signed; }
437
438 private:
439 FILE *fh;
440 const char *fname;
445 void* buffer;
447 };
448
450 // Accelerators (defined in ojph_img_io_*)
451 typedef void (*conversion_fun)(const line_buf *ln0, const line_buf *ln1,
452 const line_buf *ln2, void *dp,
453 ui32 bit_depth, ui32 count);
454
455 void gen_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1,
456 const line_buf *ln2, void *dp,
457 ui32 bit_depth, ui32 count);
458 void gen_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1,
459 const line_buf *ln2, void *dp,
460 ui32 bit_depth, ui32 count);
461 void gen_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1,
462 const line_buf *ln2, void *dp,
463 ui32 bit_depth, ui32 count);
464 void gen_cvrt_32b3c_to_16ub3c_le(const line_buf *ln0, const line_buf *ln1,
465 const line_buf *ln2, void *dp,
466 ui32 bit_depth, ui32 count);
467 void gen_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1,
468 const line_buf *ln2, void *dp,
469 ui32 bit_depth, ui32 count);
470 void gen_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1,
471 const line_buf *ln2, void *dp,
472 ui32 bit_depth, ui32 count);
473
474 void sse41_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1,
475 const line_buf *ln2, void *dp,
476 ui32 bit_depth, ui32 count);
477 void sse41_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1,
478 const line_buf *ln2, void *dp,
479 ui32 bit_depth, ui32 count);
480 void sse41_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1,
481 const line_buf *ln2, void *dp,
482 ui32 bit_depth, ui32 count);
483 void sse41_cvrt_32b3c_to_16ub3c_le(const line_buf *ln0, const line_buf *ln1,
484 const line_buf *ln2, void *dp,
485 ui32 bit_depth, ui32 count);
486 void sse41_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1,
487 const line_buf *ln2, void *dp,
488 ui32 bit_depth, ui32 count);
489 void sse41_cvrt_32b3c_to_16ub3c_be(const line_buf *ln0, const line_buf *ln1,
490 const line_buf *ln2, void *dp,
491 ui32 bit_depth, ui32 count);
492
493 void avx2_cvrt_32b1c_to_8ub1c(const line_buf *ln0, const line_buf *ln1,
494 const line_buf *ln2, void *dp,
495 ui32 bit_depth, ui32 count);
496 void avx2_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1,
497 const line_buf *ln2, void *dp,
498 ui32 bit_depth, ui32 count);
499 void avx2_cvrt_32b1c_to_16ub1c_le(const line_buf *ln0, const line_buf *ln1,
500 const line_buf *ln2, void *dp,
501 ui32 bit_depth, ui32 count);
502 void avx2_cvrt_32b1c_to_16ub1c_be(const line_buf *ln0, const line_buf *ln1,
503 const line_buf *ln2, void *dp,
504 ui32 bit_depth, ui32 count);
505
507 //
508 //
509 //
510 //
511 //
514 {
515 public:
516 virtual ~image_out_base() {}
517 virtual ui32 write(const line_buf* line, ui32 comp_num) = 0;
518 virtual void close() {}
519 };
520
522 //
523 //
524 //
525 //
526 //
528 class ppm_out : public image_out_base
529 {
530 public:
532 {
533 fh = NULL;
534 fname = NULL;
535 buffer = NULL;
538 buffer_size = 0;
540 converter = NULL;
541 lptr[0] = lptr[1] = lptr[2] = 0;
542 }
543 virtual ~ppm_out()
544 {
545 close();
546 if (buffer)
547 free(buffer);
548 }
549
550 void open(char* filename);
553 virtual ui32 write(const line_buf* line, ui32 comp_num);
554 virtual void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
555
556 private:
557 FILE *fh;
558 const char *fname;
565 const line_buf *lptr[3];
566 };
567
568#ifdef OJPH_ENABLE_TIFF_SUPPORT
570 //
571 //
572 //
573 //
574 //
576
577 class tif_out : public image_out_base
578 {
579 public:
580 tif_out()
581 {
582 tiff_handle = NULL;
583 fname = NULL;
584 buffer = NULL;
585 width = height = num_components = 0;
586 bytes_per_sample = 0;
587 bit_depth_of_data[0] = bit_depth_of_data[1] = 0;
588 bit_depth_of_data[2] = bit_depth_of_data[3] = 0;
589 buffer_size = 0;
590 cur_line = samples_per_line = 0;
591 bytes_per_line = 0;
592
593 planar_configuration = 0;
594 }
595 virtual ~tif_out()
596 {
597 close();
598 if (buffer)
599 free(buffer);
600 }
601
602 void open(char* filename);
603 void configure(ui32 width, ui32 height, ui32 num_components,
604 ui32 *bit_depth);
605 virtual ui32 write(const line_buf* line, ui32 comp_num);
606 virtual void close() {
607 if (tiff_handle) {
608 TIFFClose(tiff_handle);
609 tiff_handle = NULL;
610 }
611 fname = NULL;
612 }
613
614 private:
615 TIFF* tiff_handle;
616 size_t bytes_per_line;
617 unsigned short planar_configuration;
618
619 const char* fname;
620 ui32 width, height, num_components;
621 ui32 bit_depth_of_data[4];
622 ui32 bytes_per_sample;
623 ui8* buffer;
624 ui32 buffer_size;
625 ui32 cur_line, samples_per_line;
626 };
627#endif /* OJPH_ENABLE_TIFF_SUPPORT */
628
629
631 //
632 //
633 //
634 //
635 //
637 class yuv_out : public image_out_base
638 {
639 public:
641 {
642 fh = NULL;
643 fname = NULL;
644 width = num_components = 0;
645 bit_depth = 0;
646 comp_width = NULL;
647 buffer = NULL;
648 buffer_size = 0;
649 }
650 virtual ~yuv_out();
651
652 void open(char* filename);
654 virtual ui32 write(const line_buf* line, ui32 comp_num);
655 virtual void close() { if(fh) { fclose(fh); fh = NULL; } fname = NULL; }
656
657 private:
658 FILE *fh;
659 const char *fname;
666 };
667
669 //
670 //
671 //
672 //
673 //
675 class raw_out : public image_out_base
676 {
677 public:
679 {
680 fh = NULL;
681 fname = NULL;
682 is_signed = false;
684 lower_val = upper_val = 0;
685 width = 0;
686 buffer = NULL;
687 buffer_size = 0;
688 }
689 virtual ~raw_out();
690
691 void open(char* filename);
693 virtual ui32 write(const line_buf* line, ui32 comp_num = 0);
694 virtual void close() { if (fh) { fclose(fh); fh = NULL; } fname = NULL; }
695
696 private:
697 FILE* fh;
698 const char* fname;
705 };
706}
707
708#endif // !OJPH_IMG_IO_H
ui32 get_num_components()
Definition: ojph_img_io.h:284
void * line_buffer
Definition: ojph_img_io.h:302
bool get_is_signed(ui32 comp_num)
Definition: ojph_img_io.h:289
size_t number_of_32_bit_words_per_line
Definition: ojph_img_io.h:336
void open(const char *filename)
ui16 packing_for_image_element_1
Definition: ojph_img_io.h:332
ui8 descriptor_for_image_element_1
Definition: ojph_img_io.h:328
ui32 offset_to_data_for_image_element_1
Definition: ojph_img_io.h:334
ui32 total_image_file_size_in_bytes
Definition: ojph_img_io.h:320
FILE * file_handle
Definition: ojph_img_io.h:299
ui32 pixels_per_line
Definition: ojph_img_io.h:324
point subsampling[4]
Definition: ojph_img_io.h:309
ui16 number_of_image_elements
Definition: ojph_img_io.h:323
ui8 bitdepth_for_image_element_1
Definition: ojph_img_io.h:331
virtual ui32 read(const line_buf *line, ui32 comp_num)
ui16 * line_buffer_16bit_samples
Definition: ojph_img_io.h:313
char version[8]
Definition: ojph_img_io.h:319
ui32 offset_to_image_data_in_bytes
Definition: ojph_img_io.h:318
ui32 get_bit_depth(ui32 comp_num)
Definition: ojph_img_io.h:285
ui16 encoding_for_image_element_1
Definition: ojph_img_io.h:333
size get_size()
Definition: ojph_img_io.h:283
ui32 number_of_samples_per_line
Definition: ojph_img_io.h:311
virtual ~dpx_in()
Definition: ojph_img_io.h:264
ui8 transfer_characteristic_for_image_element_1
Definition: ojph_img_io.h:329
point get_comp_subsampling(ui32 comp_num)
Definition: ojph_img_io.h:293
ui8 colormetric_specification_for_image_element_1
Definition: ojph_img_io.h:330
ui32 lines_per_image_element
Definition: ojph_img_io.h:325
ui16 image_orientation
Definition: ojph_img_io.h:322
bool is_signed[4]
Definition: ojph_img_io.h:308
const char * fname
Definition: ojph_img_io.h:301
void close()
Definition: ojph_img_io.h:275
ui32 bit_depth[4]
Definition: ojph_img_io.h:307
bool is_byte_swapping_necessary
Definition: ojph_img_io.h:316
ui32 data_sign_for_image_element_1
Definition: ojph_img_io.h:327
virtual void close()
Definition: ojph_img_io.h:71
virtual ui32 read(const line_buf *line, ui32 comp_num)=0
virtual ~image_in_base()
Definition: ojph_img_io.h:69
virtual ui32 write(const line_buf *line, ui32 comp_num)=0
virtual void close()
Definition: ojph_img_io.h:518
virtual ~image_out_base()
Definition: ojph_img_io.h:516
point subsampling[3]
Definition: ojph_img_io.h:141
ui32 get_height()
Definition: ojph_img_io.h:117
void open(const char *filename)
ui32 get_num_components()
Definition: ojph_img_io.h:119
void set_planar(bool planar)
Definition: ojph_img_io.h:113
size get_size()
Definition: ojph_img_io.h:115
ui32 num_ele_per_line
Definition: ojph_img_io.h:133
ui32 bytes_per_sample
Definition: ojph_img_io.h:133
ui32 get_width()
Definition: ojph_img_io.h:116
ui32 max_val_num_bits
Definition: ojph_img_io.h:132
ui32 get_bit_depth(ui32 comp_num)
Definition: ojph_img_io.h:120
const char * fname
Definition: ojph_img_io.h:129
void finalize_alloc()
ui32 temp_buf_byte_size
Definition: ojph_img_io.h:134
ppm_in(mem_fixed_allocator *p=NULL)
Definition: ojph_img_io.h:84
ui32 get_max_val()
Definition: ojph_img_io.h:118
void * temp_buf
Definition: ojph_img_io.h:131
virtual ~ppm_in()
Definition: ojph_img_io.h:102
void close()
Definition: ojph_img_io.h:112
point get_comp_subsampling(ui32 comp_num)
Definition: ojph_img_io.h:124
mem_fixed_allocator * alloc_p
Definition: ojph_img_io.h:130
bool get_is_signed(ui32 comp_num)
Definition: ojph_img_io.h:122
bool is_signed[3]
Definition: ojph_img_io.h:140
si64 start_of_data
Definition: ojph_img_io.h:137
ui32 bit_depth[3]
Definition: ojph_img_io.h:139
virtual ui32 read(const line_buf *line, ui32 comp_num)
ui32 num_components
Definition: ojph_img_io.h:559
const char * fname
Definition: ojph_img_io.h:558
virtual void close()
Definition: ojph_img_io.h:554
void open(char *filename)
virtual ui32 write(const line_buf *line, ui32 comp_num)
ui32 bytes_per_line
Definition: ojph_img_io.h:563
ui32 bytes_per_sample
Definition: ojph_img_io.h:560
const line_buf * lptr[3]
Definition: ojph_img_io.h:565
virtual ~ppm_out()
Definition: ojph_img_io.h:543
conversion_fun converter
Definition: ojph_img_io.h:564
void configure(ui32 width, ui32 height, ui32 num_components, ui32 bit_depth)
ui32 samples_per_line
Definition: ojph_img_io.h:563
void close()
Definition: ojph_img_io.h:431
ui32 bytes_per_sample
Definition: ojph_img_io.h:442
virtual ~raw_in()
Definition: ojph_img_io.h:422
ui32 get_bit_depth()
Definition: ojph_img_io.h:435
void * buffer
Definition: ojph_img_io.h:445
void set_img_props(const size &s, ui32 bit_depth, bool is_signed)
size_t buffer_size
Definition: ojph_img_io.h:446
const char * fname
Definition: ojph_img_io.h:440
void open(const char *filename)
virtual ui32 read(const line_buf *line, ui32 comp_num=0)
bool get_is_signed()
Definition: ojph_img_io.h:436
void open(char *filename)
void configure(bool is_signed, ui32 bit_depth, ui32 width)
virtual void close()
Definition: ojph_img_io.h:694
virtual ~raw_out()
const char * fname
Definition: ojph_img_io.h:698
virtual ui32 write(const line_buf *line, ui32 comp_num=0)
ui32 bytes_per_sample
Definition: ojph_img_io.h:700
point * get_comp_subsampling()
Definition: ojph_img_io.h:385
ui32 width[3]
Definition: ojph_img_io.h:391
virtual ui32 read(const line_buf *line, ui32 comp_num)
ui32 height[3]
Definition: ojph_img_io.h:391
void open(const char *filename)
void * temp_buf
Definition: ojph_img_io.h:390
const char * fname
Definition: ojph_img_io.h:389
void set_img_props(const size &s, ui32 num_components, ui32 num_downsampling, const point *downsampling)
void set_bit_depth(ui32 num_bit_depths, ui32 *bit_depth)
virtual ~yuv_in()
Definition: ojph_img_io.h:368
ui32 bytes_per_sample[3]
Definition: ojph_img_io.h:392
ui32 * get_bit_depth()
Definition: ojph_img_io.h:384
point subsampling[3]
Definition: ojph_img_io.h:398
void close()
Definition: ojph_img_io.h:377
ui32 get_num_components()
Definition: ojph_img_io.h:383
ui32 bit_depth[3]
Definition: ojph_img_io.h:397
ui32 comp_address[3]
Definition: ojph_img_io.h:393
const char * fname
Definition: ojph_img_io.h:659
void open(char *filename)
ui32 * comp_width
Definition: ojph_img_io.h:663
ui32 num_components
Definition: ojph_img_io.h:661
void configure(ui32 bit_depth, ui32 num_components, ui32 *comp_width)
virtual void close()
Definition: ojph_img_io.h:655
virtual ~yuv_out()
virtual ui32 write(const line_buf *line, ui32 comp_num)
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(* 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:451
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)
int64_t si64
Definition: ojph_defs.h:57
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 avx2_cvrt_32b3c_to_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)
uint16_t ui16
Definition: ojph_defs.h:52
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 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 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)
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 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 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_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_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_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
int32_t si32
Definition: ojph_defs.h:55
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)
uint32_t ui32
Definition: ojph_defs.h:54
uint8_t ui8
Definition: ojph_defs.h:50
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_8ub3c(const line_buf *ln0, const line_buf *ln1, const line_buf *ln2, void *dp, ui32 bit_depth, ui32 count)