Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: third_party/android_opengl/etc1/etc1.h

Issue 486093002: Fix thumbnail store crashing on loading old files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle endianness of float reads Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2009 Google Inc. 1 // Copyright 2009 Google Inc.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 17 matching lines...) Expand all
28 // pIn - pointer to the image data. Formatted such that 28 // pIn - pointer to the image data. Formatted such that
29 // pixel (x,y) is at pIn + pixelSize * x + stride * y; 29 // pixel (x,y) is at pIn + pixelSize * x + stride * y;
30 // pOut - pointer to encoded data. Must be large enough to store entire encoded image. 30 // pOut - pointer to encoded data. Must be large enough to store entire encoded image.
31 // pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYT E RGB image. 31 // pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYT E RGB image.
32 // returns non-zero if there is an error. 32 // returns non-zero if there is an error.
33 33
34 bool etc1_encode_image(const unsigned char* pIn, unsigned int width, unsigned in t height, 34 bool etc1_encode_image(const unsigned char* pIn, unsigned int width, unsigned in t height,
35 unsigned int pixelSize, unsigned int stride, unsigned char* pOut, unsig ned int outWidth, 35 unsigned int pixelSize, unsigned int stride, unsigned char* pOut, unsig ned int outWidth,
36 unsigned int outHeight); 36 unsigned int outHeight);
37 37
38 // Size of a PKM header, in bytes.
39
40 #define ETC_PKM_HEADER_SIZE 16
41
42 // Format a PKM header
43
44 void etc1_pkm_format_header(unsigned char* pHeader, unsigned int width, unsigned int height);
45
46 // Check if a PKM header is correctly formatted.
47
48 bool etc1_pkm_is_valid(const unsigned char* pHeader);
49
50 // Read the image width from a PKM header
51
52 unsigned int etc1_pkm_get_width(const unsigned char* pHeader);
53
54 // Read the image height from a PKM header
55
56 unsigned int etc1_pkm_get_height(const unsigned char* pHeader);
57
38 #endif // THIRD_PARTY_ANDROID_OPENGL_ETC1_ETC1_H_ 58 #endif // THIRD_PARTY_ANDROID_OPENGL_ETC1_ETC1_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698