def _get_default_jp2_boxes(self):
<EOL>boxes = [JPEG2000SignatureBox(),<EOL>FileTypeBox(),<EOL>JP2HeaderBox(),<EOL>ContiguousCodestreamBox()]<EOL>height = self.codestream.segment[<NUM_LIT:1>].ysiz<EOL>width = self.codestream.segment[<NUM_LIT:1>].xsiz<EOL>num_components = len(self.codestream.segment[<NUM_LIT:1>].xrsiz)<EOL>if num_components < <NUM_LIT:3>:<EOL><INDENT>colorspace = core.GREYSCALE<EOL><DEDENT>else:<EOL><INDENT>if len(self.box) == <NUM_LIT:0>:<EOL><INDENT>colorspace = core.SRGB<EOL><DEDENT>else:<EOL><INDENT>jp2hs = [box for box in self.box if box.box_id == '<STR_LIT>']<EOL>colorspace = jp2hs[<NUM_LIT:0>].box[<NUM_LIT:1>].colorspace<EOL><DEDENT><DEDENT>boxes[<NUM_LIT:2>].box = [ImageHeaderBox(height=height, width=width,<EOL>num_components=num_components),<EOL>ColourSpecificationBox(colorspace=colorspace)]<EOL>return boxes<EOL>
Create a default set of JP2 boxes.