Mentions légales du service

Skip to content
Snippets Groups Projects

Mv/color blocks

Merged Mathieu Faverge requested to merge mv/color_blocks into master
8 files
+ 91
79
Compare changes
  • Side-by-side
  • Inline
Files
8
#include <assert.h>
#include <math.h>
#include "Zooming.hpp"
#include "../Helper.hpp"
@@ -91,10 +92,10 @@ void Zooming::move(double xStart, double xEnd, double yStart, double yEnd)
int lbloknum = cblk[1].m_bloknum;
// Get first block size in col from x to xEnd
int x = (cblk->m_fcolnum - startCol) * xCoeff;
int xEnd = (cblk->m_lcolnum - startCol) * xCoeff;
int x = (cblk->m_fcolnum - startCol) * xCoeff;
int xEnd = (cblk->m_lcolnum + 1 - startCol) * xCoeff;
xEnd = ( xEnd > x+1 ) ? xEnd : x+1;
float cblk_color = cblk->m_color;
blok = m_matrix->m_bloktab + fbloknum;
for (j = fbloknum; j < lbloknum; ++j, blok++)
@@ -106,16 +107,16 @@ void Zooming::move(double xStart, double xEnd, double yStart, double yEnd)
}
// Get first block size in row from y to yEnd
int y = (blok->m_frownum - startRow) * yCoeff;
int yEnd = (blok->m_lrownum - startRow) * yCoeff;
int y = (blok->m_frownum - startRow) * yCoeff;
int yEnd = (blok->m_lrownum + 1 - startRow) * yCoeff;
yEnd = ( yEnd > y+1 ) ? yEnd : y+1;
float color = blok->m_color == -1. ? cblk_color : blok->m_color;
for( m=x; m<xEnd; m++ )
{
for( n=y; n<yEnd; n++ )
{
m_colors[m][n] = 0.0f;
m_colors[m][n] = color;
}
}
}
Loading