private void int_upsample(ref ComponentBuffer input_data)
{
ComponentBuffer output_data = m_color_buf[m_currentComponent];
int h_expand = m_h_expand[m_currentComponent];
int v_expand = m_v_expand[m_currentComponent];
int inrow = 0;
int outrow = 0;
while (outrow < m_cinfo.m_max_v_samp_factor)
{
/* Generate one output row with proper horizontal expansion */
int row = m_upsampleRowOffset + inrow;
for (int col = 0; col < m_cinfo.m_output_width; col++)
{
byte invalue = input_data[row][col]; /* don't need GETJSAMPLE() here */
int outIndex = 0;
for (int h = h_expand; h > 0; h--)
{
output_data[outrow][outIndex] = invalue;
outIndex++;
}
}
/* Generate any additional output rows by duplicating the first one */
if (v_expand > 1)
{
JpegUtils.jcopy_sample_rows(output_data, outrow, output_data,
outrow + 1, v_expand - 1, m_cinfo.m_output_width);
}
inrow++;
outrow += v_expand;
}
}
}