Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 0173 safe crop area editor #197

Merged
merged 7 commits into from Oct 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions spec/profiles/ttml2-full.xml
Expand Up @@ -139,6 +139,7 @@
<feature value="required">#rubyOverhangClass</feature>
<feature value="required">#rubyPosition</feature>
<feature value="required">#rubyReserve</feature>
<feature value="required">#safeCropArea</feature>
<feature value="required">#showBackground</feature>
<feature value="required">#source</feature>
<feature value="required">#structure</feature>
Expand Down
1 change: 1 addition & 0 deletions spec/profiles/ttml2-presentation.xml
Expand Up @@ -144,6 +144,7 @@
<feature value="optional">#rubyOverhangClass</feature>
<feature value="optional">#rubyPosition</feature>
<feature value="optional">#rubyReserve</feature>
<feature value="optional">#safeCropArea</feature>
<feature value="optional">#showBackground</feature>
<feature value="optional">#source</feature>
<feature value="optional">#styling</feature>
Expand Down
1 change: 1 addition & 0 deletions spec/profiles/ttml2-transformation.xml
Expand Up @@ -146,6 +146,7 @@
<feature value="optional">#rubyOverhangClass</feature>
<feature value="optional">#rubyPosition</feature>
<feature value="optional">#rubyReserve</feature>
<feature value="optional">#safeCropArea</feature>
<feature value="optional">#showBackground</feature>
<feature value="optional">#source</feature>
<feature value="optional">#styling</feature>
Expand Down
Binary file modified spec/rnc/schema.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions spec/rnc/ttml2-datatypes.rnc
Expand Up @@ -309,6 +309,9 @@ TTAF.RubyPosition.datatype =
"after" |
"interCharacter"

TTAF.SafeCropArea.datatype =
string

TTAF.ShowBackground.datatype =
"always" |
"whenActive"
Expand Down
3 changes: 3 additions & 0 deletions spec/rnc/ttml2-parameter-attribs.rnc
Expand Up @@ -42,6 +42,8 @@ TTAF.processorProfileCombination.attrib
= attribute ttp:processorProfileCombination { TTAF.ProfileCombination.datatype }?
TTAF.profile.attrib
= attribute ttp:profile { TTAF.Profile.datatype }?
TTAF.safeCropArea.attrib
= attribute ttp:safeCropArea { TTAF.SafeCropArea.datatype }?
TTAF.storageAspectRatio.attrib
= attribute ttp:storageAspectRatio { TTAF.StorageAspectRatio.datatype }?
TTAF.subFrameRate.attrib
Expand Down Expand Up @@ -76,6 +78,7 @@ TTAF.Parameter.attrib.class &=
TTAF.processorProfiles.attrib,
TTAF.processorProfileCombination.attrib,
TTAF.profile.attrib,
TTAF.safeCropArea.attrib,
TTAF.storageAspectRatio.attrib,
TTAF.subFrameRate.attrib,
TTAF.tickRate.attrib,
Expand Down
4 changes: 3 additions & 1 deletion spec/ttml2-changes.html
Expand Up @@ -105,7 +105,9 @@ <h3><a id="change-history-ttml1-rec-2e-to-ttml2-wd"/>1.1 Changes from TTML1 (2nd

* In 5.3.1, add new parameter attribute vocabulary
'ttp:mediaDuration',
'ttp:mediaOffset' and
'ttp:mediaOffset',
'ttp:safeCropArea',
and
'ttp:storageAspectRatio'
to Table 5-5.

Expand Down
210 changes: 131 additions & 79 deletions spec/ttml2.html

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions spec/ttml2.xml
Expand Up @@ -1131,6 +1131,15 @@ that effectively represent the content, styling, layout, and timing of a source
an <loc href="#terms-intermediate-synchronic-document">intermediate synchronic document</loc>.</p>
</def>
</gitem>

<gitem id="terms-higher-level-protocol">
<label>[higher level protocol]</label>
<def>
<p>A protocol or process of the <loc href="#terms-document-processing-context">document processing context</loc>
that is outside the scope of this specification.</p>
</def>
</gitem>

<gitem id="terms-nested-profile">
<label>[nested profile]</label>
<def>
Expand Down Expand Up @@ -3019,6 +3028,7 @@ Parameter Attributes
<loc href="#parameter-attribute-mediaDuration">ttp:mediaDuration</loc>,
<loc href="#parameter-attribute-mediaOffset">ttp:mediaOffset</loc>,
<loc href="#parameter-attribute-pixelAspectRatio">ttp:pixelAspectRatio</loc>,
<loc href="#parameter-attribute-safeCropArea">ttp:safeCropArea</loc>,
<loc href="#parameter-attribute-storageAspectRatio">ttp:storageAspectRatio</loc>,
<loc href="#parameter-attribute-subFrameRate">ttp:subFrameRate</loc>,
<loc href="#parameter-attribute-tickRate">ttp:tickRate</loc>,
Expand Down Expand Up @@ -4390,6 +4400,7 @@ of which TTML Content can be related to an external environment.</p>
<item><p><specref ref="parameter-attribute-mediaDuration"/></p></item>
<item><p><specref ref="parameter-attribute-mediaOffset"/></p></item>
<item><p><specref ref="parameter-attribute-pixelAspectRatio"/></p></item>
<item><p><specref ref="parameter-attribute-safeCropArea"/></p></item>
<item><p><specref ref="parameter-attribute-storageAspectRatio"/></p></item>
<item><p><specref ref="parameter-attribute-subFrameRate"/></p></item>
<item><p><specref ref="parameter-attribute-tickRate"/></p></item>
Expand Down Expand Up @@ -4890,6 +4901,87 @@ If specified, then both numerator and demoninator must be non-zero.</p>
<p>A <att>ttp:pixelAspectRatio</att> attribute is considered to be significant only
when specified on the <el>tt</el> element.</p>
</div3>
<div3 id="parameter-attribute-safeCropArea">
<head>ttp:safeCropArea</head>
<p>The <att>ttp:safeCropArea</att> attribute may be used to designate a rectangular area of the <loc href="#terms-root-container-region">root
container region</loc> outside of which renderable content may be safely cropped during presentation processing.</p>
<note role="motivation">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making origin optional is unnecessarily complex - I would simplify this by requiring it. (incidentally in an early draft of the submission I did exactly the same thing but got strong feedback that it would be better not to do this.)

<p>Under normal circumstances, renderable content within the <loc href="#terms-root-container-region">root container region</loc>
is not cropped during presentation processing. That is, the entirety of the <loc href="#terms-root-container-region">root container region</loc>
is presented. However, under special circumstances, such as when a <loc href="#terms-related-media-object">related media object</loc> is cropped, then
some cropping may also be applied to the <loc href="#terms-root-container-region">root container region</loc>. The <att>ttp:safeCropArea</att> parameter
attribute provides a means for the author to signal a portion of the <loc href="#terms-root-container-region">root container region</loc>
where cropping may safely occur, which is to say that the complement of this portion should not be cropped, i.e., the interior of the
safe crop area is not safe to crop and should remain visible when presented.</p>
</note>
<note role="elaboration">
<p>Alternative names have been suggested for this attribute that would emphasize the intent to ensure that content remains visible as opposed
to suggesting an intent to allow content to be hidden (by cropping). After considering alternatives, the current name has been retained in order to
reflect existing industry practice surrounding this concept.</p>
</note>
<p>If specified, the value of this attribute must adhere to the following syntax:</p>
<table id="parameter-attribute-safeCropArea-syntax" role="syntax">
<caption>Syntax Representation &ndash; ttp:safeCropArea</caption>
<tbody>
<tr>
<td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a very complicated way to say that the width must not be more than 100%.

<eg xml:space="preserve">
ttp:safeCropArea
: origin? extent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, why not simply restrict the height to a maximum of 100%?


origin
: x y

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just remove this by requiring the origin to be specified.

extent
: width height

x, y, width, height
: <loc href="#style-value-percentage">&lt;percentage&gt;</loc> // where <emph>percentage</emph> is non-negative
</eg>
</td>
</tr>
</tbody>
</table>
<p>Computed values of the origin and extent of the safe crop area are determined by the rules described below,
where percentage values are resolved with respect to the width and height of the <loc href="#terms-root-container-region">root container region</loc>.</p>
<note role="explanation">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear what this is trying to achieve, or why it is a good idea. Same goes for height.

For example, say the width is 60% and x is 30%; then the difference between those is 30%, which is smaller than the interim computed value of width, being 60%. So safe crop area is specified as having extent 60% and this clause makes it 30% instead. That seems like an unexpected result.

<p>The intent of the following rules is to ensure
that the safe crop area is bounded by the <loc href="#terms-root-container-region">root container region</loc>.</p>
</note>
<p>The interim computed values of the <emph>width</emph> and <emph>height</emph> of the extent of the safe crop area are determined as follows:</p>
<ulist>
<item><p>the interim computed value of <emph>width</emph>, <emph>I<sub>W</sub></emph>,
is the minimum of the resolved value of the specified <emph>width</emph> and
the computed <emph>width</emph> of the <loc href="#terms-root-container-region">root container region</loc>;</p></item>
<item><p>the interim computed value of <emph>height</emph>, <emph>I<sub>H</sub></emph>,
is the minimum of the resolved value of the specified <emph>height</emph> and
the computed <emph>height</emph> of the <loc href="#terms-root-container-region">root container region</loc>.</p></item>
</ulist>
<p>The computed values of the <emph>x</emph> and <emph>y</emph> of the origin of the safe crop area are determined as follows:</p>
<ulist>
<item><p>if no <code>origin</code> component is specified, then the computed value of <emph>x</emph> is
one half of the difference between the computed <emph>width</emph> of the <loc href="#terms-root-container-region">root container region</loc> and <emph>I<sub>W</sub></emph>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is better. I'm not sure exactly why we need to distinguish the processing context from the higher level protocol - from the perspective of the TTML 2 semantics they seem like they are both "instructions from above" and the precise origin doesn't make any difference.

otherwise, it is the minimum of the resolved value of the specified <emph>x</emph> and the computed <emph>width</emph> of the
<loc href="#terms-root-container-region">root container region</loc>;</p></item>
<item><p>if no <code>origin</code> component is specified, then the computed value of <emph>y</emph> is
one half of the difference between the computed <emph>height</emph> of the <loc href="#terms-root-container-region">root container region</loc> and <emph>I<sub>H</sub></emph>;
otherwise, it is the minimum of the resolved value of the specified <emph>y</emph> and the computed <emph>height</emph> of the
<loc href="#terms-root-container-region">root container region</loc>.</p></item>
</ulist>
<p>The final computed values of the <emph>width</emph> and <emph>height</emph> of the extent of the safe crop area are determined as follows:</p>
<ulist>
<item><p>the final computed value of <emph>width</emph> is the minimum of (1) the difference between the computed <emph>width</emph>
of the <loc href="#terms-root-container-region">root container region</loc> and the computed value of <emph>x</emph> and (2) the interim computed value of <emph>width</emph>,
<emph>I<sub>W</sub></emph>;</p></item>
<item><p>the final computed value of <emph>height</emph> is the minimum of (1) the difference between the computed <emph>height</emph>
of the <loc href="#terms-root-container-region">root container region</loc> and the computed value of <emph>y</emph> and (2) the interim computed value of <emph>height</emph>,
<emph>I<sub>H</sub></emph>.</p></item>
</ulist>
<p>When presented on a visual medium, renderable content within the bounds of the safe crop area must not be cropped unless overridden
by a <loc href="#terms-higher-level-protocol">higher level protocol</loc>.</p>
<p>A <att>ttp:safeCropArea</att> attribute is considered to be significant only
when specified on the <el>tt</el> element.</p>
</div3>
<div3 id="parameter-attribute-storageAspectRatio">
<head>ttp:storageAspectRatio</head>
<p>The <att>ttp:storageAspectRatio</att> attribute may be used to express the <loc href="#terms-storage-aspect-ratio">storage aspect ratio</loc> associated with the
Expand Down Expand Up @@ -19479,6 +19571,15 @@ transforming the <loc href="#style-attribute-rubyReserve"><att>tts:rubyReserve</
<code>#rubyReserve</code> feature if it implements presentation semantic support for the
<loc href="#style-attribute-rubyReserve"><att>tts:rubyReserve</att></loc> attribute.</p>
</div3>
<div3 id="feature-safeCropArea">
<head>#safeCropArea</head>
<p>A TTML <loc href="#terms-transformation-processor">transformation processor</loc> supports the
<code>#safeCropArea</code> feature if it recognizes and is capable of
transforming the <loc href="#parameter-attribute-safeCropArea"><att>ttp:safeCropArea</att></loc> attribute.</p>
<p>A TTML <loc href="#terms-presentation-processor">presentation processor</loc> supports the
<code>#safeCropArea</code> feature if it implements presentation semantic support for the
<loc href="#parameter-attribute-safeCropArea"><att>ttp:safeCropArea</att></loc> attribute.</p>
</div3>
<div3 id="feature-showBackground">
<head>#showBackground</head>
<p>A TTML <loc href="#terms-transformation-processor">transformation processor</loc> supports the
Expand Down Expand Up @@ -20917,6 +21018,11 @@ is optional (O), for transformation and <loc href="#terms-presentation-processor
<td>O</td>
</tr>
<tr>
<td><loc href="#feature-safeCropArea"><code>#safeCropArea</code></loc></td>
<td>O</td>
<td>O</td>
</tr>
<tr>
<td><loc href="#feature-showBackground"><code>#showBackground</code></loc></td>
<td>O</td>
<td>O</td>
Expand Down
Binary file modified spec/xsd/schema.zip
Binary file not shown.
6 changes: 6 additions & 0 deletions spec/xsd/ttml2-datatypes.xsd
Expand Up @@ -571,6 +571,12 @@
<xs:simpleType name="rubyReserve">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="safeCropArea">
<xs:annotation>
<xs:documentation>percentage percentage (percentage percentage)?</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="script">
<xs:restriction base="xs:string"/>
</xs:simpleType>
Expand Down
2 changes: 2 additions & 0 deletions spec/xsd/ttml2-parameter-attribs.xsd
Expand Up @@ -23,6 +23,7 @@
<xs:attribute name="permitFeatureNarrowing" type="ttd:permitFeatureNarrowingOrWidening"/>
<xs:attribute name="permitFeatureWidening" type="ttd:permitFeatureNarrowingOrWidening"/>
<xs:attribute name="profile" type="ttd:profile"/>
<xs:attribute name="safeCropArea" type="ttd:safeCropArea"/>
<xs:attribute name="storageAspectRatio" type="ttd:storageAspectRatio"/>
<xs:attribute name="subFrameRate" type="ttd:subFrameRate"/>
<xs:attribute name="tickRate" type="ttd:tickRate"/>
Expand All @@ -49,6 +50,7 @@
<xs:attribute ref="ttp:processorProfiles"/>
<xs:attribute ref="ttp:processorProfileCombination"/>
<xs:attribute ref="ttp:profile"/>
<xs:attribute ref="ttp:safeCropArea"/>
<xs:attribute ref="ttp:storageAspectRatio"/>
<xs:attribute ref="ttp:subFrameRate"/>
<xs:attribute ref="ttp:tickRate"/>
Expand Down