WO2022105514A1 - Page turning simulation method for electronic book, and electronic device and computer storage medium - Google Patents

Page turning simulation method for electronic book, and electronic device and computer storage medium Download PDF

Info

Publication number
WO2022105514A1
WO2022105514A1 PCT/CN2021/124748 CN2021124748W WO2022105514A1 WO 2022105514 A1 WO2022105514 A1 WO 2022105514A1 CN 2021124748 W CN2021124748 W CN 2021124748W WO 2022105514 A1 WO2022105514 A1 WO 2022105514A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
turning
book
reference point
boundary line
Prior art date
Application number
PCT/CN2021/124748
Other languages
French (fr)
Chinese (zh)
Inventor
孙上斌
Original Assignee
掌阅科技股份有限公司
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 掌阅科技股份有限公司 filed Critical 掌阅科技股份有限公司
Publication of WO2022105514A1 publication Critical patent/WO2022105514A1/en

Links

Images

Classifications

    • 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
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/02Digital computers in general; Data processing equipment in general manually operated with input through keyboard and computation using a built-in program, e.g. pocket calculators
    • G06F15/025Digital computers in general; Data processing equipment in general manually operated with input through keyboard and computation using a built-in program, e.g. pocket calculators adapted to a specific application
    • G06F15/0291Digital computers in general; Data processing equipment in general manually operated with input through keyboard and computation using a built-in program, e.g. pocket calculators adapted to a specific application for reading, e.g. e-books
    • 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/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor

Definitions

  • the present disclosure relates to the field of computers, and in particular, to a simulated page-turning method for an electronic book, an electronic device, and a computer storage medium.
  • E-books are portable, and users can open e-books to read anytime, anywhere.
  • the page content conversion process will be completed by means of instantaneous page switching.
  • the above-mentioned page turning method is rather obtrusive, and cannot simulate the traditional paper-based page turning method.
  • the page turning operation is usually completed by lifting a corner of the book page to make the book page appear in a curled state. It can be seen that the existing e-book page turning method cannot simulate the page turning effect of a real paper book.
  • the present disclosure is proposed in order to provide an electronic book simulation page turning method, electronic device and computer storage medium that overcome the above problems or at least partially solve the above problems.
  • a method for simulating page turning of an electronic book comprising:
  • a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
  • an electronic device including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface communicate with each other through the communication bus;
  • the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the following operations:
  • a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
  • a non-volatile computer-readable storage medium is provided, and at least one executable instruction is stored in the non-volatile computer-readable storage medium, and the executable instruction causes a processor to perform the following operations :
  • a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
  • a computer program product comprising a computing program stored on the above-mentioned non-volatile computer-readable storage medium.
  • shadow elements can be added to the original book pages to be turned according to the page-turning instructions, so as to obtain page-turning book pages containing shadow elements, and according to the page-turning instructions
  • the amount of displacement change between the page-turning transformation position of the page-turning reference point in the page-turning reference point relative to the page initial position of the page-turning reference point determines the page-turning action area included in the page-turning book page, so as to draw the page-turning action area in the page-turning action area.
  • Each page image unit included and the page-turning position of the shadow element are included to realize the simulated page-turning processing of the book page. It can be seen that this method can display the page-turning state of the book presented by the curling process of the book page, give the user a visual experience of page-turning when reading a real paper book, and can also add shadow elements to the page, so that the page is turned The part behind the page has a shadow effect, which further enhances the effect of the simulated page turning.
  • FIG. 1 shows a flowchart of a method for simulating page turning of an electronic book provided by an embodiment of the present disclosure
  • FIG. 2 shows a flowchart of a method for simulating page turning of an electronic book provided by another embodiment of the present disclosure
  • FIG. 3 shows a schematic structural diagram of an electronic device according to another embodiment of the present disclosure
  • Figure 5 shows a schematic diagram of yet another page turning state
  • Figure 6 shows a schematic structural diagram of a page-turning book page after adding a shadow element
  • Figure 7 shows a schematic diagram of yet another form of shadow element.
  • FIG. 1 shows a flowchart of a method for simulating page turning of an electronic book provided by an embodiment of the present disclosure. As shown in Figure 1, the method includes the following steps:
  • Step S110 In response to the received page-turning instruction, add a shadow element to the original book page to be turned, to obtain a page-turning book page including the shadow element.
  • the shadow element may be various types of elements such as shadow pictures, as long as a shadow effect can be achieved.
  • the page After the shadow element is added, the page not only contains the original page content, but also further includes the added shadow element.
  • the original book page after adding the shadow element is called a flip book page.
  • Step S120 Obtain the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point, and determine the page-turning included in the page-turning book page according to the displacement change. area of action.
  • the page area in the book page that is in a curled state under the influence of the page turning operation is only a partial area of the book page, and the partial area is the page turning action area.
  • the rest of the page area that is not affected by the page turning operation and still remains in a flat state (non-curling state) is a non-page turning action area.
  • the page turning instruction is usually triggered by a sliding operation.
  • the page turning reference point in the book page is usually: a position point on the page boundary line adjacent to the triggering position of the page turning instruction.
  • the page turning reference point is the page vertex at the lower right corner of the book page.
  • the initial page position of the page turning reference point is the position of the intersection between the right boundary line and the lower boundary line of the book page.
  • the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point can reflect the magnitude and direction of the page-turning operation, and then the page of the page-turning book can be determined according to the above-mentioned displacement change.
  • Step S130 Obtain the page initial position of each page image unit and shadow element contained in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element included in the page-turning action area, so as to realize the book page Simulation of page turning processing.
  • each page image unit included in the page will also be in a curled state. Therefore, it is necessary to calculate each page according to the initial page position of each page image unit included in the page-turning action area.
  • the corresponding page-turning transformation position of the image unit after the curl transformation refers to the position of each page image unit on the page of the book before the page turning operation is performed, which can be specifically represented by page coordinates;
  • the page turning transformation position of the page image unit refers to: executing After the page turning operation, each page image unit shows the changed position according to the curling state of the book page.
  • the page-turning transformation position of each page image unit can be obtained based on the displacement change amount.
  • the shadow elements are also processed in a similar manner: first determine the page initial position of each shadow element, and then calculate the page-turning transformation position of each shadow element. It can be seen that by calculating and displaying the page-turning transformation positions of each page image unit and the shadow element, a page curling effect similar to the page-turning effect of a paper book can be rendered, thereby realizing the simulated page-turning processing of the book page. Moreover, it can also imitate the real shadow effect.
  • a shadow element can be added to the original book page to be turned according to the page-turning instruction, so as to obtain a page-turning book page containing the shadow element, and
  • the displacement change between the page-turning transformation position of the reference point and the page initial position of the page-turning reference point determines the page-turning action area included in the page of the page-turning book, so as to draw each page image unit included in the page-turning action area and
  • the page-turning position of the shadow element is changed to realize the simulated page-turning processing of the book page.
  • this method can display the page-turning state of the book presented by the curling process of the book page, give the user a visual experience of page-turning when reading a real paper book, and can also add shadow elements to the page, so that the page is turned The part behind the page has a shadow effect, which further enhances the effect of the simulated page turning.
  • FIG. 2 shows a flowchart of a method for simulating page turning of an electronic book provided by another embodiment of the present disclosure. As shown in Figure 2, the method includes the following steps:
  • Step S210 In response to the received page-turning instruction, add a shadow element to the original book page to be turned, to obtain a page-turning book page including the shadow element.
  • the shadow element may be various types of elements such as shadow pictures, as long as a shadow effect can be achieved.
  • the page After the shadow element is added, the page not only contains the original page content, but also further includes the added shadow element.
  • the original book page after adding the shadow element is called a flip book page.
  • shadow elements are semi-transparent image-like elements.
  • a page boundary line included in the original book page to be turned is determined, and a shadow element is added to the outer area of the original book page along the page boundary line.
  • the inner area of the original book page corresponds to the content part of the book page, and accordingly, the outer area of the original book page corresponds to the area other than the content part of the book page, it can be seen that the outer area of the original book page actually The area that is invisible to the reading user is on the outside of the book page. Since the shadow element is added to the outer area of the original book page, it will not affect the normal reading of the book.
  • the page boundary line refers to the boundary line located at the edge of the page of the book.
  • a book page includes four page boundary lines.
  • shadow elements may be added only to the outer area corresponding to at least one page boundary line, and the specific implementation details are not limited.
  • Implementation method first, obtain the touch position corresponding to the page turning instruction, and determine the first page boundary line and/or the second page boundary line adjacent to the touch position; then, along the first page boundary line in the original book The first shadow element is added to the outer area of the page; and/or, the second shadow element is added to the outer area of the original book page along the boundary line of the second page.
  • the boundary line of the first page may be perpendicular to the boundary line of the second page. For example, FIG.
  • FIG. 6 shows a schematic diagram of the structure of a page of a page-turning book after adding a shadow element.
  • the original book page 60 before adding the shadow element has four page boundary lines. It is assumed that the touch position corresponding to the page turning command is the point Y in the figure, and the two adjacent touch position Y
  • the page boundary lines are respectively a first page boundary line 61 and a second page boundary line 62 that are perpendicular to each other.
  • a first shadow element 63 is added to the outer area of the original book page along the first page boundary line 61
  • a second shadow element 64 is added to the outer area of the original book page along the second page boundary line 62 .
  • the flipped book page after adding the shadow element includes: the original book page 60 , the first shadow element 63 and the second shadow element 64 . It can be seen that by adding a shadow element to the page boundary line corresponding to the page turning instruction, the shadow element can be turned and curled together with the page in the subsequent page turning process, thereby presenting a natural shadow effect.
  • the range of adding shadow elements can be set according to the page turning action area included in the book page. Specifically, adding a first shadow element to an outer area of the original book page along a first partial line segment included in the first page boundary line; and/or adding a first shadow element along the second partial line segment included in the second page boundary line on the original book page A second shadow element is added to the outer area of the ; wherein the length of the first partial line segment and/or the line segment of the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
  • Step S220 Obtain the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point.
  • the page turning reference point in the book page is usually: a position point on the page boundary line adjacent to the triggering position of the page turning instruction.
  • the page turning reference point is the page vertex at the lower right corner of the book page.
  • the initial page position of the page turning reference point is the position of the intersection between the right boundary line and the lower boundary line of the book page.
  • the page turning change position As the page turning operation is performed, the position of the page turning reference point will change, and the changed position is called the page turning change position.
  • the amount of displacement change between the page turning transformation position of the page turning reference point relative to the page initial position of the page turning reference point can reflect the magnitude and direction of the page turning operation.
  • Step S230 Determine the page-turning action area included in the page of the page-turning book according to the displacement change.
  • the page area in the book page that is in a curled state under the influence of the page turning operation is only a partial area of the book page, and the partial area is the page turning action area.
  • the rest of the page area that is not affected by the page turning operation and still remains in a flat state (non-curling state) is a non-page turning action area.
  • Step S240 Obtain the page initial positions of each page image unit and shadow element contained in the page-turning action area, and calculate and display the page-turning transformation positions of each page image unit and shadow element included in the page-turning action area, so as to realize the book page Simulation of page turning processing.
  • each page image unit included in the page will also be in a curled state. Therefore, it is necessary to calculate each page according to the initial page position of each page image unit included in the page-turning action area.
  • the corresponding page-turning transformation position of the image unit after the curl transformation refers to the position of each page image unit on the page of the book before the page turning operation is performed, which can be specifically represented by page coordinates;
  • the page turning transformation position of the page image unit refers to: executing After the page turning operation, each page image unit shows the changed position according to the curling state of the book page.
  • the page-turning transformation position of each page image unit can be obtained based on the displacement change amount.
  • the shadow elements are also processed in a similar manner: first determine the page initial position of each shadow element, and then calculate the page-turning transformation position of each shadow element. It can be seen that by calculating and displaying the page-turning transformation positions of each page image unit and the shadow element, a page curling effect similar to the page-turning effect of a paper book can be rendered, thereby realizing the simulated page-turning processing of the book page. Moreover, it can also imitate the real shadow effect.
  • Step 1 In response to the received page-turning instruction, add a shadow element to the original book page to be turned, to obtain a page-turning book page containing the shadow element; obtain the page-turning transformation position of the page-turning reference point in the page-turning book page The amount of displacement change between the initial position of the page relative to the page turning reference point.
  • the page turning instruction in this embodiment is a sliding page turning command.
  • the page turning reference point in the book page is usually: a position point on the page boundary line adjacent to the triggering position of the page turning instruction.
  • FIG. 4 shows a schematic diagram of a page turning state.
  • the trigger position of the page turning instruction is located in the lower right corner area of the book page.
  • the page turning reference point in the book page is the lower right corner of the book page.
  • the initial page position of the page turning reference point is the right boundary line (corresponding to the second page boundary line 64 in FIG. 6 ) and the lower boundary line (corresponding to the first page boundary line 63 in FIG. 6 ) of the book page.
  • the position of the intersection point between them is point F in Figure 4.
  • the position of the page turning reference point will change, and the changed position is called the page turning change position.
  • point A in FIG. 4 corresponds to the page-turning transition position of the page-turning reference point.
  • the amount of displacement change between the page turning transformation position of the page turning reference point relative to the page initial position of the page turning reference point can reflect the magnitude and direction of the page turning operation.
  • the displacement change amount can be determined by the length and slope of the line segment AF.
  • the following method when obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the book page and the page initial position of the page-turning reference point, the following method is used: first, obtain the information of the sliding page-turning instruction. Swipe direction and/or swipe length. Wherein, the sliding direction and/or the sliding length of the sliding page turning instruction is used to represent the sliding displacement amount of the sliding page turning command, and the sliding displacement amount depends on factors such as the duration of the sliding operation and the sliding speed. Then, according to the sliding direction and/or the sliding length, the displacement direction and/or the displacement length of the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is determined.
  • the displacement direction of the page-turning transformation position of the page-turning reference point relative to the initial position of the page of the page-turning reference point matches the sliding direction of the sliding-type page-turning instruction
  • the page-turning transformation position of the page-turning reference point is relative to the page turning direction.
  • a shadow element can be added to the original book page.
  • the first shadow element can be added directly along the above-mentioned first page boundary line in the outer area of the original book page; and along the second page boundary line Add a second shadow element to the outer area of the original book page.
  • the size of the shadow element may be further adjusted according to the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point.
  • a first shadow element is added in the outer area of the original book page along the first partial line segment included in the first page boundary line;
  • Two shaded elements, the line lengths of the first partial line segment and the second partial line segment are determined according to the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page relative to the page initial position of the page-turning reference point.
  • Step 2 Calculate the page curling radius corresponding to the page turning instruction.
  • the page curling radius refers to the radius of the cylindrical surface formed by the curled book pages when the book pages are in a curled state with the page turning operation.
  • the page curl radius is used to indicate how curled the book pages are.
  • the curling radius of the page is mainly calculated according to the displacement change amount and the circle radius formula.
  • the inventor found in the process of realizing the present disclosure that when the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is too small, the page-turning effect will be difficult to detect; However, when the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is too large, the page turning amplitude is too large and the normal reading of the user is affected.
  • a lower threshold and an upper threshold are preset.
  • the page curling radius corresponding to the page turning instruction is determined to be a preset lower limit value, where the preset lower limit value is a preset minimum radius. If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is greater than the preset upper limit threshold, the page curling radius corresponding to the page turning instruction is determined to be the preset upper limit value , wherein the preset upper limit value is a preset maximum radius.
  • the calculation is performed according to the displacement change and the circle radius formula.
  • Page curl radius is used to define the relative relationship between the displacement change between the page-turning transformation position of the page-turning reference point and the page initial position of the page-turning reference point and the curling radius of the page.
  • the ratio between the displacement change between the page turning transformation position of the page turning reference point and the page initial position of the page turning reference point and the page curling radius has a preset law, for example, may be a preset constant.
  • Step 3 Determine the page-turning action area included in the book page according to the page curling radius, the page initial position of the page-turning reference point, and the page-turning transformation position of the page-turning reference point.
  • the page area in the book page that is in a curled state under the influence of the page turning operation is only a partial area of the book page, and the partial area is the page turning action area.
  • the rest of the page area that is not affected by the page turning operation and still remains in a flat state (non-curling state) is a non-page turning action area.
  • the following methods are used: The page initial position of the page turning reference point and the reference line of the page turning change position of the page turning reference point, determine the target point located on the reference line according to the page curl radius; then, according to the target point passing through the target point and perpendicular to the reference line The boundary line defines the page-turning action area contained in the book page.
  • the reference line passing through the initial page position of the page turning reference point and the page turning change position of the page turning reference point is the straight line defined by the point A and the point F in FIG. 4 .
  • the specific position of the target point on the reference straight line is mainly determined according to the size of the page curling radius.
  • the target point in Figure 4 is point P.
  • the boundary line passing through the target point and perpendicular to the reference line is the line defined by point C and point J in FIG. 4 .
  • the boundary line is used to divide the page-turning action area and the non-page-turning action area included in the book page.
  • the lower-left area of the boundary line corresponds to the page-turning area, and the image units contained in this part of the area will undergo curl transformation; while the upper-right area of the boundary line corresponds to the non-page-turning area, and the images contained in this part area will undergo curl transformation. Cells do not undergo curl transformation.
  • a boundary line passing through the target point and perpendicular to the reference line can be drawn through the target point on the reference line defined by the length of the page curl radius, and the page turning action area can be quickly determined through the boundary line.
  • the first intersection point between the boundary line and the first page boundary line is point C
  • the second intersection point between the boundary line and the second page boundary line is point J
  • passing through point C and point J can more accurately define the page turning action area.
  • the target point shown in FIG. 4 is located between the page initial position of the page turning reference point and the page turning transformation position of the page turning reference point.
  • the page change position is between the page initial position of the page turning reference point and the target point.
  • the page curling radius is greater than the preset value, indicating that the sliding displacement corresponding to the page turning command at this time is large, and the target point is between the initial page position of the page turning reference point and the page turning reference between the page-turning positions of the points.
  • the target point P is located between the point A and the point F.
  • the first sub-area included in the page-turning effect area without curl transformation and the second sub area with curl transformation are determined according to the target point.
  • the first sub-area without curling transformation corresponds to the back area of the book page.
  • the area composed of points A, B, and K in FIG. 4 is the first sub-area, and this area is used to display the page-turned The area on the back of the book that has not undergone a curl transformation.
  • the second sub-region where the curl transformation occurs includes the front and back regions of the book page.
  • the target mapping point located on the reference line and corresponding to the target point; wherein, the interval between the target mapping point and the page initial position of the page turning reference point is the difference between the target point and the page turning change position of the page turning reference point interval matching.
  • the target mapping point can be determined by: firstly drawing a reference line segment formed by the page initial position of the page-turning reference point and the page-turning transformation position of the page-turning reference point, that is, the line segment AF in FIG. 4 , and then determining The midpoint of the line segment AF is the point G, and accordingly, the distances from the target mapping point O and the target point P to the midpoint G are equal.
  • the boundary mapping straight line passing through the target mapping point and perpendicular to the reference line determines the first critical point (ie point B1) located on the boundary line of the first page of the book page and the second critical point located on the boundary line of the second page of the book page Critical point (ie point K1); wherein, the first page boundary line is perpendicular to the second page boundary line, and the page initial position of the page turning reference point is at the intersection of the first page boundary line and the second page boundary line.
  • the boundary mapping straight line passing through the target mapping point and perpendicular to the reference straight line is the straight line determined by the point B1 and the point K1 in FIG. 4 .
  • a triangular area formed by the first critical point, the second critical point and the initial position of the page of the page turning reference point is determined, and the first sub-region that does not undergo curl transformation is determined according to the triangular area and the mapping area corresponding to the triangular area region and the second subregion where the warp transformation takes place.
  • the triangular area formed by the first critical point, the second critical point and the initial position of the page of the page turning reference point is the area formed by the points B1, K1 and F.
  • the mapping area corresponding to the triangular area is the area formed by points B, K and A.
  • the point B corresponds to the page-turning transformation position of the point B1 after the curling transformation
  • the point K corresponds to the page-turning transformation position of the point K1 after the curling transformation.
  • the mapping area is the corresponding texture area after being flipped by the triangle area, and the mapping area corresponds to the back of the triangle area.
  • first, the triangle region and its corresponding mapping region are determined. It is determined as the first sub-region where no curling transformation has occurred, and the remaining regions correspond to the second sub-region where curling transformation has occurred.
  • Step 4 Obtain the initial page position of each image unit included in the page-turning action area, and calculate and display the page-turning transformation position of each image unit in combination with the page curl radius, so as to realize the simulated page-turning process of the book page.
  • each image unit included in the page will also be in a curled state. Therefore, it is necessary to calculate the initial position of each image unit included in the page turning action area according to the page initial position of each image unit.
  • the corresponding page transformation position after curl transformation refers to the position of each image unit on the page of the book before performing the page turning operation, which can be specifically represented by page coordinates;
  • the page turning transformation position of the image unit refers to: performing the page turning operation Afterwards, each image unit presents a changed position according to the curled state of the book page.
  • the page-turning transformation position of each image unit can be calculated based on the page curl radius. It can be seen that, by calculating and displaying the page-turning transformation positions of each image unit, a page curling effect similar to that presented when a paper book is turned can be rendered, thereby realizing the simulated page-turning processing of the book pages.
  • the initial page position of each image unit included in the page-turning action area is obtained, and when the page-turning transformation position of each image unit is calculated and displayed in combination with the page curl radius, for the first sub-region in FIG. 4, according to the mapping relationship Determine the page-turning transformation position of each image unit in the first sub-region; for the second sub-region, determine the page-turning transformation position of each image unit in the second sub-region according to the cylinder equation determined by the page curl radius.
  • each image unit included in the page-turning action area is also called a page image unit, which refers to a page image constituent element of a book page, for example, an image unit may be an image pixel point.
  • a page image unit which refers to a page image constituent element of a book page
  • an image unit may be an image pixel point.
  • the first sub-area does not undergo curl transformation, only the triangular area formed by the three points of B1K1F is mapped to the mapping area formed by the three points of BKA through the mapping method. Therefore, according to the mapping relationship, determine the The page-turning transformation position of each image unit of .
  • the first sub-area corresponds to the back area of the book page, therefore, it is necessary to first acquire the mapped image units in the back area corresponding to each image unit in the first sub-area, and then map each image unit to the back area.
  • the mapped image units in the back area of are mapped to the corresponding page-turning transformation positions.
  • the back area corresponding to each image unit refers to an area located at the same coordinate position as the image unit in the back page corresponding to the currently displayed book page.
  • the corresponding mapped image unit in the back area is the image unit located at the lower left corner of page 6. That is, the mapped image unit in the back area corresponding to a certain image unit refers to the image unit at the same position on the back of the image unit obtained by turning the page over.
  • each image pixel in the above-mentioned second sub-region undergoes curl transformation. Therefore, for each image pixel in the second sub-region, the second sub-region is determined according to the cylinder equation determined by the page curling radius.
  • the page-turning transformation position of each image unit in the sub-region For example, the point E and the point H in FIG. 4 are auxiliary calculation points involved in the calculation process, and the line segment EH is the vertical bisector of the line segment AF.
  • the point D1 in FIG. 4 is the midpoint of the line segment CB1
  • the point I1 is the midpoint of the line segment JK1.
  • the point D is the page-turning transformation position corresponding to the point D1
  • the point I is the page-turning transformation position corresponding to the point I1.
  • the point M corresponds to the page turning change position corresponding to the midpoint of the line segment B1D1
  • the point N corresponds to the page turning change position corresponding to the midpoint of the line segment K1I1.
  • a specific image pixel it is first determined that the image pixel is located in the first sub-region or the second sub-region, and if it is located in the first sub-region, it is determined according to the mapping method that corresponds to the initial position of the image pixel on the page If it is located in the second sub-region, substitute the initial page position of the image pixel into the cylinder equation determined by the page curl radius, and determine the page-turning transformation position corresponding to the image pixel according to the calculation result. For example, the position of point D is obtained by substituting the initial position of the page of point D1 into the cylinder equation.
  • the second sub-area includes both the front area and the back area of the original book page. Therefore, in the above process, it is necessary to first distinguish the first sub-area corresponding to the front area contained in the second sub-area. Two front sub-areas, and a second back sub-area corresponding to the back area. In order to divide the above-mentioned second front sub-region and second back sub-region, it needs to be divided according to point D1 and point I1 in FIG. 4 .
  • the above-mentioned second front sub-region and second back sub-region are divided in the following manner: First, draw a boundary line that passes through the target point P and is perpendicular to the reference line, and determines the distance between the boundary line and the first page boundary line. the first intersection point C and the second intersection point J of the boundary line and the second page boundary line; then, determine the first midpoint D1 between the first intersection point C and the first critical point B1, and the second intersection point J and the second intersection point The second midpoint I1 between the critical points K1 is determined according to the first midpoint D1 and the second midpoint I1. Two back sub-regions (regions formed by points D1, B1, K1, I1).
  • each image pixel point in the second back sub-area it is necessary to first acquire the mapped image units in the back area corresponding to each image unit in the second back sub-area, and then map the image units corresponding to each image unit.
  • the mapped image unit in the back area is mapped to the corresponding page turning position.
  • FIG. 4 corresponds to the case where the page curling radius is larger
  • FIG. 5 further shows a schematic diagram of the page curling effect when the page curling radius is smaller.
  • the page-turning transformation position of the page-turning reference point is between the page initial position of the page-turning reference point and the target point.
  • the target point P in FIG. 5 is located on the extension line of the line segment AF.
  • the target point P and the page-turning change position A of the page-turning reference point coincide with each other.
  • the page-turning action area cannot be divided into the above-mentioned first sub-area and The second sub-area, but only contains an integral area.
  • the page-turning transformation position of each image unit is calculated and displayed in combination with the page curling radius, the page-turning is determined directly according to the cylindrical equation determined by the page curling radius. The page transform position of each image unit in the active area.
  • the page-turning action area can still be divided into pages corresponding to the pages of the book.
  • the page turning action area can be divided into a front action area corresponding to the front content of the book page (for example, the second front sub-region in FIG. 4 ) and a back content corresponding to the book page (for example, the triangular area and the second back sub-area in FIG.
  • the back active area 4 can be collectively referred to as the back active area).
  • the back action area corresponding to the back content of the book page it is necessary to obtain the mapped image units in the back area corresponding to each image unit in the back action area, and then, map the back area corresponding to each image unit in the back area.
  • the mapped image unit is mapped to the corresponding page transform position.
  • the first shadow element may be added in the outer area of the original book page along the first partial line segment included in the first page boundary line
  • the second shadow element may be included along the second page boundary line
  • the second partial line segment is added in the outer area of the original book page.
  • the first partial line segment included in the first page boundary line is defined by the first intersection point C between the above-mentioned boundary line and the first page boundary line and The page initial position F of the page turning reference point is defined; the second partial line segment included in the second page boundary line is defined by the second intersection J of the above-mentioned boundary line and the second page boundary line and the page initial position of the page turning reference point Position F is limited.
  • Figure 7 shows a schematic diagram of another form of shadow element.
  • the first page boundary line includes a first partial line segment 71
  • the second page boundary line includes a second partial line segment 72 .
  • a first shadow element 73 is added along the first partial line segment 71 in the outer region of the original book page
  • a second shadow element 74 is added along the second partial line segment 72 in the outer region of the original book page.
  • this embodiment does not limit the timing of adding shadow elements, and shadow elements may also be relative to the page of the page-turning reference point at the page-turning transformation position of the page-turning reference point obtained in the page of the page-turning book.
  • the displacement change between the initial positions is added after determining the page-turning action area included in the page of the page-turning book according to the displacement change. It can be seen that the execution sequence of the above steps can be flexibly adjusted.
  • a shadow element can also be added first, and after the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point is obtained, Displacement delta adjusts the size and position of shadow elements.
  • a shadow element is added to the outside of the original book page in advance, so it can be calculated according to the initial page position of each pixel in the shadow element at the same time.
  • the page transform position of each pixel in the shadow element This method can make the added shadow effect more realistic, and there is no need to additionally perform the operation of adding shadow after calculating the page-turning transformation position of each page image unit, so that the shadow element and the page image unit undergo curl transformation together.
  • the sliding page turning instruction is usually triggered continuously.
  • the user slides in a preset direction for a certain period of time to trigger the sliding page turning command.
  • the current sliding direction and sliding length are continuously detected, and the page-turning transformation position of the page-turning reference point is dynamically calculated according to the current real-time detection result, and the page-turning transformation position of the page-turning reference point is dynamically calculated according to the calculated turning.
  • the page turning transformation position of the page reference point calculates the page curl radius and the page turning transformation position of each image unit in the page turning action area.
  • the area range of the page turning action area and the corresponding page curling radius are dynamically changed.
  • the page in the initial stage of page turning, the page may be in the state shown in Figure 5, and as the page turning instruction continues to run, the page may be in the state shown in Figure 4. Therefore, in this embodiment, it is necessary to dynamically perform multiple times Computational process in order to present the page state corresponding to each page turning stage in real time.
  • step S210 when a page-turning instruction triggered for a book page containing preset picture elements is detected, the picture drawing interface is called. Perform the next steps.
  • the book page containing preset picture elements means that the content of the page includes dynamic pictures or picture elements for linking to video resources.
  • dynamic video resources are inserted into e-books by means of image links, etc., so that users can obtain information in the form of pictures or videos during the process of reading e-books, thereby improving book reading efficiency.
  • the page turning instruction is usually triggered by a sliding operation.
  • a picture drawing interface is called to implement a subsequent page-turning drawing operation.
  • the picture drawing interface refers to an interface dedicated to realizing the picture drawing function.
  • the Android system it can be implemented through an interface with a drawing function provided by the Android system.
  • the ios system it can be implemented through a custom developed interface with a drawing function. Since the interface logic of the picture drawing interface can be flexibly adjusted according to actual business requirements, it is especially suitable for page-turning and drawing processing of complex book pages containing pictures.
  • drawing processing is mostly implemented by OpenGL in traditional methods.
  • the OpenGL drawing method has the following limitations: it cannot be applied to the processing of book pages containing pictures. That is to say, the OpenGL drawing method can only be applied to the drawing processing of regular book pages containing text, and cannot be applied when the book pages contain pictures or picture links used to link to video resources. Therefore, in order to solve the above problem, when a page-turning instruction is detected, the page description information of the book page corresponding to the page-turning command is further obtained, and whether the book page contains a preset picture is judged by the page description information of the book page Element, if so, call the above picture drawing interface to implement page turning drawing processing; if not, you can flexibly choose whether to process by conventional OpenGL drawing method.
  • the preset picture element is used to display dynamic picture resources, that is, video resources or motion picture resources. By inserting preset picture elements into the page, video content can be played during the e-book reading process, thereby improving the efficiency of information acquisition by users.
  • the page source code contains a source code matching the preset picture element by parsing the page source code corresponding to the book page. way to achieve.
  • the page-turning action area corresponding to the page-turning instruction included in the book page is determined through the picture drawing interface. Specifically, when determining the page-turning action area, calculation processing is required.
  • the number of image units to be calculated is reduced by sampling, thereby improving the calculation efficiency.
  • the image units ie page image units
  • the image unit contained in the book pages are sampled through the picture drawing interface to obtain the sampling units contained in the book pages; according to the sampling units contained in the book pages, the The page-turning action area corresponding to the page command.
  • the image unit may be image information in the form of image pixels and the like, and sampling is used to reduce the number of image units to reduce the amount of calculation.
  • the page area of the book page is divided into a plurality of area grids through the picture drawing interface, and sampling processing is performed on the image units contained in each area grid, respectively, to obtain a set of sampling units corresponding to each area grid. ;
  • the set of sampling units corresponding to each area grid determine the area grids belonging to the page turning action area.
  • the size of each area grid is preset, and accordingly, each area grid is divided according to the corresponding size, so that the page area of the entire book page is divided into a plurality of area grids arranged in sequence.
  • the sampling processing is performed for each area grid
  • several image units in the area grid may be extracted according to a preset sampling ratio, wherein the extracted image units are also called sampling units.
  • the image units together constitute a set of sampling units corresponding to the area grid.
  • the page-turning transformation positions of each page image unit and the shadow element contained in the page-turning action area are calculated through the picture drawing interface, and the page-turning transformation positions of each page image unit and the shadow element obtained by calculation are calculated. Rendering to achieve simulated page-turning of book pages.
  • the page initial position of each image unit included in the sampling unit set corresponding to the area grid belonging to the page turning action area is obtained through the picture drawing interface; according to the page initial position of each image unit included in the sampling unit set , calculate and display the page-turning transformation position of each image unit included in the sampling unit set, so as to realize the simulated page-turning processing of book pages.
  • the sampling processing in this embodiment it is not necessary to perform operations on all the image units in the area grid one by one, but only need to perform operations on each image unit in the sampling unit set included in the area grid. Computation.
  • it can be filled by an edge drawing algorithm, a smoothing algorithm, or a shrinking algorithm.
  • Embodiments of the present application provide a non-volatile computer-readable storage medium, where the non-volatile computer-readable storage medium stores at least one executable instruction, and the computer-executable instruction can execute the electronic functions in any of the foregoing method embodiments. Book simulation page turning method.
  • Executable instructions can specifically be used to cause the processor to perform the following operations:
  • a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
  • adding a shadow element to the original book page to be turned includes:
  • determining a page boundary line included in the original book page to be turned, and adding a shadow element to the outer area of the original book page along the page boundary line includes:
  • a first shadow element is added in the outer area of the original book page along the first page boundary line; and/or, the second shadow element is added in the outer area of the original book page along the second page boundary line.
  • the boundary line of the first page and the boundary line of the second page are perpendicular to each other; and the shadow element is a translucent picture element.
  • a first shadow element is added to the outer area of the original book page along the first page boundary line; and/or, a second shadow element is added to the outer area of the original book page along the second page boundary line
  • Elements include:
  • the line segment length of the first partial line segment and/or the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
  • determining the page-turning action area included in the page of the page-turning book according to the displacement change includes:
  • the page initial position of the page turning reference point, and the page turning transformation position of the page turning reference point the page turning action area included in the book page is determined.
  • determining the page turning action area included in the book page includes:
  • the page turning action area included in the book page is determined according to the boundary line passing through the target point and perpendicular to the reference line.
  • calculating the page curling radius corresponding to the page turning instruction includes:
  • the page curling radius corresponding to the page turning instruction is determined to be the preset lower limit value ;
  • the page curling radius corresponding to the page turning instruction is determined to be the preset upper limit value ;
  • FIG. 3 shows a schematic structural diagram of an electronic device according to another embodiment of the present disclosure.
  • the specific embodiment of the present disclosure does not limit the specific implementation of the electronic device.
  • the electronic device may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .
  • processor processor
  • Communication interface Communication Interface
  • memory memory
  • communication bus 308 a communication bus
  • the processor 302 , the communication interface 304 , and the memory 306 communicate with each other through the communication bus 308 .
  • the communication interface 304 is used for communicating with network elements of other devices such as clients or other servers.
  • the processor 302 is configured to execute the program 310, and specifically, may execute the relevant steps in the foregoing embodiments of the method for simulating page turning of an electronic book.
  • the program 310 may include program code including computer operation instructions.
  • the processor 302 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present disclosure.
  • the one or more processors included in the electronic device may be the same type of processors, such as one or more CPUs; or may be different types of processors, such as one or more CPUs and one or more ASICs.
  • the memory 306 is used to store the program 310 .
  • Memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
  • the program 310 can specifically be used to cause the processor 302 to perform the following operations:
  • a shadow element is added for the original book page to be turned to obtain a page-turning book page that includes the shadow element;
  • adding a shadow element to the original book page to be turned includes:
  • determining a page boundary line included in the original book page to be turned, and adding a shadow element to the outer area of the original book page along the page boundary line includes:
  • a first shadow element is added in the outer area of the original book page along the first page boundary line; and/or, the second shadow element is added in the outer area of the original book page along the second page boundary line.
  • the boundary line of the first page and the boundary line of the second page are perpendicular to each other; and the shadow element is a translucent picture element.
  • a first shadow element is added to the outer area of the original book page along the first page boundary line; and/or, a second shadow element is added to the outer area of the original book page along the second page boundary line
  • Elements include:
  • the line segment length of the first partial line segment and/or the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
  • determining the page-turning action area included in the page of the page-turning book according to the displacement change includes:
  • the page initial position of the page turning reference point, and the page turning transformation position of the page turning reference point the page turning action area included in the book page is determined.
  • determining the page turning action area included in the book page includes:
  • the page turning action area included in the book page is determined according to the boundary line passing through the target point and perpendicular to the reference line.
  • calculating the page curling radius corresponding to the page turning instruction includes:
  • the page curling radius corresponding to the page turning instruction is determined to be the preset lower limit value ;
  • the page curling radius corresponding to the page turning instruction is determined to be the preset upper limit value ;
  • modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment.
  • the modules or units or components in the embodiments may be combined into one module or unit or component, and further they may be divided into multiple sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method so disclosed may be employed in any combination unless at least some of such features and/or procedures or elements are mutually exclusive. All processes or units of equipment are combined.
  • Each feature disclosed in this specification may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

Abstract

Disclosed are a page turning simulation method for an electronic book, and an electronic device and a computer storage medium. The method comprises: in response to a received page turning instruction, adding shadow elements to an original book page, so as to obtain a page-turning book page; acquiring the displacement variation of a page-turning change position of a page-turning reference point in the page-turning book page relative to an initial page position of the page-turning reference point, and according to the displacement variation, determining a page-turning action area contained in the page-turning book page; and acquiring the initial page positions of page image units and shadow elements contained in the page-turning action area, and calculating and displaying the page-turning change positions of the page image units and shadow elements contained in the page-turning action area.

Description

电子书的仿真翻页方法、电子设备及计算机存储介质Simulated page-turning method, electronic device and computer storage medium for e-book
相关申请的交叉参考CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2020年11月23日提交中国专利局、申请号为202011322290.3、名称为“电子书的仿真翻页方法、电子设备及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on November 23, 2020 with the application number 202011322290.3 and entitled "E-book page-turning method, electronic device and computer storage medium", the entire content of which is approved by Reference is incorporated in this application.
技术领域technical field
本公开涉及计算机领域,具体涉及一种电子书的仿真翻页方法、电子设备及计算机存储介质。The present disclosure relates to the field of computers, and in particular, to a simulated page-turning method for an electronic book, an electronic device, and a computer storage medium.
背景技术Background technique
目前,随着电子设备的日益普及,越来越多的用户习惯于通过电子设备阅读电子书。电子书具有便携性,用户能够随时随地打开电子书进行阅读。在传统方式中,当用户通过电子书执行翻页操作时,将通过页面瞬时切换的方式完成页面内容的转换过程。At present, with the increasing popularity of electronic devices, more and more users are accustomed to reading e-books through electronic devices. E-books are portable, and users can open e-books to read anytime, anywhere. In a traditional way, when a user performs a page turning operation through an electronic book, the page content conversion process will be completed by means of instantaneous page switching.
但是,上述翻页方式较为突兀,无法模拟传统的纸质阅读翻页方式。例如,当用户阅读纸质书籍时,翻页操作通常是通过掀起书籍页面的一角,以使书籍页面呈现出卷曲状态进而完成的。由此可见,现有的电子书翻页方式无法模拟真实的纸质书籍的翻页效果。However, the above-mentioned page turning method is rather obtrusive, and cannot simulate the traditional paper-based page turning method. For example, when a user reads a paper book, the page turning operation is usually completed by lifting a corner of the book page to make the book page appear in a curled state. It can be seen that the existing e-book page turning method cannot simulate the page turning effect of a real paper book.
公开内容public content
鉴于上述问题,提出了本公开以便提供一种克服上述问题或者至少部分地解决上述问题的电子书的仿真翻页方法、电子设备及计算机存储介质。In view of the above problems, the present disclosure is proposed in order to provide an electronic book simulation page turning method, electronic device and computer storage medium that overcome the above problems or at least partially solve the above problems.
根据本公开的一个方面,提供了一种电子书的仿真翻页方法,包括:According to an aspect of the present disclosure, there is provided a method for simulating page turning of an electronic book, comprising:
响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面;In response to the received page-turning instruction, a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量,根据位移变化量确定翻页书籍页面中包含的翻页作用区域;Obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point, and determining the page-turning action area included in the page of the page-turning book according to the displacement change;
获取翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。Obtain the page initial position of each page image unit and shadow element included in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element included in the page-turning action area, so as to realize the simulated page turning of the book. page processing.
根据本公开的另一方面,提供了一种电子设备,包括:处理器、存储器、通信接口和通信总线,处理器、存储器和通信接口通过通信总线完成相互间的通信;According to another aspect of the present disclosure, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface communicate with each other through the communication bus;
存储器用于存放至少一可执行指令,可执行指令使处理器执行以下操作:The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the following operations:
响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面;In response to the received page-turning instruction, a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量,根据位移变化量确定翻页书籍页面中包含的翻页作用区域;Obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point, and determining the page-turning action area included in the page of the page-turning book according to the displacement change;
获取翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍 页面的仿真翻页处理。Obtain the page initial position of each page image unit and shadow element included in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element included in the page-turning action area, so as to realize the simulated page turning of the book. page processing.
根据本公开的又一方面,提供了一种非易失性计算机可读存储介质,该非易失性计算机可读存储介质中存储有至少一可执行指令,可执行指令使处理器执行以下操作:According to yet another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, and at least one executable instruction is stored in the non-volatile computer-readable storage medium, and the executable instruction causes a processor to perform the following operations :
响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面;In response to the received page-turning instruction, a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量,根据位移变化量确定翻页书籍页面中包含的翻页作用区域;Obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point, and determining the page-turning action area included in the page of the page-turning book according to the displacement change;
获取翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。Obtain the page initial position of each page image unit and shadow element included in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element included in the page-turning action area, so as to realize the simulated page turning of the book. page processing.
根据本公开的再又一方面,还提供了一种计算机程序产品,该计算机程序产品包括存储在上述非易失性计算机可读存储介质上的计算程序。在本公开提供的电子书的仿真翻页方法、电子设备及计算机存储介质中,能够根据翻页指令对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面,并根据翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量确定翻页书籍页面中包含的翻页作用区域,从而绘制翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。由此可见,该方式能够展示通过书籍页面的卷曲过程而呈现的书籍翻页状态,给予用户阅读真实的纸质书籍时的翻页视觉体验,并且,还能够针对页面添加阴影元素,从而使翻页后的部分具有阴影效果,进一步提升了仿真翻页的效果。According to yet another aspect of the present disclosure, there is also provided a computer program product, the computer program product comprising a computing program stored on the above-mentioned non-volatile computer-readable storage medium. In the simulated page-turning method, electronic device and computer storage medium of an electronic book provided by the present disclosure, shadow elements can be added to the original book pages to be turned according to the page-turning instructions, so as to obtain page-turning book pages containing shadow elements, and according to the page-turning instructions The amount of displacement change between the page-turning transformation position of the page-turning reference point in the page-turning reference point relative to the page initial position of the page-turning reference point determines the page-turning action area included in the page-turning book page, so as to draw the page-turning action area in the page-turning action area. Each page image unit included and the page-turning position of the shadow element are included to realize the simulated page-turning processing of the book page. It can be seen that this method can display the page-turning state of the book presented by the curling process of the book page, give the user a visual experience of page-turning when reading a real paper book, and can also add shadow elements to the page, so that the page is turned The part behind the page has a shadow effect, which further enhances the effect of the simulated page turning.
上述说明仅是本公开技术方案的概述,为了能够更清楚了解本公开的技术手段,而可依照说明书的内容予以实施,并且为了让本公开的上述和其它目的、特征和优点能够更明显易懂,以下特举本公开的具体实施方式。The above description is only an overview of the technical solutions of the present disclosure. In order to understand the technical means of the present disclosure more clearly, it can be implemented according to the contents of the description, and in order to make the above-mentioned and other purposes, features and advantages of the present disclosure more obvious and easy to understand , the following specific embodiments of the present disclosure are given.
附图概述BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本公开的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for purposes of illustrating preferred embodiments only and are not to be considered limiting of the present disclosure. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:
图1示出了本公开一个实施例提供的电子书的仿真翻页方法的流程图;FIG. 1 shows a flowchart of a method for simulating page turning of an electronic book provided by an embodiment of the present disclosure;
图2示出了本公开另一个实施例提供的电子书的仿真翻页方法的流程图;2 shows a flowchart of a method for simulating page turning of an electronic book provided by another embodiment of the present disclosure;
图3示出了根据本公开另一个实施例的一种电子设备的结构示意图;FIG. 3 shows a schematic structural diagram of an electronic device according to another embodiment of the present disclosure;
图4示出了一种翻页状态的示意图;4 shows a schematic diagram of a page turning state;
图5示出了又一种翻页状态的示意图;Figure 5 shows a schematic diagram of yet another page turning state;
图6示出了添加阴影元素后的翻页书籍页面的结构示意图;Figure 6 shows a schematic structural diagram of a page-turning book page after adding a shadow element;
图7示出了又一种形式的阴影元素的示意图。Figure 7 shows a schematic diagram of yet another form of shadow element.
本公开的较佳实施方式Preferred Embodiments of the Disclosure
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限 制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.
实施例一Example 1
图1示出了本公开一个实施例提供的电子书的仿真翻页方法的流程图。如图1所示,该方法包括以下步骤:FIG. 1 shows a flowchart of a method for simulating page turning of an electronic book provided by an embodiment of the present disclosure. As shown in Figure 1, the method includes the following steps:
步骤S110:响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面。Step S110: In response to the received page-turning instruction, add a shadow element to the original book page to be turned, to obtain a page-turning book page including the shadow element.
其中,阴影元素可以为阴影图片等各种类型的元素,只要能够实现阴影效果即可。添加阴影元素之后,页面中不仅包含原始页面内容,还进一步包含已添加的阴影元素,为了便于描述,将添加阴影元素后的原始书籍页面称为翻页书籍页面。The shadow element may be various types of elements such as shadow pictures, as long as a shadow effect can be achieved. After the shadow element is added, the page not only contains the original page content, but also further includes the added shadow element. For the convenience of description, the original book page after adding the shadow element is called a flip book page.
步骤S120:获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量,根据位移变化量确定翻页书籍页面中包含的翻页作用区域。Step S120: Obtain the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point, and determine the page-turning included in the page-turning book page according to the displacement change. area of action.
由于翻页操作通常仅用于掀起书籍页面的一角,因此,书籍页面中受到翻页操作影响而呈现卷曲状态的页面区域仅为书籍页面中的局部区域,该局部区域即为翻页作用区域。其余未受到翻页操作影响而仍然保持平面状态(非卷曲状态)的页面区域为非翻页作用区域。Since the page turning operation is usually only used to lift a corner of the book page, the page area in the book page that is in a curled state under the influence of the page turning operation is only a partial area of the book page, and the partial area is the page turning action area. The rest of the page area that is not affected by the page turning operation and still remains in a flat state (non-curling state) is a non-page turning action area.
具体实施时,该翻页指令通常通过滑动操作触发。书籍页面中的翻页参考点通常为:与翻页指令的触发位置相邻的页面边界线上的位置点。例如,当翻页指令的触发位置位于书籍页面的右下角区域时,该翻页参考点为书籍页面的右下角的页面顶点。相应地,该翻页参考点的页面初始位置即为书籍页面的右侧边界线与下方边界线之间的交点位置。随着翻页操作的执行,该翻页参考点的位置将发生改变,改变后的位置称为翻页变换位置。相应地,翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量能够反映翻页操作的幅度和方向,进而能够根据上述位移变化量确定翻页书籍页面中包含的翻页作用区域。During specific implementation, the page turning instruction is usually triggered by a sliding operation. The page turning reference point in the book page is usually: a position point on the page boundary line adjacent to the triggering position of the page turning instruction. For example, when the trigger position of the page turning instruction is located in the lower right corner area of the book page, the page turning reference point is the page vertex at the lower right corner of the book page. Correspondingly, the initial page position of the page turning reference point is the position of the intersection between the right boundary line and the lower boundary line of the book page. As the page turning operation is performed, the position of the page turning reference point will change, and the changed position is called the page turning change position. Correspondingly, the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point can reflect the magnitude and direction of the page-turning operation, and then the page of the page-turning book can be determined according to the above-mentioned displacement change. The page-turning effect area contained in .
步骤S130:获取翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。Step S130: Obtain the page initial position of each page image unit and shadow element contained in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element included in the page-turning action area, so as to realize the book page Simulation of page turning processing.
具体地,当书籍页面呈现出卷曲状态时,页面中包含的各个页面图像单元也将呈现出卷曲状态,因此,需要根据翻页作用区域中包含的各个页面图像单元的页面初始位置,计算各个页面图像单元在卷曲变换之后对应的翻页变换位置。其中,各个页面图像单元的页面初始位置是指:在执行翻页操作之前,各个页面图像单元位于书籍页面中的位置,具体可通过页面坐标表示;页面图像单元的翻页变换位置是指:执行翻页操作之后,各个页面图像单元随书籍页面的卷曲状态而呈现出的改变后的位置。具体实施时,由于上述的位移变化量能够反映书籍页面的卷曲程度,因此,各个页面图像单元的翻页变换位置能够基于位移变化量得到。其中,阴影元素也采用类似的处理方式:先确定各个阴影元素的页面初始位置,然后,计算各个阴影元素的翻页变换位置。由此可见,通过计算并展示各个页面图像单元以及阴影元素的翻页变换位置,能够渲染出类似于纸质书籍翻页时所呈现的页面卷曲效果,从而实现书籍页面的仿真翻页处理。并且,还能够模仿真实的阴影效果。Specifically, when a book page is in a curled state, each page image unit included in the page will also be in a curled state. Therefore, it is necessary to calculate each page according to the initial page position of each page image unit included in the page-turning action area. The corresponding page-turning transformation position of the image unit after the curl transformation. Wherein, the page initial position of each page image unit refers to the position of each page image unit on the page of the book before the page turning operation is performed, which can be specifically represented by page coordinates; the page turning transformation position of the page image unit refers to: executing After the page turning operation, each page image unit shows the changed position according to the curling state of the book page. During specific implementation, since the above-mentioned displacement change amount can reflect the degree of curling of the pages of the book, the page-turning transformation position of each page image unit can be obtained based on the displacement change amount. The shadow elements are also processed in a similar manner: first determine the page initial position of each shadow element, and then calculate the page-turning transformation position of each shadow element. It can be seen that by calculating and displaying the page-turning transformation positions of each page image unit and the shadow element, a page curling effect similar to the page-turning effect of a paper book can be rendered, thereby realizing the simulated page-turning processing of the book page. Moreover, it can also imitate the real shadow effect.
在本公开提供的电子书的仿真翻页方法中,能够根据翻页指令对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面,并根据翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量确定翻页书籍页面中包含的翻页作用区域,从而绘制翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。由此可见,该方式能够展示通过书籍页面的卷曲过程而呈现的书籍翻页状态,给予用户阅读真实的纸质书籍时的翻页视觉体验,并且,还能够针对页面添加阴影元素,从而使翻页后的部分具有阴影效果,进一步提升了仿真翻页的效果。In the simulated page-turning method for an electronic book provided by the present disclosure, a shadow element can be added to the original book page to be turned according to the page-turning instruction, so as to obtain a page-turning book page containing the shadow element, and The displacement change between the page-turning transformation position of the reference point and the page initial position of the page-turning reference point determines the page-turning action area included in the page of the page-turning book, so as to draw each page image unit included in the page-turning action area and The page-turning position of the shadow element is changed to realize the simulated page-turning processing of the book page. It can be seen that this method can display the page-turning state of the book presented by the curling process of the book page, give the user a visual experience of page-turning when reading a real paper book, and can also add shadow elements to the page, so that the page is turned The part behind the page has a shadow effect, which further enhances the effect of the simulated page turning.
实施例二Embodiment 2
图2示出了本公开另一个实施例提供的电子书的仿真翻页方法的流程图。如图2所示,该方法包括以下步骤:FIG. 2 shows a flowchart of a method for simulating page turning of an electronic book provided by another embodiment of the present disclosure. As shown in Figure 2, the method includes the following steps:
步骤S210:响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面。Step S210: In response to the received page-turning instruction, add a shadow element to the original book page to be turned, to obtain a page-turning book page including the shadow element.
其中,阴影元素可以为阴影图片等各种类型的元素,只要能够实现阴影效果即可。添加阴影元素之后,页面中不仅包含原始页面内容,还进一步包含已添加的阴影元素,为了便于描述,将添加阴影元素后的原始书籍页面称为翻页书籍页面。例如,阴影元素为半透明的图片类元素。The shadow element may be various types of elements such as shadow pictures, as long as a shadow effect can be achieved. After the shadow element is added, the page not only contains the original page content, but also further includes the added shadow element. For the convenience of description, the original book page after adding the shadow element is called a flip book page. For example, shadow elements are semi-transparent image-like elements.
具体实施时,确定待翻页的原始书籍页面中包含的页面边界线,沿页面边界线在原始书籍页面的外部区域添加阴影元素。其中,原始书籍页面的内部区域对应于书籍页面的内容部分,相应地,原始书籍页面的外部区域对应于除书籍页面的内容部分之外的区域,由此可见,原始书籍页面的外部区域实际上对于阅读用户而言是不可见的区域,其位于书籍页面的外侧。由于阴影元素添加在原始书籍页面的外部区域,因而不会影响书籍的正常阅读。另外,页面边界线是指:位于书籍页面边缘的边界线。通常,一个书籍页面包括四条页面边界线,本实施例可以仅针对其中的至少一条页面边界线所对应的外部区域添加阴影元素,具体实施细节不做限定。During specific implementation, a page boundary line included in the original book page to be turned is determined, and a shadow element is added to the outer area of the original book page along the page boundary line. Wherein, the inner area of the original book page corresponds to the content part of the book page, and accordingly, the outer area of the original book page corresponds to the area other than the content part of the book page, it can be seen that the outer area of the original book page actually The area that is invisible to the reading user is on the outside of the book page. Since the shadow element is added to the outer area of the original book page, it will not affect the normal reading of the book. In addition, the page boundary line refers to the boundary line located at the edge of the page of the book. Generally, a book page includes four page boundary lines. In this embodiment, shadow elements may be added only to the outer area corresponding to at least one page boundary line, and the specific implementation details are not limited.
为了确保添加的阴影元素的位置与用户翻页位置相匹配,在确定待翻页的原始书籍页面中包含的页面边界线,沿页面边界线在原始书籍页面的外部区域添加阴影元素时,通过以下方式实现:首先,获取与翻页指令相对应的触控位置,确定与触控位置相邻的第一页面边界线和/或第二页面边界线;然后,沿第一页面边界线在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线在原始书籍页面的外部区域添加第二阴影元素。其中,第一页面边界线可能与第二页面边界线相互垂直。例如,图6示出了添加阴影元素后的翻页书籍页面的结构示意图。如图6所示,添加阴影元素之前的原始书籍页面60具有四条页面边界线,假设与翻页指令相对应的触控位置为图中的点Y,与该触控位置Y相邻的两条页面边界线分别为相互垂直的第一页面边界线61以及第二页面边界线62。相应地,沿第一页面边界线61在原始书籍页面的外部区域添加第一阴影元素63,沿第二页面边界线62在原始书籍页面的外部区域添加第二阴影元素64。由此可见,添加阴影元素后的翻页书籍页面包括:原始书籍页面60、第一阴影元素63以及第二阴影元素64。由此可见,通过针对与翻页指令相对应的页面边界线添加阴影元素的方式,能够使后续翻页过程中阴影元素随页面一起翻转卷曲,进而呈现出自然的阴影效果。In order to ensure that the position of the added shadow element matches the page turning position of the user, when determining the page boundary line contained in the original book page to be turned, and adding the shadow element along the page boundary line in the outer area of the original book page, use the following Implementation method: first, obtain the touch position corresponding to the page turning instruction, and determine the first page boundary line and/or the second page boundary line adjacent to the touch position; then, along the first page boundary line in the original book The first shadow element is added to the outer area of the page; and/or, the second shadow element is added to the outer area of the original book page along the boundary line of the second page. Wherein, the boundary line of the first page may be perpendicular to the boundary line of the second page. For example, FIG. 6 shows a schematic diagram of the structure of a page of a page-turning book after adding a shadow element. As shown in FIG. 6 , the original book page 60 before adding the shadow element has four page boundary lines. It is assumed that the touch position corresponding to the page turning command is the point Y in the figure, and the two adjacent touch position Y The page boundary lines are respectively a first page boundary line 61 and a second page boundary line 62 that are perpendicular to each other. Correspondingly, a first shadow element 63 is added to the outer area of the original book page along the first page boundary line 61 , and a second shadow element 64 is added to the outer area of the original book page along the second page boundary line 62 . It can be seen that the flipped book page after adding the shadow element includes: the original book page 60 , the first shadow element 63 and the second shadow element 64 . It can be seen that by adding a shadow element to the page boundary line corresponding to the page turning instruction, the shadow element can be turned and curled together with the page in the subsequent page turning process, thereby presenting a natural shadow effect.
优选地,考虑到翻页过程中仅涉及书籍页面的部分区域发生卷曲变换,因此,为了节 约系统处理资源,可以根据书籍页面中包含的翻页作用区域设置阴影元素的添加范围。具体地,沿第一页面边界线中包含的第一局部线段在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线中包含的第二局部线段在原始书籍页面的外部区域添加第二阴影元素;其中,第一局部线段和/或第二局部线段的线段长度根据翻页指令所对应的滑动操作的滑动位移量确定。Preferably, considering that only a part of the book page is involved in the curling transformation during the page turning process, in order to save system processing resources, the range of adding shadow elements can be set according to the page turning action area included in the book page. Specifically, adding a first shadow element to an outer area of the original book page along a first partial line segment included in the first page boundary line; and/or adding a first shadow element along the second partial line segment included in the second page boundary line on the original book page A second shadow element is added to the outer area of the ; wherein the length of the first partial line segment and/or the line segment of the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
步骤S220:获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量。Step S220: Obtain the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point.
书籍页面中的翻页参考点通常为:与翻页指令的触发位置相邻的页面边界线上的位置点。例如,当翻页指令的触发位置位于书籍页面的右下角区域时,该翻页参考点为书籍页面的右下角的页面顶点。相应地,该翻页参考点的页面初始位置即为书籍页面的右侧边界线与下方边界线之间的交点位置。随着翻页操作的执行,该翻页参考点的位置将发生改变,改变后的位置称为翻页变换位置。相应地,翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量能够反映翻页操作的幅度和方向。The page turning reference point in the book page is usually: a position point on the page boundary line adjacent to the triggering position of the page turning instruction. For example, when the trigger position of the page turning instruction is located in the lower right corner area of the book page, the page turning reference point is the page vertex at the lower right corner of the book page. Correspondingly, the initial page position of the page turning reference point is the position of the intersection between the right boundary line and the lower boundary line of the book page. As the page turning operation is performed, the position of the page turning reference point will change, and the changed position is called the page turning change position. Correspondingly, the amount of displacement change between the page turning transformation position of the page turning reference point relative to the page initial position of the page turning reference point can reflect the magnitude and direction of the page turning operation.
步骤S230:根据位移变化量确定翻页书籍页面中包含的翻页作用区域。Step S230: Determine the page-turning action area included in the page of the page-turning book according to the displacement change.
由于翻页操作通常仅用于掀起书籍页面的一角,因此,书籍页面中受到翻页操作影响而呈现卷曲状态的页面区域仅为书籍页面中的局部区域,该局部区域即为翻页作用区域。其余未受到翻页操作影响而仍然保持平面状态(非卷曲状态)的页面区域为非翻页作用区域。Since the page turning operation is usually only used to lift a corner of the book page, the page area in the book page that is in a curled state under the influence of the page turning operation is only a partial area of the book page, and the partial area is the page turning action area. The rest of the page area that is not affected by the page turning operation and still remains in a flat state (non-curling state) is a non-page turning action area.
步骤S240:获取翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。Step S240: Obtain the page initial positions of each page image unit and shadow element contained in the page-turning action area, and calculate and display the page-turning transformation positions of each page image unit and shadow element included in the page-turning action area, so as to realize the book page Simulation of page turning processing.
具体地,当书籍页面呈现出卷曲状态时,页面中包含的各个页面图像单元也将呈现出卷曲状态,因此,需要根据翻页作用区域中包含的各个页面图像单元的页面初始位置,计算各个页面图像单元在卷曲变换之后对应的翻页变换位置。其中,各个页面图像单元的页面初始位置是指:在执行翻页操作之前,各个页面图像单元位于书籍页面中的位置,具体可通过页面坐标表示;页面图像单元的翻页变换位置是指:执行翻页操作之后,各个页面图像单元随书籍页面的卷曲状态而呈现出的改变后的位置。具体实施时,由于上述的位移变化量能够反映书籍页面的卷曲程度,因此,各个页面图像单元的翻页变换位置能够基于位移变化量得到。其中,阴影元素也采用类似的处理方式:先确定各个阴影元素的页面初始位置,然后,计算各个阴影元素的翻页变换位置。由此可见,通过计算并展示各个页面图像单元以及阴影元素的翻页变换位置,能够渲染出类似于纸质书籍翻页时所呈现的页面卷曲效果,从而实现书籍页面的仿真翻页处理。并且,还能够模仿真实的阴影效果。Specifically, when a book page is in a curled state, each page image unit included in the page will also be in a curled state. Therefore, it is necessary to calculate each page according to the initial page position of each page image unit included in the page-turning action area. The corresponding page-turning transformation position of the image unit after the curl transformation. Wherein, the page initial position of each page image unit refers to the position of each page image unit on the page of the book before the page turning operation is performed, which can be specifically represented by page coordinates; the page turning transformation position of the page image unit refers to: executing After the page turning operation, each page image unit shows the changed position according to the curling state of the book page. During specific implementation, since the above-mentioned displacement change amount can reflect the degree of curling of the pages of the book, the page-turning transformation position of each page image unit can be obtained based on the displacement change amount. The shadow elements are also processed in a similar manner: first determine the page initial position of each shadow element, and then calculate the page-turning transformation position of each shadow element. It can be seen that by calculating and displaying the page-turning transformation positions of each page image unit and the shadow element, a page curling effect similar to the page-turning effect of a paper book can be rendered, thereby realizing the simulated page-turning processing of the book page. Moreover, it can also imitate the real shadow effect.
接下来,通过一个具体示例详细介绍上述的仿真翻页方法的具体实现细节。该示例包括以下步骤:Next, the specific implementation details of the above-mentioned simulated page turning method are described in detail through a specific example. The example includes the following steps:
步骤一:响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面;获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量。Step 1: In response to the received page-turning instruction, add a shadow element to the original book page to be turned, to obtain a page-turning book page containing the shadow element; obtain the page-turning transformation position of the page-turning reference point in the page-turning book page The amount of displacement change between the initial position of the page relative to the page turning reference point.
具体地,本实施例中的翻页指令为滑动类翻页指令。书籍页面中的翻页参考点通常为:与翻页指令的触发位置相邻的页面边界线上的位置点。图4示出了一种翻页状态的示意图,如图4所示,翻页指令的触发位置位于书籍页面的右下角区域,相应地,书籍页面中的翻页参考点为书籍页面右下角的页面顶点。该翻页参考点的页面初始位置即为书籍页面 的右侧边界线(对应于图6中的第二页面边界线64)与下方边界线(对应于图6中的第一页面边界线63)之间的交点位置,即图4中的F点。Specifically, the page turning instruction in this embodiment is a sliding page turning command. The page turning reference point in the book page is usually: a position point on the page boundary line adjacent to the triggering position of the page turning instruction. FIG. 4 shows a schematic diagram of a page turning state. As shown in FIG. 4 , the trigger position of the page turning instruction is located in the lower right corner area of the book page. Correspondingly, the page turning reference point in the book page is the lower right corner of the book page. The vertex of the page. The initial page position of the page turning reference point is the right boundary line (corresponding to the second page boundary line 64 in FIG. 6 ) and the lower boundary line (corresponding to the first page boundary line 63 in FIG. 6 ) of the book page. The position of the intersection point between them is point F in Figure 4.
随着翻页操作的执行,该翻页参考点的位置将发生改变,改变后的位置称为翻页变换位置。例如,图4中的A点对应于翻页参考点的翻页变换位置。相应地,翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量能够反映翻页操作的幅度和方向。该位移变化量可通过线段AF的长度和斜率确定。As the page turning operation is performed, the position of the page turning reference point will change, and the changed position is called the page turning change position. For example, point A in FIG. 4 corresponds to the page-turning transition position of the page-turning reference point. Correspondingly, the amount of displacement change between the page turning transformation position of the page turning reference point relative to the page initial position of the page turning reference point can reflect the magnitude and direction of the page turning operation. The displacement change amount can be determined by the length and slope of the line segment AF.
具体地,在获取书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量时,通过以下方式实现:首先,获取滑动类翻页指令的滑动方向和/或滑动长度。其中,滑动类翻页指令的滑动方向和/或滑动长度用于表示滑动类翻页指令的滑动位移量,该滑动位移量取决于滑动操作的持续时长和滑动速度等因素。然后,根据滑动方向和/或滑动长度,确定翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置的位移方向和/或位移长度。其中,翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置的位移方向与滑动类翻页指令的滑动方向匹配,并且,翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置的位移长度与滑动类翻页指令的滑动长度之间具有预设的比例关系。Specifically, when obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the book page and the page initial position of the page-turning reference point, the following method is used: first, obtain the information of the sliding page-turning instruction. Swipe direction and/or swipe length. Wherein, the sliding direction and/or the sliding length of the sliding page turning instruction is used to represent the sliding displacement amount of the sliding page turning command, and the sliding displacement amount depends on factors such as the duration of the sliding operation and the sliding speed. Then, according to the sliding direction and/or the sliding length, the displacement direction and/or the displacement length of the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is determined. Wherein, the displacement direction of the page-turning transformation position of the page-turning reference point relative to the initial position of the page of the page-turning reference point matches the sliding direction of the sliding-type page-turning instruction, and the page-turning transformation position of the page-turning reference point is relative to the page turning direction. There is a preset proportional relationship between the displacement length of the initial page position of the reference point and the sliding length of the sliding page turning instruction.
其中,在本步骤中,可以针对原始书籍页面添加阴影元素,具体添加时,可以直接沿上述第一页面边界线在原始书籍页面的外部区域添加第一阴影元素;并沿第二页面边界线在原始书籍页面的外部区域添加第二阴影元素。或者,也可以进一步根据翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量来调整阴影元素的尺寸。例如,沿第一页面边界线中包含的第一局部线段在原始书籍页面的外部区域添加第一阴影元素;沿第二页面边界线中包含的第二局部线段在原始书籍页面的外部区域添加第二阴影元素,第一局部线段和第二局部线段的线段长度根据翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量确定。Wherein, in this step, a shadow element can be added to the original book page. When adding, the first shadow element can be added directly along the above-mentioned first page boundary line in the outer area of the original book page; and along the second page boundary line Add a second shadow element to the outer area of the original book page. Alternatively, the size of the shadow element may be further adjusted according to the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point. For example, a first shadow element is added in the outer area of the original book page along the first partial line segment included in the first page boundary line; Two shaded elements, the line lengths of the first partial line segment and the second partial line segment are determined according to the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page relative to the page initial position of the page-turning reference point.
步骤二:计算与翻页指令相对应的页面卷曲半径。Step 2: Calculate the page curling radius corresponding to the page turning instruction.
由于翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量能够反映翻页操作的幅度和方向,进而能够计算出与该翻页指令相对应的页面卷曲半径。其中,页面卷曲半径是指:当书籍页面随翻页操作而呈现出卷曲状态时,由卷曲后的书籍页面形成的圆柱曲面的半径。该页面卷曲半径用于指示书籍页面的卷曲程度。Since the displacement change between the page-turning transformation position of the page-turning reference point relative to the initial page position of the page-turning reference point can reflect the magnitude and direction of the page-turning operation, the page curl corresponding to the page-turning instruction can be calculated. radius. The page curling radius refers to the radius of the cylindrical surface formed by the curled book pages when the book pages are in a curled state with the page turning operation. The page curl radius is used to indicate how curled the book pages are.
具体实施时,页面卷曲半径主要根据位移变化量以及圆周半径公式计算得到。其中,发明人在实现本公开的过程中发现,当翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量过小时,将导致翻页效果难以察觉;而当翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量过大时,又将导致翻页幅度过大从而影响用户的正常阅读。为了解决上述问题,在本实施例中,预先设置有下限阈值以及上限阈值,若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量小于预设下限阈值,则确定与翻页指令相对应的页面卷曲半径为预设下限值,其中,该预设下限值为预先设定的最小半径。若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量大于预设上限阈值,则确定与翻页指令相对应的页面卷曲半径为预设上限值,其中,该预设上限值为预先设定的最大半径。若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量介于预设下限阈值与预设上限阈值之间,则根据位移变化量以及圆周半径公式计算页面卷曲半径。其中,圆周半径公式用于限定翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位 移变化量与页面卷曲半径之间的相对关系。通常情况下,翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量与页面卷曲半径之间的比值具有预设规律,例如,可能为预设常数。During specific implementation, the curling radius of the page is mainly calculated according to the displacement change amount and the circle radius formula. Wherein, the inventor found in the process of realizing the present disclosure that when the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is too small, the page-turning effect will be difficult to detect; However, when the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is too large, the page turning amplitude is too large and the normal reading of the user is affected. In order to solve the above problem, in this embodiment, a lower threshold and an upper threshold are preset. If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is less than the preset lower limit If the threshold is set, the page curling radius corresponding to the page turning instruction is determined to be a preset lower limit value, where the preset lower limit value is a preset minimum radius. If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is greater than the preset upper limit threshold, the page curling radius corresponding to the page turning instruction is determined to be the preset upper limit value , wherein the preset upper limit value is a preset maximum radius. If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is between the preset lower threshold and the preset upper threshold, the calculation is performed according to the displacement change and the circle radius formula. Page curl radius. Wherein, the circle radius formula is used to define the relative relationship between the displacement change between the page-turning transformation position of the page-turning reference point and the page initial position of the page-turning reference point and the curling radius of the page. Usually, the ratio between the displacement change between the page turning transformation position of the page turning reference point and the page initial position of the page turning reference point and the page curling radius has a preset law, for example, may be a preset constant.
步骤三:根据页面卷曲半径、翻页参考点的页面初始位置以及翻页参考点的翻页变换位置,确定书籍页面中包含的翻页作用区域。Step 3: Determine the page-turning action area included in the book page according to the page curling radius, the page initial position of the page-turning reference point, and the page-turning transformation position of the page-turning reference point.
由于翻页操作通常仅用于掀起书籍页面的一角,因此,书籍页面中受到翻页操作影响而呈现卷曲状态的页面区域仅为书籍页面中的局部区域,该局部区域即为翻页作用区域。其余未受到翻页操作影响而仍然保持平面状态(非卷曲状态)的页面区域为非翻页作用区域。为了模拟真实的翻页卷曲状态,需要首先确定上述的翻页作用区域,以便于在后续步骤中针对该翻页作用区域执行卷曲变换处理。Since the page turning operation is usually only used to lift a corner of the book page, the page area in the book page that is in a curled state under the influence of the page turning operation is only a partial area of the book page, and the partial area is the page turning action area. The rest of the page area that is not affected by the page turning operation and still remains in a flat state (non-curling state) is a non-page turning action area. In order to simulate a real page-turning curl state, it is necessary to first determine the above-mentioned page-turning action area, so as to perform curl transformation processing for the page-turning action area in subsequent steps.
具体实施时,在根据页面卷曲半径、翻页参考点的页面初始位置以及翻页参考点的翻页变换位置,确定书籍页面中包含的翻页作用区域时,通过以下方式实现:首先,确定经过翻页参考点的页面初始位置以及翻页参考点的翻页变换位置的参考直线,根据页面卷曲半径确定位于该参考直线上的目标点;然后,根据经过该目标点且垂直于该参考直线的边界直线确定书籍页面中包含的翻页作用区域。During specific implementation, when determining the page-turning action area included in the book page according to the page curl radius, the page initial position of the page-turning reference point, and the page-turning transformation position of the page-turning reference point, the following methods are used: The page initial position of the page turning reference point and the reference line of the page turning change position of the page turning reference point, determine the target point located on the reference line according to the page curl radius; then, according to the target point passing through the target point and perpendicular to the reference line The boundary line defines the page-turning action area contained in the book page.
其中,经过翻页参考点的页面初始位置以及翻页参考点的翻页变换位置的参考直线即为图4中由点A和点F限定的直线。在根据页面卷曲半径确定位于该参考直线上的目标点时,主要根据页面卷曲半径的大小确定该目标点位于参考直线上的具体位置。其中,图4中的目标点为P点。相应地,经过该目标点且垂直于该参考直线的边界直线即为图4中由点C和点J限定的直线。其中,边界直线用于划分书籍页面中包含的翻页作用区域以及非翻页作用区域。例如,边界直线的左下方区域对应于翻页作用区域,该部分区域中包含的图像单元将发生卷曲变换;而边界直线的右上方区域对应于非翻页作用区域,该部分区域中包含的图像单元不发生卷曲变换。由此可见,通过由页面卷曲半径的长度限定的位于参考直线上的目标点,即可绘制经过该目标点且垂直于参考直线的边界直线,通过该边界直线即可快速确定翻页作用区域。其中,如图4所示,该边界直线与第一页面边界线之间的第一交点为点C,且该边界直线与第二页面边界线之间的第二交点为点J,通过点C和点J能够更准确地限定翻页作用区域。The reference line passing through the initial page position of the page turning reference point and the page turning change position of the page turning reference point is the straight line defined by the point A and the point F in FIG. 4 . When determining the target point on the reference straight line according to the page curling radius, the specific position of the target point on the reference straight line is mainly determined according to the size of the page curling radius. Among them, the target point in Figure 4 is point P. Correspondingly, the boundary line passing through the target point and perpendicular to the reference line is the line defined by point C and point J in FIG. 4 . The boundary line is used to divide the page-turning action area and the non-page-turning action area included in the book page. For example, the lower-left area of the boundary line corresponds to the page-turning area, and the image units contained in this part of the area will undergo curl transformation; while the upper-right area of the boundary line corresponds to the non-page-turning area, and the images contained in this part area will undergo curl transformation. Cells do not undergo curl transformation. It can be seen that a boundary line passing through the target point and perpendicular to the reference line can be drawn through the target point on the reference line defined by the length of the page curl radius, and the page turning action area can be quickly determined through the boundary line. Wherein, as shown in FIG. 4 , the first intersection point between the boundary line and the first page boundary line is point C, and the second intersection point between the boundary line and the second page boundary line is point J, passing through point C and point J can more accurately define the page turning action area.
其中,图4所示的目标点位于翻页参考点的页面初始位置以及翻页参考点的翻页变换位置之间,实际上,当页面卷曲半径较小时,还可能是翻页参考点的翻页变换位置介于翻页参考点的页面初始位置以及目标点之间。总之,本公开不限定目标点位于参考直线上的具体位置。Among them, the target point shown in FIG. 4 is located between the page initial position of the page turning reference point and the page turning transformation position of the page turning reference point. In fact, when the page curling radius is small, it may also be the turning of the page turning reference point The page change position is between the page initial position of the page turning reference point and the target point. In conclusion, the present disclosure does not limit the specific position of the target point on the reference line.
例如,在第一种情况中,页面卷曲半径大于预设值,说明此时的翻页指令所对应的滑动位移量较大,则目标点介于翻页参考点的页面初始位置以及翻页参考点的翻页变换位置之间。如图4所示,目标点P位于点A和点F之间。相应地,在确定书籍页面中包含的翻页作用区域时,根据目标点确定翻页作用区域中包含的未发生卷曲变换的第一子区域,以及发生卷曲变换的第二子区域。其中,未发生卷曲变换的第一子区域对应于书籍页面的背面区域,例如,图4中由点A、B、K构成的区域即为第一子区域,该区域用于展示翻页后的书籍背面区域,且该背面区域未发生卷曲变换。发生卷曲变换的第二子区域包括书籍页面的正面区域以及背面区域。For example, in the first case, the page curling radius is greater than the preset value, indicating that the sliding displacement corresponding to the page turning command at this time is large, and the target point is between the initial page position of the page turning reference point and the page turning reference between the page-turning positions of the points. As shown in FIG. 4, the target point P is located between the point A and the point F. Correspondingly, when determining the page-turning effect area included in the book page, the first sub-area included in the page-turning effect area without curl transformation and the second sub area with curl transformation are determined according to the target point. Among them, the first sub-area without curling transformation corresponds to the back area of the book page. For example, the area composed of points A, B, and K in FIG. 4 is the first sub-area, and this area is used to display the page-turned The area on the back of the book that has not undergone a curl transformation. The second sub-region where the curl transformation occurs includes the front and back regions of the book page.
具体地,在根据目标点确定翻页作用区域中包含的未发生卷曲变换的第一子区域,以及发生卷曲变换的第二子区域时,通过以下方式实现:Specifically, when determining, according to the target point, the first sub-area that does not undergo curl transformation and the second sub-region that undergoes curl transformation and included in the page-turning action region, the following methods are used:
首先,确定位于参考直线上且与目标点相对应的目标映射点;其中,目标映射点和翻页参考点的页面初始位置之间的间隔与目标点和翻页参考点的翻页变换位置之间的间隔匹配。具体地,该目标映射点可通过以下方式确定:先绘制由翻页参考点的页面初始位置以及翻页参考点的翻页变换位置构成的参考线段,即图4中的线段AF,然后,确定线段AF的中点为点G,相应地,目标映射点O与目标点P到中点G的距离相等。由此可见,目标映射点和翻页参考点的页面初始位置之间的间隔(即线段OF的长度)与目标点和翻页参考点的翻页变换位置之间的间隔(即线段AP的长度)相等。First, determine the target mapping point located on the reference line and corresponding to the target point; wherein, the interval between the target mapping point and the page initial position of the page turning reference point is the difference between the target point and the page turning change position of the page turning reference point interval matching. Specifically, the target mapping point can be determined by: firstly drawing a reference line segment formed by the page initial position of the page-turning reference point and the page-turning transformation position of the page-turning reference point, that is, the line segment AF in FIG. 4 , and then determining The midpoint of the line segment AF is the point G, and accordingly, the distances from the target mapping point O and the target point P to the midpoint G are equal. It can be seen that the interval between the target mapping point and the page initial position of the page turning reference point (that is, the length of the line segment OF) and the interval between the target point and the page turning change position of the page turning reference point (that is, the length of the line segment AP) )equal.
然后,根据经过目标映射点且垂直于参考直线的边界映射直线,确定位于书籍页面的第一页面边界线的第一临界点(即点B1)以及位于书籍页面的第二页面边界线的第二临界点(即点K1);其中,第一页面边界线垂直于第二页面边界线,且翻页参考点的页面初始位置位于第一页面边界线与第二页面边界线的交点。其中,经过目标映射点且垂直于参考直线的边界映射直线即为由图4中的点B1和点K1确定的直线。Then, according to the boundary mapping line passing through the target mapping point and perpendicular to the reference line, determine the first critical point (ie point B1) located on the boundary line of the first page of the book page and the second critical point located on the boundary line of the second page of the book page Critical point (ie point K1); wherein, the first page boundary line is perpendicular to the second page boundary line, and the page initial position of the page turning reference point is at the intersection of the first page boundary line and the second page boundary line. The boundary mapping straight line passing through the target mapping point and perpendicular to the reference straight line is the straight line determined by the point B1 and the point K1 in FIG. 4 .
最后,确定由第一临界点、第二临界点以及翻页参考点的页面初始位置构成的三角区域,根据该三角区域以及与该三角区域相对应的映射区域确定未发生卷曲变换的第一子区域以及发生卷曲变换的第二子区域。其中,由第一临界点、第二临界点以及翻页参考点的页面初始位置构成的三角区域即为由点B1、K1和F构成的区域。相应地,与该三角区域相对应的映射区域即为由点B、K和A构成的区域。其中,点B对应于点B1经卷曲变换后的翻页变换位置,点K对应于点K1经卷曲变换后的翻页变换位置。由此可见,映射区域是由三角区域翻转后对应的贴图区域,且映射区域对应于三角区域的背面。Finally, a triangular area formed by the first critical point, the second critical point and the initial position of the page of the page turning reference point is determined, and the first sub-region that does not undergo curl transformation is determined according to the triangular area and the mapping area corresponding to the triangular area region and the second subregion where the warp transformation takes place. Wherein, the triangular area formed by the first critical point, the second critical point and the initial position of the page of the page turning reference point is the area formed by the points B1, K1 and F. Correspondingly, the mapping area corresponding to the triangular area is the area formed by points B, K and A. The point B corresponds to the page-turning transformation position of the point B1 after the curling transformation, and the point K corresponds to the page-turning transformation position of the point K1 after the curling transformation. It can be seen that the mapping area is the corresponding texture area after being flipped by the triangle area, and the mapping area corresponds to the back of the triangle area.
具体地,在根据该三角区域以及与该三角区域相对应的映射区域确定未发生卷曲变换的第一子区域以及发生卷曲变换的第二子区域时,首先,将三角区域及其对应的映射区域确定为未发生卷曲变换的第一子区域,剩余的区域即对应于发生卷曲变换的第二子区域。Specifically, when determining the first sub-region that does not undergo curl transformation and the second sub-region that undergoes curl transformation according to the triangle region and the mapping region corresponding to the triangle region, first, the triangle region and its corresponding mapping region are determined. It is determined as the first sub-region where no curling transformation has occurred, and the remaining regions correspond to the second sub-region where curling transformation has occurred.
步骤四:获取翻页作用区域中包含的各个图像单元的页面初始位置,结合页面卷曲半径计算并展示各个图像单元的翻页变换位置,以实现书籍页面的仿真翻页处理。Step 4: Obtain the initial page position of each image unit included in the page-turning action area, and calculate and display the page-turning transformation position of each image unit in combination with the page curl radius, so as to realize the simulated page-turning process of the book page.
具体地,当书籍页面呈现出卷曲状态时,页面中包含的各个图像单元也将呈现出卷曲状态,因此,需要根据翻页作用区域中包含的各个图像单元的页面初始位置,计算各个图像单元在卷曲变换之后对应的翻页变换位置。其中,各个图像单元的页面初始位置是指:在执行翻页操作之前,各个图像单元位于书籍页面中的位置,具体可通过页面坐标表示;图像单元的翻页变换位置是指:执行翻页操作之后,各个图像单元随书籍页面的卷曲状态而呈现出的改变后的位置。具体实施时,由于页面卷曲半径能够反映书籍页面的卷曲程度,因此,各个图像单元的翻页变换位置能够基于页面卷曲半径计算得到。由此可见,通过计算并展示各个图像单元的翻页变换位置,能够渲染出类似于纸质书籍翻页时所呈现的页面卷曲效果,从而实现书籍页面的仿真翻页处理。Specifically, when the page of the book is in a curled state, each image unit included in the page will also be in a curled state. Therefore, it is necessary to calculate the initial position of each image unit included in the page turning action area according to the page initial position of each image unit. The corresponding page transformation position after curl transformation. Wherein, the initial page position of each image unit refers to the position of each image unit on the page of the book before performing the page turning operation, which can be specifically represented by page coordinates; the page turning transformation position of the image unit refers to: performing the page turning operation Afterwards, each image unit presents a changed position according to the curled state of the book page. During specific implementation, since the page curl radius can reflect the curl degree of the book page, the page-turning transformation position of each image unit can be calculated based on the page curl radius. It can be seen that, by calculating and displaying the page-turning transformation positions of each image unit, a page curling effect similar to that presented when a paper book is turned can be rendered, thereby realizing the simulated page-turning processing of the book pages.
具体实施时,获取翻页作用区域中包含的各个图像单元的页面初始位置,结合页面卷曲半径计算并展示各个图像单元的翻页变换位置时,针对图4中的第一子区域,按照映射关系确定第一子区域中的各个图像单元的翻页变换位置;针对第二子区域,根据由页面卷曲半径确定的圆柱方程确定第二子区域中的各个图像单元的翻页变换位置。In the specific implementation, the initial page position of each image unit included in the page-turning action area is obtained, and when the page-turning transformation position of each image unit is calculated and displayed in combination with the page curl radius, for the first sub-region in FIG. 4, according to the mapping relationship Determine the page-turning transformation position of each image unit in the first sub-region; for the second sub-region, determine the page-turning transformation position of each image unit in the second sub-region according to the cylinder equation determined by the page curl radius.
其中,翻页作用区域中包含的各个图像单元也叫页面图像单元,是指书籍页面的页面图像构成要素,例如,图像单元可以为图像像素点。根据每个图像像素点在原始书籍页面中的页面初始位置,即可结合页面卷曲半径计算出该图像像素点在卷曲变换后所对应的翻页变换位置。Wherein, each image unit included in the page-turning action area is also called a page image unit, which refers to a page image constituent element of a book page, for example, an image unit may be an image pixel point. According to the initial page position of each image pixel in the original book page, the page-turning transformation position corresponding to the image pixel after the curling transformation can be calculated in combination with the page curling radius.
由于上述的第一子区域并未发生卷曲变换,只是通过映射方式将由B1K1F三个点构成的三角区域映射到了由BKA三个点构成的映射区域内,因此,按照映射关系确定第一子区域中的各个图像单元的翻页变换位置。另外,考虑到第一子区域对应于书籍页面的背面区域,因此,需要先获取与第一子区域中的各个图像单元相对应的背面区域内的映射图像单元,然后,将各个图像单元相对应的背面区域内的映射图像单元映射至对应的翻页变换位置。其中,各个图像单元相对应的背面区域是指:当前展示的书籍页面所对应的背面页面中与该图像单元位于同一坐标位置的区域。例如,对于位于第5页的右下角区域的某个图像单元而言,其对应的背面区域内的映射图像单元即为位于第6页的左下角的图像单元。即:某图像单元相对应的背面区域内的映射图像单元是指:将页面翻转后得到的该图像单元背面的同一位置的图像单元。Since the above-mentioned first sub-area does not undergo curl transformation, only the triangular area formed by the three points of B1K1F is mapped to the mapping area formed by the three points of BKA through the mapping method. Therefore, according to the mapping relationship, determine the The page-turning transformation position of each image unit of . In addition, considering that the first sub-area corresponds to the back area of the book page, therefore, it is necessary to first acquire the mapped image units in the back area corresponding to each image unit in the first sub-area, and then map each image unit to the back area. The mapped image units in the back area of are mapped to the corresponding page-turning transformation positions. The back area corresponding to each image unit refers to an area located at the same coordinate position as the image unit in the back page corresponding to the currently displayed book page. For example, for an image unit located in the lower right corner area of page 5, the corresponding mapped image unit in the back area is the image unit located at the lower left corner of page 6. That is, the mapped image unit in the back area corresponding to a certain image unit refers to the image unit at the same position on the back of the image unit obtained by turning the page over.
与第一子区域不同,上述的第二子区域中的各个图像像素点发生了卷曲变换,因此,针对第二子区域中的各个图像像素点,根据由页面卷曲半径确定的圆柱方程确定第二子区域中的各个图像单元的翻页变换位置。例如,图4中的点E和点H为计算过程中涉及到的辅助计算点,线段EH为线段AF的垂直平分线。另外,图4中的点D1为线段CB1的中点,而点I1为线段JK1的中点。相应地,点D为点D1对应的翻页变换位置,点I为点I1对应的翻页变换位置。点M对应于线段B1D1的中点所对应的翻页变换位置,点N对应于线段K1I1的中点所对应的翻页变换位置。具体实施时,针对特定的图像像素点,先判断该图像像素点位于第一子区域或第二子区域,若位于第一子区域则按照映射方式确定与该图像像素点的页面初始位置相对应的翻页变换位置;若位于第二子区域,则将该图像像素点的页面初始位置代入由页面卷曲半径确定的圆柱方程,根据计算结果确定与该图像像素点相对应的翻页变换位置。例如,将点D1的页面初始位置代入圆柱方程即得到点D的位置。Different from the first sub-region, each image pixel in the above-mentioned second sub-region undergoes curl transformation. Therefore, for each image pixel in the second sub-region, the second sub-region is determined according to the cylinder equation determined by the page curling radius. The page-turning transformation position of each image unit in the sub-region. For example, the point E and the point H in FIG. 4 are auxiliary calculation points involved in the calculation process, and the line segment EH is the vertical bisector of the line segment AF. In addition, the point D1 in FIG. 4 is the midpoint of the line segment CB1, and the point I1 is the midpoint of the line segment JK1. Correspondingly, the point D is the page-turning transformation position corresponding to the point D1, and the point I is the page-turning transformation position corresponding to the point I1. The point M corresponds to the page turning change position corresponding to the midpoint of the line segment B1D1, and the point N corresponds to the page turning change position corresponding to the midpoint of the line segment K1I1. In specific implementation, for a specific image pixel, it is first determined that the image pixel is located in the first sub-region or the second sub-region, and if it is located in the first sub-region, it is determined according to the mapping method that corresponds to the initial position of the image pixel on the page If it is located in the second sub-region, substitute the initial page position of the image pixel into the cylinder equation determined by the page curl radius, and determine the page-turning transformation position corresponding to the image pixel according to the calculation result. For example, the position of point D is obtained by substituting the initial position of the page of point D1 into the cylinder equation.
另外,上文已经提到过,第二子区域同时包含原始书籍页面的正面区域以及背面区域,为此,在上述过程中,需要先区分第二子区域中包含的与正面区域相对应的第二正面子区域、以及与背面区域相对应的第二背面子区域。为了划分上述的第二正面子区域以及第二背面子区域,需要根据图4中的点D1以及点I1进行划分。In addition, as mentioned above, the second sub-area includes both the front area and the back area of the original book page. Therefore, in the above process, it is necessary to first distinguish the first sub-area corresponding to the front area contained in the second sub-area. Two front sub-areas, and a second back sub-area corresponding to the back area. In order to divide the above-mentioned second front sub-region and second back sub-region, it needs to be divided according to point D1 and point I1 in FIG. 4 .
具体地,上述的第二正面子区域以及第二背面子区域通过以下方式划分:首先,绘制经过目标点P且垂直于参考直线的边界直线,确定该边界直线与第一页面边界线之间的第一交点C以及该边界直线与第二页面边界线的第二交点J;然后,确定第一交点C与第一临界点B1之间的第一中点D1,以及第二交点J与第二临界点K1之间的第二中点I1,根据上述的第一中点D1以及第二中点I1确定上述的第二正面子区域(由点C、D1、I1、J构成的区域)以及第二背面子区域(由点D1、B1、K1、I1构成的区域)。相应地,针对第二背面子区域中的各个图像像素点,需要先获取与第二背面子区域中的各个图像单元相对应的背面区域内的映射图像单元,然后,将各个图像单元相对应的背面区域内的映射图像单元映射至对应的翻页变换位置。Specifically, the above-mentioned second front sub-region and second back sub-region are divided in the following manner: First, draw a boundary line that passes through the target point P and is perpendicular to the reference line, and determines the distance between the boundary line and the first page boundary line. the first intersection point C and the second intersection point J of the boundary line and the second page boundary line; then, determine the first midpoint D1 between the first intersection point C and the first critical point B1, and the second intersection point J and the second intersection point The second midpoint I1 between the critical points K1 is determined according to the first midpoint D1 and the second midpoint I1. Two back sub-regions (regions formed by points D1, B1, K1, I1). Correspondingly, for each image pixel point in the second back sub-area, it is necessary to first acquire the mapped image units in the back area corresponding to each image unit in the second back sub-area, and then map the image units corresponding to each image unit. The mapped image unit in the back area is mapped to the corresponding page turning position.
图4对应于页面卷曲半径较大的情况,图5进一步示出了页面卷曲半径较小时的页面卷曲效果示意图。如图5所示,若页面卷曲半径不大于预设值,则翻页参考点的翻页变换位置介于翻页参考点的页面初始位置以及目标点之间。例如,图5中的目标点P位于线段AF的延长线上。当然,也可能目标点P与翻页参考点的翻页变换位置A相互重合。但是,无论是目标点P位于线段AF的延长线上,还是目标点P与翻页参考点的翻页变换位置A相互重合,都将导致翻页作用区域无法划分为上述的第一子区域以及第二子区域,而仅包含一个整体性区域。此时,在获取翻页作用区域中包含的各个图像单元的页面初始 位置,结合页面卷曲半径计算并展示各个图像单元的翻页变换位置时,直接根据由页面卷曲半径确定的圆柱方程确定翻页作用区域中的各个图像单元的翻页变换位置。FIG. 4 corresponds to the case where the page curling radius is larger, and FIG. 5 further shows a schematic diagram of the page curling effect when the page curling radius is smaller. As shown in FIG. 5 , if the page curling radius is not greater than the preset value, the page-turning transformation position of the page-turning reference point is between the page initial position of the page-turning reference point and the target point. For example, the target point P in FIG. 5 is located on the extension line of the line segment AF. Of course, it is also possible that the target point P and the page-turning change position A of the page-turning reference point coincide with each other. However, whether the target point P is located on the extension line of the line segment AF, or the target point P and the page-turning transformation position A of the page-turning reference point coincide with each other, the page-turning action area cannot be divided into the above-mentioned first sub-area and The second sub-area, but only contains an integral area. At this time, when the initial page position of each image unit included in the page-turning action area is obtained, and the page-turning transformation position of each image unit is calculated and displayed in combination with the page curling radius, the page-turning is determined directly according to the cylindrical equation determined by the page curling radius. The page transform position of each image unit in the active area.
另外,如图5所示,当目标点P位于线段AF的延长线或目标点P与翻页参考点的翻页变换位置A相互重合时,翻页作用区域仍然可以划分为对应于书籍页面的正面内容的正面作用区域以及对应于书籍页面的背面内容的背面作用区域。由此可见,无论目标点的位置如何,翻页作用区域都可以划分为对应于书籍页面的正面内容的正面作用区域(例如图4中的第二正面子区域)以及对应于书籍页面的背面内容的背面作用区域(例如,图4中的三角区域以及第二背面子区域都可以统称为背面作用区域)。其中,对于对应于书籍页面的背面内容的背面作用区域,都需要获取与背面作用区域中的各个图像单元相对应的背面区域内的映射图像单元,然后,将各个图像单元相对应的背面区域内的映射图像单元映射至对应的翻页变换位置。In addition, as shown in FIG. 5 , when the target point P is located on the extension line of the line segment AF or when the target point P and the page-turning transformation position A of the page-turning reference point coincide with each other, the page-turning action area can still be divided into pages corresponding to the pages of the book. The front active area of the front content and the back active area corresponding to the back content of the book page. It can be seen that, regardless of the position of the target point, the page turning action area can be divided into a front action area corresponding to the front content of the book page (for example, the second front sub-region in FIG. 4 ) and a back content corresponding to the book page (for example, the triangular area and the second back sub-area in FIG. 4 can be collectively referred to as the back active area). Among them, for the back action area corresponding to the back content of the book page, it is necessary to obtain the mapped image units in the back area corresponding to each image unit in the back action area, and then, map the back area corresponding to each image unit in the back area. The mapped image unit is mapped to the corresponding page transform position.
另外,上文已经提到过,第一阴影元素可以沿第一页面边界线中包含的第一局部线段在原始书籍页面的外部区域添加,且第二阴影元素可以沿第二页面边界线中包含的第二局部线段在原始书籍页面的外部区域添加。为了便于确定局部线段的长度和位置,在一个具体示例中,第一页面边界线中包含的第一局部线段由上文提到的边界直线与第一页面边界线之间的第一交点C以及翻页参考点的页面初始位置F限定;第二页面边界线中包含的第二局部线段由上文提到的边界直线与第二页面边界线的第二交点J以及翻页参考点的页面初始位置F限定。图7示出了另一种形式的阴影元素的示意图。如图7所示,第一页面边界线中包含第一局部线段71,第二页面边界线中包含第二局部线段72。相应地,沿第一局部线段71在原始书籍页面的外部区域添加第一阴影元素73,沿第二局部线段72在原始书籍页面的外部区域添加第二阴影元素74。In addition, as mentioned above, the first shadow element may be added in the outer area of the original book page along the first partial line segment included in the first page boundary line, and the second shadow element may be included along the second page boundary line The second partial line segment is added in the outer area of the original book page. In order to facilitate the determination of the length and position of the partial line segment, in a specific example, the first partial line segment included in the first page boundary line is defined by the first intersection point C between the above-mentioned boundary line and the first page boundary line and The page initial position F of the page turning reference point is defined; the second partial line segment included in the second page boundary line is defined by the second intersection J of the above-mentioned boundary line and the second page boundary line and the page initial position of the page turning reference point Position F is limited. Figure 7 shows a schematic diagram of another form of shadow element. As shown in FIG. 7 , the first page boundary line includes a first partial line segment 71 , and the second page boundary line includes a second partial line segment 72 . Correspondingly, a first shadow element 73 is added along the first partial line segment 71 in the outer region of the original book page, and a second shadow element 74 is added along the second partial line segment 72 in the outer region of the original book page.
另外,还需要说明的是,本实施例并不限定阴影元素的添加时机,阴影元素也可以在获取到翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量,并根据该位移变化量确定出翻页书籍页面中包含的翻页作用区域之后添加。由此可见,上述的各个步骤之间的执行顺序可以灵活调整。或者,也可以先添加阴影元素,在获取到翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量之后,再根据获取到的位移变化量调整阴影元素的尺寸以及设置位置。In addition, it should also be noted that this embodiment does not limit the timing of adding shadow elements, and shadow elements may also be relative to the page of the page-turning reference point at the page-turning transformation position of the page-turning reference point obtained in the page of the page-turning book. The displacement change between the initial positions is added after determining the page-turning action area included in the page of the page-turning book according to the displacement change. It can be seen that the execution sequence of the above steps can be flexibly adjusted. Alternatively, a shadow element can also be added first, and after the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point is obtained, Displacement delta adjusts the size and position of shadow elements.
由此可见,由于本实施例在计算各个页面图像单元的翻页变换位置之前,预先在原始书籍页面的外部添加了阴影元素,因此,能够同时根据阴影元素中的各个像素点的页面初始位置计算阴影元素中的各个像素点的翻页变换位置。该方式能够使添加的阴影效果更加真实,并且,无需在计算出各个页面图像单元的翻页变换位置之后,额外执行添加阴影的操作,使阴影元素与页面图像单元一同发生卷曲变换。It can be seen that, before calculating the page-turning transformation position of each page image unit in this embodiment, a shadow element is added to the outside of the original book page in advance, so it can be calculated according to the initial page position of each pixel in the shadow element at the same time. The page transform position of each pixel in the shadow element. This method can make the added shadow effect more realistic, and there is no need to additionally perform the operation of adding shadow after calculating the page-turning transformation position of each page image unit, so that the shadow element and the page image unit undergo curl transformation together.
另外,还需要说明的是,在本实施例中,滑动类翻页指令通常是持续触发的,例如,用户沿预设方向滑动一定时长,以触发该滑动类翻页指令。相应地,在滑动类翻页指令的触发过程中,持续检测当前的滑动方向和滑动长度,并根据当前的实时检测结果动态计算翻页参考点的翻页变换位置,并动态根据计算得到的翻页参考点的翻页变换位置计算页面卷曲半径以及翻页作用区域内的各个图像单元的翻页变换位置。也就是说,在持续翻页的过程中,翻页作用区域的区域范围及其对应的页面卷曲半径都是动态变化的。例如,可能在翻页的初始阶段,页面呈现图5所示的状态,随着翻页指令的持续运行,页面呈现图4所示的状态,因此,在本实施例中,需要动态进行多次计算过程,以便实时呈现与各个翻页阶段相对应的页面状态。In addition, it should also be noted that, in this embodiment, the sliding page turning instruction is usually triggered continuously. For example, the user slides in a preset direction for a certain period of time to trigger the sliding page turning command. Correspondingly, in the triggering process of the sliding page-turning instruction, the current sliding direction and sliding length are continuously detected, and the page-turning transformation position of the page-turning reference point is dynamically calculated according to the current real-time detection result, and the page-turning transformation position of the page-turning reference point is dynamically calculated according to the calculated turning The page turning transformation position of the page reference point calculates the page curl radius and the page turning transformation position of each image unit in the page turning action area. That is to say, in the process of continuous page turning, the area range of the page turning action area and the corresponding page curling radius are dynamically changed. For example, in the initial stage of page turning, the page may be in the state shown in Figure 5, and as the page turning instruction continues to run, the page may be in the state shown in Figure 4. Therefore, in this embodiment, it is necessary to dynamically perform multiple times Computational process in order to present the page state corresponding to each page turning stage in real time.
综上可知,通过本实施例中的仿真翻页方法,能够使书籍页面随翻页操作而呈现自然卷曲的效果。并且,在翻页并卷曲的过程中,卷曲后的页面上的各个图像单元也随之变换,从而呈现出真实的形变状态。例如,图4中的“尊者级”几个字显示出卷曲的效果。由此可见,本实施例能够模拟真实的纸质书籍的翻页状态,使翻页过程中的电子书页面的部分所显示的内容与纸质书籍的翻页过程中所对应的内容一致。另外,通过预先添加阴影元素的方式,使页面添加阴影的操作与卷曲变换操作同时完成,无需在页面卷曲后二次执行阴影变换处理,既提升了处理效率,又实现了真实的仿真翻页效果。From the above, it can be seen that through the simulated page-turning method in this embodiment, the pages of the book can be naturally curled with the page-turning operation. In addition, during the process of page turning and curling, each image unit on the curled page is also transformed, thereby presenting a real deformation state. For example, the words "Venerable" in Figure 4 show the effect of curling. It can be seen that this embodiment can simulate the page-turning state of a real paper book, so that the content displayed on the page of the e-book during the page-turning process is consistent with the content corresponding to the page-turning process of the paper book. In addition, by adding shadow elements in advance, the operation of adding shadows to the page and the curling transformation operation are completed at the same time, and there is no need to perform shadow transformation processing twice after the page is curled, which not only improves the processing efficiency, but also achieves a real simulated page turning effect. .
另外,本领域技术人员还可以针对上述实施例进行各种改动和变形:具体地,在步骤S210中,当检测到针对包含预设图片元素的书籍页面触发的翻页指令时,调用图片绘制接口执行后续步骤。其中,包含预设图片元素的书籍页面是指:页面内容中包含动态图片或用于链接至视频资源的图片元素等内容。例如,在电子书中通过图片链接等方式插入动态的视频资源,以便于用户在阅读电子书的过程中获取图片或视频等形式的信息,进而提升书籍阅读效率。具体地,该翻页指令通常通过滑动操作触发。相应地,当检测到通过滑动操作触发的翻页指令时,调用图片绘制接口,以实现后续的翻页绘制操作。其中,图片绘制接口是指:专用于实现图片绘制功能的接口。例如,在安卓系统中,可通过安卓系统提供的具备绘图功能的接口实现。又如,在ios系统中,可通过自定义开发的具有绘图功能的接口实现。由于该图片绘制接口的接口逻辑可以根据实际业务需求灵活调整,因此,尤其适用于包含图片的复杂书籍页面的翻页绘制处理。其中,发明人在实现本公开的过程中发现,传统方式中大多通过OpenGL方式实现绘图处理,但是,OpenGL绘制方式具有以下局限性:无法适用于包含图片的书籍页面的处理。也就是说,OpenGL绘制方式只能应用于常规的包含文字的书籍页面的绘制处理,而当书籍页面中包含图片或用于链接至视频资源的图片链接时则无法适用。因此,为了解决上述问题,当检测到翻页指令时,进一步获取与该翻页指令相对应的书籍页面的页面描述信息,通过该书籍页面的页面描述信息判断该书籍页面中是否包含预设图片元素,若是,则调用上述图片绘制接口实现翻页绘制处理;若否,则可以灵活选择是否通过常规的OpenGL绘制方式处理。其中,预设图片元素用于展示动态图片资源,即视频资源或动图资源。通过在页面中插入预设图片元素使电子书阅读过程中能够播放视频内容,从而提升用户获取信息的效率。具体地,在根据书籍页面的页面描述信息判断该书籍页面中是否包含预设图片元素时,可通过解析书籍页面对应的页面源码,判断页面源码中是否包含与预设图片元素相匹配的源码标识符的方式实现。相应地,在步骤S220以及步骤S230中,通过图片绘制接口确定书籍页面中包含的与翻页指令相对应的翻页作用区域。具体地,在确定翻页作用区域时,需要进行计算处理,为了降低计算运算量,在本实施例中,通过采样方式降低待计算的图像单元的数量,从而提升计算效率。具体地,通过图片绘制接口对书籍页面中包含的图像单元(即页面图像单元)进行采样处理,得到书籍页面中包含的采样单元;根据书籍页面中包含的采样单元确定书籍页面中包含的与翻页指令相对应的翻页作用区域。其中,图像单元可以是图像像素点等形式的图像信息,采样用于降低图像单元的数量,以减少计算量。具体实施时,通过图片绘制接口将书籍页面的页面区域划分为多个区域网格,分别针对各个区域网格中包含的图像单元进行采样处理,得到分别与各个区域网格相对应的采样单元集合;相应地,根据与各个区域网格相对应的采样单元集合,确定属于翻页作用区域的区域网格。例如,预先设置各个区域网格的尺寸,相应地,按照对应的尺寸划分各个区域网格,从而将整个书籍页面的页面区域划分为多个依次排列的区域网格。具体地,在针对每个区域网格执行采样处理时,可以按照预设的采样比例抽取该区域网格中的若干图像单元,其中,抽取的图像单元也叫采样单元,相应地,抽取的各个图像单元共同构成与该区域网格相对应的采样 单元集合。对应地,在上述步骤S240中,通过图片绘制接口计算翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,对计算得到的各个页面图像单元以及阴影元素的翻页变换位置进行渲染,以实现书籍页面的仿真翻页处理。具体实施时,通过图片绘制接口获取与属于翻页作用区域的区域网格相对应的采样单元集合中包含的各个图像单元的页面初始位置;根据采样单元集合中包含的各个图像单元的页面初始位置,计算并展示采样单元集合中包含的各个图像单元的翻页变换位置,以实现书籍页面的仿真翻页处理。由此可见,本实施例通过采样处理,无需针对区域网格中的全部图像单元进行逐一运算,只需针对区域网格中包含的采样单元集合中的各个图像单元进行运算即可,大幅降低了运算量。另外,对于未包含在采样单元集合中的其他图像单元,可通过边缘绘制算法、平滑算法或拉缩算法等进行填充。In addition, those skilled in the art can also make various changes and modifications to the above-mentioned embodiments: Specifically, in step S210, when a page-turning instruction triggered for a book page containing preset picture elements is detected, the picture drawing interface is called. Perform the next steps. Wherein, the book page containing preset picture elements means that the content of the page includes dynamic pictures or picture elements for linking to video resources. For example, dynamic video resources are inserted into e-books by means of image links, etc., so that users can obtain information in the form of pictures or videos during the process of reading e-books, thereby improving book reading efficiency. Specifically, the page turning instruction is usually triggered by a sliding operation. Correspondingly, when a page-turning instruction triggered by a sliding operation is detected, a picture drawing interface is called to implement a subsequent page-turning drawing operation. The picture drawing interface refers to an interface dedicated to realizing the picture drawing function. For example, in the Android system, it can be implemented through an interface with a drawing function provided by the Android system. For another example, in the ios system, it can be implemented through a custom developed interface with a drawing function. Since the interface logic of the picture drawing interface can be flexibly adjusted according to actual business requirements, it is especially suitable for page-turning and drawing processing of complex book pages containing pictures. Among them, in the process of implementing the present disclosure, the inventor found that drawing processing is mostly implemented by OpenGL in traditional methods. However, the OpenGL drawing method has the following limitations: it cannot be applied to the processing of book pages containing pictures. That is to say, the OpenGL drawing method can only be applied to the drawing processing of regular book pages containing text, and cannot be applied when the book pages contain pictures or picture links used to link to video resources. Therefore, in order to solve the above problem, when a page-turning instruction is detected, the page description information of the book page corresponding to the page-turning command is further obtained, and whether the book page contains a preset picture is judged by the page description information of the book page Element, if so, call the above picture drawing interface to implement page turning drawing processing; if not, you can flexibly choose whether to process by conventional OpenGL drawing method. The preset picture element is used to display dynamic picture resources, that is, video resources or motion picture resources. By inserting preset picture elements into the page, video content can be played during the e-book reading process, thereby improving the efficiency of information acquisition by users. Specifically, when judging whether the book page contains a preset picture element according to the page description information of the book page, it can be determined whether the page source code contains a source code matching the preset picture element by parsing the page source code corresponding to the book page. way to achieve. Correspondingly, in step S220 and step S230, the page-turning action area corresponding to the page-turning instruction included in the book page is determined through the picture drawing interface. Specifically, when determining the page-turning action area, calculation processing is required. In order to reduce the calculation amount, in this embodiment, the number of image units to be calculated is reduced by sampling, thereby improving the calculation efficiency. Specifically, the image units (ie page image units) contained in the book pages are sampled through the picture drawing interface to obtain the sampling units contained in the book pages; according to the sampling units contained in the book pages, the The page-turning action area corresponding to the page command. Wherein, the image unit may be image information in the form of image pixels and the like, and sampling is used to reduce the number of image units to reduce the amount of calculation. In the specific implementation, the page area of the book page is divided into a plurality of area grids through the picture drawing interface, and sampling processing is performed on the image units contained in each area grid, respectively, to obtain a set of sampling units corresponding to each area grid. ; Correspondingly, according to the set of sampling units corresponding to each area grid, determine the area grids belonging to the page turning action area. For example, the size of each area grid is preset, and accordingly, each area grid is divided according to the corresponding size, so that the page area of the entire book page is divided into a plurality of area grids arranged in sequence. Specifically, when the sampling processing is performed for each area grid, several image units in the area grid may be extracted according to a preset sampling ratio, wherein the extracted image units are also called sampling units. The image units together constitute a set of sampling units corresponding to the area grid. Correspondingly, in the above step S240, the page-turning transformation positions of each page image unit and the shadow element contained in the page-turning action area are calculated through the picture drawing interface, and the page-turning transformation positions of each page image unit and the shadow element obtained by calculation are calculated. Rendering to achieve simulated page-turning of book pages. During specific implementation, the page initial position of each image unit included in the sampling unit set corresponding to the area grid belonging to the page turning action area is obtained through the picture drawing interface; according to the page initial position of each image unit included in the sampling unit set , calculate and display the page-turning transformation position of each image unit included in the sampling unit set, so as to realize the simulated page-turning processing of book pages. It can be seen that, through the sampling processing in this embodiment, it is not necessary to perform operations on all the image units in the area grid one by one, but only need to perform operations on each image unit in the sampling unit set included in the area grid. Computation. In addition, for other image units that are not included in the sampling unit set, it can be filled by an edge drawing algorithm, a smoothing algorithm, or a shrinking algorithm.
实施例三Embodiment 3
本申请实施例提供了一种非易失性计算机可读存储介质,非易失性计算机可读存储介质存储有至少一可执行指令,该计算机可执行指令可执行上述任意方法实施例中的电子书的仿真翻页方法。Embodiments of the present application provide a non-volatile computer-readable storage medium, where the non-volatile computer-readable storage medium stores at least one executable instruction, and the computer-executable instruction can execute the electronic functions in any of the foregoing method embodiments. Book simulation page turning method.
可执行指令具体可以用于使得处理器执行以下操作:Executable instructions can specifically be used to cause the processor to perform the following operations:
响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面;In response to the received page-turning instruction, a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量,根据位移变化量确定翻页书籍页面中包含的翻页作用区域;Obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point, and determining the page-turning action area included in the page of the page-turning book according to the displacement change;
获取翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。Obtain the page initial position of each page image unit and shadow element included in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element included in the page-turning action area, so as to realize the simulated page turning of the book. page processing.
在一种可选的实现方式中,针对待翻页的原始书籍页面添加阴影元素包括:In an optional implementation manner, adding a shadow element to the original book page to be turned includes:
确定待翻页的原始书籍页面中包含的页面边界线,沿页面边界线在原始书籍页面的外部区域添加阴影元素。Determine the page boundary line included in the original book page to be turned, and add shadow elements along the page boundary line in the outer area of the original book page.
在一种可选的实现方式中,确定待翻页的原始书籍页面中包含的页面边界线,沿页面边界线在原始书籍页面的外部区域添加阴影元素包括:In an optional implementation manner, determining a page boundary line included in the original book page to be turned, and adding a shadow element to the outer area of the original book page along the page boundary line includes:
获取与翻页指令相对应的触控位置,确定与触控位置相邻的第一页面边界线和/或第二页面边界线;Acquire the touch position corresponding to the page turning instruction, and determine the first page boundary line and/or the second page boundary line adjacent to the touch position;
沿第一页面边界线在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线在原始书籍页面的外部区域添加第二阴影元素。A first shadow element is added in the outer area of the original book page along the first page boundary line; and/or, the second shadow element is added in the outer area of the original book page along the second page boundary line.
在一种可选的实现方式中,第一页面边界线与第二页面边界线相互垂直;并且,阴影元素为半透明的图片类元素。In an optional implementation manner, the boundary line of the first page and the boundary line of the second page are perpendicular to each other; and the shadow element is a translucent picture element.
在一种可选的实现方式中,沿第一页面边界线在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线在原始书籍页面的外部区域添加第二阴影元素包括:In an optional implementation manner, a first shadow element is added to the outer area of the original book page along the first page boundary line; and/or, a second shadow element is added to the outer area of the original book page along the second page boundary line Elements include:
沿第一页面边界线中包含的第一局部线段在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线中包含的第二局部线段在原始书籍页面的外部区域添加第二阴影元素;adding a first shadow element along the first partial line segment contained in the first page boundary line in the outer region of the original book page; and/or along the second partial line segment included in the second page boundary line in the outer region of the original book page Add a second shadow element;
其中,第一局部线段和/或第二局部线段的线段长度根据翻页指令所对应的滑动操作的滑动位移量确定。Wherein, the line segment length of the first partial line segment and/or the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
在一种可选的实现方式中,根据位移变化量确定翻页书籍页面中包含的翻页作用区域包括:In an optional implementation manner, determining the page-turning action area included in the page of the page-turning book according to the displacement change includes:
根据位移变化量计算与翻页指令相对应的页面卷曲半径;Calculate the page curling radius corresponding to the page turning instruction according to the displacement change;
根据页面卷曲半径、翻页参考点的页面初始位置以及翻页参考点的翻页变换位置,确定书籍页面中包含的翻页作用区域。According to the page curling radius, the page initial position of the page turning reference point, and the page turning transformation position of the page turning reference point, the page turning action area included in the book page is determined.
在一种可选的实现方式中,根据页面卷曲半径、翻页参考点的页面初始位置以及翻页参考点的翻页变换位置,确定书籍页面中包含的翻页作用区域包括:In an optional implementation manner, according to the page curl radius, the page initial position of the page turning reference point, and the page turning transformation position of the page turning reference point, determining the page turning action area included in the book page includes:
确定经过翻页参考点的页面初始位置以及翻页参考点的翻页变换位置的参考直线,根据页面卷曲半径确定位于参考直线上的目标点;Determine the initial position of the page passing through the page turning reference point and the reference line of the page turning transformation position of the page turning reference point, and determine the target point located on the reference line according to the curling radius of the page;
根据经过目标点且垂直于参考直线的边界直线确定书籍页面中包含的翻页作用区域。The page turning action area included in the book page is determined according to the boundary line passing through the target point and perpendicular to the reference line.
在一种可选的实现方式中,计算与翻页指令相对应的页面卷曲半径包括:In an optional implementation manner, calculating the page curling radius corresponding to the page turning instruction includes:
若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量小于预设下限阈值,则确定与翻页指令相对应的页面卷曲半径为预设下限值;If the displacement change between the page-turning transformation position of the page-turning reference point and the page initial position of the page-turning reference point is less than the preset lower limit threshold, the page curling radius corresponding to the page turning instruction is determined to be the preset lower limit value ;
若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量大于预设上限阈值,则确定与翻页指令相对应的页面卷曲半径为预设上限值;If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is greater than the preset upper limit threshold, the page curling radius corresponding to the page turning instruction is determined to be the preset upper limit value ;
若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量介于预设下限阈值与预设上限阈值之间,则根据位移变化量以及圆周半径公式计算页面卷曲半径。If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is between the preset lower threshold and the preset upper threshold, the calculation is performed according to the displacement change and the circle radius formula. Page curl radius.
实施例四Embodiment 4
图3示出了根据本公开另一个实施例的一种电子设备的结构示意图,本公开具体实施例并不对电子设备的具体实现做限定。FIG. 3 shows a schematic structural diagram of an electronic device according to another embodiment of the present disclosure. The specific embodiment of the present disclosure does not limit the specific implementation of the electronic device.
如图3所示,该电子设备可以包括:处理器(processor)302、通信接口(Communications Interface)304、存储器(memory)306、以及通信总线308。As shown in FIG. 3 , the electronic device may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .
其中:处理器302、通信接口304、以及存储器306通过通信总线308完成相互间的通信。通信接口304,用于与其它设备比如客户端或其它服务器等的网元通信。处理器302,用于执行程序310,具体可以执行上述电子书的仿真翻页方法实施例中的相关步骤。The processor 302 , the communication interface 304 , and the memory 306 communicate with each other through the communication bus 308 . The communication interface 304 is used for communicating with network elements of other devices such as clients or other servers. The processor 302 is configured to execute the program 310, and specifically, may execute the relevant steps in the foregoing embodiments of the method for simulating page turning of an electronic book.
具体地,程序310可以包括程序代码,该程序代码包括计算机操作指令。Specifically, the program 310 may include program code including computer operation instructions.
处理器302可能是中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本公开实施例的一个或多个集成电路。电子设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。The processor 302 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present disclosure. The one or more processors included in the electronic device may be the same type of processors, such as one or more CPUs; or may be different types of processors, such as one or more CPUs and one or more ASICs.
存储器306,用于存放程序310。存储器306可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 306 is used to store the program 310 . Memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
程序310具体可以用于使得处理器302执行以下操作:The program 310 can specifically be used to cause the processor 302 to perform the following operations:
响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影 元素的翻页书籍页面;In response to the page-turning instruction received, a shadow element is added for the original book page to be turned to obtain a page-turning book page that includes the shadow element;
获取翻页书籍页面中的翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量,根据位移变化量确定翻页书籍页面中包含的翻页作用区域;Obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning book page and the page initial position of the page-turning reference point, and determining the page-turning action area included in the page of the page-turning book according to the displacement change;
获取翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现书籍页面的仿真翻页处理。Obtain the page initial position of each page image unit and shadow element contained in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element included in the page-turning action area, so as to realize the simulated page turning of the book. page processing.
在一种可选的实现方式中,针对待翻页的原始书籍页面添加阴影元素包括:In an optional implementation manner, adding a shadow element to the original book page to be turned includes:
确定待翻页的原始书籍页面中包含的页面边界线,沿页面边界线在原始书籍页面的外部区域添加阴影元素。Determine the page boundary line included in the original book page to be turned, and add shadow elements along the page boundary line in the outer area of the original book page.
在一种可选的实现方式中,确定待翻页的原始书籍页面中包含的页面边界线,沿页面边界线在原始书籍页面的外部区域添加阴影元素包括:In an optional implementation manner, determining a page boundary line included in the original book page to be turned, and adding a shadow element to the outer area of the original book page along the page boundary line includes:
获取与翻页指令相对应的触控位置,确定与触控位置相邻的第一页面边界线和/或第二页面边界线;Acquire the touch position corresponding to the page turning instruction, and determine the first page boundary line and/or the second page boundary line adjacent to the touch position;
沿第一页面边界线在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线在原始书籍页面的外部区域添加第二阴影元素。A first shadow element is added in the outer area of the original book page along the first page boundary line; and/or, the second shadow element is added in the outer area of the original book page along the second page boundary line.
在一种可选的实现方式中,第一页面边界线与第二页面边界线相互垂直;并且,阴影元素为半透明的图片类元素。In an optional implementation manner, the boundary line of the first page and the boundary line of the second page are perpendicular to each other; and the shadow element is a translucent picture element.
在一种可选的实现方式中,沿第一页面边界线在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线在原始书籍页面的外部区域添加第二阴影元素包括:In an optional implementation manner, a first shadow element is added to the outer area of the original book page along the first page boundary line; and/or, a second shadow element is added to the outer area of the original book page along the second page boundary line Elements include:
沿第一页面边界线中包含的第一局部线段在原始书籍页面的外部区域添加第一阴影元素;和/或,沿第二页面边界线中包含的第二局部线段在原始书籍页面的外部区域添加第二阴影元素;adding a first shadow element along the first partial line segment contained in the first page boundary line in the outer area of the original book page; and/or along the second partial line segment contained in the second page boundary line in the outer area of the original book page Add a second shadow element;
其中,第一局部线段和/或第二局部线段的线段长度根据翻页指令所对应的滑动操作的滑动位移量确定。Wherein, the line segment length of the first partial line segment and/or the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
在一种可选的实现方式中,根据位移变化量确定翻页书籍页面中包含的翻页作用区域包括:In an optional implementation manner, determining the page-turning action area included in the page of the page-turning book according to the displacement change includes:
根据位移变化量计算与翻页指令相对应的页面卷曲半径;Calculate the page curling radius corresponding to the page turning instruction according to the displacement change;
根据页面卷曲半径、翻页参考点的页面初始位置以及翻页参考点的翻页变换位置,确定书籍页面中包含的翻页作用区域。According to the page curling radius, the page initial position of the page turning reference point, and the page turning transformation position of the page turning reference point, the page turning action area included in the book page is determined.
在一种可选的实现方式中,根据页面卷曲半径、翻页参考点的页面初始位置以及翻页参考点的翻页变换位置,确定书籍页面中包含的翻页作用区域包括:In an optional implementation manner, according to the page curl radius, the page initial position of the page turning reference point, and the page turning transformation position of the page turning reference point, determining the page turning action area included in the book page includes:
确定经过翻页参考点的页面初始位置以及翻页参考点的翻页变换位置的参考直线,根据页面卷曲半径确定位于参考直线上的目标点;Determine the initial position of the page passing through the page turning reference point and the reference line of the page turning transformation position of the page turning reference point, and determine the target point located on the reference line according to the curling radius of the page;
根据经过目标点且垂直于参考直线的边界直线确定书籍页面中包含的翻页作用区域。The page turning action area included in the book page is determined according to the boundary line passing through the target point and perpendicular to the reference line.
在一种可选的实现方式中,计算与翻页指令相对应的页面卷曲半径包括:In an optional implementation manner, calculating the page curling radius corresponding to the page turning instruction includes:
若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量小于预设下限阈值,则确定与翻页指令相对应的页面卷曲半径为预设下限值;If the displacement change between the page-turning transformation position of the page-turning reference point and the page initial position of the page-turning reference point is less than the preset lower limit threshold, the page curling radius corresponding to the page turning instruction is determined to be the preset lower limit value ;
若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量 大于预设上限阈值,则确定与翻页指令相对应的页面卷曲半径为预设上限值;If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is greater than the preset upper limit threshold, the page curling radius corresponding to the page turning instruction is determined to be the preset upper limit value ;
若翻页参考点的翻页变换位置相对于翻页参考点的页面初始位置之间的位移变化量介于预设下限阈值与预设上限阈值之间,则根据位移变化量以及圆周半径公式计算页面卷曲半径。If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is between the preset lower threshold and the preset upper threshold, the calculation is performed according to the displacement change and the circle radius formula. Page curl radius.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本公开也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本公开的内容,并且上面对特定语言所做的描述是为了披露本公开的最佳实施方式。The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with teaching based on this. The structure required to construct such a system is apparent from the above description. Furthermore, this disclosure is not directed to any particular programming language. It is to be understood that various programming languages may be used to implement the disclosures described herein and that the descriptions of specific languages above are intended to disclose the best mode of the disclosure.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本公开的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. It will be understood, however, that embodiments of the present disclosure may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个公开方面中的一个或多个,在上面对本公开的示例性实施例的描述中,本公开的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本公开要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,公开方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本公开的单独实施例。Similarly, it will be appreciated that in the above description of exemplary embodiments of the disclosure, various features of the disclosure are sometimes grouped together into a single embodiment, figure, or its description. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed disclosure requires more features than are expressly recited in each claim. Rather, as the following claims reflect, disclosed aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of the present disclosure.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and further they may be divided into multiple sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method so disclosed may be employed in any combination unless at least some of such features and/or procedures or elements are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本公开的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, it will be understood by those skilled in the art that although some of the embodiments herein include certain features, but not others, included in other embodiments, that combinations of features of the different embodiments are intended to be within the scope of the present disclosure And form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
应该注意的是上述实施例对本公开进行说明而不是对本公开进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本公开可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-described embodiments illustrate rather than limit the disclosure, and that alternative embodiments may be devised by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present disclosure may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.

Claims (18)

  1. 一种电子书的仿真翻页方法,包括:A method for simulating page turning of an electronic book, comprising:
    响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面;In response to the received page-turning instruction, a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
    获取所述翻页书籍页面中的翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量,根据所述位移变化量确定所述翻页书籍页面中包含的翻页作用区域;Obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning reference point relative to the page initial position of the page-turning reference point, and determining the page-turning book page according to the displacement change The page-turning action area contained in the ;
    获取所述翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示所述翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现所述书籍页面的仿真翻页处理。Obtain the page initial position of each page image unit and shadow element contained in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element contained in the page-turning action area, so as to realize the Describes the simulated page-turning processing of book pages.
  2. 根据权利要求1所述的方法,其中,所述针对待翻页的原始书籍页面添加阴影元素包括:The method according to claim 1, wherein the adding a shadow element to the original book page to be turned comprises:
    确定所述待翻页的原始书籍页面中包含的页面边界线,沿所述页面边界线在所述原始书籍页面的外部区域添加阴影元素。A page boundary line included in the original book page to be turned is determined, and a shadow element is added to the outer area of the original book page along the page boundary line.
  3. 根据权利要求2所述的方法,其中,确定所述待翻页的原始书籍页面中包含的页面边界线,沿所述页面边界线在所述原始书籍页面的外部区域添加阴影元素包括:The method according to claim 2, wherein determining a page boundary line included in the original book page to be turned, and adding a shadow element to the outer area of the original book page along the page boundary line comprises:
    获取与所述翻页指令相对应的触控位置,确定与所述触控位置相邻的第一页面边界线和/或第二页面边界线;acquiring a touch position corresponding to the page turning instruction, and determining a first page boundary line and/or a second page boundary line adjacent to the touch position;
    沿所述第一页面边界线在所述原始书籍页面的外部区域添加第一阴影元素;和/或,沿所述第二页面边界线在所述原始书籍页面的外部区域添加第二阴影元素。adding a first shadow element along the first page boundary line in the outer area of the original book page; and/or adding a second shadow element along the second page boundary line in the outer area of the original book page.
  4. 根据权利要求3所述的方法,其中,所述第一页面边界线与所述第二页面边界线相互垂直;并且,所述阴影元素为半透明的图片类元素。The method according to claim 3, wherein the boundary line of the first page and the boundary line of the second page are perpendicular to each other; and the shadow element is a translucent picture element.
  5. 根据权利要求3或4所述的方法,其中,所述沿所述第一页面边界线在所述原始书籍页面的外部区域添加第一阴影元素;和/或,沿所述第二页面边界线在所述原始书籍页面的外部区域添加第二阴影元素包括:The method according to claim 3 or 4, wherein the adding a first shadow element along the first page boundary line in the outer area of the original book page; and/or along the second page boundary line Adding a second shadow element to the outer area of the original book page includes:
    沿所述第一页面边界线中包含的第一局部线段在所述原始书籍页面的外部区域添加所述第一阴影元素;和/或,沿所述第二页面边界线中包含的第二局部线段在所述原始书籍页面的外部区域添加所述第二阴影元素;adding the first shadow element to an outer area of the original book page along a first partial line segment contained in the first page boundary line; and/or along a second partial line segment contained in the second page boundary line adding the second shadow element to the outer area of the original book page by a line segment;
    其中,所述第一局部线段和/或所述第二局部线段的线段长度根据翻页指令所对应的滑动操作的滑动位移量确定。Wherein, the line segment length of the first partial line segment and/or the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
  6. 根据权利要求1-5任一所述的方法,其中,所述根据所述位移变化量确定所述翻页书籍页面中包含的翻页作用区域包括:The method according to any one of claims 1-5, wherein the determining the page-turning action area included in the page of the page-turning book according to the displacement change comprises:
    根据所述位移变化量计算与所述翻页指令相对应的页面卷曲半径;Calculate the page curling radius corresponding to the page turning instruction according to the displacement change;
    根据所述页面卷曲半径、所述翻页参考点的页面初始位置以及所述翻页参考点的翻页变换位置,确定所述书籍页面中包含的翻页作用区域。The page-turning action area included in the book page is determined according to the page curling radius, the page initial position of the page-turning reference point, and the page-turning transformation position of the page-turning reference point.
  7. 根据权利要求6所述的方法,其中,所述根据所述页面卷曲半径、所述翻页参考点的页面初始位置以及所述翻页参考点的翻页变换位置,确定所述书籍页面中包含的翻页作用区域包括:The method according to claim 6, wherein, according to the page curling radius, the page initial position of the page turning reference point, and the page turning transformation position of the page turning reference point, it is determined that the book page contains The page-turning action area includes:
    确定经过所述翻页参考点的页面初始位置以及所述翻页参考点的翻页变换位置的参考直线,根据所述页面卷曲半径确定位于所述参考直线上的目标点;determining a reference line passing through the page initial position of the page turning reference point and the page turning transformation position of the page turning reference point, and determining a target point located on the reference line according to the page curl radius;
    根据经过所述目标点且垂直于所述参考直线的边界直线确定所述书籍页面中包含的翻页作用区域。The page-turning action area included in the book page is determined according to the boundary line passing through the target point and perpendicular to the reference line.
  8. 根据权利要求6或7所述的方法,其中,所述计算与所述翻页指令相对应的页面卷曲半径包括:The method according to claim 6 or 7, wherein the calculating the page curl radius corresponding to the page turning instruction comprises:
    若所述翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量小于预设下限阈值,则确定与所述翻页指令相对应的页面卷曲半径为预设下限值;If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is less than a preset lower limit threshold, determine the page curling radius corresponding to the page turning instruction is the preset lower limit value;
    若所述翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量大于预设上限阈值,则确定与所述翻页指令相对应的页面卷曲半径为预设上限值;If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is greater than a preset upper limit threshold, determine the page curling radius corresponding to the page turning instruction is the preset upper limit value;
    若所述翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量介于所述预设下限阈值与所述预设上限阈值之间,则根据所述位移变化量以及圆周半径公式计算所述页面卷曲半径。If the amount of displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is between the preset lower threshold and the preset upper threshold, then according to The displacement variation and the circle radius formula calculate the page curling radius.
  9. 一种电子设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;An electronic device, comprising: a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface communicate with each other through the communication bus;
    所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行以下操作:The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the following operations:
    响应于接收到的翻页指令,针对待翻页的原始书籍页面添加阴影元素,得到包含阴影元素的翻页书籍页面;In response to the received page-turning instruction, a shadow element is added to the original book page to be turned to obtain a page-turning book page containing the shadow element;
    获取所述翻页书籍页面中的翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量,根据所述位移变化量确定所述翻页书籍页面中包含的翻页作用区域;Obtaining the displacement change between the page-turning transformation position of the page-turning reference point in the page-turning reference point relative to the page initial position of the page-turning reference point, and determining the page-turning book page according to the displacement change The page-turning action area contained in the ;
    获取所述翻页作用区域中包含的各个页面图像单元以及阴影元素的页面初始位置,计算并展示所述翻页作用区域中包含的各个页面图像单元以及阴影元素的翻页变换位置,以实现所述书籍页面的仿真翻页处理。Obtain the page initial position of each page image unit and shadow element contained in the page-turning action area, calculate and display the page-turning transformation position of each page image unit and shadow element contained in the page-turning action area, so as to realize the Describes the simulated page-turning processing of book pages.
  10. 根据权利要求9所述的电子设备,其中,所述可执行指令使所述处理器执行以下操作:9. The electronic device of claim 9, wherein the executable instructions cause the processor to:
    确定所述待翻页的原始书籍页面中包含的页面边界线,沿所述页面边界线在所述原始书籍页面的外部区域添加阴影元素。A page boundary line included in the original book page to be turned is determined, and a shadow element is added to the outer area of the original book page along the page boundary line.
  11. 根据权利要求10所述的电子设备,其中,所述可执行指令使所述处理器执行以下操作:11. The electronic device of claim 10, wherein the executable instructions cause the processor to:
    获取与所述翻页指令相对应的触控位置,确定与所述触控位置相邻的第一页面边界线和/或第二页面边界线;acquiring a touch position corresponding to the page turning instruction, and determining a first page boundary line and/or a second page boundary line adjacent to the touch position;
    沿所述第一页面边界线在所述原始书籍页面的外部区域添加第一阴影元素;和/或,沿所述第二页面边界线在所述原始书籍页面的外部区域添加第二阴影元素。adding a first shadow element along the first page boundary line in the outer area of the original book page; and/or adding a second shadow element along the second page boundary line in the outer area of the original book page.
  12. 根据权利要求11所述的电子设备,其中,所述第一页面边界线与所述第二页面边界线相互垂直;并且,所述阴影元素为半透明的图片类元素。The electronic device according to claim 11, wherein the first page boundary line and the second page boundary line are perpendicular to each other; and the shadow element is a translucent picture element.
  13. 根据权利要求11或12所述的电子设备,其中,所述可执行指令使所述处理器执行以下操作:The electronic device of claim 11 or 12, wherein the executable instructions cause the processor to:
    沿所述第一页面边界线中包含的第一局部线段在所述原始书籍页面的外部区域添加所述第一阴影元素;和/或,沿所述第二页面边界线中包含的第二局部线段在所述原始书籍页面的外部区域添加所述第二阴影元素;adding the first shadow element to an outer area of the original book page along a first partial line segment contained in the first page boundary line; and/or along a second partial line segment contained in the second page boundary line adding the second shadow element to the outer area of the original book page by a line segment;
    其中,所述第一局部线段和/或所述第二局部线段的线段长度根据翻页指令所对应的滑动操作的滑动位移量确定。Wherein, the line segment length of the first partial line segment and/or the second partial line segment is determined according to the sliding displacement amount of the sliding operation corresponding to the page turning instruction.
  14. 根据权利要求9-13任一所述的电子设备,其中,所述可执行指令使所述处理器执行以下操作:The electronic device of any of claims 9-13, wherein the executable instructions cause the processor to:
    根据所述位移变化量计算与所述翻页指令相对应的页面卷曲半径;Calculate the page curling radius corresponding to the page turning instruction according to the displacement change;
    根据所述页面卷曲半径、所述翻页参考点的页面初始位置以及所述翻页参考点的翻页变换位置,确定所述书籍页面中包含的翻页作用区域。The page-turning action area included in the book page is determined according to the page curling radius, the page initial position of the page-turning reference point, and the page-turning transformation position of the page-turning reference point.
  15. 根据权利要求14所述的电子设备,其中,所述可执行指令使所述处理器执行以下操作:15. The electronic device of claim 14, wherein the executable instructions cause the processor to:
    确定经过所述翻页参考点的页面初始位置以及所述翻页参考点的翻页变换位置的参考直线,根据所述页面卷曲半径确定位于所述参考直线上的目标点;determining a reference line passing through the page initial position of the page turning reference point and the page turning transformation position of the page turning reference point, and determining a target point located on the reference line according to the page curl radius;
    根据经过所述目标点且垂直于所述参考直线的边界直线确定所述书籍页面中包含的翻页作用区域。The page-turning action area included in the book page is determined according to the boundary line passing through the target point and perpendicular to the reference line.
  16. 根据权利要求14或15所述的电子设备,其中,所述可执行指令使所述处理器执行以下操作:15. The electronic device of claim 14 or 15, wherein the executable instructions cause the processor to:
    若所述翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量小于预设下限阈值,则确定与所述翻页指令相对应的页面卷曲半径为预设下限值;If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is less than a preset lower limit threshold, determine the page curling radius corresponding to the page turning instruction is the preset lower limit value;
    若所述翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量大于预设上限阈值,则确定与所述翻页指令相对应的页面卷曲半径为预设上限值;If the displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is greater than a preset upper limit threshold, determine the page curling radius corresponding to the page turning instruction is the preset upper limit value;
    若所述翻页参考点的翻页变换位置相对于所述翻页参考点的页面初始位置之间的位移变化量介于所述预设下限阈值与所述预设上限阈值之间,则根据所述位移变化量以及圆周半径公式计算所述页面卷曲半径。If the amount of displacement change between the page-turning transformation position of the page-turning reference point relative to the page initial position of the page-turning reference point is between the preset lower threshold and the preset upper threshold, then according to The displacement variation and the circle radius formula calculate the page curling radius.
  17. 一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质中存储有至少一可执行指令,所述可执行指令使处理器执行如权利要求1-8任一所述的仿真翻页方法。A non-volatile computer-readable storage medium, wherein at least one executable instruction is stored in the non-volatile computer-readable storage medium, and the executable instruction causes a processor to execute any one of claims 1-8. The simulated page turning method described above.
  18. 一种计算机程序产品,该计算机程序产品包括存储在非易失性计算机可读存储介质上的计算程序,该计算机程序包括程序指令,当该程序指令被处理器执行时,使该处理器执行如权利要求1-8任一所述的仿真翻页方法。A computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform a The simulation page turning method according to any one of claims 1-8.
PCT/CN2021/124748 2020-11-23 2021-10-19 Page turning simulation method for electronic book, and electronic device and computer storage medium WO2022105514A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011322290.3 2020-11-23
CN202011322290.3A CN112433795A (en) 2020-11-23 2020-11-23 Electronic book simulation page turning method, electronic equipment and computer storage medium

Publications (1)

Publication Number Publication Date
WO2022105514A1 true WO2022105514A1 (en) 2022-05-27

Family

ID=74693660

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/124748 WO2022105514A1 (en) 2020-11-23 2021-10-19 Page turning simulation method for electronic book, and electronic device and computer storage medium

Country Status (2)

Country Link
CN (1) CN112433795A (en)
WO (1) WO2022105514A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433795A (en) * 2020-11-23 2021-03-02 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium
CN112433796B (en) * 2020-11-23 2021-08-10 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium
CN115016701A (en) * 2022-07-25 2022-09-06 北京字跳网络技术有限公司 Page turning method and device, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102221980A (en) * 2011-07-29 2011-10-19 深圳芯智汇科技有限公司 Electronic book simulated flipping-over effect realization method and system
CN102981718A (en) * 2012-10-11 2013-03-20 北京掌中浩阅科技有限公司 Method for imitating real book page-turning effect of electronic books
CN103970432A (en) * 2014-04-28 2014-08-06 深圳市云宙多媒体技术有限公司 Method and device for simulating real page-turning effect
US8826191B1 (en) * 2011-01-05 2014-09-02 Google Inc. Zooming while page turning in document
WO2020211010A1 (en) * 2019-04-17 2020-10-22 深圳市柔宇科技有限公司 Method for page turning of electronic document, display terminal and storage medium
CN112433795A (en) * 2020-11-23 2021-03-02 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium
CN112433796A (en) * 2020-11-23 2021-03-02 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium
CN112433657A (en) * 2020-11-23 2021-03-02 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101923435B (en) * 2010-08-24 2012-11-21 福州瑞芯微电子有限公司 Method for simulating real page turning effect for electronic book

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8826191B1 (en) * 2011-01-05 2014-09-02 Google Inc. Zooming while page turning in document
CN102221980A (en) * 2011-07-29 2011-10-19 深圳芯智汇科技有限公司 Electronic book simulated flipping-over effect realization method and system
CN102981718A (en) * 2012-10-11 2013-03-20 北京掌中浩阅科技有限公司 Method for imitating real book page-turning effect of electronic books
CN103970432A (en) * 2014-04-28 2014-08-06 深圳市云宙多媒体技术有限公司 Method and device for simulating real page-turning effect
WO2020211010A1 (en) * 2019-04-17 2020-10-22 深圳市柔宇科技有限公司 Method for page turning of electronic document, display terminal and storage medium
CN112433795A (en) * 2020-11-23 2021-03-02 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium
CN112433796A (en) * 2020-11-23 2021-03-02 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium
CN112433657A (en) * 2020-11-23 2021-03-02 掌阅科技股份有限公司 Electronic book simulation page turning method, electronic equipment and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHEN JING: "Implementing Translational Page Turning Effect in Reading Apps on Android", 11 March 2016 (2016-03-11), XP055931649, Retrieved from the Internet <URL:www.jb51.net/article/80815.htm> *

Also Published As

Publication number Publication date
CN112433795A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
WO2022105513A1 (en) Simulated page turning method for electronic book, and electronic device and computer storage medium
WO2022105514A1 (en) Page turning simulation method for electronic book, and electronic device and computer storage medium
CN112433657B (en) Electronic book simulation page turning method, electronic equipment and computer storage medium
WO2020155785A1 (en) Screen adaptive display method, electronic device and computer storage medium
US11455460B2 (en) Method for displaying handwritten note in electronic book, electronic device and computer storage medium
KR20190136085A (en) On-screen comment display method and electronic device
CN111127623B (en) Model rendering method and device, storage medium and terminal
US11054969B2 (en) Method and device for displaying page of electronic book, and terminal device
JP5671921B2 (en) Information processing apparatus, information processing method, and program
US10726599B2 (en) Realistic augmentation of images and videos with graphics
US20190259216A1 (en) Refining local parameterizations for applying two-dimensional images to three-dimensional models
US11276227B2 (en) Object rendering method and apparatus, storage medium, and electronic device using a simulated pre-integration map
CN106095437A (en) The implementation method of the layout type of user interface RTL from right to left and device
WO2020001022A1 (en) Image expansion method, computing device and computer storage medium
CN106294501A (en) web animation effect display method and device
CN109985384B (en) Method and device for dynamically adjusting map
US20220121307A1 (en) Method and device of drawing handwriting track, electronic apparatus, medium, and program product
WO2022193616A1 (en) Application page display method, electronic device, and storage medium
WO2023066121A1 (en) Rendering of three-dimensional model
WO2011112395A1 (en) Map spotlights
CN105955599A (en) Realization method for simulating document reading mode in electronic device
CN107797752A (en) The rendering method and device of written handwriting, interactive intelligent tablet computer and storage medium
CN106095139A (en) A kind of method promoting lines drafting speed in projection interactive system
WO2022048414A1 (en) Image generation method, apparatus, and device, and storage medium
CN111177811A (en) Automatic fire point location layout method applied to cloud platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21893662

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21893662

Country of ref document: EP

Kind code of ref document: A1