// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // An Image wraps an image any flavor, be it platform-native GdkBitmap/NSImage, // or a SkBitmap. This also provides easy conversion to other image types // through operator overloading. It will cache the converted representations // internally to prevent double-conversion. // // The lifetime of both the initial representation and any converted ones are // tied to the lifetime of the Image's internal storage. To allow Images to be // cheaply passed around by value, the actual image data is stored in a ref- // counted member. When all Images referencing this storage are deleted, the // actual representations are deleted, too. // // Images can be empty, in which case they have no backing representation. // Attempting to use an empty Image will result in a crash. #ifndef UI_GFX_IMAGE_IMAGE_H_ #define UI_GFX_IMAGE_IMAGE_H_ #include <stddef.h> #include <memory> #include <vector> #include "base/containers/span.h" #include "base/memory/scoped_policy.h" #include "base/memory/scoped_refptr.h" #include "build/build_config.h" #include "ui/gfx/gfx_export.h" #include "ui/gfx/native_widget_types.h" #if BUILDFLAG(IS_MAC) typedef struct CGColorSpace* CGColorSpaceRef; #endif class SkBitmap; namespace base { class RefCountedMemory; } namespace gfx { struct ImagePNGRep; class ImageSkia; class Size; namespace internal { class ImageRep; class ImageStorage; } class GFX_EXPORT Image { … }; } // namespace gfx #endif // UI_GFX_IMAGE_IMAGE_H_