Skip to content

Commit 8ab0d99

Browse files
committed
Merge branch 'master' into autobuild/alpha and bump version number.
2 parents 8add814 + b24c6c7 commit 8ab0d99

28 files changed

+395
-604
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ $RECYCLE.BIN/
208208
/stamp-h1
209209
# Files created by configure script in specific subdirectories
210210
/platform/Makefile
211-
/source/jversion.h
212211
/source/Makefile
213212
/unix/Makefile
214213
/vfe/Makefile

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@ env:
22
global:
33
# Required for clang.
44
- CXXFLAGS="-fno-fast-math"
5+
56
branches:
67
except:
78
- /^v[0-9]/
89

910
os:
1011
- linux
11-
# - osx
12+
- osx
1213

1314
language: cpp
1415

1516
compiler:
1617
- gcc
1718
- clang
1819

19-
matrix:
20-
allow_failures:
21-
- os: osx
22-
2320
sudo: false
2421

2522
addons:

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,21 @@ This document is still a work in progress. While the POV-Ray project itself
88
has existed for more than 20 years, this is the first time we have done a
99
release on github, so please bear with us - it's a little bare at the moment.
1010

11-
Last edit: 2016-09-30
11+
Last edit: 2016-10-09
12+
13+
Build Status
14+
--------------------------------------
15+
16+
We're constantly monitoring the code quality of (almost) all branches and pull requests,
17+
to make sure the code builds ok on our major target platforms. The current status of
18+
our _master branch_ is reported as follows:
19+
20+
- [![Build status](https://ci.appveyor.com/api/projects/status/5953wf13f9soyw23/branch/master?svg=true)](https://ci.appveyor.com/project/c-lipka/povray-exwy4)
21+
(AppVeyor: Windows Server 2012 with Visual Studio 2015)
22+
- [![Build Status](https://semaphoreci.com/api/v1/pov-ray/povray/branches/master/shields_badge.svg)](https://semaphoreci.com/pov-ray/povray)
23+
(Semaphore: Ubuntu 14.04 LTE 64-bit with gcc 4.8)
24+
- [![Build Status](https://travis-ci.org/POV-Ray/povray.svg?branch=master)](https://travis-ci.org/POV-Ray/povray)
25+
(Travis CI: Ubuntu 12.04 LTE 64-bit with gcc 4.6 and with clang 4.2; OS X 10.11 with gcc 4.2 and with clang 4.2)
1226

1327
License
1428
--------------------------------------

source-doc/styleguide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ Miscellaneous Coding Rules
220220
- **Output Parameters**: When declaring a function that is to modify any of its parameters, prefer references over
221221
pointers.
222222

223+
- **Locale**: Do not tamper with the C locale (i.e. do not call `setlocale` or any other function doing the same job),
224+
as plenty of code in POV-Ray relies on it remaining set to the default.
225+
223226

224227
Code Documentation
225228
==================

source/backend/povray.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@
6666
#include <png.h>
6767
#endif
6868
#ifndef LIBJPEG_MISSING
69-
#include <jversion.h>
69+
#include <jpeglib.h>
70+
#ifndef JPEG_LIB_VERSION_MAJOR
71+
#define JPEG_LIB_VERSION_MAJOR (JPEG_LIB_VERSION / 10)
72+
#endif
73+
#ifndef JPEG_LIB_VERSION_MINOR
74+
// This is known to erroneously identify versions 8a and 8b as version 8,
75+
// but we'll live with that.
76+
#define JPEG_LIB_VERSION_MINOR (JPEG_LIB_VERSION % 10)
77+
#endif
7078
#endif
7179
#ifndef LIBTIFF_MISSING
7280
extern "C"
@@ -400,10 +408,9 @@ void BuildInitInfo(POVMSObjectPtr msg)
400408
err = POVMSAttr_New(&attr);
401409
if(err == kNoErr)
402410
{
403-
ExtractLibraryVersion(JVERSION, buffer);
404-
405-
// TODO FIXME - shouldn't we use the JCOPYRIGHT string instead of hard-coding it here?
406-
const char *tempstr = pov_tsprintf("LibJPEG %s, Copyright 1991-2013 Thomas G. Lane, Guido Vollbeding", buffer);
411+
const char minorStr[2] = { JPEG_LIB_VERSION_MINOR ? 'a'+JPEG_LIB_VERSION_MINOR-1 : '\0', '\0' };
412+
const char *tempstr = pov_tsprintf("LibJPEG %i%s, Copyright 1991-2016 Thomas G. Lane, Guido Vollbeding",
413+
JPEG_LIB_VERSION_MAJOR, minorStr);
407414

408415
err = POVMSAttr_Set(&attr, kPOVMSType_CString, reinterpret_cast<const void *>(tempstr), (int) strlen(tempstr) + 1);
409416
if(err == kNoErr)

source/base/image/colourspace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ SimpleGammaCurvePtr GetGammaCurve(GammaTypeId type, float param)
441441
case kPOVList_GammaType_BT709: return BT709GammaCurve::Get();
442442
case kPOVList_GammaType_BT1361: return BT1361GammaCurve::Get();
443443
case kPOVList_GammaType_BT2020: return BT2020GammaCurve::Get();
444-
default: return PowerLawGammaCurve::GetByDecodingGamma(DEFAULT_FILE_GAMMA);
444+
default: POV_ASSERT (false);
445445
}
446446
}
447447

source/base/image/image.cpp

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
#include "base/image/iff.h"
5555
#include "base/image/jpeg_pov.h"
5656
#include "base/image/openexr.h"
57-
#include "base/image/pgm.h"
5857
#include "base/image/png_pov.h"
5958
#include "base/image/ppm.h"
6059
#include "base/image/targa.h"
@@ -3555,6 +3554,70 @@ void RGBFTMap2RGBAMap(const vector<Image::RGBFTMapEntry>& m, vector<Image::RGBAM
35553554
n.push_back(Image::RGBAMapEntry(i->red, i->green, i->blue, RGBFTColour::FTtoA(i->filter, i->transm)));
35563555
}
35573556

3557+
Image::ImageDataType Image::GetImageDataType (ImageChannelDataType channelType, ImageChannelLayout layout)
3558+
{
3559+
switch (layout)
3560+
{
3561+
case kImageChannelLayout_Gray:
3562+
switch (channelType)
3563+
{
3564+
case kImageChannelDataType_Int8: return Image::Gray_Int8;
3565+
case kImageChannelDataType_Int16: return Image::Gray_Int16;
3566+
case kImageChannelDataType_Gamma8: return Image::Gray_Gamma8;
3567+
case kImageChannelDataType_Gamma16: return Image::Gray_Gamma16;
3568+
default:
3569+
POV_IMAGE_ASSERT(false);
3570+
break;
3571+
}
3572+
break;
3573+
3574+
case kImageChannelLayout_GrayA:
3575+
switch (channelType)
3576+
{
3577+
case kImageChannelDataType_Int8: return Image::GrayA_Int8;
3578+
case kImageChannelDataType_Int16: return Image::GrayA_Int16;
3579+
case kImageChannelDataType_Gamma8: return Image::GrayA_Gamma8;
3580+
case kImageChannelDataType_Gamma16: return Image::GrayA_Gamma16;
3581+
default:
3582+
POV_IMAGE_ASSERT(false);
3583+
break;
3584+
}
3585+
break;
3586+
3587+
case kImageChannelLayout_RGB:
3588+
switch (channelType)
3589+
{
3590+
case kImageChannelDataType_Int8: return Image::RGB_Int8;
3591+
case kImageChannelDataType_Int16: return Image::RGB_Int16;
3592+
case kImageChannelDataType_Gamma8: return Image::RGB_Gamma8;
3593+
case kImageChannelDataType_Gamma16: return Image::RGB_Gamma16;
3594+
default:
3595+
POV_IMAGE_ASSERT(false);
3596+
break;
3597+
}
3598+
break;
3599+
3600+
case kImageChannelLayout_RGBA:
3601+
switch (channelType)
3602+
{
3603+
case kImageChannelDataType_Int8: return Image::RGBA_Int8;
3604+
case kImageChannelDataType_Int16: return Image::RGBA_Int16;
3605+
case kImageChannelDataType_Gamma8: return Image::RGBA_Gamma8;
3606+
case kImageChannelDataType_Gamma16: return Image::RGBA_Gamma16;
3607+
default:
3608+
POV_IMAGE_ASSERT(false);
3609+
break;
3610+
}
3611+
break;
3612+
3613+
default:
3614+
POV_IMAGE_ASSERT(false);
3615+
break;
3616+
}
3617+
3618+
return Image::Undefined;
3619+
}
3620+
35583621
Image *Image::Create(unsigned int w, unsigned int h, ImageDataType t, unsigned int maxRAMmbHint, unsigned int pixelsPerBlockHint)
35593622
{
35603623
try
@@ -3904,10 +3967,10 @@ following built-in formats: GIF, TGA, IFF, PGM, PPM, BMP.");
39043967
return (Iff::Read(file, options));
39053968

39063969
case PGM:
3907-
return (Pgm::Read(file, options));
3970+
return (Netpbm::Read(file, options));
39083971

39093972
case PPM:
3910-
return (Ppm::Read(file, options));
3973+
return (Netpbm::Read(file, options));
39113974

39123975
case BMP:
39133976
return (Bmp::Read(file, options));
@@ -3997,7 +4060,7 @@ following built-in formats: TGA, PPM, BMP.");
39974060
break;
39984061

39994062
case PPM:
4000-
Ppm::Write(file, image, options);
4063+
Netpbm::Write(file, image, options);
40014064
break;
40024065

40034066
case BMP:

source/base/image/image.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,22 @@ class Image
104104
RGBFTColourMap
105105
};
106106

107+
enum ImageChannelDataType
108+
{
109+
kImageChannelDataType_Int8,
110+
kImageChannelDataType_Int16,
111+
kImageChannelDataType_Gamma8,
112+
kImageChannelDataType_Gamma16,
113+
};
114+
115+
enum ImageChannelLayout
116+
{
117+
kImageChannelLayout_Gray,
118+
kImageChannelLayout_GrayA,
119+
kImageChannelLayout_RGB,
120+
kImageChannelLayout_RGBA,
121+
};
122+
107123
enum ImageDataType
108124
{
109125
/// Value used to indicate that image decoder is free to pick the most fitting type.
@@ -190,14 +206,16 @@ class Image
190206
bool premultiplyOverride; // whether to override file-format default for alpha premultiplication
191207
bool premultiply; // whether to output premultiplied ("associated") alpha or not ("straight alpha")
192208
DitherHandlerPtr dither;
193-
unsigned int offset_x;
194-
unsigned int offset_y;
209+
unsigned int offset_x; ///< Currently not actively set.
210+
unsigned int offset_y; ///< Currently not actively set.
195211

196212
WriteOptions() : bpcc(8), alphachannel(false), grayscale(false), compress(0) /*, gamma(1.0f) */, premultiplyOverride(false), premultiply(false), offset_x(0), offset_y(0) { }
197213
};
198214

199215
virtual ~Image() { }
200216

217+
static ImageDataType GetImageDataType (ImageChannelDataType channelType, ImageChannelLayout layout);
218+
201219
static Image *Create(unsigned int w, unsigned int h, ImageDataType t, unsigned int maxRAMmbHint, unsigned int pixelsPerBlockHint);
202220
static Image *Create(unsigned int w, unsigned int h, ImageDataType t, bool allowFileBacking = false);
203221
static Image *Create(unsigned int w, unsigned int h, ImageDataType t, const vector<RGBMapEntry>& m, bool allowFileBacking = false);

0 commit comments

Comments
 (0)