1 /*---------------------------------------------------------------------------*
2 
3 Copyright (C) Nintendo.  All rights reserved.
4 
5 These coded instructions, statements, and computer programs contain
6 proprietary information of Nintendo of America Inc. and/or Nintendo
7 Company Ltd., and are protected by Federal copyright law.  They may
8 not be disclosed to third parties or copied or duplicated in any form,
9 in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 
13 #ifndef NN_EC_IMAGE_FILE_H_
14 #define NN_EC_IMAGE_FILE_H_
15 
16 #include <nn/ec/ec_File.h>
17 
18 namespace nn { namespace ec {
19 
20 //! @addtogroup  nn_ec_class
21 //! @{
22 
23 /*!
24 @brief  Class for handling image files.
25 */
26 class ImageFile : public File
27 {
28 public:
29     /*!
30 @brief  Instantiates an object.
31 */
32     ImageFile();
33 
34     /*!
35 @brief  Destroys the object.
36 */
37     ~ImageFile();
38 
39     /*!
40 @brief  Gets the image width.
41 
42 @return  Returns the image width.
43 */
44     const u32 GetWidth() const;
45 
46     /*!
47 @brief  Gets the image height.
48 
49 @return  Returns the image height.
50 */
51     const u32 GetHeight() const;
52 
53     /*!
54 @brief  Gets the image size.
55 
56 The image size is calculated as width × height × color depth.
57 
58 @return  Returns the image size.
59 */
60     const size_t GetImageSize() const;
61 
62     /*!
63 @brief  Decodes the image.
64 
65 @param[out] pBuffer  Specifies the buffer for storing the decoded image data. @n
66 Set the buffer size to no less than <tt>@ref GetImageSize</tt>.
67 
68 @return  The result of processing.
69 
70 @retval Result::IsSuccess  Indicates success.
71 @retval ResultInvalidArgument  Indicates that an argument is invalid.
72 @retval ResultInvalidData  Indicates that the data is invalid. (It is not a decodable image file.)
73 @retval ResultOutOfMemory  Insufficient memory.
74 */
75     nn::Result Decode(u32* pBuffer) const;
76 };
77 
78 //! @}
79 
80 }} // namespace nn::ec
81 
82 #endif // NN_EC_IMAGE_FILE_H_
83