67 bool is_signed = (Data[2] >> 4) & 1;
68 bool reversible = (Data[2] >> 5) & 1;
69 bool color_transform = (Data[2] >> 6) & 1;
71 bool planar = (Data[3] >> 3) & 1;
73 if (num_decomps > 5) num_decomps = 5;
74 if (num_comps < 3) color_transform =
false;
75 if (color_transform) planar =
false;
77 const uint8_t *pixels = Data + 4;
78 size_t pixels_len = Size - 4;
119 dp[x] = is_signed ? val - 128 : val;
121 line = cs.
exchange(line, next_comp);
127 catch (
const std::exception &)
The object represent a codestream.
param_siz access_siz()
Returns the underlying SIZ marker segment object.
param_cod access_cod()
Returns the underlying COD marker segment object.
void close()
Call this function to close the underlying file; works for both encoding and decoding codestreams.
void set_planar(bool planar)
Sets the sequence of pushing or pull rows from the machinery.
line_buf * exchange(line_buf *line, ui32 &next_component)
This call is used to send image data rows to the library. We expect to send one row from a single com...
param_qcd access_qcd()
Returns the underlying QCD marker segment object.
void write_headers(outfile_base *file, const comment_exchange *comments=NULL, ui32 num_comments=0)
Writes codestream headers when the codestream is used for writing. This function should be called aft...
void flush()
This is the last call to a writing (encoding) codestream. This will write encoded bitstream data to t...
mem_outfile stores encoded j2k codestreams in memory
void open(size_t initial_size=65536, bool clear_mem=false)
Call this function to open a memory file.
void set_num_decomposition(ui32 num_decompositions)
void set_color_transform(bool color_transform)
void set_reversible(bool reversible)
void set_irrev_quant(float delta)
Set the irreversible quantization base delta.
void set_component(ui32 comp_num, const point &downsampling, ui32 bit_depth, bool is_signed)
void set_num_components(ui32 num_comps)
void set_image_extent(point extent)
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)