|
|
| version 1.7, 2012/03/16 09:24:11 | version 1.14, 2026/04/25 13:38:46 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: image manipulations impl1. | Parser: image manipulations impl1. |
| Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru> |
| based on: gd | based on: gd |
| Written by Tom Boutell, 5/94. | Written by Tom Boutell, 5/94. |
| Line 27 void gdImage::Create(int asx, int asy) { | Line 27 void gdImage::Create(int asx, int asy) { |
| sy = asy; | sy = asy; |
| int i; | int i; |
| pixels = (unsigned char **) malloc(sizeof(unsigned char *) * sx); | pixels = (unsigned char **) pa_malloc(sizeof(unsigned char *) * sx); |
| polyInts = 0; | polyInts = 0; |
| polyAllocated = 0; | polyAllocated = 0; |
| lineWidth = 1; | lineWidth = 1; |
| for (i=0; (i<asx); i++) | for (i=0; (i<asx); i++) |
| pixels[i] = (unsigned char *) malloc_atomic(asy); | pixels[i] = (unsigned char *) pa_malloc_atomic(asy); |
| colorsTotal = 0; | colorsTotal = 0; |
| transparent = (-1); | transparent = (-1); |
| interlace = 0; | interlace = 0; |
| Line 818 void gdImage::FilledPolygon(Point *p, in | Line 818 void gdImage::FilledPolygon(Point *p, in |
| return; | return; |
| } | } |
| if (!polyAllocated) { | if (!polyAllocated) { |
| polyInts = (int *) malloc(sizeof(int) * n); | polyInts = (int *) pa_malloc(sizeof(int) * n); |
| polyAllocated = n; | polyAllocated = n; |
| } | } |
| if (polyAllocated < n) { | if (polyAllocated < n) { |
| while (polyAllocated < n) { | while (polyAllocated < n) { |
| polyAllocated *= 2; | polyAllocated *= 2; |
| } | } |
| polyInts = (int *) realloc(polyInts, | polyInts = (int *) pa_realloc(polyInts, |
| sizeof(int) * polyAllocated); | sizeof(int) * polyAllocated); |
| } | } |
| y1 = p[0].y; | y1 = p[0].y; |
| Line 944 void gdImage::FilledPolygonReplaceColor( | Line 944 void gdImage::FilledPolygonReplaceColor( |
| return; | return; |
| } | } |
| if (!polyAllocated) { | if (!polyAllocated) { |
| polyInts = (int *) malloc(sizeof(int) * n); | polyInts = (int *) pa_malloc(sizeof(int) * n); |
| polyAllocated = n; | polyAllocated = n; |
| } | } |
| if (polyAllocated < n) { | if (polyAllocated < n) { |
| while (polyAllocated < n) { | while (polyAllocated < n) { |
| polyAllocated *= 2; | polyAllocated *= 2; |
| } | } |
| polyInts = (int *) realloc(polyInts, | polyInts = (int *) pa_realloc(polyInts, |
| sizeof(int) * polyAllocated); | sizeof(int) * polyAllocated); |
| } | } |
| y1 = p[0].y; | y1 = p[0].y; |