1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/2d/Scale.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef MOZILLA_GFX_SCALE_H_ 1.9 +#define MOZILLA_GFX_SCALE_H_ 1.10 + 1.11 +#include "Types.h" 1.12 + 1.13 +namespace mozilla { 1.14 +namespace gfx { 1.15 + 1.16 +/** 1.17 + * Scale an image using a high-quality filter. 1.18 + * 1.19 + * Synchronously scales an image and writes the output to the destination in 1.20 + * 32-bit format. The destination must be pre-allocated by the caller. 1.21 + * 1.22 + * Returns true if scaling was successful, and false otherwise. Currently, this 1.23 + * function is implemented using Skia. If Skia is not enabled when building, 1.24 + * calling this function will always return false. 1.25 + * 1.26 + * IMPLEMTATION NOTES: 1.27 + * This API is not currently easily hardware acceleratable. A better API might 1.28 + * take a SourceSurface and return a SourceSurface; the Direct2D backend, for 1.29 + * example, could simply set a status bit on a copy of the image, and use 1.30 + * Direct2D's high-quality scaler at draw time. 1.31 + */ 1.32 +GFX2D_API bool Scale(uint8_t* srcData, int32_t srcWidth, int32_t srcHeight, int32_t srcStride, 1.33 + uint8_t* dstData, int32_t dstWidth, int32_t dstHeight, int32_t dstStride, 1.34 + SurfaceFormat format); 1.35 + 1.36 +} 1.37 +} 1.38 + 1.39 +#endif /* MOZILLA_GFX_BLUR_H_ */