SkMorphology_opts.h revision 7a47ad3bacb36ca7609490bd7cbd85d2c49a0042
17a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org/*
27a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org * Copyright 2013 The Android Open Source Project
37a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org *
47a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org * Use of this source code is governed by a BSD-style license that can be
57a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org * found in the LICENSE file.
67a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org */
77a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org
87a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org#include <SkColor.h>
97a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org
107a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org/**
117a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org * All morphology procs have the same signature: src is the source buffer, dst the
127a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org * destination buffer, radius is the morphology radius, width and height are the bounds
137a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org * of the destination buffer (in pixels), and srcStride and dstStride are the
147a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org * number of pixels per row in each buffer. All buffers are 8888.
157a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org */
167a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org
177a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.orgtypedef void (*SkMorphologyProc)(const SkPMColor* src, SkPMColor* dst, int radius,
187a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org                                 int width, int height, int srcStride, int dstStride);
197a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org
207a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.orgenum SkMorphologyProcType {
217a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org    kDilateX_SkMorphologyProcType,
227a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org    kDilateY_SkMorphologyProcType,
237a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org    kErodeX_SkMorphologyProcType,
247a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org    kErodeY_SkMorphologyProcType
257a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org};
267a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.org
277a47ad3bacb36ca7609490bd7cbd85d2c49a0042senorblanco@chromium.orgSkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type);
28