CN114995738B - Transformation method, transformation device, electronic equipment, storage medium and program product - Google Patents

Transformation method, transformation device, electronic equipment, storage medium and program product Download PDF

Info

Publication number
CN114995738B
CN114995738B CN202210612981.XA CN202210612981A CN114995738B CN 114995738 B CN114995738 B CN 114995738B CN 202210612981 A CN202210612981 A CN 202210612981A CN 114995738 B CN114995738 B CN 114995738B
Authority
CN
China
Prior art keywords
state
transformation
stored
transforming
touch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210612981.XA
Other languages
Chinese (zh)
Other versions
CN114995738A (en
Inventor
姚立恒
牟灿
蒋宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202210612981.XA priority Critical patent/CN114995738B/en
Publication of CN114995738A publication Critical patent/CN114995738A/en
Application granted granted Critical
Publication of CN114995738B publication Critical patent/CN114995738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/048Indexing scheme relating to G06F3/048
    • G06F2203/04806Zoom, i.e. interaction techniques or interactors for controlling the zooming operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/048Indexing scheme relating to G06F3/048
    • G06F2203/04808Several contacts: gestures triggering a specific function, e.g. scrolling, zooming, right-click, when the user establishes several contacts with the surface simultaneously; e.g. using several fingers or a combination of fingers and pen

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a transformation method, which comprises the following steps: detecting a touch event of a user on a touch screen; detecting the state of an element displayed on a touch screen after the touch event is detected, and acquiring a first state and a second state of the element; acquiring at least one object generated in the process of transforming the element from the first state to the second state; matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object; and transforming the element by using the associated object to obtain a target element. The invention can improve the reusability of the object, reduce the memory jitter (memory churn) generated when repeatedly creating new graphic objects, reduce the condition that the memory usage exceeds in a short time caused by continuously creating new objects, reduce the performance loss of the vehicle, improve the stability and the expression effect of transformation, provide better visual effect for users, and enable the users to zoom more silky and smooth.

Description

Transformation method, transformation device, electronic equipment, storage medium and program product
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a transformation method, an apparatus, an electronic device, a storage medium, and a program product.
Background
Currently, in touchable devices, the elements displayed in the touch screen are enlarged with the gesture already becoming necessary items. When browsing the elements, the user can use fingers to try double-click, drag, slide and the like to operate the elements so as to enable the displayed elements to reach the self-wanted expression form. Because developers with different implementation manners of gesture scaling elements can have different standards in the development process, the transformation generates problems such as memory jitter, abnormal transformation and the like.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present invention provides a transformation method, apparatus, electronic device, storage medium and program product to solve the above-mentioned technical problems.
The invention provides a transformation method, which comprises the following steps:
detecting a touch event of a user on a touch screen;
detecting the state of an element displayed on a touch screen after the touch event is detected, and acquiring a first state and a second state of the element;
acquiring at least one object generated in the process of transforming the element from the first state to the second state;
matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object;
and transforming the element by using the associated object to obtain a target element.
In an embodiment of the present invention, if there is an object that does not match the pre-stored object in the at least one object, after the step of matching the at least one object with the pre-stored object in the object pool, the method further includes:
establishing an associated object of an object which is not matched with the pre-stored object;
and transforming the element by using the newly-built association object.
In an embodiment of the present invention, the process of transforming the first state into the second state includes a plurality of sub-states, each sub-state corresponding to an object, and the creating an associated object of the object that does not match the pre-stored object includes:
obtaining a transformation parameter for transforming a former sub-state into a latter sub-state;
and transforming the object corresponding to the previous state according to the transformation parameters to obtain a transformed transformation object, wherein the transformed transformation object is used as a newly-built association object.
In an embodiment of the present invention, in the process of transforming the element with the associated object, the method further includes:
acquiring a first transformation parameter of the element transformed from the first state to the second state;
comparing the first transformation parameter with a transformation parameter threshold;
and stopping the transformation of the element when the first transformation parameter is equal to the transformation parameter threshold.
In an embodiment of the present invention, the transformation parameters include translational displacement or/and scaling, and the step of obtaining the transformation parameters includes:
acquiring the number of touch points according to the touch event;
when the number of the touch points is one, taking the displacement of the touch point movement as the translation displacement;
when the number of the touch points is more than one, acquiring the center point of each touch point; and determining the scaling according to the distance between each touch point and the center point.
In an embodiment of the present invention, after establishing the associated object of the object that does not match the pre-stored object, the method further includes:
and storing the newly-built associated object into the object pool.
The invention provides a conversion device, which comprises:
the touch detection module is used for detecting a touch event of a user on the touch screen;
the state detection module is used for detecting the state of the element displayed on the touch screen after the touch event is detected, and acquiring a first state and a second state of the element;
an object acquisition module, configured to acquire at least one object generated during a process of transforming the element from the first state to the second state;
the object matching module is used for matching the at least one object with a prestored object in the object pool and acquiring an associated object of the prestored object successfully matched with the at least one object;
and the element transformation module is used for transforming the elements by the associated objects to obtain target elements.
The invention provides an electronic device, comprising:
one or more processors;
and a storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the transformation method.
The present invention provides a computer readable storage medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the transformation method.
The invention provides a computer program product characterized in that it comprises a computer program on a computer readable medium, the computer program comprising a computer program for performing said transformation method.
The invention has the beneficial effects that: the transformation method in the invention comprises the following steps: detecting a touch event of a user on a touch screen; detecting the state of an element displayed on a touch screen after the touch event is detected, and acquiring a first state and a second state of the element; acquiring at least one object generated in the process of transforming the element from the first state to the second state; matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object; and transforming the element by using the associated object to obtain a target element. According to the method, a plurality of objects are pre-stored in the pre-established object pool, in the element transformation process, whether the associated objects which are the same as the objects exist in the object pool is searched, and if the associated objects exist, the elements are directly transformed by the associated objects. Therefore, the reusability of the objects can be improved, memory Churn generated when new graphic objects are repeatedly created is reduced, the situation that the use of short-time Memory is exceeded due to the fact that new objects are continuously created is reduced, the performance loss of the vehicle is reduced, the stability and the performance effect of transformation are improved, a better visual effect is provided for users, and zooming is smooth and fluent.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 is a schematic diagram of an implementation environment of a transformation method shown in an exemplary embodiment of the present application;
FIG. 2 is a flow chart of a transformation method shown in an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of an external matrix shown in an exemplary embodiment of the present application;
FIG. 4 is a flow chart illustrating the acquisition of transformation parameters according to an exemplary embodiment of the present application;
FIG. 5 is a flow chart illustrating the creation of an association object according to an exemplary embodiment of the present application;
FIG. 6 is a block diagram of a transformation device shown in an exemplary embodiment of the present application;
fig. 7 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
Detailed Description
Further advantages and effects of the present invention will become readily apparent to those skilled in the art from the disclosure herein, by referring to the accompanying drawings and the preferred embodiments. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be understood that the preferred embodiments are presented by way of illustration only and not by way of limitation.
It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In the following description, numerous details are set forth in order to provide a more thorough explanation of embodiments of the present invention, it will be apparent, however, to one skilled in the art that embodiments of the present invention may be practiced without these specific details, in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring the embodiments of the present invention.
FIG. 1 is a schematic diagram of an exemplary transformation method implementation environment of the present application. Referring to fig. 1, the implementation environment includes a terminal device 101 and a server 102, where the terminal device 101 and the server 102 communicate through a wired or wireless network.
It should be understood that the number of terminal devices 101 and servers 102 in fig. 1 is merely illustrative. There may be any number of terminal devices 101 and servers 102 as practical.
The terminal device 101 corresponds to a client, and may be any electronic device having a user input interface, including but not limited to a touch screen, a keyboard, physical keys, an audio pick-up device, and the like, including but not limited to a smart phone, a tablet, a notebook, a computer, a car-mounted computer, and the like.
The server 102 corresponds to a server, which may be a server providing various services, may be an independent physical server, may be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content DeliveryNetwork, content distribution networks), and basic cloud computing services such as big data and artificial intelligent platforms, which are not limited herein.
The terminal device 101 may communicate with the server 102 via a wireless network such as 3G (third generation mobile information technology), 4G (fourth generation mobile information technology), 5G (fifth generation mobile information technology), and the like, which is not limited in this regard.
Referring to fig. 2, fig. 2 is a flowchart illustrating a transformation method according to an exemplary embodiment of the present application. The method may be applied to the implementation environment shown in fig. 1 and specifically performed by the terminal device 101 in the implementation environment. It should be understood that the method may be adapted to other exemplary implementation environments and be specifically executed by devices in other implementation environments, and the implementation environments to which the method is adapted are not limited by the present embodiment.
Referring to fig. 2, fig. 2 is a flowchart of an exemplary transformation method of the present application, where the transformation method at least includes steps S201 to S205, including:
s201, detecting a touch event of a user on a touch screen;
s202, detecting the state of an element displayed on a touch screen after the touch event is detected, and acquiring a first state and a second state of the element;
s203, acquiring at least one object generated in the process of transforming the element from the first state to the second state;
s204, matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object;
s205, transforming the elements by the associated objects to obtain target elements.
According to the method, a plurality of objects are pre-stored in the pre-established object pool, in the element transformation process, whether the associated objects which are the same as the objects exist in the object pool is searched, and if the associated objects exist, the elements are directly transformed by the associated objects. Therefore, the reusability of the object can be improved, memory Churn generated when new graphic objects are repeatedly created is reduced, the performance loss of the vehicle machine is reduced, the stability and the expression effect of element transformation are improved, a better visual effect is provided for a user, and zooming is smooth and fluent.
It should be noted that, in an exemplary embodiment of the present application, the transformation method shown in fig. 2 may be applied to a vehicle-mounted computer, in which an Android system is operated, and a target element, such as a picture, is displayed on a display screen of the vehicle-mounted computer, and the picture may be scaled or/and translated by the method shown in fig. 2 to transform the picture into a state desired by a user.
A picture is essentially a collection of points that form a matrix, and therefore the transformation of a picture is essentially a transformation of a matrix. In the Android system, the method comprises the following steps:
an external matrix change monitor (Listener) changes the external matrix, the total matrix also changes, and the display position of the picture changes as the external matrix changes.
An object Pool (Objects Pool) in which several Objects are pre-stored, which Objects can be understood as a total matrix.
Matrix Pool and rectangular Pool (Matrix & rectangular Pool) are specific implementations of object Pool, controlling the number of Matrix objects generated during actual operation.
Scaled image computation tools (Math Utilities) provide the various computations required in the graphics scaling process, such as common computations for intermediate points, scaling, matrix dot inversion, etc.
Scaling an image view, intercepting a touch event, judging a gesture of the touch event, and issuing the touch event to finish view (picture) scaling or/and translation. In the Android system, a plurality of gestures are defined, and the transformation of pictures can be completed through the gestures. The plurality of gestures may include, for example, the following:
action_up, action_cancel-due to the lifting or canceling of the finger, stopping the image change operation that may exist before, and restoring the default no-touch state;
action_pointer_up-lifting of one or more fingers generated during gesture operation, at this time, the zoom control point needs to be judged again to keep the smoothness of the zoom operation;
the action_down-state of finger press, normally scroll translation, if there is a previous zoom change, the current scroll translation operation is not allowed;
action_pointer_down-in the zooming process, a touch point is added, and at the moment, the current zooming operation is needed to be carried out by forcedly switching to zooming;
active _ MOVE-there are two possibilities, panning or zooming at this time, and a determination of whether the maximum ratio is exceeded needs to be added at this stage to reduce the likelihood of display anomalies in extreme cases.
A Gesture Detector (gestme Detector) assists the zoom image view to determine the Gesture of the touch event. The following gestures are also defined on the basis of zooming the image view in a custom manner: such as jerk (flick), long press (long click), double click (double tap), etc.
The following describes the detailed steps of the transformation method for transforming pictures according to the present invention by means of specific embodiments.
In an exemplary embodiment of the present application, in step S201, a touch event of a user on a touch screen is detected.
As described above, the touch screen can enable a user to operate the electronic terminal by lightly touching icons or characters on the display screen with a finger, a touch pen or the like, so that human-computer interaction is more direct. The touch event is generated when a user touches the touch screen with a finger. The touch event is divided into a single-point touch event and a multi-point touch event, and the touch event can be judged to be the single-point touch event generated by a single finger or the multi-point touch event generated by more than two fingers through the number of touch points. When the number of the touch points is detected to be one, judging that the touch event is a single-point touch event; when more than one touch point is detected, the touch event is determined to be a multi-point touch event. If the touch event is a single-point touch event, the operation on the touch screen is a translation operation, and the translation operation includes translation operations that may include different directions, such as up-slide translation, down-slide translation, left-slide translation, right-slide translation, and the like; when the touch event is a multi-touch event, the operation on the touch screen is a zoom operation.
It should be noted that the position of the touch point may be identified by a coordinate value in a touch coordinate system of the touch screen.
In an exemplary embodiment of the present application, in step S202, after the touch event is detected, the state of the picture displayed on the touch screen is detected, and the first state and the second state of the picture are obtained.
After the touch event is detected, the picture can be considered to be changed, so that the state of the picture can be detected; the state of the picture comprises the size and the position of the picture, wherein A represents the picture processing the first state, and B represents the picture processing the second state. The first state includes the position and size of the picture at the beginning (without change), and the second state includes the size and position of the picture after the change.
In an exemplary embodiment of the present application, in step S203, at least one object generated in the process of transforming the picture from the first state to the second state is acquired.
In this embodiment, the external matrix change monitor monitors the change of the external matrix, and when the external matrix (the matrix composed of mscal and MSKEW in fig. 3) changes, the total matrix (the matrix shown in fig. 3) also changes, and the transformation of the picture can be obtained by calculating the total matrix parameters, so as to realize the transformation of the picture. Wherein the transformation parameters include at least one of: translational displacement, scaling; the transformation of the picture includes at least one of: and (5) translating and zooming.
In the process of transforming the picture from the first state to the second state, the external matrix is transformed multiple times, i.e. a plurality of new external matrices are generated. In this embodiment, the external matrix is defined as objects, i.e. a plurality of objects are generated during the transition of the picture from the first state to the second state. If the first state is transformed into the second state, which is defined to include a plurality of sub-states, each sub-state corresponds to an object, and the sub-state is transformed based on the previous sub-state. The calculation of the middle point, the scaling ratio, the matrix point inversion and the like of the picture scaling is realized through a scaled image calculation tool (Math Utilities).
In an exemplary embodiment of the present application, in step S204, the at least one object is matched with a pre-stored object in the object pool, and an associated object of the pre-stored object that is successfully matched with the at least one object is obtained.
During the transformation of the picture, the external matrix changes, which results in a change of the total matrix. In the present embodiment, the total matrix is defined as an association matrix. Multiple external matrices are generated in the process of transforming the picture from the first state to the second state, and then multiple total matrices are obtained through multiple computations, so that the time for transforming the picture state is increased due to multiple computations in the process of transforming the picture. For one picture translation, the whole process may generate hundreds of external matrixes, so that calculation is performed hundreds of times, and picture display is performed hundreds of times, so that a clamping occurs in the picture conversion process.
In the application, the generated object is matched with the pre-stored object in the object pool, and if the matching is successful, the generated object exists in the pre-stored object. Because the association object with association relation with the pre-stored object exists in the object pool, the subsequent calculation is needed by utilizing the association object, and the association object is not needed to be calculated based on the generated object, namely the total matrix is obtained through the external matrix calculation, so that the middle calculation process is omitted, and the time for picture transformation is saved. The association relation refers to that the association object is obtained after the pre-stored object is transformed. Taking one calculation as an example, if the total matrix may take 100ms by external matrix calculation, and the correlation matrix is obtained by matching, the required time is generally less than 50ms, which can save one time.
In an exemplary embodiment of the present application, referring to fig. 4, fig. 4 is a flowchart of obtaining transformation parameters, including steps S401 to S403:
step S401, according to the touch event, the number of touch points is obtained;
step S402, when the number of the touch points is one, taking the displacement of the touch point movement as the translation displacement;
step S403, when the number of the touch points is more than one, acquiring a center point of each touch point; and determining the scaling according to the distance between each touch point and the center point.
In an exemplary embodiment of the present application, if there is an object that does not match the pre-stored object in the at least one object, after the step of matching the at least one object with the pre-stored object in the object pool, the method further includes: establishing an associated object of an object which is not matched with the pre-stored object; and transforming the element by using the newly-built association object.
Specifically, referring to fig. 5, fig. 5 is a flowchart of establishing an association object. In fig. 5, the establishing the association object of the object not matching the pre-stored object includes steps S501 to S502:
s501, obtaining a conversion parameter for converting a former sub-state into a latter sub-state;
s502, according to the transformation parameters, transforming the object corresponding to the previous state to obtain a transformed transformation object, wherein the transformed transformation object is used as a newly-built association object.
Many methods are provided in Android for picture processing modes, while Matrix (Matrix) is a component closer to the bottom layer and is more flexible to operate than other tools (e.g., canvas). In Android, the matrix is a 3x3 matrix, and different from the matrix in mathematics, the content represented by each bit has a special meaning, and the expression is as follows:
Figure BDA0003672530450000101
specifically, referring to fig. 3, the proportional rotation part includes two sets of parameters, namely MSCALE and MSKEW. The MSCALE group parameters control the scaling in the X, Y direction, while the MSKEW group parameters control the miscut in the X, Y direction. The translation part alone has a set of parameters, MTRANS, controlling the translation in the X, Y direction. While the lowest one uses less, usually the MPERSP 2 is assigned for distinguishing between vectors and points.
Specifically, assume that the scaling in the x-axis is k 1 The y-axis scale is k 2 The original image has width and height of x respectively 0 、y 0 Then the post-scaling formula is calculated at this time:
x=k 1 ×x 0
y=k 2 ×y 0
at this time, the expression is expressed by matrix calculation, and then the following is obtained:
Figure BDA0003672530450000102
from the above equation, for a scaling process, the parameter to be recorded is k 1 、k 2 、x 0 、y 0 . Similarly, in the translation process, if the translation variables are Δx and Δy respectively, the translation formula and the formula after being converted into the matrix are:
x=x 0 +Δx
y=y 0 +Δy
Figure BDA0003672530450000103
and transmitting the parameters into the part matrix according to the correct sequence, so that a changed total matrix, namely the associated object, can be correctly obtained.
In an exemplary embodiment of the present application, after establishing the associated object of the object that does not match the pre-stored object, the method further includes: and storing the newly-built associated object into the object pool. It should be noted that after no corresponding associated object exists in the object pool, a new associated object is built and stored in the object pool, so that the associated object is called in the conversion process of the subsequent picture, the multiplexing rate of the associated object is improved, and the picture conversion time is saved.
In an exemplary embodiment of the present application, in the process of transforming the element with the association object, the method further includes: acquiring a first transformation parameter of the element transformed from the first state to the second state; comparing the first transformation parameter with a transformation parameter threshold; and stopping the transformation of the element when the first transformation parameter is equal to the transformation parameter threshold. Wherein the transformation parameter threshold comprises a translational displacement threshold or/and a scaling threshold.
When the first conversion parameter is equal to the conversion parameter threshold, it is described that the picture is converted to the maximum position at this time, and thus the conversion operation for the picture is stopped. In the embodiment, the maximum magnification is scaled by constraint, the maximum magnification is set as a boundary value, and when the boundary value is triggered, the operation of continuing scaling or the translation operation is canceled, so that the constraint on the extreme condition is realized.
Fig. 6 is a block diagram of a conversion device shown in an exemplary embodiment of the present application. The device can be applied to the implementation environment shown in fig. 1 and is particularly configured in an intelligent terminal. The apparatus may also be adapted to other exemplary implementation environments and may be specifically configured in other devices, and the present embodiment is not limited to the implementation environments to which the apparatus is adapted.
As shown in fig. 6, the exemplary transforming device includes:
the touch detection module 601 is configured to detect a touch event of a user on the touch screen;
the state detection module 602 is configured to detect a state of an element displayed on the touch screen after the touch event is detected, and obtain a first state and a second state of the element;
an object obtaining module 603, configured to obtain at least one object generated during the process of transforming the element from the first state to the second state;
an object matching module 604, configured to match the at least one object with a pre-stored object in the object pool, and obtain an associated object of the pre-stored object that is successfully matched with the at least one object;
and the element transformation module 605 is configured to transform the element with the associated object to obtain a target element.
It should be noted that, the transformation device provided in the foregoing embodiment and the transformation method provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit perform the operation has been described in detail in the method embodiment, which is not described herein again. In practical application, the conversion device provided in the above embodiment may distribute the functions to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above, which is not limited herein.
The embodiment of the application also provides electronic equipment, which comprises: one or more processors; and a storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the transformation methods provided in the respective embodiments described above.
Fig. 7 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application. It should be noted that, the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a central processing unit (Central Processing Unit, CPU) 701 that can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 702 or a program loaded from a storage section 708 into a random access Memory (Random Access Memory, RAM) 703. In the RAM 703, various programs and data required for the system operation are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An Input/Output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 810 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 710 as needed, so that a computer program read out therefrom is installed into the storage section 708 as needed.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. When executed by a Central Processing Unit (CPU) 701, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Another aspect of the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a transformation method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment or may exist alone without being incorporated in the electronic device.
Another aspect of the present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the transformation methods provided in the respective embodiments described above.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. It is therefore intended that all equivalent modifications and changes made by those skilled in the art without departing from the spirit and technical spirit of the present invention shall be covered by the appended claims.

Claims (9)

1. A method of transformation comprising:
detecting a touch event of a user on a touch screen;
detecting the state of an element displayed on a touch screen after the touch event is detected, and acquiring a first state and a second state of the element;
acquiring at least one object generated in the process of transforming the element from the first state to the second state; wherein the object is an external matrix;
matching the at least one object with a pre-stored object in an object pool, and acquiring an associated object of the pre-stored object successfully matched with the at least one object; the pre-stored object is a pre-stored external matrix, and the associated object is a total matrix;
and transforming the element by using the associated object to obtain a target element.
2. The transformation method according to claim 1, further comprising, after the step of matching the at least one object with a pre-stored object in the object pool, if there is an object in the at least one object that does not match the pre-stored object:
establishing an associated object of an object which is not matched with the pre-stored object;
and transforming the element by using the newly-built association object.
3. The transformation method according to claim 2, wherein the process of transforming the first state into the second state includes a plurality of sub-states, each corresponding to an object, the creating an associated object of the objects that does not match the pre-stored object, comprising:
obtaining a transformation parameter for transforming a former sub-state into a latter sub-state;
and transforming the object corresponding to the previous state according to the transformation parameters to obtain a transformed transformation object, wherein the transformed transformation object is used as a newly-built association object.
4. The transformation method according to claim 1, wherein in transforming the element with the associated object, the method further comprises:
acquiring a first transformation parameter of the element transformed from the first state to the second state;
comparing the first transformation parameter with a transformation parameter threshold;
and stopping the transformation of the element when the first transformation parameter is equal to the transformation parameter threshold.
5. A transformation method according to claim 3, wherein the transformation parameters comprise translational displacement or/and scaling, and the step of obtaining transformation parameters comprises:
acquiring the number of touch points according to the touch event;
when the number of the touch points is one, taking the displacement of the touch point movement as the translation displacement;
when the number of the touch points is more than one, acquiring the center point of each touch point; and determining the scaling according to the distance between each touch point and the center point.
6. A transformation method according to claim 2 or 3, characterized in that after establishing an associated object of an object that does not match a pre-stored object, it further comprises:
and storing the newly-built associated object into the object pool.
7. A conversion device, the device comprising:
the touch detection module is used for detecting a touch event of a user on the touch screen;
the state detection module is used for detecting the state of the element displayed on the touch screen after the touch event is detected, and acquiring a first state and a second state of the element;
an object acquisition module, configured to acquire at least one object generated during a process of transforming the element from the first state to the second state; wherein the object is an external matrix;
the object matching module is used for matching the at least one object with a prestored object in the object pool and acquiring an associated object of the prestored object successfully matched with the at least one object; the pre-stored object is a pre-stored external matrix, and the associated object is a total matrix;
and the element transformation module is used for transforming the elements by the associated objects to obtain target elements.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the transformation method of any one of claims 1-6.
9. A computer readable storage medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the transformation method of any one of claims 1 to 6.
CN202210612981.XA 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product Active CN114995738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210612981.XA CN114995738B (en) 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210612981.XA CN114995738B (en) 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product

Publications (2)

Publication Number Publication Date
CN114995738A CN114995738A (en) 2022-09-02
CN114995738B true CN114995738B (en) 2023-06-16

Family

ID=83031190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210612981.XA Active CN114995738B (en) 2022-05-31 2022-05-31 Transformation method, transformation device, electronic equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114995738B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112819889A (en) * 2020-12-30 2021-05-18 浙江大华技术股份有限公司 Method and device for determining position information, storage medium and electronic device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722332B (en) * 2012-05-31 2015-07-29 华为终端有限公司 A kind of method that touch-screen equipment and operational processes thereof trigger
WO2014056129A1 (en) * 2012-10-08 2014-04-17 华为终端有限公司 Processing method of touch screen device user interface and touch screen device
US10474347B2 (en) * 2015-10-21 2019-11-12 International Business Machines Corporation Automated modification of graphical user interfaces
CN108389155B (en) * 2018-03-20 2021-10-01 北京奇虎科技有限公司 Image processing method and device and electronic equipment
FR3080469A1 (en) * 2018-04-23 2019-10-25 B<>Com METHOD FOR PROCESSING A HOLOGRAM, DEVICE, HOLOGRAPHIC RESTITUTION SYSTEM AND COMPUTER PROGRAM THEREOF
US20190324621A1 (en) * 2018-04-23 2019-10-24 Qualcomm Incorporated System and Methods for Utilizing Multi-Finger Touch Capability to Efficiently Perform Content Editing on a Computing Device
CN109087238B (en) * 2018-07-04 2021-04-23 北京市商汤科技开发有限公司 Image processing method and apparatus, electronic device, and computer-readable storage medium
CN110286827B (en) * 2019-06-27 2021-07-13 广州视源电子科技股份有限公司 Element scaling control method, device, equipment and storage medium
CN110471610A (en) * 2019-08-16 2019-11-19 上海闻泰信息技术有限公司 Terminal control method, device, terminal and storage medium
CN110647286A (en) * 2019-10-09 2020-01-03 北京字节跳动网络技术有限公司 Screen element control method, device, equipment and storage medium
CN111258455B (en) * 2020-01-17 2023-08-18 Oppo广东移动通信有限公司 Event stream processing method, event stream processing device and mobile terminal
CN113986438B (en) * 2021-10-30 2024-01-30 深圳市快易典教育科技有限公司 Animation loading method, system, device and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112819889A (en) * 2020-12-30 2021-05-18 浙江大华技术股份有限公司 Method and device for determining position information, storage medium and electronic device

Also Published As

Publication number Publication date
CN114995738A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN107273083B (en) Interaction method, device, equipment and storage medium between terminal equipment
US9250780B2 (en) Information processing method and electronic device
WO2022121790A1 (en) Split-screen display method and apparatus, electronic device, and readable storage medium
CN106485173B (en) Sensitive information display method and device
US20220324327A1 (en) Method for controlling terminal, electronic device and storage medium
EP4339808A1 (en) Page processing method and apparatus, electronic device, and readable storage medium
CN110275659A (en) A kind of image switching method, device, electronic equipment and storage medium
CN112099714B (en) Screenshot method and device, electronic equipment and readable storage medium
CN113655929A (en) Interface display adaptation processing method and device and electronic equipment
CN112269501A (en) Icon moving method and device and electronic equipment
US11243679B2 (en) Remote data input framework
CN109521922B (en) Display scale changing method, device and equipment of terminal
CN113703630A (en) Interface display method and device
CN114995738B (en) Transformation method, transformation device, electronic equipment, storage medium and program product
CN113312122A (en) Virtual keyboard calling method and device, computer storage medium and electronic equipment
CN114629800B (en) Visual generation method, device, terminal and storage medium for industrial control network target range
CN113126867B (en) Browser control method and device, browser, terminal and storage medium
CN108351888B (en) Generating deferrable data streams
CN114416264A (en) Message display method and device
CN113902841A (en) Image drawing method and device, electronic equipment and readable storage medium
CN113360064A (en) Method and device for searching local area of picture, medium and electronic equipment
CN113763459B (en) Element position updating method and device, electronic equipment and storage medium
CN113157197B (en) Touch pad control method and device
CN114895832B (en) Object adjustment method, device, electronic equipment and computer readable medium
CN113835792B (en) Method and device for drawing page element

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant