Lines Matching full:box
53 * Reads a IHDR box - Image Header box
68 * Writes the Image Header box - Image Header box.
79 * Writes the Bit per Component box.
90 * Reads a Bit per Component box.
112 * Writes the Channel Definition box.
123 * Writes the Colour Specification box.
134 * Writes a FTYP box - File type box
147 * Reads a a FTYP box - File type box
149 * @param p_header_data the data contained in the FTYP box.
151 * @param p_header_size the size of the data contained in the FTYP box.
154 * @return true if the FTYP box is valid.
166 * Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).
168 * @param p_header_data the data contained in the file header box.
170 * @param p_header_size the size of the data contained in the file header box.
173 * @return true if the JP2 Header box was successfully recognized.
181 * Writes the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).
194 …* Writes the Jpeg2000 codestream Header box - JP2C Header box. This function must be called AFTER …
208 * Write index Finder box
218 * Write index Finder box
239 * Reads a jpeg2000 file signature box.
241 * @param p_header_data the data contained in the signature box.
243 * @param p_header_size the size of the data contained in the signature box.
246 * @return true if the file signature box is valid.
254 * Writes a jpeg2000 file signature box.
307 * Reads the Color Specification box.
344 * @return true if the box is valid.
366 * Reads a box header. The box is the way data is packed inside a jpeg2000 file structure.
369 * @param box the box structure to fill.
373 * @return true if the box is recognized, false otherwise
375 static OPJ_BOOL opj_jp2_read_boxhdr(opj_jp2_box_t *box,
396 * Finds the image execution function related to the given box id.
405 * Finds the execution function related to the given box id.
432 …* Reads a box header. The box is the way data is packed inside a jpeg2000 file structure. Data is …
434 * @param box the box structure to fill.
437 * @param p_box_max_size the maximum number of bytes in the box.
440 * @return true if the box is recognized, false otherwise
442 static OPJ_BOOL opj_jp2_read_boxhdr_char( opj_jp2_box_t *box,
461 static OPJ_BOOL opj_jp2_read_boxhdr(opj_jp2_box_t *box, in opj_jp2_read_boxhdr() argument
471 assert(box != 00); in opj_jp2_read_boxhdr()
481 opj_read_bytes(l_data_header,&(box->length), 4); in opj_jp2_read_boxhdr()
482 opj_read_bytes(l_data_header+4,&(box->type), 4); in opj_jp2_read_boxhdr()
484 if(box->length == 0)/* last box */ in opj_jp2_read_boxhdr()
487 box->length = (OPJ_UINT32)bleft; in opj_jp2_read_boxhdr()
488 assert( (OPJ_OFF_T)box->length == bleft ); in opj_jp2_read_boxhdr()
492 /* do we have a "special very large box ?" */ in opj_jp2_read_boxhdr()
494 if (box->length == 1) { in opj_jp2_read_boxhdr()
509 opj_event_msg(p_manager, EVT_ERROR, "Cannot handle box sizes higher than 2^32\n"); in opj_jp2_read_boxhdr()
512 opj_read_bytes(l_data_header+4,&(box->length), 4); in opj_jp2_read_boxhdr()
520 opj_jp2_box_t box;
522 box.init_pos = cio_tell(cio);
534 box.length = cio_tell(cio) - box.init_pos;
535 cio_seek(cio, box.init_pos);
536 cio_write(cio, box.length, 4); /* L */
537 cio_seek(cio, box.init_pos + box.length);
552 opj_event_msg(p_manager, EVT_ERROR, "Bad image header box (bad size)\n"); in opj_jp2_read_ihdr()
577 /* Should be equal to 7 cf. chapter about image header box of the norm */ in opj_jp2_read_ihdr()
579 …opj_event_msg(p_manager, EVT_INFO, "JP2 IHDR box: compression type indicate that the file is not a… in opj_jp2_read_ihdr()
608 opj_write_bytes(l_current_ihdr_ptr,22,4); /* write box size */ in opj_jp2_write_ihdr()
645 /* room for 8 bytes for box and 1 byte for each component */ in opj_jp2_write_bpcc()
660 opj_write_bytes(l_current_bpcc_ptr,l_bpcc_size,4); /* write box size */ in opj_jp2_write_bpcc()
691 …j_event_msg(p_manager, EVT_WARNING, "A BPCC header box is available although BPC given by the IHDR… in opj_jp2_read_bpcc()
696 opj_event_msg(p_manager, EVT_ERROR, "Bad BPCC header box (bad size)\n"); in opj_jp2_read_bpcc()
710 /* room for 8 bytes for box, 2 for n */ in opj_jp2_write_cdef()
732 opj_write_bytes(l_current_cdef_ptr,l_cdef_size,4); /* write box size */ in opj_jp2_write_cdef()
762 /* room for 8 bytes for box 3 for common data and variable upon profile*/ in opj_jp2_write_colr()
790 opj_write_bytes(l_current_colr_ptr,l_colr_size,4); /* write box size */ in opj_jp2_write_colr()
1097 opj_event_msg(p_manager, EVT_ERROR, "Invalid PCLR box. Reports %d entries\n", (int)nr_entries); in opj_jp2_read_pclr()
1105 opj_event_msg(p_manager, EVT_ERROR, "Invalid PCLR box. Reports 0 palette columns\n"); in opj_jp2_read_pclr()
1192 opj_event_msg(p_manager, EVT_ERROR, "Need to read a PCLR box before the CMAP box.\n"); in opj_jp2_read_cmap()
1196 /* Part 1, I.5.3.5: 'There shall be at most one Component Mapping box in opj_jp2_read_cmap()
1197 * inside a JP2 Header box' : in opj_jp2_read_cmap()
1200 opj_event_msg(p_manager, EVT_ERROR, "Only one CMAP box is allowed.\n"); in opj_jp2_read_cmap()
1206 opj_event_msg(p_manager, EVT_ERROR, "Insufficient data for CMAP box.\n"); in opj_jp2_read_cmap()
1314 /* Part 1, I.5.3.6: 'The shall be at most one Channel Definition box in opj_jp2_read_cdef()
1315 * inside a JP2 Header box.'*/ in opj_jp2_read_cdef()
1319 opj_event_msg(p_manager, EVT_ERROR, "Insufficient data for CDEF box.\n"); in opj_jp2_read_cdef()
1327 …opj_event_msg(p_manager, EVT_ERROR, "Number of channel description is equal to zero in CDEF box.\n… in opj_jp2_read_cdef()
1332 opj_event_msg(p_manager, EVT_ERROR, "Insufficient data for CDEF box.\n"); in opj_jp2_read_cdef()
1380 opj_event_msg(p_manager, EVT_ERROR, "Bad COLR header box (bad size)\n"); in opj_jp2_read_colr()
1404 opj_event_msg(p_manager, EVT_ERROR, "Bad COLR header box (bad size: %d)\n", p_colr_header_size); in opj_jp2_read_colr()
1409 … opj_event_msg(p_manager, EVT_WARNING, "Bad COLR header box (bad size: %d)\n", p_colr_header_size); in opj_jp2_read_colr()
1450 …opj_event_msg(p_manager, EVT_WARNING, "Bad COLR header box (CIELab, bad size: %d)\n", p_colr_heade… in opj_jp2_read_colr()
1486 conforming JP2 reader shall ignore the entire Colour Specification box.*/ in opj_jp2_read_colr()
1487 opj_event_msg(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), " in opj_jp2_read_colr()
1488 "so we will ignore the entire Colour Specification box. \n", jp2->meth); in opj_jp2_read_colr()
1558 /* size of data for super box*/ in opj_jp2_write_jp2h()
1562 /* to store the data of the super box */ in opj_jp2_write_jp2h()
1589 /* write box header */ in opj_jp2_write_jp2h()
1618 /* write super box size */ in opj_jp2_write_jp2h()
1621 /* write super box data on stream */ in opj_jp2_write_jp2h()
1623 opj_event_msg(p_manager, EVT_ERROR, "Stream error while writing JP2 Header box\n"); in opj_jp2_write_jp2h()
1631 opj_event_msg(p_manager, EVT_ERROR, "Stream error while writing JP2 Header box\n"); in opj_jp2_write_jp2h()
1675 opj_write_bytes(l_current_data_ptr, l_ftyp_size,4); /* box size */ in opj_jp2_write_ftyp()
1751 /* write box length */ in opj_jp2_write_jp()
1753 /* writes box type */ in opj_jp2_write_jp()
1816 /* Profile box */ in opj_jp2_setup_encoder()
1829 /* Image Header box */ in opj_jp2_setup_encoder()
1852 jp2->UnkC = 0; /* UnkC, colorspace specified in colr box */ in opj_jp2_setup_encoder()
1855 /* BitsPerComponent box */ in opj_jp2_setup_encoder()
1860 /* Colour Specification box */ in opj_jp2_setup_encoder()
1875 /* Channel Definition box */ in opj_jp2_setup_encoder()
1899 …opj_event_msg(p_manager, EVT_WARNING, "Alpha channel specified but unknown enumcs. No cdef box wil… in opj_jp2_setup_encoder()
1901 …, "Alpha channel specified but not enough image components for an automatic cdef box creation.\n"); in opj_jp2_setup_encoder()
1904 …EVT_WARNING, "Alpha channel position conflicts with color channel. No cdef box will be created.\n"… in opj_jp2_setup_encoder()
1908 …opj_event_msg(p_manager, EVT_WARNING, "Multiple alpha channels specified. No cdef box will be crea… in opj_jp2_setup_encoder()
2109 opj_jp2_box_t box; in opj_jp2_read_header_procedure() local
2129 while (opj_jp2_read_boxhdr(&box,&l_nb_bytes_read,stream,p_manager)) { in opj_jp2_read_header_procedure()
2130 /* is it the codestream box ? */ in opj_jp2_read_header_procedure()
2131 if (box.type == JP2_JP2C) { in opj_jp2_read_header_procedure()
2143 else if (box.length == 0) { in opj_jp2_read_header_procedure()
2144 opj_event_msg(p_manager, EVT_ERROR, "Cannot handle box of undefined sizes\n"); in opj_jp2_read_header_procedure()
2149 else if (box.length < l_nb_bytes_read) { in opj_jp2_read_header_procedure()
2150 opj_event_msg(p_manager, EVT_ERROR, "invalid box size %d (%x)\n", box.length, box.type); in opj_jp2_read_header_procedure()
2155 l_current_handler = opj_jp2_find_handler(box.type); in opj_jp2_read_header_procedure()
2156 l_current_handler_misplaced = opj_jp2_img_find_handler(box.type); in opj_jp2_read_header_procedure()
2157 l_current_data_size = box.length - l_nb_bytes_read; in opj_jp2_read_header_procedure()
2161 …placed '%c%c%c%c' box outside jp2h box\n", (OPJ_BYTE)(box.type>>24), (OPJ_BYTE)(box.type>>16), (OP… in opj_jp2_read_header_procedure()
2166 …der box not read yet, '%c%c%c%c' box will be ignored\n", (OPJ_BYTE)(box.type>>24), (OPJ_BYTE)(box.… in opj_jp2_read_header_procedure()
2169 opj_event_msg(p_manager, EVT_ERROR, "Problem with skipping JPEG2000 box, stream error\n"); in opj_jp2_read_header_procedure()
2178 …box size %d for box '%c%c%c%c'. Need %d bytes, %d bytes remaining \n", box.length, (OPJ_BYTE)(box.… in opj_jp2_read_header_procedure()
2186 … opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to handle jpeg2000 box\n"); in opj_jp2_read_header_procedure()
2195 opj_event_msg(p_manager, EVT_ERROR, "Problem with reading JPEG2000 box, stream error\n"); in opj_jp2_read_header_procedure()
2207 …sg(p_manager, EVT_ERROR, "Malformed JP2 file format: first box must be JPEG 2000 signature box\n"); in opj_jp2_read_header_procedure()
2212 …j_event_msg(p_manager, EVT_ERROR, "Malformed JP2 file format: second box must be file type box\n"); in opj_jp2_read_header_procedure()
2218 opj_event_msg(p_manager, EVT_ERROR, "Problem with skipping JPEG2000 box, stream error\n"); in opj_jp2_read_header_procedure()
2317 * Finds the image execution function related to the given box id.
2337 * Reads a jpeg2000 file signature box.
2339 * @param p_header_data the data contained in the signature box.
2341 * @param p_header_size the size of the data contained in the signature box.
2344 * @return true if the file signature box is valid.
2361 opj_event_msg(p_manager, EVT_ERROR, "The signature box must be the first box in the file.\n"); in opj_jp2_read_jp()
2367 opj_event_msg(p_manager, EVT_ERROR, "Error with JP signature Box size\n"); in opj_jp2_read_jp()
2384 * Reads a a FTYP box - File type box
2386 * @param p_header_data the data contained in the FTYP box.
2388 * @param p_header_size the size of the data contained in the FTYP box.
2391 * @return true if the FTYP box is valid.
2407 opj_event_msg(p_manager, EVT_ERROR, "The ftyp box must be the second box in the file.\n"); in opj_jp2_read_ftyp()
2413 opj_event_msg(p_manager, EVT_ERROR, "Error with FTYP signature Box size\n"); in opj_jp2_read_ftyp()
2427 opj_event_msg(p_manager, EVT_ERROR, "Error with FTYP signature Box size\n"); in opj_jp2_read_ftyp()
2436 opj_event_msg(p_manager, EVT_ERROR, "Not enough memory with FTYP Box\n"); in opj_jp2_read_ftyp()
2489 * Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).
2491 * @param p_header_data the data contained in the file header box.
2493 * @param p_header_size the size of the data contained in the file header box.
2496 * @return true if the JP2 Header box was successfully recognized.
2505 opj_jp2_box_t box; in opj_jp2_read_jp2h() local
2514 /* make sure the box is well placed */ in opj_jp2_read_jp2h()
2516 opj_event_msg(p_manager, EVT_ERROR, "The box must be the first box in the file.\n"); in opj_jp2_read_jp2h()
2525 if (! opj_jp2_read_boxhdr_char(&box,p_header_data,&l_box_size,p_header_size, p_manager)) { in opj_jp2_read_jp2h()
2526 opj_event_msg(p_manager, EVT_ERROR, "Stream error while reading JP2 Header box\n"); in opj_jp2_read_jp2h()
2530 if (box.length > p_header_size) { in opj_jp2_read_jp2h()
2531 …opj_event_msg(p_manager, EVT_ERROR, "Stream error while reading JP2 Header box: box length is inco… in opj_jp2_read_jp2h()
2535 l_current_handler = opj_jp2_img_find_handler(box.type); in opj_jp2_read_jp2h()
2536 l_current_data_size = box.length - l_box_size; in opj_jp2_read_jp2h()
2548 if (box.type == JP2_IHDR) { in opj_jp2_read_jp2h()
2553 p_header_size -= box.length; in opj_jp2_read_jp2h()
2557 …opj_event_msg(p_manager, EVT_ERROR, "Stream error while reading JP2 Header box: no 'ihdr' box.\n"); in opj_jp2_read_jp2h()
2566 static OPJ_BOOL opj_jp2_read_boxhdr_char( opj_jp2_box_t *box, in opj_jp2_read_boxhdr_char() argument
2577 assert(box != 00); in opj_jp2_read_boxhdr_char()
2582 opj_event_msg(p_manager, EVT_ERROR, "Cannot handle box of less than 8 bytes\n"); in opj_jp2_read_boxhdr_char()
2589 box->length = (OPJ_UINT32)(l_value); in opj_jp2_read_boxhdr_char()
2593 box->type = (OPJ_UINT32)(l_value); in opj_jp2_read_boxhdr_char()
2597 /* do we have a "special very large box ?" */ in opj_jp2_read_boxhdr_char()
2599 if (box->length == 1) { in opj_jp2_read_boxhdr_char()
2603 opj_event_msg(p_manager, EVT_ERROR, "Cannot handle XL box of less than 16 bytes\n"); in opj_jp2_read_boxhdr_char()
2612 opj_event_msg(p_manager, EVT_ERROR, "Cannot handle box sizes higher than 2^32\n"); in opj_jp2_read_boxhdr_char()
2618 box->length = (OPJ_UINT32)(l_value); in opj_jp2_read_boxhdr_char()
2620 if (box->length == 0) { in opj_jp2_read_boxhdr_char()
2621 opj_event_msg(p_manager, EVT_ERROR, "Cannot handle box of undefined sizes\n"); in opj_jp2_read_boxhdr_char()
2625 else if (box->length == 0) { in opj_jp2_read_boxhdr_char()
2626 opj_event_msg(p_manager, EVT_ERROR, "Cannot handle box of undefined sizes\n"); in opj_jp2_read_boxhdr_char()
2629 if (box->length < *p_number_bytes_read) { in opj_jp2_read_boxhdr_char()
2630 opj_event_msg(p_manager, EVT_ERROR, "Box length is inconsistent.\n"); in opj_jp2_read_boxhdr_char()
2877 …opj_event_msg(p_manager, EVT_WARNING, "JP2 box which are after the codestream will not be read by … in opj_jp2_get_tile()