Added transform syncronization, an animation module and made the app work faster

This commit is contained in:
Alice Vital
2022-06-23 13:22:32 +03:00
parent 25a72c3c86
commit b1552d0ebc
98 changed files with 11657 additions and 7788 deletions

View File

@ -5,6 +5,7 @@
Apophysis "3D hack" Copyright (C) 2007-2008 Peter Sdobnov
Apophysis "7X" Copyright (C) 2009-2010 Georg Kiehne
Apophysis AV "Phoenix Edition" Copyright (C) 2021-2022 Alice V. Koryagina
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -26,7 +27,7 @@ unit BucketFillerThread;
interface
uses
Classes, Windows, ControlPoint, RenderingInterface, XForm;
Classes, Windows, ControlPoint;
type
TBucketFillerThread = class(TThread)
@ -39,7 +40,7 @@ type
nrbatches: integer;
batchcounter: Pinteger;
ColorMap: TColorMapArray;
//ColorMap: TColorMapArray;
CriticalSection: TRTLCriticalSection;
AddPointsProc: procedure (const points: TPointsArray) of object;
@ -53,8 +54,6 @@ type
implementation
//uses SysUtils, FormRender;
///////////////////////////////////////////////////////////////////////////////
constructor TBucketFillerThread.Create(cp: TControlPoint);
begin

View File

@ -27,7 +27,7 @@ unit ImageMaker;
interface
uses
Windows, Graphics, ControlPoint, RenderingCommon, PngImage, Bezier;
Windows, Graphics, ControlPoint, RenderingCommon, Vcl.Imaging.PngImage, Bezier;
type TPalette = record
logpal : TLogPalette;
@ -97,7 +97,7 @@ type
implementation
uses
Math, SysUtils, JPEG, Global, Types;
Math, SysUtils, Vcl.Imaging.JPEG, Global, Types;
{ TImageMaker }
@ -108,12 +108,11 @@ type
red: byte;
end;
// AV: specific types used only for transparency
PByteArray = ^TByteArray;
TByteArray = array[0..0] of byte;
// PLongintArray = ^TLongintArray;
// TLongintArray = array[0..0] of Longint;
TByteArray = array[0..0] of byte; // AV: single-element array?! why not [word] instead [0..0]?!
PRGBArray = ^TRGBArray;
TRGBArray = array[0..0] of TRGB;
TRGBArray = array[0..0] of TRGB; // AV: single-element array?! why not [word] instead [0..0]?!
///////////////////////////////////////////////////////////////////////////////
constructor TImageMaker.Create;
@ -394,7 +393,6 @@ var
f_select : double;
f_select_int, f_coef_idx : integer;
arr_filt_width : integer;
c : array of double;
ss : integer;
scf:boolean;
scfact : double;
@ -407,7 +405,6 @@ var
bx, by: integer;
label zero_alpha;
begin
SetLength(c, 4);
if fcp.gamma = 0 then
gamma := fcp.gamma
@ -716,7 +713,7 @@ end;
procedure TImageMaker.SaveImage(FileName: String);
var
i,row: integer;
PngObject: TPngObject;
PngObject: TPNGImage;
rowbm, rowpng: PByteArray;
JPEGImage: TJPEGImage;
PNGerror: boolean;
@ -725,7 +722,7 @@ begin
if UpperCase(ExtractFileExt(FileName)) = '.PNG' then begin
pngError := false;
PngObject := TPngObject.Create;
PngObject := TPNGImage.Create;
try
PngObject.Assign(FBitmap);
if fcp.Transparency then // PNGTransparency <> 0

View File

@ -5,7 +5,7 @@
Apophysis "3D hack" Copyright (C) 2007-2008 Peter Sdobnov
Apophysis "7X" Copyright (C) 2009-2010 Georg Kiehne
Apophysis AV "Phoenix Edition" Copyright (C) 2021 Alice V. Koryagina
Apophysis AV "Phoenix Edition" Copyright (C) 2021-2022 Alice V. Koryagina
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -5,7 +5,7 @@
Apophysis "3D hack" Copyright (C) 2007-2008 Peter Sdobnov
Apophysis "7X" Copyright (C) 2009-2010 Georg Kiehne
``Apophysis AV "Phoenix Edition" Copyright (C) 2021 Alice V. Koryagina
Apophysis AV "Phoenix Edition" Copyright (C) 2021 Alice V. Koryagina
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -28,7 +28,7 @@ type
TOnFinish = procedure of object;
TOnProgress = procedure(prog: double) of object;
{$ifdef Apo7X64}
{$ifdef CPUX64}
TBucket = Record
Red,
Green,
@ -55,6 +55,7 @@ type
procedure TrimWorkingSet;
implementation
uses Windows;
procedure TrimWorkingSet;

View File

@ -23,16 +23,14 @@
}
unit RenderingImplementation;
{$ifdef Apo7X64}
{$else}
{$ifndef CPUX64}
{$define _ASM_}
{$endif}
interface
uses
{$ifndef _ASM_}
{$else}
{$ifdef _ASM_}
AsmRandom,
{$endif}
Windows, Classes, Forms, Graphics, Global,

View File

@ -26,8 +26,8 @@ unit RenderingInterface;
interface
uses
Windows, Graphics, Classes, RenderingCommon,
Controlpoint, ImageMaker, PngImage, Translation;
Windows, Graphics, Classes, RenderingCommon, ImageMaker,
ControlPoint, Vcl.Imaging.PngImage, Translation;
///////////////////////////////////////////////////////////////////////////////
//
@ -51,7 +51,7 @@ type
Green,
Blue:
{$ifdef Apo7X64}
{$ifdef CPUX64}
double
{$else}
single
@ -71,9 +71,6 @@ type
const
MAX_FILTER_WIDTH = 25;
//const
//SizeOfBucket: array[0..3] of byte = (32, 32, 32, 32);
function TimeToString(t: TDateTime): string;
type
@ -296,9 +293,7 @@ type
implementation
uses
Math, SysUtils, Forms,
RenderingImplementation,
Binary, Global;
Math, SysUtils, Forms, RenderingImplementation, Binary, Global;
///////////////////////////////////////////////////////////////////////////////
//
@ -309,6 +304,7 @@ procedure TBaseRenderer.Hibernate(filePath: string);
begin
// todo
end;
procedure TBaseRenderer.Resume(filePath: string);
begin
// todo
@ -344,10 +340,11 @@ begin
// entered memory - imagesize
MaxMemory := FMaxMem * 1024 * 1024 - 4 * image_Height * int64(image_Width);
if (SingleBuffer) then
ApproxMemory := 16 * sqr(oversample) * image_Height * int64(image_Width)
else
ApproxMemory := 32 * sqr(oversample) * image_Height * int64(image_Width);
{$ifdef CPUX86}
ApproxMemory := 16 * sqr(oversample) * image_Height * int64(image_Width);
{$else}
ApproxMemory := 32 * sqr(oversample) * image_Height * int64(image_Width);
{$endif}
assert(MaxMemory > 0);
if MaxMemory <= 0 then exit;
@ -816,10 +813,12 @@ begin
try
// FStop := 0;
// TrimWorkingSet;
if SingleBuffer then
TimeTrace(Format(TextByKey('common-trace-allocating'), [BucketSize * 16 / 1048576]))
else
TimeTrace(Format(TextByKey('common-trace-allocating'), [BucketSize * 32 / 1048576]));
{$ifdef CPUX86}
TimeTrace(Format(TextByKey('common-trace-allocating'), [BucketSize * 16 / 1048576]));
{$else}
TimeTrace(Format(TextByKey('common-trace-allocating'), [BucketSize * 32 / 1048576]));
{$endif}
AllocateBuckets;