Commit Graph

1153 Commits

Author SHA1 Message Date
Campbell Barton
60ffc08547 Cleanup: use BLI_hash_ prefix for md5 api 2014-11-14 11:53:27 +01:00
Campbell Barton
14795baf21 Cleanup: headers 2014-11-14 11:49:45 +01:00
Bastien Montagne
64c0c13e6e Add Murmur2A hashing feature to BLI
Murmur2a is a very fast hashing function generation int32 hashes.
It also features a very good distribution of generated hashes.

However, it is not endianness-agnostic, meaning it will usually generate
different hashes for a same key on big- and little-endian architectures.
Consequently, **it shall not be used to generate persistent hashes**
(never store them in .blend file e.g.).

This implementation supports incremental hashing, and is a direct
adaptation of reference implementation (in c++):
https://smhasher.googlecode.com/svn-history/r130/trunk/MurmurHash2.cpp

That cpp code was also used to generate reference values in gtests file.

Reviewers: sergey, campbellbarton

Reviewed By: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D892
2014-11-14 11:00:26 +01:00
Antony Riakiotakis
33bff4caef Fix issue reported by Sebastian Koenig on irc, Clone brush would paint
trash with float images.

Issue is uninitialized alpha in the clone brush + a clamping issue for
float images. There's still some 'swimming' and brightness issue here
but I have to do work for the weekly, will investigate further later.
2014-10-17 14:11:13 +02:00
Sergey Sharybin
ab8e709d67 Fix for wrong color space when image loader set both rect and rect_float
Quite safe for 2.72.
2014-09-29 14:34:37 +06:00
Campbell Barton
6f2f80887b GHash: use bool for comparison (simplify compare) 2014-09-25 06:16:37 +10:00
Campbell Barton
3f2cf6da6f Cleanup: remove _DEBUG define usage 2014-08-27 18:59:32 +10:00
Sergey Sharybin
dc05d817eb Correction to the mipmaps generation
Seem we've always were wrong with multiplying alpha by 255,
other channels seems to be multiplied by 256 with the shift
operations.
2014-08-18 18:03:56 +06:00
Campbell Barton
bba80ed7af Cleanup 2014-08-17 12:18:40 +10:00
Antony Riakiotakis
e05567ef3e Fix out of bounds read when recalculating mipmaps, error reported by
address sanitizer.

This was strangely only triggered when float buffers were used.
2014-08-13 19:07:45 +02:00
Antony Riakiotakis
ba345bcbb6 Fix T41414, T41386.
There were a few issues to fix here:

* We did not really unpremultiply float image dabs prior to sending them
to the GPU. That made float and byte image result different in texture
painting and undoing could change the result.
* To make textures nicely composited over the mesh, I used decal mode in
OpenGL texture environment for the texture unit. This uses the texture's
alpha channel with a nice over operator.
* Texture creation used to override the alpha setting due to the display
restrictions. Not so anymore, people can now create transparent byte
images.

Also, made alpha zero default for new textures now, since it has such a
nice effect here.
2014-08-12 13:49:45 +02:00
Sergey Sharybin
1ca8684911 Fix T40744: MIP Map is generating strange noise in texture, Blender Internal 2014-08-11 17:37:56 +06:00
Thomas Dinges
e3ed13cbd4 Cleanup: Remove special code for Visual Studio 2008.
Goodbye VC2008, it has been a pleasure (more or less) :D SCons / CMake cleaenup will follow.
Differential Revision: https://developer.blender.org/D715
2014-08-07 13:52:15 +02:00
Bastien Montagne
fa8d38da74 Fix T41241: VSE: cropping strips puts a transparent line through the image. 2014-07-30 17:29:06 +02:00
Antony Riakiotakis
f745564e4e GSOC 2013 paint
Yep, at last it's here!

There are a few minor issues remaining but development can go on in
master after discussion at blender institute.

For full list of features see:

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting

Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.
2014-07-21 12:02:05 +02:00
Campbell Barton
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
Campbell Barton
b4b5d9c24e Style cleanup 2014-07-05 05:26:32 +10:00
Bastien Montagne
e3c8cf0a9e Add (r)partition funcs to BLI_string, to get left-most/right-most first occurence of delimiters.
Inspired by Python (r)partition str functions. Also added some Gtest cases for those new funcs.

Reviewed by Campbell Barton, many thanks!
2014-07-04 14:14:06 +02:00
Sergey Sharybin
3f55de5613 Fix strict flags compilation 2014-07-01 13:13:11 +06:00
Campbell Barton
2e840e56cf CMake: correct include dirs 2014-07-01 09:36:28 +10:00
Sergey Sharybin
e919a37e97 Fix T40818: libpng warning: iCCP: known incorrect sRGB profile
Suppress warning for now, it's harmless and only happens
with new libpng.

In the future we might try enabling it for non-datatoc-ed
files, but it's really not worth spending lots of time on.
2014-06-30 21:08:33 +06:00
Campbell Barton
f69d5cc4b8 Remove unused function 2014-06-22 13:05:48 +10:00
Bastien Montagne
01d802976f BLI_md5: add a utility function to 'translate' raw 16bytes digest into a nice 32chars hexadecimal string.
That kind of stuff belongs to BLI, not specialized code like thumbs.c
2014-06-20 16:18:26 +02:00
Campbell Barton
716430ab64 Code cleanup: comments 2014-06-15 12:15:53 +10:00
Sergey Sharybin
74e32efbc8 Fix wrong memory write in partial render update with Save Buffers enabled
No idea why this issue hasn't been spotted before. Took several hours to
figure out where exactly wrong memory access happens..

P.S. I really want to switch ImBuf->rect from int* to unsigned char*...
2014-06-10 17:10:37 +06:00
Sergey Sharybin
615f4dc92f Fix T40547: Can't read single channel EXRs
The root of the issue goes to the fact that we only can
read RGB EXR files, but they could be YCbCr or just Luma.
Added support for this two cases.

Note: internally EXR would still be 3 channels, so no
big memory save would happen here, at least yet.
2014-06-09 16:43:08 +06:00
Sergey Sharybin
973f95fa9d Fix T40157: Loading movies larger than 4GB in size fails
Issue was caused by _wstat returning EOVERFLOW error because
of file size didn't fit into stat structure which was using
long datatype.

The idea of this patch is to use _wstat64 and _stat64 structure
which is capable storing 64bit file sizes.

Made it a typedef for stat structure used by BLI_stat function
in order to make code easier to follow and avoid ifdefs all
over the place.

Additionally solved issue with BLI_exists which was wrongly
returning False in cases destination file is larger then 4GB.
2014-05-28 23:21:39 +06:00
Sergey Sharybin
56b7d55833 Report to the console when custom ocio config is used 2014-05-23 13:48:35 +02:00
Campbell Barton
48881ad1e0 Code cleanup: doxy comments 2014-05-14 15:00:47 +10:00
Dalai Felinto
8904eaf504 Fix T40107: painting on a psd image crashes blender + style cleanup in file
The issue was that we can't assume we support the colorspace from the file. The reported file had an invalid colorspace in fact, which was leading to the segfault in Blender.

Thanks for Sergey Sharybin for the help here.
2014-05-10 10:58:48 -03:00
Dalai Felinto
3312b20ac8 IMB buffer functions to take a mask as input
The mask make sure the conversion only happens in a few areas of the
buffer.

New Functions:
* IMB_buffer_byte_from_float_mask
* IMB_buffer_float_from_float_mask

The functions are an adaptation of their maskless counterparts without accepting different profiles for the input and output buffers.

Review: Sergey Sharybin
2014-05-02 20:56:16 -03:00
Campbell Barton
fa25d7cf7b Code cleanup: remove defines no longer needed on windows 2014-05-02 00:55:54 +10:00
Thomas Dinges
55b2a5aa45 More fixes, msvc 2008 needs math includes for "isnan".. 2014-05-01 00:36:15 +02:00
Campbell Barton
af86b008b2 Include removal gave problems with windows, ifdef some back in for windows only 2014-05-01 07:21:08 +10:00
Campbell Barton
cb48c0ceea Revert "Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc7a."
This reverts commit a47a4ef82f.
2014-05-01 07:20:46 +10:00
Thomas Dinges
a47a4ef82f Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc. 2014-04-30 23:16:12 +02:00
Campbell Barton
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
Campbell Barton
d2032d0dfe Fix T39931: Crash generating thumbnails (error in escaping) 2014-04-30 20:44:52 +10:00
Sergey Sharybin
fe29f92030 Fix T39953: Float data images display trash in image editor
Was a failure of optimization trick.
2014-04-30 16:26:20 +06:00
Campbell Barton
863352dfdc Correct issue with IMB_ispic returning bool 2014-04-30 10:43:46 +10:00
Campbell Barton
b6e967be63 Code cleanup: const args and arrays 2014-04-27 08:56:54 +10:00
Campbell Barton
7ca74fc1c0 Code cleanup: use 'const' for arrays (blenloader, gpu, imbuf, makesdna, modifiers, nodes) 2014-04-27 00:25:16 +10:00
Campbell Barton
551096d6fd BLI_open: check returned value for -1 instead of < 0 2014-04-22 16:40:17 +10:00
Campbell Barton
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
Campbell Barton
412826a504 Mempool: delay allocating an initial chunk, its not always used 2014-04-08 12:58:56 +10:00
Antony Riakiotakis
aabf4154e5 Fix building for Windows. 2014-04-07 04:18:03 +03:00
Campbell Barton
be8b4b8b0c Todo T36849: support XDG thumbnail management standard 2014-04-07 08:43:46 +10:00
Campbell Barton
af59ee340f Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient now 2014-04-05 12:14:05 +11:00
Bastien Montagne
35747ee3d5 Rename "BLI_cpu.h" to "BLI_system.h" and add to it BLI_getpid() helper.
There is not much sense to have a whole BLI file just to check SSE2 on CPUs...
So idea is to rename it to more generic "BLI_system", and add to it more system-related
utils, like e.g. an include helper for getpid(), which allows to hide unix/windows
internals from rest of the code...

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D439
2014-04-02 11:59:43 +02:00
Sergey Sharybin
ee72cba008 Fix T39446: Blender Crashes when Camera Tracking
Issue is likely caused by thread-unsafe nature of IMB_freeImBuf
which might lead to race condition in some circumstances.

Now made it thread-safe and from Sebastian's tests seems crash is
gone now, so hopefully the root of the issue is finally nailed down.
2014-04-01 13:14:37 +06:00