epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2006 The Android Open Source Project |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 9 | #include "SkBitmap.h" |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 10 | #include "SkImage.h" |
reed@android.com | 6efdc47 | 2008-12-19 18:24:35 +0000 | [diff] [blame] | 11 | #include "SkImageDecoder.h" |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 12 | #include "SkImageEncoder.h" |
reed@android.com | 6efdc47 | 2008-12-19 18:24:35 +0000 | [diff] [blame] | 13 | #include "SkMovie.h" |
scroggo | a1193e4 | 2015-01-21 12:09:53 -0800 | [diff] [blame] | 14 | #include "SkStream.h" |
reed@android.com | 6efdc47 | 2008-12-19 18:24:35 +0000 | [diff] [blame] | 15 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 16 | class SkColorTable; |
reed@android.com | 6efdc47 | 2008-12-19 18:24:35 +0000 | [diff] [blame] | 17 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 18 | // Empty implementations for SkImageDecoder. |
| 19 | |
scroggo@google.com | e5c9c49 | 2013-10-01 19:54:42 +0000 | [diff] [blame] | 20 | SkImageDecoder::SkImageDecoder() {} |
| 21 | |
| 22 | SkImageDecoder::~SkImageDecoder() {} |
| 23 | |
scroggo@google.com | b5571b3 | 2013-09-25 21:34:24 +0000 | [diff] [blame] | 24 | SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable*) { |
reed@android.com | 6efdc47 | 2008-12-19 18:24:35 +0000 | [diff] [blame] | 25 | return NULL; |
| 26 | } |
| 27 | |
scroggo@google.com | 468142b | 2013-07-09 15:48:24 +0000 | [diff] [blame] | 28 | void SkImageDecoder::copyFieldsToOther(SkImageDecoder* ) {} |
| 29 | |
reed | bfefc7c | 2014-06-12 17:40:00 -0700 | [diff] [blame] | 30 | bool SkImageDecoder::DecodeFile(const char[], SkBitmap*, SkColorType, Mode, Format*) { |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 31 | return false; |
| 32 | } |
| 33 | |
scroggo | 2a12080 | 2014-10-22 12:07:00 -0700 | [diff] [blame] | 34 | SkImageDecoder::Result SkImageDecoder::decode(SkStream*, SkBitmap*, SkColorType, Mode) { |
| 35 | return kFailure; |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 36 | } |
| 37 | |
reed | bfefc7c | 2014-06-12 17:40:00 -0700 | [diff] [blame] | 38 | bool SkImageDecoder::DecodeStream(SkStreamRewindable*, SkBitmap*, SkColorType, Mode, Format*) { |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 39 | return false; |
| 40 | } |
| 41 | |
reed | bfefc7c | 2014-06-12 17:40:00 -0700 | [diff] [blame] | 42 | bool SkImageDecoder::DecodeMemory(const void*, size_t, SkBitmap*, SkColorType, Mode, Format*) { |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 43 | return false; |
| 44 | } |
| 45 | |
scroggo@google.com | b5571b3 | 2013-09-25 21:34:24 +0000 | [diff] [blame] | 46 | bool SkImageDecoder::buildTileIndex(SkStreamRewindable*, int *width, int *height) { |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 47 | return false; |
| 48 | } |
| 49 | |
scroggo | a1193e4 | 2015-01-21 12:09:53 -0800 | [diff] [blame] | 50 | bool SkImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, |
| 51 | int* /*width*/, int* /*height*/) { |
| 52 | SkDELETE(stream); |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | |
reed | bfefc7c | 2014-06-12 17:40:00 -0700 | [diff] [blame] | 57 | bool SkImageDecoder::decodeSubset(SkBitmap*, const SkIRect&, SkColorType) { |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 58 | return false; |
| 59 | } |
| 60 | |
| 61 | SkImageDecoder::Format SkImageDecoder::getFormat() const { |
| 62 | return kUnknown_Format; |
| 63 | } |
| 64 | |
scroggo@google.com | b5571b3 | 2013-09-25 21:34:24 +0000 | [diff] [blame] | 65 | SkImageDecoder::Format SkImageDecoder::GetStreamFormat(SkStreamRewindable*) { |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 66 | return kUnknown_Format; |
| 67 | } |
| 68 | |
| 69 | const char* SkImageDecoder::GetFormatName(Format) { |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 70 | return NULL; |
| 71 | } |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 72 | |
| 73 | SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker*) { |
| 74 | return NULL; |
| 75 | } |
| 76 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 77 | SkBitmap::Allocator* SkImageDecoder::setAllocator(SkBitmap::Allocator*) { |
| 78 | return NULL; |
| 79 | } |
| 80 | |
| 81 | void SkImageDecoder::setSampleSize(int) {} |
| 82 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 83 | bool SkImageDecoder::cropBitmap(SkBitmap*, SkBitmap*, int, int, int, int, int, |
| 84 | int, int) { |
| 85 | return false; |
| 86 | } |
| 87 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 88 | bool SkImageDecoder::allocPixelRef(SkBitmap*, SkColorTable*) const { |
| 89 | return false; |
| 90 | } |
| 91 | |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 92 | ///////////////////////////////////////////////////////////////////////// |
| 93 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 94 | // Empty implementation for SkMovie. |
| 95 | |
scroggo@google.com | b5571b3 | 2013-09-25 21:34:24 +0000 | [diff] [blame] | 96 | SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) { |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 97 | return NULL; |
| 98 | } |
| 99 | |
| 100 | ///////////////////////////////////////////////////////////////////////// |
| 101 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 102 | // Empty implementations for SkImageEncoder. |
| 103 | |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 104 | SkImageEncoder* SkImageEncoder::Create(Type t) { |
| 105 | return NULL; |
| 106 | } |
| 107 | |
| 108 | bool SkImageEncoder::EncodeFile(const char file[], const SkBitmap&, Type, int quality) { |
| 109 | return false; |
| 110 | } |
| 111 | |
| 112 | bool SkImageEncoder::EncodeStream(SkWStream*, const SkBitmap&, SkImageEncoder::Type, int) { |
| 113 | return false; |
| 114 | } |
| 115 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 116 | SkData* SkImageEncoder::EncodeData(const SkBitmap&, Type, int quality) { |
| 117 | return NULL; |
| 118 | } |
| 119 | |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 120 | bool SkImageEncoder::encodeStream(SkWStream*, const SkBitmap&, int) { |
reed@android.com | 6efdc47 | 2008-12-19 18:24:35 +0000 | [diff] [blame] | 121 | return false; |
| 122 | } |
| 123 | |
scroggo@google.com | 7def5e1 | 2013-05-31 14:00:10 +0000 | [diff] [blame] | 124 | SkData* SkImageEncoder::encodeData(const SkBitmap&, int) { |
| 125 | return NULL; |
| 126 | } |
| 127 | |
| 128 | bool SkImageEncoder::encodeFile(const char file[], const SkBitmap& bm, int quality) { |
| 129 | return false; |
| 130 | } |
reed@android.com | 6efdc47 | 2008-12-19 18:24:35 +0000 | [diff] [blame] | 131 | ///////////////////////////////////////////////////////////////////////// |