Merge branch 'master' into softproofing

This commit is contained in:
Hombre
2016-10-04 00:04:57 +02:00
71 changed files with 1083 additions and 822 deletions

View File

@@ -28,9 +28,9 @@ namespace
void getScanline8 (const uint16_t *red, const uint16_t *green, const uint16_t *blue, int width, unsigned char* buffer)
{
for (int i = 0, ix = 0; i < width; i++) {
buffer[ix++] = red[i] >> 8;
buffer[ix++] = green[i] >> 8;
buffer[ix++] = blue[i] >> 8;
buffer[ix++] = rtengine::uint16ToUint8Rounded(red[i]);
buffer[ix++] = rtengine::uint16ToUint8Rounded(green[i]);
buffer[ix++] = rtengine::uint16ToUint8Rounded(blue[i]);
}
}
@@ -92,10 +92,10 @@ void Image16::setScanline (int row, unsigned char* buffer, int bps, float *minVa
case (IIOSF_UNSIGNED_CHAR): {
int ix = 0;
for (int i = 0; i < width; i++) {
r(row, i) = (unsigned short)(buffer[ix++]) << 8;
g(row, i) = (unsigned short)(buffer[ix++]) << 8;
b(row, i) = (unsigned short)(buffer[ix++]) << 8;
for (int i = 0; i < width; ++i) {
r(row, i) = static_cast<unsigned short>(buffer[ix++]) * 257;
g(row, i) = static_cast<unsigned short>(buffer[ix++]) * 257;
b(row, i) = static_cast<unsigned short>(buffer[ix++]) * 257;
}
break;
@@ -105,7 +105,7 @@ void Image16::setScanline (int row, unsigned char* buffer, int bps, float *minVa
unsigned short* sbuffer = (unsigned short*) buffer;
int ix = 0;
for (int i = 0; i < width; i++) {
for (int i = 0; i < width; ++i) {
r(row, i) = sbuffer[ix++];
g(row, i) = sbuffer[ix++];
b(row, i) = sbuffer[ix++];
@@ -298,11 +298,11 @@ Image16::to8()
{
Image8* img8 = new Image8(width, height);
for ( int h = 0; h < height; ++h ) {
for ( int w = 0; w < width; ++w ) {
img8->r(h, w) = (unsigned char)( r(h, w) >> 8);
img8->g(h, w) = (unsigned char)( g(h, w) >> 8);
img8->b(h, w) = (unsigned char)( b(h, w) >> 8);
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
img8->r(h, w) = uint16ToUint8Rounded(r(h, w));
img8->g(h, w) = uint16ToUint8Rounded(g(h, w));
img8->b(h, w) = uint16ToUint8Rounded(b(h, w));
}
}
@@ -314,11 +314,11 @@ Image16::tofloat()
{
Imagefloat* imgfloat = new Imagefloat(width, height);
for ( int h = 0; h < height; ++h ) {
for ( int w = 0; w < width; ++w ) {
imgfloat->r(h, w) = (float)r(h, w);
imgfloat->g(h, w) = (float)g(h, w);
imgfloat->b(h, w) = (float)b(h, w);
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
imgfloat->r(h, w) = r(h, w);
imgfloat->g(h, w) = g(h, w);
imgfloat->b(h, w) = b(h, w);
}
}