Skip to content

Commit

Permalink
Merge pull request #454 from OpenShot/merge-master-to-develop1
Browse files Browse the repository at this point in the history
Merge master into develop (and bump version to -dev2)
  • Loading branch information
jonoomph committed Mar 3, 2020
2 parents 7fbd44a + efe0728 commit f1e5c9c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -40,7 +40,7 @@ For more information, please visit <http://www.openshot.org/>.
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")

################ PROJECT VERSION ####################
set(PROJECT_VERSION_FULL "0.2.5-dev1")
set(PROJECT_VERSION_FULL "0.2.5-dev2")
set(PROJECT_SO_VERSION 19)

# Remove the dash and anything following, to get the #.#.# version for project()
Expand Down
2 changes: 1 addition & 1 deletion src/Frame.cpp
Expand Up @@ -581,7 +581,7 @@ void Frame::Save(std::string path, float scale, std::string format, int quality)
std::shared_ptr<QImage> previewImage = GetImage();

// scale image if needed
if (abs(scale) > 1.001 || abs(scale) < 0.999)
if (fabs(scale) > 1.001 || fabs(scale) < 0.999)
{
int new_width = width;
int new_height = height;
Expand Down
18 changes: 8 additions & 10 deletions src/effects/ColorShift.cpp
Expand Up @@ -75,25 +75,24 @@ std::shared_ptr<Frame> ColorShift::GetFrame(std::shared_ptr<Frame> frame, int64_
// Get the current shift amount, and clamp to range (-1 to 1 range)
// Red Keyframes
float red_x_shift = red_x.GetValue(frame_number);
int red_x_shift_limit = round(frame_image_width * fmod(abs(red_x_shift), 1.0));
int red_x_shift_limit = round(frame_image_width * fmod(fabs(red_x_shift), 1.0));
float red_y_shift = red_y.GetValue(frame_number);
int red_y_shift_limit = round(frame_image_height * fmod(abs(red_y_shift), 1.0));
int red_y_shift_limit = round(frame_image_height * fmod(fabs(red_y_shift), 1.0));
// Green Keyframes
float green_x_shift = green_x.GetValue(frame_number);
int green_x_shift_limit = round(frame_image_width * fmod(abs(green_x_shift), 1.0));
int green_x_shift_limit = round(frame_image_width * fmod(fabs(green_x_shift), 1.0));
float green_y_shift = green_y.GetValue(frame_number);
int green_y_shift_limit = round(frame_image_height * fmod(abs(green_y_shift), 1.0));
int green_y_shift_limit = round(frame_image_height * fmod(fabs(green_y_shift), 1.0));
// Blue Keyframes
float blue_x_shift = blue_x.GetValue(frame_number);
int blue_x_shift_limit = round(frame_image_width * fmod(abs(blue_x_shift), 1.0));
int blue_x_shift_limit = round(frame_image_width * fmod(fabs(blue_x_shift), 1.0));
float blue_y_shift = blue_y.GetValue(frame_number);
int blue_y_shift_limit = round(frame_image_height * fmod(abs(blue_y_shift), 1.0));
int blue_y_shift_limit = round(frame_image_height * fmod(fabs(blue_y_shift), 1.0));
// Alpha Keyframes
float alpha_x_shift = alpha_x.GetValue(frame_number);
int alpha_x_shift_limit = round(frame_image_width * fmod(abs(alpha_x_shift), 1.0));
int alpha_x_shift_limit = round(frame_image_width * fmod(fabs(alpha_x_shift), 1.0));
float alpha_y_shift = alpha_y.GetValue(frame_number);
int alpha_y_shift_limit = round(frame_image_height * fmod(abs(alpha_y_shift), 1.0));

int alpha_y_shift_limit = round(frame_image_height * fmod(fabs(alpha_y_shift), 1.0));

// Make temp copy of pixels
unsigned char *temp_image = new unsigned char[frame_image_width * frame_image_height * 4]();
Expand Down Expand Up @@ -130,7 +129,6 @@ std::shared_ptr<Frame> ColorShift::GetFrame(std::shared_ptr<Frame> frame, int64_
blue_starting_row_index = starting_row_index;
alpha_starting_row_index = starting_row_index;


red_pixel_offset = 0;
green_pixel_offset = 0;
blue_pixel_offset = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/effects/Shift.cpp
Expand Up @@ -69,9 +69,9 @@ std::shared_ptr<Frame> Shift::GetFrame(std::shared_ptr<Frame> frame, int64_t fra

// Get the current shift amount, and clamp to range (-1 to 1 range)
double x_shift = x.GetValue(frame_number);
double x_shift_limit = fmod(abs(x_shift), 1.0);
double x_shift_limit = fmod(fabs(x_shift), 1.0);
double y_shift = y.GetValue(frame_number);
double y_shift_limit = fmod(abs(y_shift), 1.0);
double y_shift_limit = fmod(fabs(y_shift), 1.0);

// Declare temp arrays to hold pixels while we move things around
unsigned char *temp_row = new unsigned char[frame_image->width() * 4]();
Expand Down
2 changes: 1 addition & 1 deletion src/effects/Wave.cpp
Expand Up @@ -74,7 +74,7 @@ std::shared_ptr<Frame> Wave::GetFrame(std::shared_ptr<Frame> frame, int64_t fram
int pixel_count = frame_image->width() * frame_image->height();

// Get current keyframe values
double time = frame_number;//abs(((frame_number + 255) % 510) - 255);
double time = frame_number;
double wavelength_value = wavelength.GetValue(frame_number);
double amplitude_value = amplitude.GetValue(frame_number);
double multiplier_value = multiplier.GetValue(frame_number);
Expand Down

0 comments on commit f1e5c9c

Please sign in to comment.