OpenJPH: ojph::ppm_in Class Reference

OpenJPH Open-source implementation of JPEG2000 Part-15

Loading...
Searching...
No Matches
ojph::ppm_in Class Reference

`#include <ojph_img_io.h>`

Inheritance diagram for ojph::ppm_in:

## Public Member Functions
| ppm_in (mem_fixed_allocator *p=NULL)
virtual | ~ppm_in ()
void | open (const char *filename)
void | finalize_alloc ()
virtual ui32 | read (const line_buf *line, ui32 comp_num)
void | close ()
void | set_planar (bool planar)
size | get_size ()
ui32 | get_width ()
ui32 | get_height ()
ui32 | get_max_val ()
ui32 | get_num_components ()
ui32 | get_bit_depth (ui32 comp_num)
bool | get_is_signed (ui32 comp_num)
point | get_comp_subsampling (ui32 comp_num)
Public Member Functions inherited from ojph::image_in_base
virtual | ~image_in_base ()

## Private Attributes
FILE * | fh
const char * | fname
mem_fixed_allocator * | alloc_p
void * | temp_buf
ui32 | width
ui32 | height
ui32 | num_comps
ui32 | max_val
ui32 | max_val_num_bits
ui32 | bytes_per_sample
ui32 | 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]

## Detailed Description

Definition at line 81 of file ojph_img_io.h.

## Constructor & Destructor Documentation

## ◆ ppm_in()

ojph::ppm_in::ppm_in | ( | mem_fixed_allocator * | p = NULL | ) |
| inline

Definition at line 84 of file ojph_img_io.h.

References alloc_p, bit_depth, bytes_per_sample, cur_line, fh, fname, height, is_signed, max_val, max_val_num_bits, num_comps, num_ele_per_line, planar, start_of_data, subsampling, temp_buf, temp_buf_byte_size, and width.

## ◆ ~ppm_in()

virtual ojph::ppm_in::~ppm_in | ( |  | ) |
| inlinevirtual

Definition at line 102 of file ojph_img_io.h.

References alloc_p, close(), and temp_buf.

## Member Function Documentation

## ◆ close()

void ojph::ppm_in::close | ( |  | ) |
| inlinevirtual

Reimplemented from ojph::image_in_base.

Definition at line 112 of file ojph_img_io.h.

References fh, and fname.

Referenced by open(), read(), and ~ppm_in().

## ◆ finalize_alloc()

void ojph::ppm_in::finalize_alloc | ( |  | ) |

Definition at line 326 of file ojph_img_io.cpp.

References alloc_p, bytes_per_sample, num_comps, temp_buf, and width.

## ◆ get_bit_depth()

ui32 ojph::ppm_in::get_bit_depth | ( | ui32 | comp_num | ) |
| inline

Definition at line 120 of file ojph_img_io.h.

References bit_depth, fh, and num_comps.

Referenced by load_ppm(), and main().

## ◆ get_comp_subsampling()

point ojph::ppm_in::get_comp_subsampling | ( | ui32 | comp_num | ) |
| inline

Definition at line 124 of file ojph_img_io.h.

References fh, num_comps, and subsampling.

Referenced by main().

## ◆ get_height()

ui32 ojph::ppm_in::get_height | ( |  | ) |
| inline

Definition at line 117 of file ojph_img_io.h.

References fh, and height.

Referenced by load_ppm(), and main().

## ◆ get_is_signed()

bool ojph::ppm_in::get_is_signed | ( | ui32 | comp_num | ) |
| inline

Definition at line 122 of file ojph_img_io.h.

References fh, is_signed, and num_comps.

Referenced by main().

## ◆ get_max_val()

ui32 ojph::ppm_in::get_max_val | ( |  | ) |
| inline

Definition at line 118 of file ojph_img_io.h.

References fh, and max_val.

## ◆ get_num_components()

ui32 ojph::ppm_in::get_num_components | ( |  | ) |
| inline

Definition at line 119 of file ojph_img_io.h.

References fh, and num_comps.

Referenced by load_ppm(), and main().

## ◆ get_size()

size ojph::ppm_in::get_size | ( |  | ) |
| inline

Definition at line 115 of file ojph_img_io.h.

References fh, height, and width.

## ◆ get_width()

ui32 ojph::ppm_in::get_width | ( |  | ) |
| inline

Definition at line 116 of file ojph_img_io.h.

References fh, and width.

Referenced by load_ppm(), and main().

## ◆ open()

void ojph::ppm_in::open | ( | const char * | filename | ) |

Definition at line 245 of file ojph_img_io.cpp.

References alloc_p, bit_depth, bytes_per_sample, close(), ojph::count_leading_zeros(), cur_line, ojph::eat_white_spaces(), fh, fname, height, max_val, max_val_num_bits, num_comps, num_ele_per_line, OJPH_ERROR, ojph::ojph_ftell(), start_of_data, temp_buf, temp_buf_byte_size, and width.

Referenced by load_ppm(), and main().

## ◆ read()

ui32 ojph::ppm_in::read | ( | const line_buf * | line,
|  | ui32 | comp_num )
| virtual

Implements ojph::image_in_base.

Definition at line 338 of file ojph_img_io.cpp.

References bytes_per_sample, close(), cur_line, fh, fname, height, ojph::line_buf::i32, num_comps, num_ele_per_line, OJPH_ERROR, ojph::ojph_fseek(), planar, ojph::line_buf::size, start_of_data, ojph::swap_bytes_if_le(), temp_buf, temp_buf_byte_size, and width.

Referenced by load_ppm().

## ◆ set_planar()

void ojph::ppm_in::set_planar | ( | bool | planar | ) |
| inline

Definition at line 113 of file ojph_img_io.h.

References planar.

Referenced by load_ppm().

## Member Data Documentation

## ◆ alloc_p

mem_fixed_allocator* ojph::ppm_in::alloc_p
| private

Definition at line 130 of file ojph_img_io.h.

Referenced by finalize_alloc(), open(), ppm_in(), and ~ppm_in().

## ◆ bit_depth

ui32 ojph::ppm_in::bit_depth[3]
| private

Definition at line 139 of file ojph_img_io.h.

Referenced by get_bit_depth(), open(), and ppm_in().

## ◆ bytes_per_sample

ui32 ojph::ppm_in::bytes_per_sample
| private

Definition at line 133 of file ojph_img_io.h.

Referenced by finalize_alloc(), open(), ppm_in(), and read().

## ◆ cur_line

ui32 ojph::ppm_in::cur_line
| private

Definition at line 136 of file ojph_img_io.h.

Referenced by open(), ppm_in(), and read().

## ◆ fh

FILE* ojph::ppm_in::fh
| private

Definition at line 128 of file ojph_img_io.h.

Referenced by close(), get_bit_depth(), get_comp_subsampling(), get_height(), get_is_signed(), get_max_val(), get_num_components(), get_size(), get_width(), open(), ppm_in(), and read().

## ◆ fname

const char* ojph::ppm_in::fname
| private

Definition at line 129 of file ojph_img_io.h.

Referenced by close(), open(), ppm_in(), and read().

## ◆ height

ui32 ojph::ppm_in::height
| private

Definition at line 132 of file ojph_img_io.h.

Referenced by get_height(), get_size(), open(), ppm_in(), and read().

## ◆ is_signed

bool ojph::ppm_in::is_signed[3]
| private

Definition at line 140 of file ojph_img_io.h.

Referenced by get_is_signed(), and ppm_in().

## ◆ max_val

ui32 ojph::ppm_in::max_val
| private

Definition at line 132 of file ojph_img_io.h.

Referenced by get_max_val(), open(), and ppm_in().

## ◆ max_val_num_bits

ui32 ojph::ppm_in::max_val_num_bits
| private

Definition at line 132 of file ojph_img_io.h.

Referenced by open(), and ppm_in().

## ◆ num_comps

ui32 ojph::ppm_in::num_comps
| private

Definition at line 132 of file ojph_img_io.h.

Referenced by finalize_alloc(), get_bit_depth(), get_comp_subsampling(), get_is_signed(), get_num_components(), open(), ppm_in(), and read().

## ◆ num_ele_per_line

ui32 ojph::ppm_in::num_ele_per_line
| private

Definition at line 133 of file ojph_img_io.h.

Referenced by open(), ppm_in(), and read().

## ◆ planar

bool ojph::ppm_in::planar
| private

Definition at line 138 of file ojph_img_io.h.

Referenced by ppm_in(), read(), and set_planar().

## ◆ start_of_data

si64 ojph::ppm_in::start_of_data
| private

Definition at line 137 of file ojph_img_io.h.

Referenced by open(), ppm_in(), and read().

## ◆ subsampling

point ojph::ppm_in::subsampling[3]
| private

Definition at line 141 of file ojph_img_io.h.

Referenced by get_comp_subsampling(), and ppm_in().

## ◆ temp_buf

void* ojph::ppm_in::temp_buf
| private

Definition at line 131 of file ojph_img_io.h.

Referenced by finalize_alloc(), open(), ppm_in(), read(), and ~ppm_in().

## ◆ temp_buf_byte_size

ui32 ojph::ppm_in::temp_buf_byte_size
| private

Definition at line 134 of file ojph_img_io.h.

Referenced by open(), ppm_in(), and read().

## ◆ width

ui32 ojph::ppm_in::width
| private

Definition at line 132 of file ojph_img_io.h.

Referenced by finalize_alloc(), get_size(), get_width(), open(), ppm_in(), and read().

The documentation for this class was generated from the following files:

- /build/openjph/src/OpenJPH/src/apps/common/ojph_img_io.h
- /build/openjph/src/OpenJPH/src/apps/others/ojph_img_io.cpp