This file contains the implementation of the interface functions for YCRCB2RGB core. Refer to the header file <aclass="el"href="xycrcb2rgb_8h.html">xycrcb2rgb.h</a> for more detailed information.<p>
This function initializes the YCrCb2Rgb core. This function must be called prior to using the YCrCb2Rgb core. Initialization of the YCrCb2Rgb includes setting up the instance data and ensuring the hardware is in a quiescent state.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>CfgPtr</em> </td><td>is a reference to a structure containing information about a specific <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> driver. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>EffectiveAddr</em> </td><td>is the core base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the core physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, pass in the physical address instead.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>- XST_SUCCESS if initialization was successful.</dd></dl>
This function translates the <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___inputs.html">XYCrCb2Rgb_Coef_Inputs</a> structure into the <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___outputs.html">XYCrCb2Rgb_Coef_Outputs</a> structure that can be used to program the core's registers. The <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___inputs.html">XYCrCb2Rgb_Coef_Inputs</a> structure uses the same values as the core's GUIs. The <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___outputs.html">XYCrCb2Rgb_Coef_Outputs</a> structure uses the values that can be programmed into the core's registers.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the XYCrCb2Rgbb instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>CoefIn</em> </td><td>specifies a pointer to a <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___inputs.html">XYCrCb2Rgb_Coef_Inputs</a> structure to be translated. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>CoefOut</em> </td><td>specifies a pointer to a <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___outputs.html">XYCrCb2Rgb_Coef_Outputs</a> structure with translated values. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DataWidth</em> </td><td>specifies a valid range of [8,10,12,16] that needs to be set. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>MWidth</em> </td><td>specifies a valid range from min(32, DataWidth + 17)</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>RetVal, returns value with following bit information:<ul>
<li>bit(0) = 1 = data width outside range [8, 10, 12, 16]</li><li>bit(1) = Acoef + Bcoef > 1.0</li><li>bit(2) = Y Offset outside data width range: [-2^DataWidth, (2^DataWidth)-1].</li><li>bit(3) = Cb Offset outside data width range: [-2^DataWidth, (2^DataWidth)-1].</li><li>bit(4) = Cr Offset outside data width range: [-2^DataWidth, (2^DataWidth)-1].</li><li>bit(5) = RGB Max outside data width range: [0, (2^DataWidth)-1].</li><li>bit(6) = RGB Min outside data width range: [0, (2^DataWidth)-1].</li></ul>
</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Floating point coefficients are represented in 17-bit fixed point format where 17 bits indicates integer portion (Mantissa) of the number exclusive of sign bit. </dd></dl>
This function disables Bypass mode of the core.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
This function disables debug test pattern mode.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
This function sets the bypass bit of control register to switch the core to bypass mode if debug is enabled in the IP.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
This function switches the core to test-pattern generator mode if debug feature is enabled.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
This function gets the active H/V sizes of the YCrCb2Rgb core from active size register.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>HSize</em> </td><td>is a pointer to 16-bit variable in which the number of Active Pixels per scanline is returned within the range [32, 8192]. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>VSize</em> </td><td>is a pointer to 16-bit variable in which the number of Active Lines per frame is returned within the range [32, 8192].</td></tr>
This function gets offset compensation value from the Blue channel.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>BOffset is a compensation value within the range [0, 255] from the Blue channel.</dd></dl>
This function returns A, B, C and D coefficients.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the XYCrCb2Rgbb instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Coef</em> </td><td>specifies a pointer to <aclass="el"href="struct_x_y_cr_cb2_rgb___coefficients.html">XYCrCb2Rgb_Coefficients</a> structure in which ACoef, BCoef, CCoef, DCoef members value will be updated within the range [0.0, 1.0].</td></tr>
<dlcompact><dt><b>Note:</b></dt><dd>Floating point coefficients are represented in 17-bit fixed point format where 17 bits indicates integer portion (Mantissa) of the number exclusive of sign bit. </dd></dl>
This function returns the frame count, the number of frames processed since power-up. This is available only if the debugging feature is enabled.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>DbgFrameCount, number of frames processed since power-up.</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Debug functionality should be enabled. </dd></dl>
This function returns Line count, the number of lines processed since power-up. This is available only if the debugging feature is enabled.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>DbgLineCount, number of lines processed since power-up.</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Debug functionality should be enabled. </dd></dl>
This function returns the pixel count, the number of pixels processed since power up. This is available only if the debugging feature is enabled.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>DbgPixelCount, number of pixels processed since power-up.</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Debug functionality should be enabled. </dd></dl>
This function gets offset compensation value from the Green channel.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>GOffset is a compensation value within the range [0, 255] from the Green channel.</dd></dl>
This function gets the maximum value on RGB channels of the output.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>RGBMax is the maximum value within the range [0, 255] from RGB channels of the output.</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Clipping functionality should be enabled. </dd></dl>
This function gets the minimum value on RGB channels of the output.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>RGBMin is the minimum value within the range [0, 255] from RGB channels of the output.</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Clamping functionality should be enabled. </dd></dl>
This function gets offset compensation value from the Red channel.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>ROffset is a compensation value within the range [0, 255] from the Red channel.</dd></dl>
This function facilitates software identification of exact version of the YCrCb2rGB hardware (h/w).<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>Version, contents of a Version register.</dd></dl>
This function returns the current bypass mode of the core.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd><ul>
<li>TRUE if Bypass mode is enabled.</li><li>FALSE if Bypass mode is not enabled.</li></ul>
</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Debug functionality should be enabled. </dd></dl>
This function returns the test-pattern generator mode (enabled or not), if debug feature is enabled.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd><ul>
<li>TRUE if Test-pattern mode is enabled.</li><li>FALSE if Test-pattern mode is not enabled.</li></ul>
</dd></dl>
<dlcompact><dt><b>Note:</b></dt><dd>Debug functionality should be enabled. </dd></dl>
This function governs the range of outputs R, G and B by affecting the conversion coefficients as well as the clipping and clamping values.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Range</em> </td><td>needs to be set from the enum XYcc_OutputRanges values as: 0 = XYCC_TV_16_TO_240, 1 = XYCC_STUDIO_16_TO_235, 2 = XYCC_GRAPHICS_0_TO_255.</td></tr>
This function populates an <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___inputs.html">XYCrCb2Rgb_Coef_Inputs</a> structure with the values from the selected video standard.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the XYCrCb2Rgbb instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>StandardSel</em> </td><td>needs to be set from enum XYcc_Standards value as : 0 = XYCC_STANDARD_ITU_601_SD 1 = XYCC_STANDARD_ITU_709_NTSC 2 = XYCC_STANDARD_ITU_709_PAL 3 = XYCC_STANDARD_YUV. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InputRange</em> </td><td>needs to be set from enum XYcc_OutputRanges value as: 0 = XYCC_TV_16_TO_240, 1 = XYCC_STUDIO_16_TO_235, 2 = XYCC_GRAPHICS_0_TO_255. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DataWidth</em> </td><td>specifies the valid range of [8,10,12,16] that needs to be set. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>CoefIn</em> </td><td>specifies a pointer to a <aclass="el"href="struct_x_y_cr_cb2_rgb___coef___inputs.html">XYCrCb2Rgb_Coef_Inputs</a> structure which is populated with the values from selected video standard.</td></tr>
<dlcompact><dt><b>Note:</b></dt><dd>Floating point coefficients are represented in 17-bit fixed point format where 17 bits indicates integer portion (Mantissa) of the number exclusive of sign bit. </dd></dl>
This function sets active H/V sizes in the active frame size register.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>HSize</em> </td><td>specifies the number of Active Pixels per scanline that needs to be set within the range [32, 8192]. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>VSize</em> </td><td>specifies the number of Active Lines per frame that needs to be set within the range [32, 8192].</td></tr>
This function sets offset compensation value on the Blue channel.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>BOffset</em> </td><td>is a compensation value within the range [0, 255] to be set on the Blue channel.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Coef</em> </td><td>specifies a pointer to <aclass="el"href="struct_x_y_cr_cb2_rgb___coefficients.html">XYCrCb2Rgb_Coefficients</a> structure in which ACoef, BCoef, CCoef, DCoef members value within the range [0.0, 1.0] that needs to be set.</td></tr>
<dlcompact><dt><b>Note:</b></dt><dd>Floating point coefficients are represented in 17-bit fixed point format where 17 bits indicates integer portion (Mantissa) of the number exclusive of sign bit. </dd></dl>
This function sets offset compensation value on the Green channel.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>GOffset</em> </td><td>is a compensation value within the range [0, 255] to be set on the Green channel.</td></tr>
This function sets the RGB maximum value on YCrCb2Rgb channels of the output.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>RGBMax</em> </td><td>is the maximum value within the range [0, 255] on the RGB channels of the output.</td></tr>
This function sets minimum value on RGB channels of the output.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>RGBMin</em> </td><td>is the minimum value within the range [0, 255] on RGB channels of the output.</td></tr>
This function sets offset compensation value on the Red channel.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>ROffset</em> </td><td>is compensation value within the range [0, 255] to be set on the Red channel.</td></tr>
This function sets up double buffered active size register and enables the register update.<p>
<dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_y_cr_cb2_rgb.html">XYCrCb2Rgb</a> instance.</td></tr>