MCPcopy Create free account
hub / github.com/android/ndk-samples / ImageReader

Class ImageReader

camera/basic/src/main/cpp/image_reader.h:34–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32};
33
34class ImageReader {
35 public:
36 /**
37 * Ctor and Dtor()
38 */
39 explicit ImageReader(ImageFormat* res, enum AIMAGE_FORMATS format);
40
41 ~ImageReader();
42
43 /**
44 * Report cached ANativeWindow, which was used to create camera's capture
45 * session output.
46 */
47 ANativeWindow* GetNativeWindow(void);
48
49 /**
50 * Retrieve Image on the top of Reader's queue
51 */
52 AImage* GetNextImage(void);
53
54 /**
55 * Retrieve Image on the back of Reader's queue, dropping older images
56 */
57 AImage* GetLatestImage(void);
58
59 /**
60 * Delete Image
61 * @param image {@link AImage} instance to be deleted
62 */
63 void DeleteImage(AImage* image);
64
65 /**
66 * AImageReader callback handler. Called by AImageReader when a frame is
67 * captured
68 * (Internal function, not to be called by clients)
69 */
70 void ImageCallback(AImageReader* reader);
71
72 /**
73 * DisplayImage()
74 * Present camera image to the given display buffer. Avaliable image is
75 * converted
76 * to display buffer format. Supported display format:
77 * WINDOW_FORMAT_RGBX_8888
78 * WINDOW_FORMAT_RGBA_8888
79 * @param buf {@link ANativeWindow_Buffer} for image to display to.
80 * @param image a {@link AImage} instance, source of image conversion.
81 * it will be deleted via {@link AImage_delete}
82 * @return true on success, false on failure
83 */
84 bool DisplayImage(ANativeWindow_Buffer* buf, AImage* image);
85 /**
86 * Configure the rotation angle necessary to apply to
87 * Camera image when presenting: all rotations should be accumulated:
88 * CameraSensorOrientation + Android Device Native Orientation +
89 * Human Rotation (rotated degree related to Phone native orientation
90 */
91 void SetPresentRotation(int32_t angle);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected