OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 String filenameExtension() const override { return "jpg"; } | 47 String filenameExtension() const override { return "jpg"; } |
48 void onSetData(SharedBuffer* data) override; | 48 void onSetData(SharedBuffer* data) override; |
49 bool hasColorProfile() const override { return m_hasColorProfile; } | 49 bool hasColorProfile() const override { return m_hasColorProfile; } |
50 IntSize decodedSize() const override { return m_decodedSize; } | 50 IntSize decodedSize() const override { return m_decodedSize; } |
51 IntSize decodedYUVSize(int component, SizeType) const override; | 51 IntSize decodedYUVSize(int component, SizeType) const override; |
52 bool setSize(unsigned width, unsigned height) override; | 52 bool setSize(unsigned width, unsigned height) override; |
53 bool canDecodeToYUV() override; | 53 bool canDecodeToYUV() override; |
54 bool decodeToYUV() override; | 54 bool decodeToYUV() override; |
55 void setImagePlanes(PassOwnPtr<ImagePlanes>) override; | 55 void setImagePlanes(PassOwnPtr<ImagePlanes>) override; |
56 bool hasImagePlanes() const { return m_imagePlanes; } | 56 bool hasImagePlanes() const { return m_imagePlanes; } |
| 57 bool canDecodeToRGB565() override; |
| 58 bool setDecodeRGB565Enabled(bool) override; |
| 59 bool decodeToRGB565Enabled() const { return m_decodeToRGB565; } |
57 | 60 |
58 bool outputScanlines(); | 61 bool outputScanlines(); |
59 unsigned desiredScaleNumerator() const; | 62 unsigned desiredScaleNumerator() const; |
60 void complete(); | 63 void complete(); |
61 | 64 |
62 void setOrientation(ImageOrientation orientation) { m_orientation = orientat
ion; } | 65 void setOrientation(ImageOrientation orientation) { m_orientation = orientat
ion; } |
63 void setHasColorProfile(bool hasColorProfile) { m_hasColorProfile = hasColor
Profile; } | 66 void setHasColorProfile(bool hasColorProfile) { m_hasColorProfile = hasColor
Profile; } |
64 void setDecodedSize(unsigned width, unsigned height); | 67 void setDecodedSize(unsigned width, unsigned height); |
65 | 68 |
66 private: | 69 private: |
67 // ImageDecoder: | 70 // ImageDecoder: |
68 void decodeSize() override { decode(true); } | 71 void decodeSize() override { decode(true); } |
69 void decode(size_t) override { decode(false); } | 72 void decode(size_t) override { decode(false); } |
70 | 73 |
71 // Decodes the image. If |onlySize| is true, stops decoding after | 74 // Decodes the image. If |onlySize| is true, stops decoding after |
72 // calculating the image size. If decoding fails but there is no more | 75 // calculating the image size. If decoding fails but there is no more |
73 // data coming, sets the "decode failure" flag. | 76 // data coming, sets the "decode failure" flag. |
74 void decode(bool onlySize); | 77 void decode(bool onlySize); |
75 | 78 |
76 OwnPtr<JPEGImageReader> m_reader; | 79 OwnPtr<JPEGImageReader> m_reader; |
77 OwnPtr<ImagePlanes> m_imagePlanes; | 80 OwnPtr<ImagePlanes> m_imagePlanes; |
78 IntSize m_decodedSize; | 81 IntSize m_decodedSize; |
79 bool m_hasColorProfile; | 82 bool m_hasColorProfile; |
| 83 bool m_decodeToRGB565; |
80 }; | 84 }; |
81 | 85 |
82 } // namespace blink | 86 } // namespace blink |
83 | 87 |
84 #endif | 88 #endif |
OLD | NEW |