Skip navigation links

Package io.scif.media.imageio.plugins.jpeg2000

Package containing the public classes used by the Sun JPEG 2000 plug-in for the Image I/O Framework.

See: Description

Package io.scif.media.imageio.plugins.jpeg2000 Description

Package containing the public classes used by the Sun JPEG 2000 plug-in for the Image I/O Framework.

Image Metadata

Document Type Definition

The DTD for the native image metadata format is as follows:

<!DOCTYPE "com_sun_media_imageio_plugins_jpeg2000_image_1.0" [ 

  <!ELEMENT com_sun_media_imageio_plugins_jpeg2000_image_1.0 (JPEG2000SignatureBox,
                                              JPEG2000FileTypeBox,
                                              OtherBoxes) >

  <!-- JPEG2000HeaderSuperBox should be before JPEG2000CodeStreamBox;  This
      is the only constraint for the sequence of these boxes -->
  <!ELEMENT OtherBoxes (JPEG2000HeaderSuperBox,
                          JPEG2000CodeStreamBox,
                          JPEG2000IntellectualPropertyRightsBox*,
                          JPEG2000XMLBox*,
                          JPEG2000UUIDBox*,
                          JPEG2000UUIDInfoBox*)>

  <!-- JPEG 2000 Signature box -->
  <!ELEMENT JPEG2000SignatureBox EMPTY>
    <!ATTLIST JPEG2000SignatureBox
              Length CDATA #FIXED "12"
              Type CDATA #FIXED "jP  "
              Signature CDATA #FIXED "0x0D0A870A">

  <!-- JPEG 2000 File type box -->
  <!ELEMENT JPEG2000FileTypeBox (Brand, MinorVersion, CompatibilityList) >
    <!ELEMENT Brand (#PCDATA)>
    <!ELEMENT MinorVersion (#PCDATA)>
    <!ELEMENT CompatibilityList (#PCDATA)>
    <!ATTLIST JPEG2000FileTypeBox
              Length CDATA #FIXED "12"
              Type CDATA #FIXED "jP  "
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 header super box-->
  <!ELEMENT JPEG2000HeaderSuperBox (JPEG2000HeaderBox, OptionalBoxes) >
    <!ELEMENT OptionalBoxes (JPEG2000BitsPerComponentBox,
                                JPEG2000ColorSpecificationBox,
                                JPEG2000PaletteBox?,
                                JPEG2000ComponentMappingBox?,
                                JPEG2000ChannelDefinitionBox?,
                                JPEG2000ResolutionBox?)>
    <!ATTLIST JPEG2000HeaderSuperBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "jp2h"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 image header box -->
  <!ELEMENT JPEG2000HeaderBox (Width, Height, NumComponents, BitDepth,
                                 CompressionType, UnknownColorspace,
                                 IntellectualProperty)>
    <!ELEMENT Width (#PCDATA)>
    <!ELEMENT Height (#PCDATA)>
    <!ELEMENT NumComponents (#PCDATA)>
    <!ELEMENT BitDepth (#PCDATA)>
    <!ELEMENT CompressionType (#PCDATA)>
    <!ELEMENT UnknownColorspace (#PCDATA)>
    <!ELEMENT IntellectualProperty (#PCDATA)>
    <!ATTLIST JPEG2000HeaderBox
              Length CDATA #FIXED "22"
              Type CDATA #FIXED "ihdr">

  <!-- JPEG 2000 bits per component box -->
  <!ELEMENT JPEG2000BitsPerComponentBox (BitDepth)>
    <!ATTLIST JPEG2000BitsPerComponentBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "bpcc"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 color specification box -->
  <!ELEMENT JPEG2000ColorSpecificationBox (Method, Precedence,
                                             ApproximationAccuracy,
                                             EnumeratedColorSpace,
                                             ICCProfile)>
    <!ELEMENT Method (#PCDATA)>
    <!ELEMENT Precedence (#PCDATA)>
    <!ELEMENT ApproximationAccuracy (#PCDATA)>
    <!ELEMENT EnumeratedColorSpace (#PCDATA)>
    <!ELEMENT ICCProfile (#PCDATA)>
    <!ATTLIST JPEG2000ColorSpecificationBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "colr"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 palette box -->
  <!ELEMENT JPEG2000PaletteBox (NumberEntries, NumberColors,
                                  BitDepth,
                                  LUT)>
    <!ELEMENT NumberEntries (#PCDATA)>
    <!ELEMENT NumberColors (#PCDATA)>
    <!ELEMENT LUT (LUTRow*)>
    <!ELEMENT LUTRow (#PCDATA)>
    <!ATTLIST JPEG2000PaletteBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "pclr"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 component mapping box-->
  <!ELEMENT JPEG2000ComponentMappingBox (Component, ComponentType,
                                           ComponentAssociation)>
    <!ELEMENT Component (#PCDATA)>
    <!ELEMENT ComponentType (#PCDATA)>
    <!ELEMENT ComponentAssociation (#PCDATA)>
    <!ATTLIST JPEG2000ComponentMappingBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "cmap"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 channel definition box-->
  <!ELEMENT JPEG2000ChannelDefinitionBox (NumberOfDefinition, Definitions)>
    <!ELEMENT NumberOfDefinition (#PCDATA)>
    <!ELEMENT Definitions (ChannelNumber, ChannelType)*>
    <!ELEMENT ChannelNumber (#PCDATA)>
    <!ELEMENT ChannelType (#PCDATA)>
    <!ELEMENT ChannelAssociation (#PCDATA)>
    <!ATTLIST JPEG2000ChannelDefinitionBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "cdef"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 resolution box-->
  <!ELEMENT JPEG2000ResolutionBox (JPEG2000CaptureResolutionBox,
                                     JPEG2000DefaultDisplayResolutionBox)>
    <!ATTLIST JPEG2000ResolutionBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "res "
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 capture resolution box-->
  <!ELEMENT JPEG2000CaptureResolutionBox (VerticalResolutionNumerator,
                                            VerticalResolutionDenominator,
                                            HorizontalResolutionNumerator,
                                            HorizontalResolutionDenominator,
                                            VerticalResolutionExponent,
                                            HorizontalResolutionExponent)>
    <!ELEMENT VerticalResolutionNumerator (#PCDATA)>
    <!ELEMENT VerticalResolutionDenominator (#PCDATA)>
    <!ELEMENT HorizontalResolutionNumerator (#PCDATA)>
    <!ELEMENT HorizontalResolutionDenominator (#PCDATA)>
    <!ELEMENT VerticalResolutionExponent (#PCDATA)>
    <!ELEMENT HorizontalResolutionExponent (#PCDATA)>
    <!ATTLIST JPEG2000CaptureResolutionBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "resc"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 default display resolution box-->
  <!ELEMENT JPEG2000DefaultDisplayResolutionBox (VerticalResolutionNumerator,
                                            VerticalResolutionDenominator,
                                            HorizontalResolutionNumerator,
                                            HorizontalResolutionDenominator,
                                            VerticalResolutionExponent,
                                            HorizontalResolutionExponent)>
    <!ATTLIST JPEG2000DefaultDisplayResolutionBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "resd"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 code stream box-->
  <!ELEMENT JPEG2000CodeStreamBox (CodeStream)>
    <!ELEMENT CodeStream (#PCDATA)>
    <!ATTLIST JPEG2000CodeStreamBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "jp2c"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 intellectual property rights box-->
  <!ELEMENT JPEG2000IntellectualPropertyRightsBox (Content)>
    <!ELEMENT Content (#PCDATA)>
    <!ATTLIST JPEG2000IntellectualPropertyRightsBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "jp2i"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 XML box-->
  <!ELEMENT JPEG2000XMLBox (Content)>
    <!ATTLIST JPEG2000XMLBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "xml "
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 UUID box-->
  <!ELEMENT JPEG2000UUIDBox (UUID, Data)>
    <!ELEMENT UUID (#PCDATA)>
    <!ELEMENT Data (#PCDATA)>
    <!ATTLIST JPEG2000UUIDBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "uuid"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 UUID info box-->
  <!ELEMENT JPEG2000UUIDInfoBox (JPEG2000UUIDListBox, JPEG2000DataEntryURLBox)>
    <!ATTLIST JPEG2000UUIDInfoBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "uinf"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 UUID list box-->
  <!ELEMENT JPEG2000UUIDListBox (NumberUUID, UUID*)>
    <!ELEMENT NumberUUID (#PCDATA)>
    <!ATTLIST JPEG2000UUIDListBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "ulst"
              ExtraLength CDATA #IMPLIED>

  <!-- JPEG 2000 Data Entry URL box-->
  <!ELEMENT JPEG2000DataEntryURLBox (Version, Flags, Location)>
    <!ELEMENT Version (#PCDATA)>
    <!ELEMENT Flags (#PCDATA)>
    <!ELEMENT URL (#PCDATA)>
    <!ATTLIST JPEG2000DataEntryURLBox
              Length CDATA #REQUIRED
              Type CDATA #FIXED "url "
              ExtraLength CDATA #IMPLIED> ]

XML Schema

The XML schema for the native image metadata format is as follows:

<?xml version="1.0" ?>
<!--Schema for JPEG 2000 image format -->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://io.scif.media.imageio"
            targetNamespace="http://io.scif.media.imageio">

  <!-- JPEG 2000 Image File-->
  <xsd:element name="com_sun_media_imageio_plugins_jpeg2000_image_1.0">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="JPEG2000SignatureBox" />
        <xsd:element ref="JPEG2000FileTypeBox" />
        <!-- JPEG2000HeaderSuperBox should be before JPEG2000CodeStreamBox;
          This is the only constraint for the sequence of these boxes -->
        <xsd:element name="OtherBoxes">
        <xsd:complexType>
          <xsd:all>
            <xsd:element ref="JPEG2000HeaderSuperBox" />
            <xsd:element ref="JPEG2000CodeStreamBox" />

            <xsd:element ref="JPEG2000IntellectualPropertyRightsBox" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element ref="JPEG2000XMLBox" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element ref="JPEG2000UUIDBox" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element ref="JPEG2000UUIDInfoBox" minOccurs="0" maxOccurs="unbounded" />
          </xsd:all>
        </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 Signature box -->
  <xsd:element name="JPEG2000SignatureBox">
    <xsd:complexType>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" fixed="12" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="jP  " />
      <xsd:attribute name="Signature" type="xsd:hexBinary" use="required" fixed="0D0A870A" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 File type box -->
  <xsd:element name="JPEG2000FileTypeBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Brand" type = "xsd:unsignedInt" />

        <xsd:element name="MinorVersion" minOccurs="0">
          <xsd:simpleType>
            <xsd:restriction base="xsd:unsignedInt">
              <xsd:enumeration value="0" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>

        <xsd:element name="CompatibilityList" type="IntegerList" />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="ftyp" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 header super box-->
  <xsd:element name="JPEG2000HeaderSuperBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="JPEG2000HeaderBox" />
        <xsd:element name="OptionalBoxes" minOccurs="0" >
          <xsd:complexType>
            <xsd:all>
              <xsd:element ref="JPEG2000BitsPerComponentBox" />
              <xsd:element ref="JPEG2000ColorSpecificationBox" />
              <xsd:element ref="JPEG2000PaletteBox" minOccurs="0" />
              <xsd:element ref="JPEG2000ComponentMappingBox" minOccurs="0" />
              <xsd:element ref="JPEG2000ChannelDefinitionBox" minOccurs="0" />
              <xsd:element ref="JPEG2000ResolutionBox" minOccurs="0" />
            </xsd:all>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="jp2h" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 image header box -->
  <xsd:element name="JPEG2000HeaderBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Width" type="xsd:unsignedInt" />
        <xsd:element name="Height" type="xsd:unsignedInt" />
        <xsd:element name="NumComponents" type="xsd:unsignedShort" />
        <xsd:element name="BitDepth" type="xsd:byte" />
        <xsd:element name="CompressionType" type="xsd:unsignedByte" />
        <xsd:element name="UnknownColorspace" type="xsd:unsignedByte" />
        <xsd:element name="IntellectualProperty">
          <xsd:simpleType>
            <xsd:restriction base="xsd:unsignedByte">
              <xsd:enumeration value="0" />
              <xsd:enumeration value="1" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>

      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" fixed="22" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="ihdr" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 bits per component box -->
  <xsd:element name="JPEG2000BitsPerComponentBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="BitDepth" type="ByteList" />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="bpcc" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 color specification box -->
  <xsd:element name="JPEG2000ColorSpecificationBox">
    <xsd:complexType>
      <xsd:sequence>

        <xsd:element name="Method">
          <xsd:simpleType>
            <xsd:restriction base="xsd:unsignedByte">
              <xsd:enumeration value="1" />
              <xsd:enumeration value="2" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>

        <xsd:element name="Precedence" type="xsd:byte" />
        <xsd:element name="ApproximationAccuracy" type="xsd:byte" />
        <xsd:element name="EnumeratedColorSpace" type="xsd:unsignedInt" />
        <xsd:element name="ICCProfile" type="xsd:anyType" />

      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="colr" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 palette box -->
  <xsd:element name="JPEG2000PaletteBox">
    <xsd:complexType>
      <xsd:sequence>

        <xsd:element name="NumberEntries">
          <xsd:simpleType>
            <xsd:restriction base="xsd:unsignedShort">
              <xsd:minInclusive value="1" />
              <xsd:maxInclusive value="1024" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>

        <xsd:element name="NumberColors">
          <xsd:simpleType>
            <xsd:restriction base="xsd:unsignedShort">
              <xsd:minInclusive value="1" />
              <xsd:maxInclusive value="255" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>

        <xsd:element name="BitDepth" type="ByteList" />

        <xsd:element name="LUT">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="LUTRow" maxOccurs="unbounded" type="ByteList" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>

      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="pclr" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 component mapping box-->
  <xsd:element name="JPEG2000ComponentMappingBox">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element name="Component" type="xsd:unsignedShort" />
        <xsd:element name="ComponentType" type="xsd:unsignedByte" />
        <xsd:element name="ComponentAssociation" type="xsd:unsignedByte" />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="cmap" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 channel definition box-->
  <xsd:element name="JPEG2000ChannelDefinitionBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="NumberOfDefinition" type="xsd:unsignedShort" />
        <xsd:element name="Definitions">
          <xsd:complexType>
            <xsd:sequence maxOccurs="unbounded">
              <xsd:element name="ChannelNumber" type="xsd:unsignedShort" />
              <xsd:element name="ChannelType">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:unsignedShort">
                    <xsd:enumeration value="0" />
                    <xsd:enumeration value="1" />
                    <xsd:enumeration value="2" />
                    <xsd:enumeration value="65535" />
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name="ChannelAssociation" type="xsd:unsignedShort" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="cdef" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 resolution box-->
  <xsd:element name="JPEG2000ResolutionBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="JPEG2000CaptureResolutionBox" minOccurs="0" />
        <xsd:element ref="JPEG2000DefaultDisplayResolutionBox" minOccurs="0" />
      </xsd:sequence>

      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="res " />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 capture resolution box-->
  <xsd:element name="JPEG2000CaptureResolutionBox">
    <xsd:complexType>

      <xsd:sequence>
        <xsd:element name="VerticalResolutionNumerator" type="xsd:unsignedShort" />
        <xsd:element name="VerticalResolutionDenominator" type="xsd:unsignedShort" />
        <xsd:element name="HorizontalResolutionNumerator" type="xsd:unsignedShort" />
        <xsd:element name="HorizontalResolutionDenominator" type="xsd:unsignedShort" />
        <xsd:element name="VerticalResolutionExponent" type="xsd:byte" />
        <xsd:element name="HorizontalResolutionExponent" type="xsd:byte" />
      </xsd:sequence>

      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" fixed ="18" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="resc" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 default display resolution box-->
  <xsd:element name="JPEG2000DefaultDisplayResolutionBox">
    <xsd:complexType>

      <xsd:sequence>
        <xsd:element name="VerticalResolutionNumerator" type="xsd:unsignedShort" />
        <xsd:element name="VerticalResolutionDenominator" type="xsd:unsignedShort" />
        <xsd:element name="HorizontalResolutionNumerator" type="xsd:unsignedShort" />
        <xsd:element name="HorizontalResolutionDenominator" type="xsd:unsignedShort" />
        <xsd:element name="VerticalResolutionExponent" type="xsd:byte" />
        <xsd:element name="HorizontalResolutionExponent" type="xsd:byte" />
      </xsd:sequence>

      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" fixed ="18" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="resd" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 code stream box-->
  <xsd:element name="JPEG2000CodeStreamBox" >
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="CodeStream" type="xsd:anyType" />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="jp2c" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 intellectual property rights box-->
  <xsd:element name="JPEG2000IntellectualPropertyRightsBox" >
    <xsd:complexType>
      <xsd:sequence>
        <!-- The structure of this box is defined in Part 2 so keep it
                  general -->
        <xsd:element name="Content" type="xsd:anyType"  />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="jp2i" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 XML box-->
  <xsd:element name="JPEG2000XMLBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Content" type="xsd:string" />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="xml " />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 UUID box-->
  <xsd:element name="JPEG2000UUIDBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="UUID">
          <xsd:simpleType>
            <xsd:restriction base="ByteList">
              <xsd:length value="16" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
        <xsd:element name="Data" type="xsd:anyType" />
      </xsd:sequence>

      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="uuid" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 UUID info box-->
  <xsd:element name="JPEG2000UUIDInfoBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="JPEG2000UUIDListBox" />
        <xsd:element ref="JPEG2000DataEntryURLBox" />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="uinf" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 UUID list box-->
  <xsd:element name="JPEG2000UUIDListBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="NumberUUID" type="xsd:unsignedShort" />
        <xsd:element name="UUID" maxOccurs="unbounded">
          <xsd:simpleType>
            <xsd:restriction base="ByteList">
              <xsd:length value="16" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="ulst" />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- JPEG 2000 Data Entry URL box-->
  <xsd:element name="JPEG2000DataEntryURLBox">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Version" type="xsd:unsignedByte" />
        <xsd:element name="Flags">
          <xsd:simpleType>
            <xsd:restriction base="ByteList">
              <xsd:length value="3" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
        <xsd:element name="URL" type="xsd:anyURI" />
      </xsd:sequence>
      <xsd:attribute name="Length" type="xsd:unsignedInt" use="required" />
      <xsd:attribute name="Type" type="xsd:string" use="required" fixed="url " />
      <xsd:attribute name="ExtraLength" type="LongNoLessThan16" use="optional" />
    </xsd:complexType>
  </xsd:element>

  <!-- The basic types defined and used in JPEG 2000 schema -->
  <xsd:simpleType name="IntegerList">
    <xsd:list itemType="xsd:unsignedInt" />
  </xsd:simpleType>

  <xsd:simpleType name="ByteList">
    <xsd:list itemType="xsd:byte" />
  </xsd:simpleType>

  <xsd:simpleType name="LongNoLessThan16">
    <xsd:restriction base="xsd:long">
      <xsd:minInclusive value="16" />
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>

Standard Image Metadata Derivation

The conversion between the native image metadata format and the standard image metadata format is based on the following mapping:
Standard Metadata Attribute        JP2 Box Element
---------------------------        ---------------
/Chroma
    /ColorSpaceType
        @name                          if UnknownColorSpace in header box is 0
                                   then if EnumeratedColorSpace in
                                        color specification box is 16 --> RGB
                                        if EnumeratedColorSpace in
                                        color specification box is 17 -->GRAY
    /NumChannels
        @value                         if palette box exists
                                        the component number in palette box 
                                   else
                                        the component number in header box
    /Palette                       if palette box exits
        /PaletteEntry
            @index             
            @red               lut[index][0]
            @green             lut[index][1]
            @blue              lut[index][2]
            @alpha             lut[index][3] if the component number is 4

/Compression
    @value                     "JPEG2000"

/Data
    /SampleFormat
        @value                         if the palette box exists, -->"Index"
                                   else if bit depth in header box or 
                                        bits per component box has the sign bit
                                             --> "SignedIntegral"
                                        else --> "UnsignedIntegral"
    /BitsPerSample
        @value                         derive from the bit depth of header box
                                   or bits per component box
    /PlanarConfiguration
        @value                         --> "TileInterleaved"

/Dimension
    /PixelAspectRatio
        @value                         the ratio of the horizontal and vertical
                                   resolution in the capture resolution box
    /HorizontalPhysicalPixelSpacing
        @value                         derived from the horizontal resolution
                                   (in pixel-per-meter) in the capture 
                                   resolution box
    /VerticalPhysicalPixelSpacing 
        @value                     derived from the vertical resolution         
                                   (in pixel-per-meter) in the capture i
                                   resolution box
/Transparency
    /Alpha
        @value                         --> "none" if no channel definition box or
                                        no alpha channel is defined in channel
                                        definition box
                                   --> "nonpremultiplied" if no premultiplied
                                        channel is defined in the channel 
                                        definition box
                                   --> "premultiplied" if any premultiplied
                                        channel(s) defined in the channel 
                                        definition box
/Text
    /TextEntry
        @value                         The content of any XML box; each XML box
                                   defines a TextEntry
Since:
1.0
Skip navigation links

Copyright © 2015–2022 SCIFIO. All rights reserved.