chromium/third_party/skia/src/core/SkMask.h

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkMask_DEFINED
#define SkMask_DEFINED

#include "include/core/SkColorPriv.h"
#include "include/core/SkRect.h"
#include "include/private/SkColorData.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTemplates.h"

#include <cstddef>
#include <cstdint>
#include <memory>

/** \class SkMask
    SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or
    the 3-channel 3D format. These are passed to SkMaskFilter objects.
*/
struct SkMask {};

template <> struct SkMask::AlphaIter<SkMask::kBW_Format> {};

template <> struct SkMask::AlphaIter<SkMask::kA8_Format> {};

template <> struct SkMask::AlphaIter<SkMask::kARGB32_Format> {};

template <> struct SkMask::AlphaIter<SkMask::kLCD16_Format> {};

///////////////////////////////////////////////////////////////////////////////

struct SkMaskBuilder : public SkMask {};

/**
 *  \using SkAutoMaskImage
 *
 *  Stack class used to manage the fImage buffer in a SkMask.
 *  When this object loses scope, the buffer is freed with SkMask::FreeImage().
 */
SkAutoMaskFreeImage;

#endif