加入收藏
举报
02-14 20:02
#0
文件名称:
OHOS.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
62.67 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# OHOS
## **Overview**
**Related Modules:**
[AbilityKit](AbilityKit.md) | [Graphic](Graphic.md) | [MultiMedia\_AudioCapturer](MultiMedia_AudioCapturer.md) | [MultiMedia\_Camera](MultiMedia_Camera.md) | [MultiMedia\_CameraAbility](MultiMedia_CameraAbility.md) | [MultiMedia\_CameraConfig](MultiMedia_CameraConfig.md) | [MuiltiMedia\_CameraDeviceCallback](MuiltiMedia_CameraDeviceCallback.md) | [MultiMedia\_CameraKit](MultiMedia_CameraKit.md) | [MultiMedia\_CameraStateCallback](MultiMedia_CameraStateCallback.md) | [MultiMedia\_MediaCommon](MultiMedia_MediaCommon.md) | [MultiMedia\_FrameConfig](MultiMedia_FrameConfig.md) | [MultiMedia\_FrameStateCallback](MultiMedia_FrameStateCallback.md) | [Surface](Surface.md) | [MultiMedia\_Player](MultiMedia_Player.md) | [MultiMedia\_Recorder](MultiMedia_Recorder.md) | [Window](Window.md)
**Description:**
Declares functions in the **CameraConfig** class.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Structures





























































































































































































































































































































Data Structure Name


Description


Ability


Declares ability-related functions, including ability lifecycle callbacks and functions for connecting to or disconnecting from AAs.


AbilityContext


Provides functions for starting and stopping an ability.


AbilityEventHandler


Declares functions for performing operations during inter-thread communication, including running and quitting the event loop of the current thread and posting tasks to an asynchronous thread.


AbilityLoader


Declares functions for registering the class names of Ability and AbilitySlice with the ability management framework.


AbilitySlice


Provides ability slice-related functions, including ability slice lifecycle callbacks and functions for connecting to or disconnecting from ability slices.


AbstractAdapter


Defines the base class for adapters. You can derive AbstractAdapter based on actual requirements and use the GetView() and GetCount() functions to implement adapters of different data types. For details, see TextAdapter.


Animator


Represents an animator.


AnimatorCallback


Represents the animator callback.


AnimatorManager


Represents the animator manager.


BinHeader


struct BinHeader for font refer to ui_font.h


ButtonStyle


Stores styles of a button in its different states.


CancelEvent


Defines a cancel event, which usually occurs when the target view changes due to user sliding. For example, this event is triggered if you, after pressing a button, does not release the button but slides.


ClickEvent


Defines a click event, which indicates that a finger is pressed on the screen and then lifted within 1 second.


Color


Converts colors in different formats and defines common colors.


Color16


Defines the color attribute when the color depth is 16.


Color24


Defines the color attribute when the color depth is 24.


Color32


Defines the color attribute when the color depth is 32.


DragEvent


Defines a drag event, which indicates a certain movement (more than 10 pixels) after a view is pressed.


EasingEquation


Defines functions for specifying the velocity of an animation.


Event


Defines the base class of a user input event and provides functions to record information such as the event position and timestamp.


FlexLayout


Defines a flexible layout container. You can perform simple adaptive layout on child views that the container holds, for example, to evenly arrange all child views in the same row or column.


FontHeader


struct FontHeader refer to ui_font.h


GlyphHeader


struct GlyphHeader for font, font tool using, not for bin file refer to ui_font.h


GlyphNode


struct GlyphNode for font refer to ui_font.h


GridLayout


Defines a grid layout container. You can perform simple grid layout on child views that the container holds.


IBufferConsumerListener


Defines the consumer listener used to notify consumers when the surface status is updated.


Image


Represents basic image attributes, including the image type and path.


ImageAnimatorInfo


Provides information about the images.


ImageHeader


Defines image head node information.


ImageInfo


Defines image information.


Interpolation


Calculates the Bezier interpolation.


KernNode


struct KernNode for kerning of font refer to ui_font.h


KeyEvent


Defines a key event, which indicates that a physical button is pressed or released.


LangBinHeader


struct LangBinHeader for font refer to ui_font.h


LangFontBinHeader


struct LangFontBinHeader for font refer to ui_font.h


LangTexsTableHeader


struct LangTexsTableHeader for font refer to ui_font.h


LangTexsUtf8Param


struct LangTexsUtf8Param for font refer to ui_font.h


Layout


Defines the base class of the layout, which indicates the basic data types and operations that may be used in the layout.


Line


Defines a line, which consists of the start and end points.


List


Defines a linked list template class, which implements the data structure of bidirectional linked list and provides basic functions such as adding, deleting, inserting, clearing, popping up, and obtaining the size of the linked list.


ListNode


Stores linked list data and contains pointers to the previous node and the next node.


ListScrollListener


Represents a listener that contains a callback to be invoked when the scroll state changes or when a new child view is selected at the preset position as this list scrolls. The scroll state can be SCROLL_STATE_STOP or SCROLL_STATE_MOVE.


LongPressEvent


Defines a long-press event, which indicates that the finger is not raised or moved within 1 second after a view is pressed.


Matrix3


Defines a 3 x 3 matrix.


Paint


Defines the basic styles of graphs drawn on canvases.


Point


Defines a point.


Polygon


Defines a polygon, including vertex coordinates and the maximum number of vertices (defined by MAX_VERTEX_NUM).


PressEvent


Defines a touch event, which indicates that the touchscreen or mouse is pressed.


RawEvent


struct of raw event


Rect


Defines a rectangle, including the position data of the four boundaries of the rectangle, and provides functions for rectangle inclusion, intersection, and aggregation.


ReleaseEvent


Defines a release event, which indicates that the touchscreen or mouse is released.


RootView


Defines the functions related to a root view which contains its child views and represents the root node in a tree structure.


StyleDefault


Define some default style for UIView.


Surface


Defines the consumer listener used to notify consumers when the surface status is updated.


SurfaceBuffer


Provides functions such as setting the virtual address, size, and additional attributes of shared memory.


SysInfo


Obtains the system information. Currently, the FPS information can be obtained. To enable the FPS feature, enable the ENABLE_FPS_SUPPORT macro.


Text


Represents the base class of Text, providing the text attribute setting and text drawing capabilities for components that require font display.


TextAdapter


Defines a text adapter, which implements UILabel instance construction and supports text data and continuous integer data.


TextFormatter


Defines a text formatter. You can inherit this class and implement the Format() function.


ThemeManager


Declares the singleton class used to manage the current screen theme of an application.


TransformMap


Transforms a rectangle, including rotation and scaling.


TtfHeader


struct TtfHeader for header of ttftab.bin refer to ui_font.h


UIAbstractClock


An abstract class that contains functions for converting units of time (hour, minute, and second), setting and obtaining the time.


UIAbstractProgress


Represents the abstract base class which provides functions related to the progress bar.


UIAbstractScroll


Defines the attributes of a scroll, including the scroll direction, blank size of a scroll view, velocity and effects of a scroll animation.


UIAnalogClock


Provides the functions related to an analog clock.


UIArcLabel


Defines functions related to an arc label.


UIAxis


Represents the coordinate axis base class, which defines the basic attributes of coordinate axis, sets whether a coordinate axis is visible, and sets the number of scales on a coordinate axis. This class is used in UIChart.


UIBoxProgress


Represents a linear progress bar.


UIButton


Represents a button.


UICanvas


Defines a canvas, which is used to draw multiple types of 2D graphs.


UIChart


Defines the chart class and provides functions such as adding and deleting data sets to display a chart.


UIChartDataSerial


Defines a data set and provides functions such as adding and deleting data points.


UIChartPillar


Provides special functions for implementing a bar chart.


UIChartPolyline


Provides special functions for implementing a polyline.


UICheckBox


Represents a check box.


UICircleProgress


Represents a circular progress bar.


UIDialog


Represents a dialog box.


UIDigitalClock


Displays time digitally.


UIDumpDomTree


Provides functions for exporting information about a specified DOM node or information about the DOM tree starting from a specified DOM node.


UIImageAnimatorView


Represents an image animator.


UIImageView


Defines the functions related to an image view.


UILabel


Defines the functions for presenting a label in a specified area, setting the style and background color of a label, and setting the display mode of a long label text.


UILabelButton


Provides the functions related to a label button.


UIList


Represents a scrollable list which is used with the adapter AbstractAdapter to implement scrolling, inertial scrolling, automatic alignment, and invoking of a callback when a child view is selected at the preset position as this list scrolls.


UIPicker


Defines a picker. Multiple texts or numbers can be put into a sliding list for selection. The selected text or numbers are highlighted.


UIRadioButton


Represents a radio button.


UIRepeatButton


Represents a repeat button.


UIScrollView


Supports horizontal or vertical scroll of child views. This class is inherited from UIAbstractScroll.


UISlider


Represents a slider.


UISnapShot


Represents the UISnapShot class.


UISwipeView


Represents a swipe view.


UITextureMapper


Rotates and scales images.


UITimePicker


Defines the time picker. The time is in the format of "hour:minute" or "hour:minute:second". The selected time is highlighted.


UIToggleButton


Represents a toggle button.


UIView


Defines the base class of a view, providing basic view attributes and operations. All views are derived from this class.


UIViewGroup


Represents a view group that consists of its child views.


UIXAxis


Defines the unique attributes and functions for the x-axis. This class is used in UIChart.


UIYAxis


Defines the unique attributes and functions for the y-axis. This class is used in UIChart.


Vector2


Defines the two-dimensional vector, and provides basic mathematical operations such as vector assignment, scalar product, cross product, addition, and subtraction.


Vector3


Defines the 3-dimensional vector, and provides basic operators such as [] and ==.


VirtualDeviceEvent


Defines a virtual device event, which is used to receive a customized input event and call back the listening function registered.


Window


Provides a drawing canvas for the RootView, which represents the root node of a view tree.


WindowConfig


Sets the attributes for this window.



## Typedefs








Typedef Name


Description


EasingFunc) (int16_t startPos, int16_t endPos, uint16_t curTime, uint16_t durationTime)


typedef int16_t(* 


Calculates the value for the current time of an animation.



## Enumerations
































Enumeration Name


Description


{ OPA_TRANSPARENT = 0, OPA_OPAQUE = 255 }


Enumerates opacity values.


UITextLanguageAlignment : uint8_t {   TEXT_ALIGNMENT_LEFT = 0, TEXT_ALIGNMENT_RIGHT, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP,   TEXT_ALIGNMENT_BOTTOM }


Enumerates text alignment modes.


UITextLanguageDirect : uint8_t { TEXT_DIRECT_LTR = 0, TEXT_DIRECT_RTL }


Enumerates text directions.


ColorMode : uint8_t {   ARGB8888 = 0, RGB888, RGB565, ARGB1555,   ARGB4444, AL44, AL88, L1,   L2, L4, L8, A1,   A2, A4, A8, UNKNOW }


colormode of image and font.


InputDevType { ,   InputDevType::INDEV_TYPE_KEY, InputDevType::INDEV_TYPE_KEYBOARD, InputDevType::INDEV_TYPE_MOUSE, InputDevType::INDEV_TYPE_BUTTON,   InputDevType::INDEV_TYPE_CROWN, InputDevType::INDEV_TYPE_ENCODER, InputDevType::INDEV_TYPE_UNKNOWN }


 

: uint8_t {   STYLE_BACKGROUND_COLOR, STYLE_BACKGROUND_OPA, STYLE_BORDER_RADIUS, STYLE_BORDER_COLOR,   STYLE_BORDER_OPA, STYLE_BORDER_WIDTH, STYLE_PADDING_LEFT, STYLE_PADDING_RIGHT,   STYLE_PADDING_TOP, STYLE_PADDING_BOTTOM, STYLE_MARGIN_LEFT, STYLE_MARGIN_RIGHT,   STYLE_MARGIN_TOP, STYLE_MARGIN_BOTTOM, STYLE_IMAGE_OPA, STYLE_TEXT_COLOR,   STYLE_TEXT_FONT, STYLE_LETTER_SPACE, STYLE_LINE_SPACE, STYLE_TEXT_OPA,   STYLE_LINE_COLOR, STYLE_LINE_WIDTH, STYLE_LINE_OPA, STYLE_LINE_CAP }


Enumerates keys of styles.


BufferConsumerUsage {   BUFFER_CONSUMER_USAGE_SORTWARE = 0, BUFFER_CONSUMER_USAGE_HARDWARE, BUFFER_CONSUMER_USAGE_HARDWARE_CONSUMER_CACHE, BUFFER_CONSUMER_USAGE_HARDWARE_PRODUCER_CACHE,   BUFFER_CONSUMER_USAGE_MAX }


Enumerates shared memory usage scenarios, including physically contiguous memory and virtual memory.


ImagePixelFormat {   IMAGE_PIXEL_FORMAT_NONE = 0, IMAGE_PIXEL_FORMAT_RGB565 = 101, IMAGE_PIXEL_FORMAT_ARGB1555, IMAGE_PIXEL_FORMAT_RGB888,   IMAGE_PIXEL_FORMAT_ARGB8888, IMAGE_PIXEL_FORMAT_YUYV = 201, IMAGE_PIXEL_FORMAT_YVYU, IMAGE_PIXEL_FORMAT_UYVY,   IMAGE_PIXEL_FORMAT_VYUY, IMAGE_PIXEL_FORMAT_AYUV, IMAGE_PIXEL_FORMAT_YUV410, IMAGE_PIXEL_FORMAT_YVU410,   IMAGE_PIXEL_FORMAT_YUV411, IMAGE_PIXEL_FORMAT_YVU411, IMAGE_PIXEL_FORMAT_YUV420, IMAGE_PIXEL_FORMAT_YVU420,   IMAGE_PIXEL_FORMAT_YUV422, IMAGE_PIXEL_FORMAT_YVU422, IMAGE_PIXEL_FORMAT_YUV444, IMAGE_PIXEL_FORMAT_YVU444,   IMAGE_PIXEL_FORMAT_NV12 = 301, IMAGE_PIXEL_FORMAT_NV21, IMAGE_PIXEL_FORMAT_NV16, IMAGE_PIXEL_FORMAT_NV61 }


Enumerates a pixel format.


WindowPixelFormat { WINDOW_PIXEL_FORMAT_RGB565 = 101, WINDOW_PIXEL_FORMAT_ARGB1555, WINDOW_PIXEL_FORMAT_RGB888, WINDOW_PIXEL_FORMAT_ARGB8888 }


Enumerates the pixel formats of this window.



## Functions






























































Function Name


Description


GetTextLangFontsTable (uint8_t langFontId)


UITextLanguageFontParam * 


Get the Text Lang Fonts Table.


GetTotalLangId ()


uint8_t 


Get the Total Lang Id.


GetTotalFontId ()


uint8_t 


Get the Total Font Id.


GetTotalTextId ()


uint16_t 


Get the Total Text Id.


GetLangTextDefaultParamTable ()


LangTextParam * 


Get the Lang Text default param table.


Intersect (const Line &a, const Line &b, Vector2< int16_t > &out)


bool 


Checks whether line segment a and line segment b intersect, and returns the intersection point (if available).


IsIntersect (const Line &a, const Line &b)


bool 


Chekcs whether line segment a and line segment b intersect.


Clip (Polygon &poly, const Line &line)


void 


Clips a polygon by using a line segment.


SuthHodgClip (const Rect &clipRect, const Polygon &polygon)


Polygon 


Implements Sutherland-Hodgman, an algorithm used for clipping polygons.


Clip (const Line &line, const Polygon &poly, Vector2< int16_t > *pOut, uint8_t *pNum)


void 


Clips a polygon by using a line segment and obtains the intersections.


ImageCacheMalloc (ImageInfo &info)


void * 


Applies for the image cache memory. You can customize the memory area when loading image resources.


ImageCacheFree (ImageInfo &info)


void 


Releases the image cache memory.


UIMalloc (uint32_t size)


void * 


Applies for memory for the graphics module. You can implement this function to override the malloc and new functions.


UIFree (void *buffer)


void 


Releases memory for the graphics module. You can implement this function to override the free and delete functions.


Rotate (const Vector2< int16_t > &point, int16_t angle, const Vector2< int16_t > &pivot, Vector2< int16_t > &out)


void 


Rotates a point around the pivot by a certain angle.


Rotate (const Line &origLine, int16_t angle, const Vector2< int16_t > &pivot, Line &out)


void 


Rotates a line around the pivot by a certain angle.


Rotate (const Rect &origRect, int16_t angle, const Vector2< int16_t > &pivot, Polygon &out)


void 


Rotates a rectangle around the pivot by a certain angle.


GetVersion ()


std::string 


Obtains the version number of the graphics module.


GetLibDsc ()


std::string 


Obtains the library description of the graphics module.



## **Details**
## **Enumeration Type Documentation**
## InputDevType
```
enum [OHOS::InputDevType](OHOS.md#ac4e2abaf935793b876fbe5905d560e92)
```


























Enumerator


Description


INDEV_TYPE_KEY 

Touchscreen


INDEV_TYPE_KEYBOARD 

Physical key


INDEV_TYPE_MOUSE 

Keyboard


INDEV_TYPE_BUTTON 

Mouse


INDEV_TYPE_CROWN 

Virtual button


INDEV_TYPE_ENCODER 

Watch crown


INDEV_TYPE_UNKNOWN 

Customized type of a specific function or event



## **Function Documentation**
## GetLangTextDefaultParamTable\(\)
```
LangTextParam* OHOS::GetLangTextDefaultParamTable ()
```
**Description:**
Get the Lang [Text](OHOS-Text.md) default param table.
**Returns:**
LangTextParam\* the param table, definition is in font tool
## GetTextLangFontsTable\(\)
```
UITextLanguageFontParam* OHOS::GetTextLangFontsTable (uint8_t langFontId)
```
**Description:**
Get the [Text](OHOS-Text.md) Lang Fonts Table.
**Parameters:**








Name


Description


uint8_t langFontId [in] the font id

**Returns:**
UITextLanguageFontParam\* the font table, definition is in font tool
## GetTotalFontId\(\)
```
uint8_t OHOS::GetTotalFontId ()
```
**Description:**
Get the Total Font Id.
**Returns:**
uint8\_t the total font id, definition is in font tool
## GetTotalLangId\(\)
```
uint8_t OHOS::GetTotalLangId ()
```
**Description:**
Get the Total Lang Id.
**Returns:**
uint8\_t the total Lang id, definition is in font tool
## GetTotalTextId\(\)
```
uint16_t OHOS::GetTotalTextId ()
```
**Description:**
Get the Total [Text](OHOS-Text.md) Id.
**Returns:**
uint8\_t the total text id, definition is in font tool
点赞 回复
回帖
支持markdown部分语法 ?