| 1 |
/* |
| 2 |
* Copyright 2015 The Etc2Comp Authors. |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
| 6 |
* You may obtain a copy of the License at |
| 7 |
* |
| 8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
* |
| 10 |
* Unless required by applicable law or agreed to in writing, software |
| 11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
* See the License for the specific language governing permissions and |
| 14 |
* limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
#pragma once |
| 18 |
|
| 19 |
#include "EtcColor.h" |
| 20 |
|
| 21 |
namespace Etc |
| 22 |
{ |
| 23 |
|
| 24 |
class Comparison; |
| 25 |
class Image; |
| 26 |
class Block4x4; |
| 27 |
|
| 28 |
class Analysis |
| 29 |
{ |
| 30 |
public: |
| 31 |
|
| 32 |
static const unsigned int MAX_COMPARISONS = 4; |
| 33 |
|
| 34 |
Analysis(Image *a_pimage, const char *a_pstrOutputFolder); |
| 35 |
|
| 36 |
void Compare(const char *a_pstrFilename, int a_iPixelX = -1, int a_iPixelY = -1); |
| 37 |
|
| 38 |
inline const char * GetOutputFolder(void) |
| 39 |
{ |
| 40 |
return m_pstrOutputFolder; |
| 41 |
} |
| 42 |
|
| 43 |
static void DrawImage(Image *a_pimage, const char *a_pstrOutputFolder, |
| 44 |
bool a_boolDrawModes); |
| 45 |
|
| 46 |
inline Image * GetImage(void) |
| 47 |
{ |
| 48 |
return m_pimage; |
| 49 |
} |
| 50 |
|
| 51 |
static void DrawBlockPixels(Block4x4 *a_pblock, |
| 52 |
ColorR8G8B8A8 *a_pargba8Output, |
| 53 |
unsigned int a_uiOutputWidth, |
| 54 |
bool a_bGrayscale, |
| 55 |
unsigned int a_uiScale = 1); |
| 56 |
|
| 57 |
static float ConvertErrorToPSNR(float a_fError, unsigned int a_uiTotalComponents); |
| 58 |
|
| 59 |
private: |
| 60 |
|
| 61 |
static void DrawBlockMode2x(Block4x4 *a_pblock, |
| 62 |
ColorR8G8B8A8 *a_pargba8Output, |
| 63 |
unsigned int a_uiOutputWidth); |
| 64 |
|
| 65 |
Image *m_pimage; |
| 66 |
const char *m_pstrOutputFolder; |
| 67 |
unsigned int m_uiComparisons; |
| 68 |
Comparison *m_apcomparison[MAX_COMPARISONS]; |
| 69 |
}; |
| 70 |
|
| 71 |
} |