zxing/docs/apidocs/com/google/zxing/PlanarYUVLuminanceSource.html
2017-10-25 18:40:07 +01:00

456 lines
21 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PlanarYUVLuminanceSource (ZXing 3.3.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="PlanarYUVLuminanceSource (ZXing 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PlanarYUVLuminanceSource.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/google/zxing/NotFoundException.html" title="class in com.google.zxing"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/google/zxing/Reader.html" title="interface in com.google.zxing"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/google/zxing/PlanarYUVLuminanceSource.html" target="_top">Frames</a></li>
<li><a href="PlanarYUVLuminanceSource.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.google.zxing</div>
<h2 title="Class PlanarYUVLuminanceSource" class="title">Class PlanarYUVLuminanceSource</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">com.google.zxing.LuminanceSource</a></li>
<li>
<ul class="inheritance">
<li>com.google.zxing.PlanarYUVLuminanceSource</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <span class="typeNameLabel">PlanarYUVLuminanceSource</span>
extends <a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a></pre>
<div class="block">This object extends LuminanceSource around an array of YUV data returned from the camera driver,
with the option to crop to a rectangle within the full data. This can be used to exclude
superfluous pixels around the perimeter and speed up decoding.
It works for any pixel format where the Y channel is planar and appears first, including
YCbCr_420_SP and YCbCr_422_SP.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>dswitkin@google.com (Daniel Switkin)</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#PlanarYUVLuminanceSource-byte:A-int-int-int-int-int-int-boolean-">PlanarYUVLuminanceSource</a></span>(byte[]&nbsp;yuvData,
int&nbsp;dataWidth,
int&nbsp;dataHeight,
int&nbsp;left,
int&nbsp;top,
int&nbsp;width,
int&nbsp;height,
boolean&nbsp;reverseHorizontal)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#crop-int-int-int-int-">crop</a></span>(int&nbsp;left,
int&nbsp;top,
int&nbsp;width,
int&nbsp;height)</code>
<div class="block">Returns a new object with cropped image data.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#getMatrix--">getMatrix</a></span>()</code>
<div class="block">Fetches luminance data for the underlying bitmap.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#getRow-int-byte:A-">getRow</a></span>(int&nbsp;y,
byte[]&nbsp;row)</code>
<div class="block">Fetches one row of luminance data from the underlying platform's bitmap.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#getThumbnailHeight--">getThumbnailHeight</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#getThumbnailWidth--">getThumbnailWidth</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#isCropSupported--">isCropSupported</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#renderThumbnail--">renderThumbnail</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.google.zxing.LuminanceSource">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;com.google.zxing.<a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a></h3>
<code><a href="../../../com/google/zxing/LuminanceSource.html#getHeight--">getHeight</a>, <a href="../../../com/google/zxing/LuminanceSource.html#getWidth--">getWidth</a>, <a href="../../../com/google/zxing/LuminanceSource.html#invert--">invert</a>, <a href="../../../com/google/zxing/LuminanceSource.html#isRotateSupported--">isRotateSupported</a>, <a href="../../../com/google/zxing/LuminanceSource.html#rotateCounterClockwise--">rotateCounterClockwise</a>, <a href="../../../com/google/zxing/LuminanceSource.html#rotateCounterClockwise45--">rotateCounterClockwise45</a>, <a href="../../../com/google/zxing/LuminanceSource.html#toString--">toString</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="PlanarYUVLuminanceSource-byte:A-int-int-int-int-int-int-boolean-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PlanarYUVLuminanceSource</h4>
<pre>public&nbsp;PlanarYUVLuminanceSource(byte[]&nbsp;yuvData,
int&nbsp;dataWidth,
int&nbsp;dataHeight,
int&nbsp;left,
int&nbsp;top,
int&nbsp;width,
int&nbsp;height,
boolean&nbsp;reverseHorizontal)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getRow-int-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRow</h4>
<pre>public&nbsp;byte[]&nbsp;getRow(int&nbsp;y,
byte[]&nbsp;row)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../com/google/zxing/LuminanceSource.html#getRow-int-byte:A-">LuminanceSource</a></code></span></div>
<div class="block">Fetches one row of luminance data from the underlying platform's bitmap. Values range from
0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have
to bitwise and with 0xff for each value. It is preferable for implementations of this method
to only fetch this row rather than the whole image, since no 2D Readers may be installed and
getMatrix() may never be called.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../com/google/zxing/LuminanceSource.html#getRow-int-byte:A-">getRow</a></code>&nbsp;in class&nbsp;<code><a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>y</code> - The row to fetch, which must be in [0,getHeight())</dd>
<dd><code>row</code> - An optional preallocated array. If null or too small, it will be ignored.
Always use the returned object, and ignore the .length of the array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>An array containing the luminance data.</dd>
</dl>
</li>
</ul>
<a name="getMatrix--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMatrix</h4>
<pre>public&nbsp;byte[]&nbsp;getMatrix()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../com/google/zxing/LuminanceSource.html#getMatrix--">LuminanceSource</a></code></span></div>
<div class="block">Fetches luminance data for the underlying bitmap. Values should be fetched using:
<code>int luminance = array[y * width + x] &amp; 0xff</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../com/google/zxing/LuminanceSource.html#getMatrix--">getMatrix</a></code>&nbsp;in class&nbsp;<code><a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A row-major 2D array of luminance values. Do not use result.length as it may be
larger than width * height bytes on some platforms. Do not modify the contents
of the result.</dd>
</dl>
</li>
</ul>
<a name="isCropSupported--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isCropSupported</h4>
<pre>public&nbsp;boolean&nbsp;isCropSupported()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../com/google/zxing/LuminanceSource.html#isCropSupported--">isCropSupported</a></code>&nbsp;in class&nbsp;<code><a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether this subclass supports cropping.</dd>
</dl>
</li>
</ul>
<a name="crop-int-int-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>crop</h4>
<pre>public&nbsp;<a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a>&nbsp;crop(int&nbsp;left,
int&nbsp;top,
int&nbsp;width,
int&nbsp;height)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../com/google/zxing/LuminanceSource.html#crop-int-int-int-int-">LuminanceSource</a></code></span></div>
<div class="block">Returns a new object with cropped image data. Implementations may keep a reference to the
original data rather than a copy. Only callable if isCropSupported() is true.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../com/google/zxing/LuminanceSource.html#crop-int-int-int-int-">crop</a></code>&nbsp;in class&nbsp;<code><a href="../../../com/google/zxing/LuminanceSource.html" title="class in com.google.zxing">LuminanceSource</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>left</code> - The left coordinate, which must be in [0,getWidth())</dd>
<dd><code>top</code> - The top coordinate, which must be in [0,getHeight())</dd>
<dd><code>width</code> - The width of the rectangle to crop.</dd>
<dd><code>height</code> - The height of the rectangle to crop.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A cropped version of this object.</dd>
</dl>
</li>
</ul>
<a name="renderThumbnail--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>renderThumbnail</h4>
<pre>public&nbsp;int[]&nbsp;renderThumbnail()</pre>
</li>
</ul>
<a name="getThumbnailWidth--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getThumbnailWidth</h4>
<pre>public&nbsp;int&nbsp;getThumbnailWidth()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>width of image from <a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#renderThumbnail--"><code>renderThumbnail()</code></a></dd>
</dl>
</li>
</ul>
<a name="getThumbnailHeight--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getThumbnailHeight</h4>
<pre>public&nbsp;int&nbsp;getThumbnailHeight()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>height of image from <a href="../../../com/google/zxing/PlanarYUVLuminanceSource.html#renderThumbnail--"><code>renderThumbnail()</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PlanarYUVLuminanceSource.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/google/zxing/NotFoundException.html" title="class in com.google.zxing"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/google/zxing/Reader.html" title="interface in com.google.zxing"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/google/zxing/PlanarYUVLuminanceSource.html" target="_top">Frames</a></li>
<li><a href="PlanarYUVLuminanceSource.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2007&#x2013;2017. All rights reserved.</small></p>
</body>
</html>